AddOnAttachment.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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. namespace Google\Service\Classroom;
  18. class AddOnAttachment extends \Google\Collection
  19. {
  20. protected $collection_key = 'copyHistory';
  21. protected $copyHistoryType = CopyHistory::class;
  22. protected $copyHistoryDataType = 'array';
  23. /**
  24. * Immutable. Identifier of the course.
  25. *
  26. * @var string
  27. */
  28. public $courseId;
  29. protected $dueDateType = Date::class;
  30. protected $dueDateDataType = '';
  31. protected $dueTimeType = TimeOfDay::class;
  32. protected $dueTimeDataType = '';
  33. /**
  34. * Immutable. Classroom-assigned identifier for this attachment, unique per
  35. * post.
  36. *
  37. * @var string
  38. */
  39. public $id;
  40. /**
  41. * Immutable. Identifier of the `Announcement`, `CourseWork`, or
  42. * `CourseWorkMaterial` under which the attachment is attached. Unique per
  43. * course.
  44. *
  45. * @var string
  46. */
  47. public $itemId;
  48. /**
  49. * Maximum grade for this attachment. Can only be set if
  50. * `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the
  51. * attachment supports grade passback. If set, this must be a non-negative
  52. * integer value. When set to zero, the attachment will not support grade
  53. * passback.
  54. *
  55. * @var
  56. */
  57. public $maxPoints;
  58. /**
  59. * Immutable. Deprecated, use `item_id` instead.
  60. *
  61. * @deprecated
  62. * @var string
  63. */
  64. public $postId;
  65. protected $studentViewUriType = EmbedUri::class;
  66. protected $studentViewUriDataType = '';
  67. protected $studentWorkReviewUriType = EmbedUri::class;
  68. protected $studentWorkReviewUriDataType = '';
  69. protected $teacherViewUriType = EmbedUri::class;
  70. protected $teacherViewUriDataType = '';
  71. /**
  72. * Required. Title of this attachment. The title must be between 1 and 1000
  73. * characters.
  74. *
  75. * @var string
  76. */
  77. public $title;
  78. /**
  79. * Output only. Identifiers of attachments that were previous copies of this
  80. * attachment. If the attachment was previously copied by virtue of its parent
  81. * post being copied, this enumerates the identifiers of attachments that were
  82. * its previous copies in ascending chronological order of copy.
  83. *
  84. * @param CopyHistory[] $copyHistory
  85. */
  86. public function setCopyHistory($copyHistory)
  87. {
  88. $this->copyHistory = $copyHistory;
  89. }
  90. /**
  91. * @return CopyHistory[]
  92. */
  93. public function getCopyHistory()
  94. {
  95. return $this->copyHistory;
  96. }
  97. /**
  98. * Immutable. Identifier of the course.
  99. *
  100. * @param string $courseId
  101. */
  102. public function setCourseId($courseId)
  103. {
  104. $this->courseId = $courseId;
  105. }
  106. /**
  107. * @return string
  108. */
  109. public function getCourseId()
  110. {
  111. return $this->courseId;
  112. }
  113. /**
  114. * Date, in UTC, that work on this attachment is due. This must be specified
  115. * if `due_time` is specified.
  116. *
  117. * @param Date $dueDate
  118. */
  119. public function setDueDate(Date $dueDate)
  120. {
  121. $this->dueDate = $dueDate;
  122. }
  123. /**
  124. * @return Date
  125. */
  126. public function getDueDate()
  127. {
  128. return $this->dueDate;
  129. }
  130. /**
  131. * Time of day, in UTC, that work on this attachment is due. This must be
  132. * specified if `due_date` is specified.
  133. *
  134. * @param TimeOfDay $dueTime
  135. */
  136. public function setDueTime(TimeOfDay $dueTime)
  137. {
  138. $this->dueTime = $dueTime;
  139. }
  140. /**
  141. * @return TimeOfDay
  142. */
  143. public function getDueTime()
  144. {
  145. return $this->dueTime;
  146. }
  147. /**
  148. * Immutable. Classroom-assigned identifier for this attachment, unique per
  149. * post.
  150. *
  151. * @param string $id
  152. */
  153. public function setId($id)
  154. {
  155. $this->id = $id;
  156. }
  157. /**
  158. * @return string
  159. */
  160. public function getId()
  161. {
  162. return $this->id;
  163. }
  164. /**
  165. * Immutable. Identifier of the `Announcement`, `CourseWork`, or
  166. * `CourseWorkMaterial` under which the attachment is attached. Unique per
  167. * course.
  168. *
  169. * @param string $itemId
  170. */
  171. public function setItemId($itemId)
  172. {
  173. $this->itemId = $itemId;
  174. }
  175. /**
  176. * @return string
  177. */
  178. public function getItemId()
  179. {
  180. return $this->itemId;
  181. }
  182. public function setMaxPoints($maxPoints)
  183. {
  184. $this->maxPoints = $maxPoints;
  185. }
  186. public function getMaxPoints()
  187. {
  188. return $this->maxPoints;
  189. }
  190. /**
  191. * Immutable. Deprecated, use `item_id` instead.
  192. *
  193. * @deprecated
  194. * @param string $postId
  195. */
  196. public function setPostId($postId)
  197. {
  198. $this->postId = $postId;
  199. }
  200. /**
  201. * @deprecated
  202. * @return string
  203. */
  204. public function getPostId()
  205. {
  206. return $this->postId;
  207. }
  208. /**
  209. * Required. URI to show the student view of the attachment. The URI will be
  210. * opened in an iframe with the `courseId`, `itemId`, `itemType`, and
  211. * `attachmentId` query parameters set.
  212. *
  213. * @param EmbedUri $studentViewUri
  214. */
  215. public function setStudentViewUri(EmbedUri $studentViewUri)
  216. {
  217. $this->studentViewUri = $studentViewUri;
  218. }
  219. /**
  220. * @return EmbedUri
  221. */
  222. public function getStudentViewUri()
  223. {
  224. return $this->studentViewUri;
  225. }
  226. /**
  227. * URI for the teacher to see student work on the attachment, if applicable.
  228. * The URI will be opened in an iframe with the `courseId`, `itemId`,
  229. * `itemType`, `attachmentId`, and `submissionId` query parameters set. This
  230. * is the same `submissionId` returned in the [`AddOnContext.studentContext`](
  231. * //devsite.google.com/classroom/reference/rest/v1/AddOnContext#StudentContex
  232. * t) field when a student views the attachment. If the URI is omitted or
  233. * removed, `max_points` will also be discarded.
  234. *
  235. * @param EmbedUri $studentWorkReviewUri
  236. */
  237. public function setStudentWorkReviewUri(EmbedUri $studentWorkReviewUri)
  238. {
  239. $this->studentWorkReviewUri = $studentWorkReviewUri;
  240. }
  241. /**
  242. * @return EmbedUri
  243. */
  244. public function getStudentWorkReviewUri()
  245. {
  246. return $this->studentWorkReviewUri;
  247. }
  248. /**
  249. * Required. URI to show the teacher view of the attachment. The URI will be
  250. * opened in an iframe with the `courseId`, `itemId`, `itemType`, and
  251. * `attachmentId` query parameters set.
  252. *
  253. * @param EmbedUri $teacherViewUri
  254. */
  255. public function setTeacherViewUri(EmbedUri $teacherViewUri)
  256. {
  257. $this->teacherViewUri = $teacherViewUri;
  258. }
  259. /**
  260. * @return EmbedUri
  261. */
  262. public function getTeacherViewUri()
  263. {
  264. return $this->teacherViewUri;
  265. }
  266. /**
  267. * Required. Title of this attachment. The title must be between 1 and 1000
  268. * characters.
  269. *
  270. * @param string $title
  271. */
  272. public function setTitle($title)
  273. {
  274. $this->title = $title;
  275. }
  276. /**
  277. * @return string
  278. */
  279. public function getTitle()
  280. {
  281. return $this->title;
  282. }
  283. }
  284. // Adding a class alias for backwards compatibility with the previous class name.
  285. class_alias(AddOnAttachment::class, 'Google_Service_Classroom_AddOnAttachment');