source: vendor/google/apiclient-services/src/Classroom/Resource/CoursesPostsAddOnAttachments.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 3 weeks ago

Upload project files

  • Property mode set to 100644
File size: 9.1 KB
RevLine 
[e3d4e0a]1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\Classroom\Resource;
19
20use Google\Service\Classroom\AddOnAttachment;
21use Google\Service\Classroom\ClassroomEmpty;
22use Google\Service\Classroom\ListAddOnAttachmentsResponse;
23
24/**
25 * The "addOnAttachments" collection of methods.
26 * Typical usage is:
27 * <code>
28 * $classroomService = new Google\Service\Classroom(...);
29 * $addOnAttachments = $classroomService->courses_posts_addOnAttachments;
30 * </code>
31 */
32class CoursesPostsAddOnAttachments extends \Google\Service\Resource
33{
34 /**
35 * Creates an add-on attachment under a post. Requires the add-on to have
36 * permission to create new attachments on the post. This method returns the
37 * following error codes: * `PERMISSION_DENIED` for access errors. *
38 * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the
39 * identified resources does not exist. (addOnAttachments.create)
40 *
41 * @param string $courseId Required. Identifier of the course.
42 * @param string $postId Optional. Deprecated, use `item_id` instead.
43 * @param AddOnAttachment $postBody
44 * @param array $optParams Optional parameters.
45 *
46 * @opt_param string addOnToken Optional. Token that authorizes the request. The
47 * token is passed as a query parameter when the user is redirected from
48 * Classroom to the add-on's URL. This authorization token is required for in-
49 * Classroom attachment creation but optional for partner-first attachment
50 * creation. Returns an error if not provided for partner-first attachment
51 * creation and the developer projects that created the attachment and its
52 * parent stream item do not match.
53 * @opt_param string itemId Identifier of the `Announcement`, `CourseWork`, or
54 * `CourseWorkMaterial` under which to create the attachment. This field is
55 * required, but is not marked as such while we are migrating from post_id.
56 * @return AddOnAttachment
57 * @throws \Google\Service\Exception
58 */
59 public function create($courseId, $postId, AddOnAttachment $postBody, $optParams = [])
60 {
61 $params = ['courseId' => $courseId, 'postId' => $postId, 'postBody' => $postBody];
62 $params = array_merge($params, $optParams);
63 return $this->call('create', [$params], AddOnAttachment::class);
64 }
65 /**
66 * Deletes an add-on attachment. Requires the add-on to have been the original
67 * creator of the attachment. This method returns the following error codes: *
68 * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is
69 * malformed. * `NOT_FOUND` if one of the identified resources does not exist.
70 * (addOnAttachments.delete)
71 *
72 * @param string $courseId Required. Identifier of the course.
73 * @param string $postId Optional. Deprecated, use `item_id` instead.
74 * @param string $attachmentId Required. Identifier of the attachment.
75 * @param array $optParams Optional parameters.
76 *
77 * @opt_param string itemId Identifier of the `Announcement`, `CourseWork`, or
78 * `CourseWorkMaterial` under which the attachment is attached. This field is
79 * required, but is not marked as such while we are migrating from post_id.
80 * @return ClassroomEmpty
81 * @throws \Google\Service\Exception
82 */
83 public function delete($courseId, $postId, $attachmentId, $optParams = [])
84 {
85 $params = ['courseId' => $courseId, 'postId' => $postId, 'attachmentId' => $attachmentId];
86 $params = array_merge($params, $optParams);
87 return $this->call('delete', [$params], ClassroomEmpty::class);
88 }
89 /**
90 * Returns an add-on attachment. Requires the add-on requesting the attachment
91 * to be the original creator of the attachment. This method returns the
92 * following error codes: * `PERMISSION_DENIED` for access errors. *
93 * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the
94 * identified resources does not exist. (addOnAttachments.get)
95 *
96 * @param string $courseId Required. Identifier of the course.
97 * @param string $postId Optional. Deprecated, use `item_id` instead.
98 * @param string $attachmentId Required. Identifier of the attachment.
99 * @param array $optParams Optional parameters.
100 *
101 * @opt_param string itemId Identifier of the `Announcement`, `CourseWork`, or
102 * `CourseWorkMaterial` under which the attachment is attached. This field is
103 * required, but is not marked as such while we are migrating from post_id.
104 * @return AddOnAttachment
105 * @throws \Google\Service\Exception
106 */
107 public function get($courseId, $postId, $attachmentId, $optParams = [])
108 {
109 $params = ['courseId' => $courseId, 'postId' => $postId, 'attachmentId' => $attachmentId];
110 $params = array_merge($params, $optParams);
111 return $this->call('get', [$params], AddOnAttachment::class);
112 }
113 /**
114 * Returns all attachments created by an add-on under the post. Requires the
115 * add-on to have active attachments on the post or have permission to create
116 * new attachments on the post. This method returns the following error codes: *
117 * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is
118 * malformed. * `NOT_FOUND` if one of the identified resources does not exist.
119 * (addOnAttachments.listCoursesPostsAddOnAttachments)
120 *
121 * @param string $courseId Required. Identifier of the course.
122 * @param string $postId Optional. Identifier of the post under the course whose
123 * attachments to enumerate. Deprecated, use `item_id` instead.
124 * @param array $optParams Optional parameters.
125 *
126 * @opt_param string itemId Identifier of the `Announcement`, `CourseWork`, or
127 * `CourseWorkMaterial` whose attachments should be enumerated. This field is
128 * required, but is not marked as such while we are migrating from post_id.
129 * @opt_param int pageSize The maximum number of attachments to return. The
130 * service may return fewer than this value. If unspecified, at most 20
131 * attachments will be returned. The maximum value is 20; values above 20 will
132 * be coerced to 20.
133 * @opt_param string pageToken A page token, received from a previous
134 * `ListAddOnAttachments` call. Provide this to retrieve the subsequent page.
135 * When paginating, all other parameters provided to `ListAddOnAttachments` must
136 * match the call that provided the page token.
137 * @return ListAddOnAttachmentsResponse
138 * @throws \Google\Service\Exception
139 */
140 public function listCoursesPostsAddOnAttachments($courseId, $postId, $optParams = [])
141 {
142 $params = ['courseId' => $courseId, 'postId' => $postId];
143 $params = array_merge($params, $optParams);
144 return $this->call('list', [$params], ListAddOnAttachmentsResponse::class);
145 }
146 /**
147 * Updates an add-on attachment. Requires the add-on to have been the original
148 * creator of the attachment. This method returns the following error codes: *
149 * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is
150 * malformed. * `NOT_FOUND` if one of the identified resources does not exist.
151 * (addOnAttachments.patch)
152 *
153 * @param string $courseId Required. Identifier of the course.
154 * @param string $postId Required. Identifier of the post under which the
155 * attachment is attached.
156 * @param string $attachmentId Required. Identifier of the attachment.
157 * @param AddOnAttachment $postBody
158 * @param array $optParams Optional parameters.
159 *
160 * @opt_param string itemId Identifier of the post under which the attachment is
161 * attached.
162 * @opt_param string updateMask Required. Mask that identifies which fields on
163 * the attachment to update. The update fails if invalid fields are specified.
164 * If a field supports empty values, it can be cleared by specifying it in the
165 * update mask and not in the `AddOnAttachment` object. If a field that does not
166 * support empty values is included in the update mask and not set in the
167 * `AddOnAttachment` object, an `INVALID_ARGUMENT` error is returned. The
168 * following fields may be specified by teachers: * `title` * `teacher_view_uri`
169 * * `student_view_uri` * `student_work_review_uri` * `due_date` * `due_time` *
170 * `max_points`
171 * @return AddOnAttachment
172 * @throws \Google\Service\Exception
173 */
174 public function patch($courseId, $postId, $attachmentId, AddOnAttachment $postBody, $optParams = [])
175 {
176 $params = ['courseId' => $courseId, 'postId' => $postId, 'attachmentId' => $attachmentId, 'postBody' => $postBody];
177 $params = array_merge($params, $optParams);
178 return $this->call('patch', [$params], AddOnAttachment::class);
179 }
180}
181
182// Adding a class alias for backwards compatibility with the previous class name.
183class_alias(CoursesPostsAddOnAttachments::class, 'Google_Service_Classroom_Resource_CoursesPostsAddOnAttachments');
Note: See TracBrowser for help on using the repository browser.