Definitions.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>
  4. *
  5. * @license GNU AGPL version 3 or any later version
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. namespace OCP\RichObjectStrings;
  22. /**
  23. * Class Definitions
  24. *
  25. * @package OCP\RichObjectStrings
  26. * @since 11.0.0
  27. */
  28. class Definitions {
  29. /**
  30. * @var array
  31. * @since 11.0.0
  32. */
  33. public $definitions = [
  34. 'addressbook' => [
  35. 'author' => 'Nextcloud',
  36. 'app' => 'dav',
  37. 'since' => '11.0.0',
  38. 'parameters' => [
  39. 'id' => [
  40. 'since' => '11.0.0',
  41. 'required' => true,
  42. 'description' => 'The id used to identify the addressbook on the instance',
  43. 'example' => '42',
  44. ],
  45. 'name' => [
  46. 'since' => '11.0.0',
  47. 'required' => true,
  48. 'description' => 'The display name of the addressbook which should be used in the visual representation',
  49. 'example' => 'Contacts',
  50. ],
  51. ],
  52. ],
  53. 'addressbook-contact' => [
  54. 'author' => 'Nextcloud',
  55. 'app' => 'dav',
  56. 'since' => '11.0.0',
  57. 'parameters' => [
  58. 'id' => [
  59. 'since' => '11.0.0',
  60. 'required' => true,
  61. 'description' => 'The id used to identify the contact on the instance',
  62. 'example' => '42',
  63. ],
  64. 'name' => [
  65. 'since' => '11.0.0',
  66. 'required' => true,
  67. 'description' => 'The display name of the contact which should be used in the visual representation',
  68. 'example' => 'John Doe',
  69. ],
  70. ],
  71. ],
  72. 'announcement' => [
  73. 'author' => 'Joas Schilling',
  74. 'app' => 'announcementcenter',
  75. 'since' => '11.0.0',
  76. 'parameters' => [
  77. 'id' => [
  78. 'since' => '11.0.0',
  79. 'required' => true, 'description' => 'The id used to identify the announcement on the instance',
  80. 'example' => '42',
  81. ],
  82. 'name' => [
  83. 'since' => '11.0.0',
  84. 'required' => true,
  85. 'description' => 'The announcement subject which should be used in the visual representation',
  86. 'example' => 'file.txt',
  87. ],
  88. 'link' => [
  89. 'since' => '11.0.0',
  90. 'required' => false,
  91. 'description' => 'The full URL to the file',
  92. 'example' => 'http://localhost/index.php/apps/announcements/#23',
  93. ],
  94. ],
  95. ],
  96. 'app' => [
  97. 'author' => 'Nextcloud',
  98. 'app' => 'updatenotification',
  99. 'since' => '11.0.0',
  100. 'parameters' => [
  101. 'id' => [
  102. 'since' => '11.0.0',
  103. 'required' => true, 'description' => 'The app id',
  104. 'example' => 'updatenotification',
  105. ],
  106. 'name' => [
  107. 'since' => '11.0.0',
  108. 'required' => true,
  109. 'description' => 'The name of the app which should be used in the visual representation',
  110. 'example' => 'Update notification',
  111. ],
  112. ],
  113. ],
  114. 'calendar' => [
  115. 'author' => 'Nextcloud',
  116. 'app' => 'dav',
  117. 'since' => '11.0.0',
  118. 'parameters' => [
  119. 'id' => [
  120. 'since' => '11.0.0',
  121. 'required' => true,
  122. 'description' => 'The id used to identify the calendar on the instance',
  123. 'example' => '42',
  124. ],
  125. 'name' => [
  126. 'since' => '11.0.0',
  127. 'required' => true,
  128. 'description' => 'The display name of the calendar which should be used in the visual representation',
  129. 'example' => 'Personal',
  130. ],
  131. ],
  132. ],
  133. 'calendar-event' => [
  134. 'author' => 'Nextcloud',
  135. 'app' => 'dav',
  136. 'since' => '11.0.0',
  137. 'parameters' => [
  138. 'id' => [
  139. 'since' => '11.0.0',
  140. 'required' => true,
  141. 'description' => 'The id used to identify the event on the instance',
  142. 'example' => '42',
  143. ],
  144. 'name' => [
  145. 'since' => '11.0.0',
  146. 'required' => true,
  147. 'description' => 'The display name of the event which should be used in the visual representation',
  148. 'example' => 'Workout',
  149. ],
  150. ],
  151. ],
  152. 'call' => [
  153. 'author' => 'Nextcloud',
  154. 'app' => 'spreed',
  155. 'since' => '11.0.2',
  156. 'parameters' => [
  157. 'id' => [
  158. 'since' => '11.0.2',
  159. 'required' => true,
  160. 'description' => 'The id used to identify the call on the instance',
  161. 'example' => '42',
  162. ],
  163. 'name' => [
  164. 'since' => '11.0.2',
  165. 'required' => true,
  166. 'description' => 'The display name of the call which should be used in the visual representation',
  167. 'example' => 'Company call',
  168. ],
  169. 'call-type' => [
  170. 'since' => '11.0.2',
  171. 'required' => true,
  172. 'description' => 'The type of the call: one2one, group or public',
  173. 'example' => 'one2one',
  174. ],
  175. ],
  176. ],
  177. 'email' => [
  178. 'author' => 'Nextcloud',
  179. 'app' => 'sharebymail',
  180. 'since' => '11.0.0',
  181. 'parameters' => [
  182. 'id' => [
  183. 'since' => '11.0.0',
  184. 'required' => true,
  185. 'description' => 'The mail-address used to identify the event on the instance',
  186. 'example' => 'test@localhost',
  187. ],
  188. 'name' => [
  189. 'since' => '11.0.0',
  190. 'required' => true,
  191. 'description' => 'The display name of a matching contact or the email (fallback) which should be used in the visual representation',
  192. 'example' => 'Foo Bar',
  193. ],
  194. ],
  195. ],
  196. 'file' => [
  197. 'author' => 'Nextcloud',
  198. 'app' => 'dav',
  199. 'since' => '11.0.0',
  200. 'parameters' => [
  201. 'id' => [
  202. 'since' => '11.0.0',
  203. 'required' => true,
  204. 'description' => 'The id used to identify the file on the instance',
  205. 'example' => '42',
  206. ],
  207. 'name' => [
  208. 'since' => '11.0.0',
  209. 'required' => true,
  210. 'description' => 'The file name which should be used in the visual representation',
  211. 'example' => 'file.txt',
  212. ],
  213. 'path' => [
  214. 'since' => '11.0.0',
  215. 'required' => true,
  216. 'description' => 'The full path of the file for the user, should not start with a slash',
  217. 'example' => 'path/to/file.txt',
  218. ],
  219. 'link' => [
  220. 'since' => '11.0.0',
  221. 'required' => false,
  222. 'description' => 'The full URL to the file',
  223. 'example' => 'http://localhost/index.php/f/42',
  224. ],
  225. ],
  226. ],
  227. 'pending-federated-share' => [
  228. 'author' => 'Nextcloud',
  229. 'app' => 'dav',
  230. 'since' => '11.0.0',
  231. 'parameters' => [
  232. 'id' => [
  233. 'since' => '11.0.0',
  234. 'required' => true,
  235. 'description' => 'The id used to identify the federated share on the instance',
  236. 'example' => '42',
  237. ],
  238. 'name' => [
  239. 'since' => '11.0.0',
  240. 'required' => true,
  241. 'description' => 'The name of the shared item which should be used in the visual representation',
  242. 'example' => 'file.txt',
  243. ],
  244. ],
  245. ],
  246. 'systemtag' => [
  247. 'author' => 'Nextcloud',
  248. 'app' => 'core',
  249. 'since' => '11.0.0',
  250. 'parameters' => [
  251. 'id' => [
  252. 'since' => '11.0.0',
  253. 'required' => true,
  254. 'description' => 'The id used to identify the systemtag on the instance',
  255. 'example' => '23',
  256. ],
  257. 'name' => [
  258. 'since' => '11.0.0',
  259. 'required' => true,
  260. 'description' => 'The display name of the systemtag which should be used in the visual representation',
  261. 'example' => 'Project 1',
  262. ],
  263. 'visibility' => [
  264. 'since' => '11.0.0',
  265. 'required' => true,
  266. 'description' => 'If the user can see the systemtag',
  267. 'example' => '1',
  268. ],
  269. 'assignable' => [
  270. 'since' => '11.0.0',
  271. 'required' => true,
  272. 'description' => 'If the user can assign the systemtag',
  273. 'example' => '0',
  274. ],
  275. ],
  276. ],
  277. 'user' => [
  278. 'author' => 'Nextcloud',
  279. 'app' => 'core',
  280. 'since' => '11.0.0',
  281. 'parameters' => [
  282. 'id' => [
  283. 'since' => '11.0.0',
  284. 'required' => true,
  285. 'description' => 'The id used to identify the user on the instance',
  286. 'example' => 'johndoe',
  287. ],
  288. 'name' => [
  289. 'since' => '11.0.0',
  290. 'required' => true,
  291. 'description' => 'The display name of the user which should be used in the visual representation',
  292. 'example' => 'John Doe',
  293. ],
  294. 'server' => [
  295. 'since' => '11.0.0',
  296. 'required' => false,
  297. 'description' => 'The URL of the instance the user lives on',
  298. 'example' => 'localhost',
  299. ],
  300. ],
  301. ],
  302. 'user-group' => [
  303. 'author' => 'Nextcloud',
  304. 'app' => 'core',
  305. 'since' => '11.0.0',
  306. 'parameters' => [
  307. 'id' => [
  308. 'since' => '11.0.0',
  309. 'required' => true,
  310. 'description' => 'The id used to identify the group on the instance',
  311. 'example' => 'supportteam',
  312. ],
  313. 'name' => [
  314. 'since' => '11.0.0',
  315. 'required' => true,
  316. 'description' => 'The display name of the group which should be used in the visual representation',
  317. 'example' => 'Support Team',
  318. ],
  319. ],
  320. ],
  321. ];
  322. /**
  323. * @param string $type
  324. * @return array
  325. * @throws InvalidObjectExeption
  326. * @since 11.0.0
  327. */
  328. public function getDefinition($type) {
  329. if (isset($this->definitions[$type])) {
  330. return $this->definitions[$type];
  331. }
  332. throw new InvalidObjectExeption('Object type is undefined');
  333. }
  334. }