PageRenderTime 48ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/application/third_party/google-api/vendor/google/apiclient-services/src/Google/Service/Classroom/Resource/CoursesCourseWork.php

https://gitlab.com/Anas7232/Layout-Changes
PHP | 223 lines | 40 code | 1 blank | 182 comment | 0 complexity | 27d247abc9e15e30ed2e952c62161043 MD5 | raw file
  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. * The "courseWork" collection of methods.
  19. * Typical usage is:
  20. * <code>
  21. * $classroomService = new Google_Service_Classroom(...);
  22. * $courseWork = $classroomService->courseWork;
  23. * </code>
  24. */
  25. class Google_Service_Classroom_Resource_CoursesCourseWork extends Google_Service_Resource
  26. {
  27. /**
  28. * Creates course work.
  29. *
  30. * The resulting course work (and corresponding student submissions) are
  31. * associated with the Developer Console project of the [OAuth client
  32. * ID](https://support.google.com/cloud/answer/6158849) used to make the
  33. * request. Classroom API requests to modify course work and student submissions
  34. * must be made with an OAuth client ID from the associated Developer Console
  35. * project.
  36. *
  37. * This method returns the following error codes:
  38. *
  39. * * `PERMISSION_DENIED` if the requesting user is not permitted to access the
  40. * requested course, create course work in the requested course, share a Drive
  41. * attachment, or for access errors. * `INVALID_ARGUMENT` if the request is
  42. * malformed. * `NOT_FOUND` if the requested course does not exist. *
  43. * `FAILED_PRECONDITION` for the following request error: *
  44. * AttachmentNotVisible (courseWork.create)
  45. *
  46. * @param string $courseId Identifier of the course. This identifier can be
  47. * either the Classroom-assigned identifier or an alias.
  48. * @param Google_Service_Classroom_CourseWork $postBody
  49. * @param array $optParams Optional parameters.
  50. * @return Google_Service_Classroom_CourseWork
  51. */
  52. public function create($courseId, Google_Service_Classroom_CourseWork $postBody, $optParams = array())
  53. {
  54. $params = array('courseId' => $courseId, 'postBody' => $postBody);
  55. $params = array_merge($params, $optParams);
  56. return $this->call('create', array($params), "Google_Service_Classroom_CourseWork");
  57. }
  58. /**
  59. * Deletes a course work.
  60. *
  61. * This request must be made by the Developer Console project of the [OAuth
  62. * client ID](https://support.google.com/cloud/answer/6158849) used to create
  63. * the corresponding course work item.
  64. *
  65. * This method returns the following error codes:
  66. *
  67. * * `PERMISSION_DENIED` if the requesting developer project did not create the
  68. * corresponding course work, if the requesting user is not permitted to delete
  69. * the requested course or for access errors. * `FAILED_PRECONDITION` if the
  70. * requested course work has already been deleted. * `NOT_FOUND` if no course
  71. * exists with the requested ID. (courseWork.delete)
  72. *
  73. * @param string $courseId Identifier of the course. This identifier can be
  74. * either the Classroom-assigned identifier or an alias.
  75. * @param string $id Identifier of the course work to delete. This identifier is
  76. * a Classroom-assigned identifier.
  77. * @param array $optParams Optional parameters.
  78. * @return Google_Service_Classroom_ClassroomEmpty
  79. */
  80. public function delete($courseId, $id, $optParams = array())
  81. {
  82. $params = array('courseId' => $courseId, 'id' => $id);
  83. $params = array_merge($params, $optParams);
  84. return $this->call('delete', array($params), "Google_Service_Classroom_ClassroomEmpty");
  85. }
  86. /**
  87. * Returns course work.
  88. *
  89. * This method returns the following error codes:
  90. *
  91. * * `PERMISSION_DENIED` if the requesting user is not permitted to access the
  92. * requested course or course work, or for access errors. * `INVALID_ARGUMENT`
  93. * if the request is malformed. * `NOT_FOUND` if the requested course or course
  94. * work does not exist. (courseWork.get)
  95. *
  96. * @param string $courseId Identifier of the course. This identifier can be
  97. * either the Classroom-assigned identifier or an alias.
  98. * @param string $id Identifier of the course work.
  99. * @param array $optParams Optional parameters.
  100. * @return Google_Service_Classroom_CourseWork
  101. */
  102. public function get($courseId, $id, $optParams = array())
  103. {
  104. $params = array('courseId' => $courseId, 'id' => $id);
  105. $params = array_merge($params, $optParams);
  106. return $this->call('get', array($params), "Google_Service_Classroom_CourseWork");
  107. }
  108. /**
  109. * Returns a list of course work that the requester is permitted to view.
  110. *
  111. * Course students may only view `PUBLISHED` course work. Course teachers and
  112. * domain administrators may view all course work.
  113. *
  114. * This method returns the following error codes:
  115. *
  116. * * `PERMISSION_DENIED` if the requesting user is not permitted to access the
  117. * requested course or for access errors. * `INVALID_ARGUMENT` if the request is
  118. * malformed. * `NOT_FOUND` if the requested course does not exist.
  119. * (courseWork.listCoursesCourseWork)
  120. *
  121. * @param string $courseId Identifier of the course. This identifier can be
  122. * either the Classroom-assigned identifier or an alias.
  123. * @param array $optParams Optional parameters.
  124. *
  125. * @opt_param int pageSize Maximum number of items to return. Zero or
  126. * unspecified indicates that the server may assign a maximum.
  127. *
  128. * The server may return fewer than the specified number of results.
  129. * @opt_param string courseWorkStates Restriction on the work status to return.
  130. * Only courseWork that matches is returned. If unspecified, items with a work
  131. * status of `PUBLISHED` is returned.
  132. * @opt_param string orderBy Optional sort ordering for results. A comma-
  133. * separated list of fields with an optional sort direction keyword. Supported
  134. * fields are `updateTime` and `dueDate`. Supported direction keywords are `asc`
  135. * and `desc`. If not specified, `updateTime desc` is the default behavior.
  136. * Examples: `dueDate asc,updateTime desc`, `updateTime,dueDate desc`
  137. * @opt_param string pageToken nextPageToken value returned from a previous list
  138. * call, indicating that the subsequent page of results should be returned.
  139. *
  140. * The list request must be otherwise identical to the one that resulted in this
  141. * token.
  142. * @return Google_Service_Classroom_ListCourseWorkResponse
  143. */
  144. public function listCoursesCourseWork($courseId, $optParams = array())
  145. {
  146. $params = array('courseId' => $courseId);
  147. $params = array_merge($params, $optParams);
  148. return $this->call('list', array($params), "Google_Service_Classroom_ListCourseWorkResponse");
  149. }
  150. /**
  151. * Modifies assignee mode and options of a coursework.
  152. *
  153. * Only a teacher of the course that contains the coursework may call this
  154. * method.
  155. *
  156. * This method returns the following error codes:
  157. *
  158. * * `PERMISSION_DENIED` if the requesting user is not permitted to access the
  159. * requested course or course work or for access errors. * `INVALID_ARGUMENT` if
  160. * the request is malformed. * `NOT_FOUND` if the requested course or course
  161. * work does not exist. (courseWork.modifyAssignees)
  162. *
  163. * @param string $courseId Identifier of the course. This identifier can be
  164. * either the Classroom-assigned identifier or an alias.
  165. * @param string $id Identifier of the coursework.
  166. * @param Google_Service_Classroom_ModifyCourseWorkAssigneesRequest $postBody
  167. * @param array $optParams Optional parameters.
  168. * @return Google_Service_Classroom_CourseWork
  169. */
  170. public function modifyAssignees($courseId, $id, Google_Service_Classroom_ModifyCourseWorkAssigneesRequest $postBody, $optParams = array())
  171. {
  172. $params = array('courseId' => $courseId, 'id' => $id, 'postBody' => $postBody);
  173. $params = array_merge($params, $optParams);
  174. return $this->call('modifyAssignees', array($params), "Google_Service_Classroom_CourseWork");
  175. }
  176. /**
  177. * Updates one or more fields of a course work.
  178. *
  179. * See google.classroom.v1.CourseWork for details of which fields may be updated
  180. * and who may change them.
  181. *
  182. * This request must be made by the Developer Console project of the [OAuth
  183. * client ID](https://support.google.com/cloud/answer/6158849) used to create
  184. * the corresponding course work item.
  185. *
  186. * This method returns the following error codes:
  187. *
  188. * * `PERMISSION_DENIED` if the requesting developer project did not create the
  189. * corresponding course work, if the user is not permitted to make the requested
  190. * modification to the student submission, or for access errors. *
  191. * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if
  192. * the requested course work has already been deleted. * `NOT_FOUND` if the
  193. * requested course, course work, or student submission does not exist.
  194. * (courseWork.patch)
  195. *
  196. * @param string $courseId Identifier of the course. This identifier can be
  197. * either the Classroom-assigned identifier or an alias.
  198. * @param string $id Identifier of the course work.
  199. * @param Google_Service_Classroom_CourseWork $postBody
  200. * @param array $optParams Optional parameters.
  201. *
  202. * @opt_param string updateMask Mask that identifies which fields on the course
  203. * work to update. This field is required to do an update. The update fails if
  204. * invalid fields are specified. If a field supports empty values, it can be
  205. * cleared by specifying it in the update mask and not in the CourseWork object.
  206. * If a field that does not support empty values is included in the update mask
  207. * and not set in the CourseWork object, an `INVALID_ARGUMENT` error will be
  208. * returned.
  209. *
  210. * The following fields may be specified by teachers:
  211. *
  212. * * `title` * `description` * `state` * `due_date` * `due_time` * `max_points`
  213. * * `scheduled_time` * `submission_modification_mode` * `topic_id`
  214. * @return Google_Service_Classroom_CourseWork
  215. */
  216. public function patch($courseId, $id, Google_Service_Classroom_CourseWork $postBody, $optParams = array())
  217. {
  218. $params = array('courseId' => $courseId, 'id' => $id, 'postBody' => $postBody);
  219. $params = array_merge($params, $optParams);
  220. return $this->call('patch', array($params), "Google_Service_Classroom_CourseWork");
  221. }
  222. }