설명 없음

Reports.php 9.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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. * Service definition for Reports (reports_v1).
  19. *
  20. * <p>
  21. * Fetches reports for the administrators of G Suite customers about the usage,
  22. * collaboration, security, and risk for their users.</p>
  23. *
  24. * <p>
  25. * For more information about this service, see the API
  26. * <a href="https://developers.google.com/admin-sdk/reports/" target="_blank">Documentation</a>
  27. * </p>
  28. *
  29. * @author Google, Inc.
  30. */
  31. class Google_Service_Reports extends Google_Service
  32. {
  33. /** View audit reports for your G Suite domain. */
  34. const ADMIN_REPORTS_AUDIT_READONLY =
  35. "https://www.googleapis.com/auth/admin.reports.audit.readonly";
  36. /** View usage reports for your G Suite domain. */
  37. const ADMIN_REPORTS_USAGE_READONLY =
  38. "https://www.googleapis.com/auth/admin.reports.usage.readonly";
  39. public $activities;
  40. public $channels;
  41. public $customerUsageReports;
  42. public $entityUsageReports;
  43. public $userUsageReport;
  44. /**
  45. * Constructs the internal representation of the Reports service.
  46. *
  47. * @param Google_Client $client
  48. */
  49. public function __construct(Google_Client $client)
  50. {
  51. parent::__construct($client);
  52. $this->rootUrl = 'https://www.googleapis.com/';
  53. $this->servicePath = 'admin/reports/v1/';
  54. $this->version = 'reports_v1';
  55. $this->serviceName = 'admin';
  56. $this->activities = new Google_Service_Reports_Resource_Activities(
  57. $this,
  58. $this->serviceName,
  59. 'activities',
  60. array(
  61. 'methods' => array(
  62. 'list' => array(
  63. 'path' => 'activity/users/{userKey}/applications/{applicationName}',
  64. 'httpMethod' => 'GET',
  65. 'parameters' => array(
  66. 'userKey' => array(
  67. 'location' => 'path',
  68. 'type' => 'string',
  69. 'required' => true,
  70. ),
  71. 'applicationName' => array(
  72. 'location' => 'path',
  73. 'type' => 'string',
  74. 'required' => true,
  75. ),
  76. 'actorIpAddress' => array(
  77. 'location' => 'query',
  78. 'type' => 'string',
  79. ),
  80. 'customerId' => array(
  81. 'location' => 'query',
  82. 'type' => 'string',
  83. ),
  84. 'endTime' => array(
  85. 'location' => 'query',
  86. 'type' => 'string',
  87. ),
  88. 'eventName' => array(
  89. 'location' => 'query',
  90. 'type' => 'string',
  91. ),
  92. 'filters' => array(
  93. 'location' => 'query',
  94. 'type' => 'string',
  95. ),
  96. 'maxResults' => array(
  97. 'location' => 'query',
  98. 'type' => 'integer',
  99. ),
  100. 'pageToken' => array(
  101. 'location' => 'query',
  102. 'type' => 'string',
  103. ),
  104. 'startTime' => array(
  105. 'location' => 'query',
  106. 'type' => 'string',
  107. ),
  108. ),
  109. ),'watch' => array(
  110. 'path' => 'activity/users/{userKey}/applications/{applicationName}/watch',
  111. 'httpMethod' => 'POST',
  112. 'parameters' => array(
  113. 'userKey' => array(
  114. 'location' => 'path',
  115. 'type' => 'string',
  116. 'required' => true,
  117. ),
  118. 'applicationName' => array(
  119. 'location' => 'path',
  120. 'type' => 'string',
  121. 'required' => true,
  122. ),
  123. 'actorIpAddress' => array(
  124. 'location' => 'query',
  125. 'type' => 'string',
  126. ),
  127. 'customerId' => array(
  128. 'location' => 'query',
  129. 'type' => 'string',
  130. ),
  131. 'endTime' => array(
  132. 'location' => 'query',
  133. 'type' => 'string',
  134. ),
  135. 'eventName' => array(
  136. 'location' => 'query',
  137. 'type' => 'string',
  138. ),
  139. 'filters' => array(
  140. 'location' => 'query',
  141. 'type' => 'string',
  142. ),
  143. 'maxResults' => array(
  144. 'location' => 'query',
  145. 'type' => 'integer',
  146. ),
  147. 'pageToken' => array(
  148. 'location' => 'query',
  149. 'type' => 'string',
  150. ),
  151. 'startTime' => array(
  152. 'location' => 'query',
  153. 'type' => 'string',
  154. ),
  155. ),
  156. ),
  157. )
  158. )
  159. );
  160. $this->channels = new Google_Service_Reports_Resource_Channels(
  161. $this,
  162. $this->serviceName,
  163. 'channels',
  164. array(
  165. 'methods' => array(
  166. 'stop' => array(
  167. 'path' => '/admin/reports_v1/channels/stop',
  168. 'httpMethod' => 'POST',
  169. 'parameters' => array(),
  170. ),
  171. )
  172. )
  173. );
  174. $this->customerUsageReports = new Google_Service_Reports_Resource_CustomerUsageReports(
  175. $this,
  176. $this->serviceName,
  177. 'customerUsageReports',
  178. array(
  179. 'methods' => array(
  180. 'get' => array(
  181. 'path' => 'usage/dates/{date}',
  182. 'httpMethod' => 'GET',
  183. 'parameters' => array(
  184. 'date' => array(
  185. 'location' => 'path',
  186. 'type' => 'string',
  187. 'required' => true,
  188. ),
  189. 'customerId' => array(
  190. 'location' => 'query',
  191. 'type' => 'string',
  192. ),
  193. 'pageToken' => array(
  194. 'location' => 'query',
  195. 'type' => 'string',
  196. ),
  197. 'parameters' => array(
  198. 'location' => 'query',
  199. 'type' => 'string',
  200. ),
  201. ),
  202. ),
  203. )
  204. )
  205. );
  206. $this->entityUsageReports = new Google_Service_Reports_Resource_EntityUsageReports(
  207. $this,
  208. $this->serviceName,
  209. 'entityUsageReports',
  210. array(
  211. 'methods' => array(
  212. 'get' => array(
  213. 'path' => 'usage/{entityType}/{entityKey}/dates/{date}',
  214. 'httpMethod' => 'GET',
  215. 'parameters' => array(
  216. 'entityType' => array(
  217. 'location' => 'path',
  218. 'type' => 'string',
  219. 'required' => true,
  220. ),
  221. 'entityKey' => array(
  222. 'location' => 'path',
  223. 'type' => 'string',
  224. 'required' => true,
  225. ),
  226. 'date' => array(
  227. 'location' => 'path',
  228. 'type' => 'string',
  229. 'required' => true,
  230. ),
  231. 'customerId' => array(
  232. 'location' => 'query',
  233. 'type' => 'string',
  234. ),
  235. 'filters' => array(
  236. 'location' => 'query',
  237. 'type' => 'string',
  238. ),
  239. 'maxResults' => array(
  240. 'location' => 'query',
  241. 'type' => 'integer',
  242. ),
  243. 'pageToken' => array(
  244. 'location' => 'query',
  245. 'type' => 'string',
  246. ),
  247. 'parameters' => array(
  248. 'location' => 'query',
  249. 'type' => 'string',
  250. ),
  251. ),
  252. ),
  253. )
  254. )
  255. );
  256. $this->userUsageReport = new Google_Service_Reports_Resource_UserUsageReport(
  257. $this,
  258. $this->serviceName,
  259. 'userUsageReport',
  260. array(
  261. 'methods' => array(
  262. 'get' => array(
  263. 'path' => 'usage/users/{userKey}/dates/{date}',
  264. 'httpMethod' => 'GET',
  265. 'parameters' => array(
  266. 'userKey' => array(
  267. 'location' => 'path',
  268. 'type' => 'string',
  269. 'required' => true,
  270. ),
  271. 'date' => array(
  272. 'location' => 'path',
  273. 'type' => 'string',
  274. 'required' => true,
  275. ),
  276. 'customerId' => array(
  277. 'location' => 'query',
  278. 'type' => 'string',
  279. ),
  280. 'filters' => array(
  281. 'location' => 'query',
  282. 'type' => 'string',
  283. ),
  284. 'maxResults' => array(
  285. 'location' => 'query',
  286. 'type' => 'integer',
  287. ),
  288. 'pageToken' => array(
  289. 'location' => 'query',
  290. 'type' => 'string',
  291. ),
  292. 'parameters' => array(
  293. 'location' => 'query',
  294. 'type' => 'string',
  295. ),
  296. ),
  297. ),
  298. )
  299. )
  300. );
  301. }
  302. }