[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 |
|
---|
| 18 | namespace Google\Service\Classroom\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Classroom\AddOnAttachmentStudentSubmission;
|
---|
| 21 |
|
---|
| 22 | /**
|
---|
| 23 | * The "studentSubmissions" collection of methods.
|
---|
| 24 | * Typical usage is:
|
---|
| 25 | * <code>
|
---|
| 26 | * $classroomService = new Google\Service\Classroom(...);
|
---|
| 27 | * $studentSubmissions = $classroomService->courses_posts_addOnAttachments_studentSubmissions;
|
---|
| 28 | * </code>
|
---|
| 29 | */
|
---|
| 30 | class CoursesPostsAddOnAttachmentsStudentSubmissions extends \Google\Service\Resource
|
---|
| 31 | {
|
---|
| 32 | /**
|
---|
| 33 | * Returns a student submission for an add-on attachment. This method returns
|
---|
| 34 | * the following error codes: * `PERMISSION_DENIED` for access errors. *
|
---|
| 35 | * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the
|
---|
| 36 | * identified resources does not exist. (studentSubmissions.get)
|
---|
| 37 | *
|
---|
| 38 | * @param string $courseId Required. Identifier of the course.
|
---|
| 39 | * @param string $postId Optional. Deprecated, use `item_id` instead.
|
---|
| 40 | * @param string $attachmentId Required. Identifier of the attachment.
|
---|
| 41 | * @param string $submissionId Required. Identifier of the student’s submission.
|
---|
| 42 | * @param array $optParams Optional parameters.
|
---|
| 43 | *
|
---|
| 44 | * @opt_param string itemId Identifier of the `Announcement`, `CourseWork`, or
|
---|
| 45 | * `CourseWorkMaterial` under which the attachment is attached. This field is
|
---|
| 46 | * required, but is not marked as such while we are migrating from post_id.
|
---|
| 47 | * @return AddOnAttachmentStudentSubmission
|
---|
| 48 | * @throws \Google\Service\Exception
|
---|
| 49 | */
|
---|
| 50 | public function get($courseId, $postId, $attachmentId, $submissionId, $optParams = [])
|
---|
| 51 | {
|
---|
| 52 | $params = ['courseId' => $courseId, 'postId' => $postId, 'attachmentId' => $attachmentId, 'submissionId' => $submissionId];
|
---|
| 53 | $params = array_merge($params, $optParams);
|
---|
| 54 | return $this->call('get', [$params], AddOnAttachmentStudentSubmission::class);
|
---|
| 55 | }
|
---|
| 56 | /**
|
---|
| 57 | * Updates data associated with an add-on attachment submission. Requires the
|
---|
| 58 | * add-on to have been the original creator of the attachment and the attachment
|
---|
| 59 | * to have a positive `max_points` value set. This method returns the following
|
---|
| 60 | * error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if
|
---|
| 61 | * the request is malformed. * `NOT_FOUND` if one of the identified resources
|
---|
| 62 | * does not exist. (studentSubmissions.patch)
|
---|
| 63 | *
|
---|
| 64 | * @param string $courseId Required. Identifier of the course.
|
---|
| 65 | * @param string $postId Optional. Deprecated, use `item_id` instead.
|
---|
| 66 | * @param string $attachmentId Required. Identifier of the attachment.
|
---|
| 67 | * @param string $submissionId Required. Identifier of the student's submission.
|
---|
| 68 | * @param AddOnAttachmentStudentSubmission $postBody
|
---|
| 69 | * @param array $optParams Optional parameters.
|
---|
| 70 | *
|
---|
| 71 | * @opt_param string itemId Identifier of the `Announcement`, `CourseWork`, or
|
---|
| 72 | * `CourseWorkMaterial` under which the attachment is attached. This field is
|
---|
| 73 | * required, but is not marked as such while we are migrating from post_id.
|
---|
| 74 | * @opt_param string updateMask Required. Mask that identifies which fields on
|
---|
| 75 | * the attachment to update. The update fails if invalid fields are specified.
|
---|
| 76 | * If a field supports empty values, it can be cleared by specifying it in the
|
---|
| 77 | * update mask and not in the `AddOnAttachmentStudentSubmission` object. The
|
---|
| 78 | * following fields may be specified by teachers: * `points_earned`
|
---|
| 79 | * @return AddOnAttachmentStudentSubmission
|
---|
| 80 | * @throws \Google\Service\Exception
|
---|
| 81 | */
|
---|
| 82 | public function patch($courseId, $postId, $attachmentId, $submissionId, AddOnAttachmentStudentSubmission $postBody, $optParams = [])
|
---|
| 83 | {
|
---|
| 84 | $params = ['courseId' => $courseId, 'postId' => $postId, 'attachmentId' => $attachmentId, 'submissionId' => $submissionId, 'postBody' => $postBody];
|
---|
| 85 | $params = array_merge($params, $optParams);
|
---|
| 86 | return $this->call('patch', [$params], AddOnAttachmentStudentSubmission::class);
|
---|
| 87 | }
|
---|
| 88 | }
|
---|
| 89 |
|
---|
| 90 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 91 | class_alias(CoursesPostsAddOnAttachmentsStudentSubmissions::class, 'Google_Service_Classroom_Resource_CoursesPostsAddOnAttachmentsStudentSubmissions');
|
---|