Notification.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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\AndroidEnterprise;
  18. class Notification extends \Google\Model
  19. {
  20. public const NOTIFICATION_TYPE_unknown = 'unknown';
  21. /**
  22. * A test push notification.
  23. */
  24. public const NOTIFICATION_TYPE_testNotification = 'testNotification';
  25. /**
  26. * Notification about change to a product's approval status.
  27. */
  28. public const NOTIFICATION_TYPE_productApproval = 'productApproval';
  29. /**
  30. * Notification about an app installation failure.
  31. */
  32. public const NOTIFICATION_TYPE_installFailure = 'installFailure';
  33. /**
  34. * Notification about app update.
  35. */
  36. public const NOTIFICATION_TYPE_appUpdate = 'appUpdate';
  37. /**
  38. * Notification about new app permissions.
  39. */
  40. public const NOTIFICATION_TYPE_newPermissions = 'newPermissions';
  41. /**
  42. * Notification about new app restrictions schema change.
  43. */
  44. public const NOTIFICATION_TYPE_appRestricionsSchemaChange = 'appRestricionsSchemaChange';
  45. /**
  46. * Notification about product availability change.
  47. */
  48. public const NOTIFICATION_TYPE_productAvailabilityChange = 'productAvailabilityChange';
  49. /**
  50. * Notification about a new device.
  51. */
  52. public const NOTIFICATION_TYPE_newDevice = 'newDevice';
  53. /**
  54. * Notification about an updated device report.
  55. */
  56. public const NOTIFICATION_TYPE_deviceReportUpdate = 'deviceReportUpdate';
  57. /**
  58. * Notification about an enterprise upgrade.
  59. */
  60. public const NOTIFICATION_TYPE_enterpriseUpgrade = 'enterpriseUpgrade';
  61. protected $appRestrictionsSchemaChangeEventType = AppRestrictionsSchemaChangeEvent::class;
  62. protected $appRestrictionsSchemaChangeEventDataType = '';
  63. protected $appUpdateEventType = AppUpdateEvent::class;
  64. protected $appUpdateEventDataType = '';
  65. protected $deviceReportUpdateEventType = DeviceReportUpdateEvent::class;
  66. protected $deviceReportUpdateEventDataType = '';
  67. /**
  68. * The ID of the enterprise for which the notification is sent. This will
  69. * always be present.
  70. *
  71. * @var string
  72. */
  73. public $enterpriseId;
  74. protected $enterpriseUpgradeEventType = EnterpriseUpgradeEvent::class;
  75. protected $enterpriseUpgradeEventDataType = '';
  76. protected $installFailureEventType = InstallFailureEvent::class;
  77. protected $installFailureEventDataType = '';
  78. protected $newDeviceEventType = NewDeviceEvent::class;
  79. protected $newDeviceEventDataType = '';
  80. protected $newPermissionsEventType = NewPermissionsEvent::class;
  81. protected $newPermissionsEventDataType = '';
  82. /**
  83. * Type of the notification.
  84. *
  85. * @var string
  86. */
  87. public $notificationType;
  88. protected $productApprovalEventType = ProductApprovalEvent::class;
  89. protected $productApprovalEventDataType = '';
  90. protected $productAvailabilityChangeEventType = ProductAvailabilityChangeEvent::class;
  91. protected $productAvailabilityChangeEventDataType = '';
  92. /**
  93. * The time when the notification was published in milliseconds since
  94. * 1970-01-01T00:00:00Z. This will always be present.
  95. *
  96. * @var string
  97. */
  98. public $timestampMillis;
  99. /**
  100. * Notifications about new app restrictions schema changes.
  101. *
  102. * @param AppRestrictionsSchemaChangeEvent $appRestrictionsSchemaChangeEvent
  103. */
  104. public function setAppRestrictionsSchemaChangeEvent(AppRestrictionsSchemaChangeEvent $appRestrictionsSchemaChangeEvent)
  105. {
  106. $this->appRestrictionsSchemaChangeEvent = $appRestrictionsSchemaChangeEvent;
  107. }
  108. /**
  109. * @return AppRestrictionsSchemaChangeEvent
  110. */
  111. public function getAppRestrictionsSchemaChangeEvent()
  112. {
  113. return $this->appRestrictionsSchemaChangeEvent;
  114. }
  115. /**
  116. * Notifications about app updates.
  117. *
  118. * @param AppUpdateEvent $appUpdateEvent
  119. */
  120. public function setAppUpdateEvent(AppUpdateEvent $appUpdateEvent)
  121. {
  122. $this->appUpdateEvent = $appUpdateEvent;
  123. }
  124. /**
  125. * @return AppUpdateEvent
  126. */
  127. public function getAppUpdateEvent()
  128. {
  129. return $this->appUpdateEvent;
  130. }
  131. /**
  132. * Notifications about device report updates.
  133. *
  134. * @param DeviceReportUpdateEvent $deviceReportUpdateEvent
  135. */
  136. public function setDeviceReportUpdateEvent(DeviceReportUpdateEvent $deviceReportUpdateEvent)
  137. {
  138. $this->deviceReportUpdateEvent = $deviceReportUpdateEvent;
  139. }
  140. /**
  141. * @return DeviceReportUpdateEvent
  142. */
  143. public function getDeviceReportUpdateEvent()
  144. {
  145. return $this->deviceReportUpdateEvent;
  146. }
  147. /**
  148. * The ID of the enterprise for which the notification is sent. This will
  149. * always be present.
  150. *
  151. * @param string $enterpriseId
  152. */
  153. public function setEnterpriseId($enterpriseId)
  154. {
  155. $this->enterpriseId = $enterpriseId;
  156. }
  157. /**
  158. * @return string
  159. */
  160. public function getEnterpriseId()
  161. {
  162. return $this->enterpriseId;
  163. }
  164. /**
  165. * Notifications about enterprise upgrade.
  166. *
  167. * @param EnterpriseUpgradeEvent $enterpriseUpgradeEvent
  168. */
  169. public function setEnterpriseUpgradeEvent(EnterpriseUpgradeEvent $enterpriseUpgradeEvent)
  170. {
  171. $this->enterpriseUpgradeEvent = $enterpriseUpgradeEvent;
  172. }
  173. /**
  174. * @return EnterpriseUpgradeEvent
  175. */
  176. public function getEnterpriseUpgradeEvent()
  177. {
  178. return $this->enterpriseUpgradeEvent;
  179. }
  180. /**
  181. * Notifications about an app installation failure.
  182. *
  183. * @param InstallFailureEvent $installFailureEvent
  184. */
  185. public function setInstallFailureEvent(InstallFailureEvent $installFailureEvent)
  186. {
  187. $this->installFailureEvent = $installFailureEvent;
  188. }
  189. /**
  190. * @return InstallFailureEvent
  191. */
  192. public function getInstallFailureEvent()
  193. {
  194. return $this->installFailureEvent;
  195. }
  196. /**
  197. * Notifications about new devices.
  198. *
  199. * @param NewDeviceEvent $newDeviceEvent
  200. */
  201. public function setNewDeviceEvent(NewDeviceEvent $newDeviceEvent)
  202. {
  203. $this->newDeviceEvent = $newDeviceEvent;
  204. }
  205. /**
  206. * @return NewDeviceEvent
  207. */
  208. public function getNewDeviceEvent()
  209. {
  210. return $this->newDeviceEvent;
  211. }
  212. /**
  213. * Notifications about new app permissions.
  214. *
  215. * @param NewPermissionsEvent $newPermissionsEvent
  216. */
  217. public function setNewPermissionsEvent(NewPermissionsEvent $newPermissionsEvent)
  218. {
  219. $this->newPermissionsEvent = $newPermissionsEvent;
  220. }
  221. /**
  222. * @return NewPermissionsEvent
  223. */
  224. public function getNewPermissionsEvent()
  225. {
  226. return $this->newPermissionsEvent;
  227. }
  228. /**
  229. * Type of the notification.
  230. *
  231. * Accepted values: unknown, testNotification, productApproval,
  232. * installFailure, appUpdate, newPermissions, appRestricionsSchemaChange,
  233. * productAvailabilityChange, newDevice, deviceReportUpdate, enterpriseUpgrade
  234. *
  235. * @param self::NOTIFICATION_TYPE_* $notificationType
  236. */
  237. public function setNotificationType($notificationType)
  238. {
  239. $this->notificationType = $notificationType;
  240. }
  241. /**
  242. * @return self::NOTIFICATION_TYPE_*
  243. */
  244. public function getNotificationType()
  245. {
  246. return $this->notificationType;
  247. }
  248. /**
  249. * Notifications about changes to a product's approval status.
  250. *
  251. * @param ProductApprovalEvent $productApprovalEvent
  252. */
  253. public function setProductApprovalEvent(ProductApprovalEvent $productApprovalEvent)
  254. {
  255. $this->productApprovalEvent = $productApprovalEvent;
  256. }
  257. /**
  258. * @return ProductApprovalEvent
  259. */
  260. public function getProductApprovalEvent()
  261. {
  262. return $this->productApprovalEvent;
  263. }
  264. /**
  265. * Notifications about product availability changes.
  266. *
  267. * @param ProductAvailabilityChangeEvent $productAvailabilityChangeEvent
  268. */
  269. public function setProductAvailabilityChangeEvent(ProductAvailabilityChangeEvent $productAvailabilityChangeEvent)
  270. {
  271. $this->productAvailabilityChangeEvent = $productAvailabilityChangeEvent;
  272. }
  273. /**
  274. * @return ProductAvailabilityChangeEvent
  275. */
  276. public function getProductAvailabilityChangeEvent()
  277. {
  278. return $this->productAvailabilityChangeEvent;
  279. }
  280. /**
  281. * The time when the notification was published in milliseconds since
  282. * 1970-01-01T00:00:00Z. This will always be present.
  283. *
  284. * @param string $timestampMillis
  285. */
  286. public function setTimestampMillis($timestampMillis)
  287. {
  288. $this->timestampMillis = $timestampMillis;
  289. }
  290. /**
  291. * @return string
  292. */
  293. public function getTimestampMillis()
  294. {
  295. return $this->timestampMillis;
  296. }
  297. }
  298. // Adding a class alias for backwards compatibility with the previous class name.
  299. class_alias(Notification::class, 'Google_Service_AndroidEnterprise_Notification');