Debian Codegraph @

docs/dyn/classroom_v1.courses.posts.addOnAttachments.html

raw
1 <html><body>
2 <style>
3
4 body, 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
15 body {
16 font-size: 13px;
17 padding: 1em;
18 }
19
20 h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23 }
24
25 h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28 }
29
30 h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34 }
35
36 pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39 }
40
41 pre {
42 margin-top: 0.5em;
43 }
44
45 h1, h2, h3, p {
46 font-family: Arial, sans serif;
47 }
48
49 h1, 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.posts.html">posts</a> . <a href="classroom_v1.courses.posts.addOnAttachments.html">addOnAttachments</a></h1>
76 <h2>Instance Methods</h2>
77 <p class="toc_element">
78 <code><a href="classroom_v1.courses.posts.addOnAttachments.studentSubmissions.html">studentSubmissions()</a></code>
79 </p>
80 <p class="firstline">Returns the studentSubmissions Resource.</p>
81
82 <p class="toc_element">
83 <code><a href="#close">close()</a></code></p>
84 <p class="firstline">Close httplib2 connections.</p>
85 <p class="toc_element">
86 <code><a href="#create">create(courseId, postId, addOnToken=None, body=None, itemId=None, x__xgafv=None)</a></code></p>
87 <p class="firstline">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.</p>
88 <p class="toc_element">
89 <code><a href="#delete">delete(courseId, postId, attachmentId, itemId=None, x__xgafv=None)</a></code></p>
90 <p class="firstline">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.</p>
91 <p class="toc_element">
92 <code><a href="#get">get(courseId, postId, attachmentId, itemId=None, x__xgafv=None)</a></code></p>
93 <p class="firstline">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.</p>
94 <p class="toc_element">
95 <code><a href="#list">list(courseId, postId, itemId=None, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
96 <p class="firstline">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.</p>
97 <p class="toc_element">
98 <code><a href="#list_next">list_next()</a></code></p>
99 <p class="firstline">Retrieves the next page of results.</p>
100 <p class="toc_element">
101 <code><a href="#patch">patch(courseId, postId, attachmentId, body=None, itemId=None, updateMask=None, x__xgafv=None)</a></code></p>
102 <p class="firstline">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.</p>
103 <h3>Method Details</h3>
104 <div class="method">
105 <code class="details" id="close">close()</code>
106 <pre>Close httplib2 connections.</pre>
107 </div>
108
109 <div class="method">
110 <code class="details" id="create">create(courseId, postId, addOnToken=None, body=None, itemId=None, x__xgafv=None)</code>
111 <pre>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.
112
113 Args:
114 courseId: string, Required. Identifier of the course. (required)
115 postId: string, Optional. Deprecated, use `item_id` instead. (required)
116 body: object, The request body.
117 The object takes the form of:
118
119 { # An add-on attachment on a post.
120 &quot;copyHistory&quot;: [ # 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.
121 { # Identifier of a previous copy of a given attachment.
122 &quot;attachmentId&quot;: &quot;A String&quot;, # Immutable. Identifier of the attachment.
123 &quot;courseId&quot;: &quot;A String&quot;, # Immutable. Identifier of the course.
124 &quot;itemId&quot;: &quot;A String&quot;, # Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached.
125 &quot;postId&quot;: &quot;A String&quot;, # Immutable. Deprecated, use `item_id` instead.
126 },
127 ],
128 &quot;courseId&quot;: &quot;A String&quot;, # Immutable. Identifier of the course.
129 &quot;dueDate&quot;: { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified.
130 &quot;day&quot;: 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn&#x27;t significant.
131 &quot;month&quot;: 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
132 &quot;year&quot;: 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
133 },
134 &quot;dueTime&quot;: { # Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`. # Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified.
135 &quot;hours&quot;: 42, # Hours of a day in 24 hour format. Must be greater than or equal to 0 and typically must be less than or equal to 23. An API may choose to allow the value &quot;24:00:00&quot; for scenarios like business closing time.
136 &quot;minutes&quot;: 42, # Minutes of an hour. Must be greater than or equal to 0 and less than or equal to 59.
137 &quot;nanos&quot;: 42, # Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 and less than or equal to 999,999,999.
138 &quot;seconds&quot;: 42, # Seconds of a minute. Must be greater than or equal to 0 and typically must be less than or equal to 59. An API may allow the value 60 if it allows leap-seconds.
139 },
140 &quot;id&quot;: &quot;A String&quot;, # Immutable. Classroom-assigned identifier for this attachment, unique per post.
141 &quot;itemId&quot;: &quot;A String&quot;, # Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course.
142 &quot;maxPoints&quot;: 3.14, # 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.
143 &quot;postId&quot;: &quot;A String&quot;, # Immutable. Deprecated, use `item_id` instead.
144 &quot;studentViewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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.
145 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
146 },
147 &quot;studentWorkReviewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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`](/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.
148 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
149 },
150 &quot;teacherViewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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.
151 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
152 },
153 &quot;title&quot;: &quot;A String&quot;, # Required. Title of this attachment. The title must be between 1 and 1000 characters.
154 }
155
156 addOnToken: string, Optional. Token that authorizes the request. The token is passed as a query parameter when the user is redirected from Classroom to the add-on&#x27;s URL. This authorization token is required for in-Classroom attachment creation but optional for partner-first attachment creation. Returns an error if not provided for partner-first attachment creation and the developer projects that created the attachment and its parent stream item do not match.
157 itemId: string, Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which to create the attachment. This field is required, but is not marked as such while we are migrating from post_id.
158 x__xgafv: string, V1 error format.
159 Allowed values
160 1 - v1 error format
161 2 - v2 error format
162
163 Returns:
164 An object of the form:
165
166 { # An add-on attachment on a post.
167 &quot;copyHistory&quot;: [ # 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.
168 { # Identifier of a previous copy of a given attachment.
169 &quot;attachmentId&quot;: &quot;A String&quot;, # Immutable. Identifier of the attachment.
170 &quot;courseId&quot;: &quot;A String&quot;, # Immutable. Identifier of the course.
171 &quot;itemId&quot;: &quot;A String&quot;, # Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached.
172 &quot;postId&quot;: &quot;A String&quot;, # Immutable. Deprecated, use `item_id` instead.
173 },
174 ],
175 &quot;courseId&quot;: &quot;A String&quot;, # Immutable. Identifier of the course.
176 &quot;dueDate&quot;: { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified.
177 &quot;day&quot;: 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn&#x27;t significant.
178 &quot;month&quot;: 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
179 &quot;year&quot;: 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
180 },
181 &quot;dueTime&quot;: { # Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`. # Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified.
182 &quot;hours&quot;: 42, # Hours of a day in 24 hour format. Must be greater than or equal to 0 and typically must be less than or equal to 23. An API may choose to allow the value &quot;24:00:00&quot; for scenarios like business closing time.
183 &quot;minutes&quot;: 42, # Minutes of an hour. Must be greater than or equal to 0 and less than or equal to 59.
184 &quot;nanos&quot;: 42, # Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 and less than or equal to 999,999,999.
185 &quot;seconds&quot;: 42, # Seconds of a minute. Must be greater than or equal to 0 and typically must be less than or equal to 59. An API may allow the value 60 if it allows leap-seconds.
186 },
187 &quot;id&quot;: &quot;A String&quot;, # Immutable. Classroom-assigned identifier for this attachment, unique per post.
188 &quot;itemId&quot;: &quot;A String&quot;, # Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course.
189 &quot;maxPoints&quot;: 3.14, # 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.
190 &quot;postId&quot;: &quot;A String&quot;, # Immutable. Deprecated, use `item_id` instead.
191 &quot;studentViewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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.
192 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
193 },
194 &quot;studentWorkReviewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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`](/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.
195 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
196 },
197 &quot;teacherViewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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.
198 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
199 },
200 &quot;title&quot;: &quot;A String&quot;, # Required. Title of this attachment. The title must be between 1 and 1000 characters.
201 }</pre>
202 </div>
203
204 <div class="method">
205 <code class="details" id="delete">delete(courseId, postId, attachmentId, itemId=None, x__xgafv=None)</code>
206 <pre>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.
207
208 Args:
209 courseId: string, Required. Identifier of the course. (required)
210 postId: string, Optional. Deprecated, use `item_id` instead. (required)
211 attachmentId: string, Required. Identifier of the attachment. (required)
212 itemId: string, Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.
213 x__xgafv: string, V1 error format.
214 Allowed values
215 1 - v1 error format
216 2 - v2 error format
217
218 Returns:
219 An object of the form:
220
221 { # 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); }
222 }</pre>
223 </div>
224
225 <div class="method">
226 <code class="details" id="get">get(courseId, postId, attachmentId, itemId=None, x__xgafv=None)</code>
227 <pre>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.
228
229 Args:
230 courseId: string, Required. Identifier of the course. (required)
231 postId: string, Optional. Deprecated, use `item_id` instead. (required)
232 attachmentId: string, Required. Identifier of the attachment. (required)
233 itemId: string, Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.
234 x__xgafv: string, V1 error format.
235 Allowed values
236 1 - v1 error format
237 2 - v2 error format
238
239 Returns:
240 An object of the form:
241
242 { # An add-on attachment on a post.
243 &quot;copyHistory&quot;: [ # 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.
244 { # Identifier of a previous copy of a given attachment.
245 &quot;attachmentId&quot;: &quot;A String&quot;, # Immutable. Identifier of the attachment.
246 &quot;courseId&quot;: &quot;A String&quot;, # Immutable. Identifier of the course.
247 &quot;itemId&quot;: &quot;A String&quot;, # Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached.
248 &quot;postId&quot;: &quot;A String&quot;, # Immutable. Deprecated, use `item_id` instead.
249 },
250 ],
251 &quot;courseId&quot;: &quot;A String&quot;, # Immutable. Identifier of the course.
252 &quot;dueDate&quot;: { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified.
253 &quot;day&quot;: 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn&#x27;t significant.
254 &quot;month&quot;: 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
255 &quot;year&quot;: 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
256 },
257 &quot;dueTime&quot;: { # Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`. # Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified.
258 &quot;hours&quot;: 42, # Hours of a day in 24 hour format. Must be greater than or equal to 0 and typically must be less than or equal to 23. An API may choose to allow the value &quot;24:00:00&quot; for scenarios like business closing time.
259 &quot;minutes&quot;: 42, # Minutes of an hour. Must be greater than or equal to 0 and less than or equal to 59.
260 &quot;nanos&quot;: 42, # Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 and less than or equal to 999,999,999.
261 &quot;seconds&quot;: 42, # Seconds of a minute. Must be greater than or equal to 0 and typically must be less than or equal to 59. An API may allow the value 60 if it allows leap-seconds.
262 },
263 &quot;id&quot;: &quot;A String&quot;, # Immutable. Classroom-assigned identifier for this attachment, unique per post.
264 &quot;itemId&quot;: &quot;A String&quot;, # Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course.
265 &quot;maxPoints&quot;: 3.14, # 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.
266 &quot;postId&quot;: &quot;A String&quot;, # Immutable. Deprecated, use `item_id` instead.
267 &quot;studentViewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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.
268 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
269 },
270 &quot;studentWorkReviewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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`](/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.
271 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
272 },
273 &quot;teacherViewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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.
274 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
275 },
276 &quot;title&quot;: &quot;A String&quot;, # Required. Title of this attachment. The title must be between 1 and 1000 characters.
277 }</pre>
278 </div>
279
280 <div class="method">
281 <code class="details" id="list">list(courseId, postId, itemId=None, pageSize=None, pageToken=None, x__xgafv=None)</code>
282 <pre>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.
283
284 Args:
285 courseId: string, Required. Identifier of the course. (required)
286 postId: string, Optional. Identifier of the post under the course whose attachments to enumerate. Deprecated, use `item_id` instead. (required)
287 itemId: string, Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` whose attachments should be enumerated. This field is required, but is not marked as such while we are migrating from post_id.
288 pageSize: integer, The maximum number of attachments to return. The service may return fewer than this value. If unspecified, at most 20 attachments will be returned. The maximum value is 20; values above 20 will be coerced to 20.
289 pageToken: string, A page token, received from a previous `ListAddOnAttachments` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAddOnAttachments` must match the call that provided the page token.
290 x__xgafv: string, V1 error format.
291 Allowed values
292 1 - v1 error format
293 2 - v2 error format
294
295 Returns:
296 An object of the form:
297
298 { # Response when listing add-on attachments.
299 &quot;addOnAttachments&quot;: [ # Attachments under the given post.
300 { # An add-on attachment on a post.
301 &quot;copyHistory&quot;: [ # 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.
302 { # Identifier of a previous copy of a given attachment.
303 &quot;attachmentId&quot;: &quot;A String&quot;, # Immutable. Identifier of the attachment.
304 &quot;courseId&quot;: &quot;A String&quot;, # Immutable. Identifier of the course.
305 &quot;itemId&quot;: &quot;A String&quot;, # Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached.
306 &quot;postId&quot;: &quot;A String&quot;, # Immutable. Deprecated, use `item_id` instead.
307 },
308 ],
309 &quot;courseId&quot;: &quot;A String&quot;, # Immutable. Identifier of the course.
310 &quot;dueDate&quot;: { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified.
311 &quot;day&quot;: 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn&#x27;t significant.
312 &quot;month&quot;: 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
313 &quot;year&quot;: 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
314 },
315 &quot;dueTime&quot;: { # Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`. # Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified.
316 &quot;hours&quot;: 42, # Hours of a day in 24 hour format. Must be greater than or equal to 0 and typically must be less than or equal to 23. An API may choose to allow the value &quot;24:00:00&quot; for scenarios like business closing time.
317 &quot;minutes&quot;: 42, # Minutes of an hour. Must be greater than or equal to 0 and less than or equal to 59.
318 &quot;nanos&quot;: 42, # Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 and less than or equal to 999,999,999.
319 &quot;seconds&quot;: 42, # Seconds of a minute. Must be greater than or equal to 0 and typically must be less than or equal to 59. An API may allow the value 60 if it allows leap-seconds.
320 },
321 &quot;id&quot;: &quot;A String&quot;, # Immutable. Classroom-assigned identifier for this attachment, unique per post.
322 &quot;itemId&quot;: &quot;A String&quot;, # Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course.
323 &quot;maxPoints&quot;: 3.14, # 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.
324 &quot;postId&quot;: &quot;A String&quot;, # Immutable. Deprecated, use `item_id` instead.
325 &quot;studentViewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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.
326 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
327 },
328 &quot;studentWorkReviewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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`](/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.
329 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
330 },
331 &quot;teacherViewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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.
332 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
333 },
334 &quot;title&quot;: &quot;A String&quot;, # Required. Title of this attachment. The title must be between 1 and 1000 characters.
335 },
336 ],
337 &quot;nextPageToken&quot;: &quot;A String&quot;, # A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages.
338 }</pre>
339 </div>
340
341 <div class="method">
342 <code class="details" id="list_next">list_next()</code>
343 <pre>Retrieves the next page of results.
344
345 Args:
346 previous_request: The request for the previous page. (required)
347 previous_response: The response from the request for the previous page. (required)
348
349 Returns:
350 A request object that you can call &#x27;execute()&#x27; on to request the next
351 page. Returns None if there are no more items in the collection.
352 </pre>
353 </div>
354
355 <div class="method">
356 <code class="details" id="patch">patch(courseId, postId, attachmentId, body=None, itemId=None, updateMask=None, x__xgafv=None)</code>
357 <pre>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.
358
359 Args:
360 courseId: string, Required. Identifier of the course. (required)
361 postId: string, Required. Identifier of the post under which the attachment is attached. (required)
362 attachmentId: string, Required. Identifier of the attachment. (required)
363 body: object, The request body.
364 The object takes the form of:
365
366 { # An add-on attachment on a post.
367 &quot;copyHistory&quot;: [ # 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.
368 { # Identifier of a previous copy of a given attachment.
369 &quot;attachmentId&quot;: &quot;A String&quot;, # Immutable. Identifier of the attachment.
370 &quot;courseId&quot;: &quot;A String&quot;, # Immutable. Identifier of the course.
371 &quot;itemId&quot;: &quot;A String&quot;, # Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached.
372 &quot;postId&quot;: &quot;A String&quot;, # Immutable. Deprecated, use `item_id` instead.
373 },
374 ],
375 &quot;courseId&quot;: &quot;A String&quot;, # Immutable. Identifier of the course.
376 &quot;dueDate&quot;: { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified.
377 &quot;day&quot;: 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn&#x27;t significant.
378 &quot;month&quot;: 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
379 &quot;year&quot;: 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
380 },
381 &quot;dueTime&quot;: { # Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`. # Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified.
382 &quot;hours&quot;: 42, # Hours of a day in 24 hour format. Must be greater than or equal to 0 and typically must be less than or equal to 23. An API may choose to allow the value &quot;24:00:00&quot; for scenarios like business closing time.
383 &quot;minutes&quot;: 42, # Minutes of an hour. Must be greater than or equal to 0 and less than or equal to 59.
384 &quot;nanos&quot;: 42, # Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 and less than or equal to 999,999,999.
385 &quot;seconds&quot;: 42, # Seconds of a minute. Must be greater than or equal to 0 and typically must be less than or equal to 59. An API may allow the value 60 if it allows leap-seconds.
386 },
387 &quot;id&quot;: &quot;A String&quot;, # Immutable. Classroom-assigned identifier for this attachment, unique per post.
388 &quot;itemId&quot;: &quot;A String&quot;, # Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course.
389 &quot;maxPoints&quot;: 3.14, # 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.
390 &quot;postId&quot;: &quot;A String&quot;, # Immutable. Deprecated, use `item_id` instead.
391 &quot;studentViewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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.
392 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
393 },
394 &quot;studentWorkReviewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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`](/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.
395 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
396 },
397 &quot;teacherViewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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.
398 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
399 },
400 &quot;title&quot;: &quot;A String&quot;, # Required. Title of this attachment. The title must be between 1 and 1000 characters.
401 }
402
403 itemId: string, Identifier of the post under which the attachment is attached.
404 updateMask: string, Required. Mask that identifies which fields on the attachment to 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 `AddOnAttachment` object. If a field that does not support empty values is included in the update mask and not set in the `AddOnAttachment` object, an `INVALID_ARGUMENT` error is returned. The following fields may be specified by teachers: * `title` * `teacher_view_uri` * `student_view_uri` * `student_work_review_uri` * `due_date` * `due_time` * `max_points`
405 x__xgafv: string, V1 error format.
406 Allowed values
407 1 - v1 error format
408 2 - v2 error format
409
410 Returns:
411 An object of the form:
412
413 { # An add-on attachment on a post.
414 &quot;copyHistory&quot;: [ # 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.
415 { # Identifier of a previous copy of a given attachment.
416 &quot;attachmentId&quot;: &quot;A String&quot;, # Immutable. Identifier of the attachment.
417 &quot;courseId&quot;: &quot;A String&quot;, # Immutable. Identifier of the course.
418 &quot;itemId&quot;: &quot;A String&quot;, # Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached.
419 &quot;postId&quot;: &quot;A String&quot;, # Immutable. Deprecated, use `item_id` instead.
420 },
421 ],
422 &quot;courseId&quot;: &quot;A String&quot;, # Immutable. Identifier of the course.
423 &quot;dueDate&quot;: { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified.
424 &quot;day&quot;: 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn&#x27;t significant.
425 &quot;month&quot;: 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
426 &quot;year&quot;: 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
427 },
428 &quot;dueTime&quot;: { # Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`. # Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified.
429 &quot;hours&quot;: 42, # Hours of a day in 24 hour format. Must be greater than or equal to 0 and typically must be less than or equal to 23. An API may choose to allow the value &quot;24:00:00&quot; for scenarios like business closing time.
430 &quot;minutes&quot;: 42, # Minutes of an hour. Must be greater than or equal to 0 and less than or equal to 59.
431 &quot;nanos&quot;: 42, # Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 and less than or equal to 999,999,999.
432 &quot;seconds&quot;: 42, # Seconds of a minute. Must be greater than or equal to 0 and typically must be less than or equal to 59. An API may allow the value 60 if it allows leap-seconds.
433 },
434 &quot;id&quot;: &quot;A String&quot;, # Immutable. Classroom-assigned identifier for this attachment, unique per post.
435 &quot;itemId&quot;: &quot;A String&quot;, # Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course.
436 &quot;maxPoints&quot;: 3.14, # 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.
437 &quot;postId&quot;: &quot;A String&quot;, # Immutable. Deprecated, use `item_id` instead.
438 &quot;studentViewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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.
439 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
440 },
441 &quot;studentWorkReviewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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`](/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.
442 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
443 },
444 &quot;teacherViewUri&quot;: { # URI to be iframed after being populated with query parameters. # 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.
445 &quot;uri&quot;: &quot;A String&quot;, # Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters.
446 },
447 &quot;title&quot;: &quot;A String&quot;, # Required. Title of this attachment. The title must be between 1 and 1000 characters.
448 }</pre>
449 </div>
450
451 </body></html>