Geen omschrijving

Script.php 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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 Script (v1).
  19. *
  20. * <p>
  21. * An API for managing and executing Google Apps Script projects. Note: In order
  22. * to use this API in your apps, you must enable it for use. To allow other
  23. * apps to manage your scripts, you must grant them access.</p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://developers.google.com/apps-script/api/" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class Google_Service_Script extends Google_Service
  33. {
  34. /** Read, send, delete, and manage your email. */
  35. const MAIL_GOOGLE_COM =
  36. "https://mail.google.com/";
  37. /** Manage your calendars. */
  38. const WWW_GOOGLE_COM_CALENDAR_FEEDS =
  39. "https://www.google.com/calendar/feeds";
  40. /** Manage your contacts. */
  41. const WWW_GOOGLE_COM_M8_FEEDS =
  42. "https://www.google.com/m8/feeds";
  43. /** View and manage the provisioning of groups on your domain. */
  44. const ADMIN_DIRECTORY_GROUP =
  45. "https://www.googleapis.com/auth/admin.directory.group";
  46. /** View and manage the provisioning of users on your domain. */
  47. const ADMIN_DIRECTORY_USER =
  48. "https://www.googleapis.com/auth/admin.directory.user";
  49. /** View and manage your Google Docs documents. */
  50. const DOCUMENTS =
  51. "https://www.googleapis.com/auth/documents";
  52. /** View and manage the files in your Google Drive. */
  53. const DRIVE =
  54. "https://www.googleapis.com/auth/drive";
  55. /** View and manage your forms in Google Drive. */
  56. const FORMS =
  57. "https://www.googleapis.com/auth/forms";
  58. /** View and manage forms that this application has been installed in. */
  59. const FORMS_CURRENTONLY =
  60. "https://www.googleapis.com/auth/forms.currentonly";
  61. /** View and manage your Google Groups. */
  62. const GROUPS =
  63. "https://www.googleapis.com/auth/groups";
  64. /** View and manage your spreadsheets in Google Drive. */
  65. const SPREADSHEETS =
  66. "https://www.googleapis.com/auth/spreadsheets";
  67. /** View your email address. */
  68. const USERINFO_EMAIL =
  69. "https://www.googleapis.com/auth/userinfo.email";
  70. public $processes;
  71. public $projects;
  72. public $projects_deployments;
  73. public $projects_versions;
  74. public $scripts;
  75. /**
  76. * Constructs the internal representation of the Script service.
  77. *
  78. * @param Google_Client $client
  79. */
  80. public function __construct(Google_Client $client)
  81. {
  82. parent::__construct($client);
  83. $this->rootUrl = 'https://script.googleapis.com/';
  84. $this->servicePath = '';
  85. $this->version = 'v1';
  86. $this->serviceName = 'script';
  87. $this->processes = new Google_Service_Script_Resource_Processes(
  88. $this,
  89. $this->serviceName,
  90. 'processes',
  91. array(
  92. 'methods' => array(
  93. 'list' => array(
  94. 'path' => 'v1/processes',
  95. 'httpMethod' => 'GET',
  96. 'parameters' => array(
  97. 'userProcessFilter.startTime' => array(
  98. 'location' => 'query',
  99. 'type' => 'string',
  100. ),
  101. 'userProcessFilter.projectName' => array(
  102. 'location' => 'query',
  103. 'type' => 'string',
  104. ),
  105. 'userProcessFilter.userAccessLevels' => array(
  106. 'location' => 'query',
  107. 'type' => 'string',
  108. 'repeated' => true,
  109. ),
  110. 'userProcessFilter.functionName' => array(
  111. 'location' => 'query',
  112. 'type' => 'string',
  113. ),
  114. 'userProcessFilter.scriptId' => array(
  115. 'location' => 'query',
  116. 'type' => 'string',
  117. ),
  118. 'userProcessFilter.types' => array(
  119. 'location' => 'query',
  120. 'type' => 'string',
  121. 'repeated' => true,
  122. ),
  123. 'userProcessFilter.statuses' => array(
  124. 'location' => 'query',
  125. 'type' => 'string',
  126. 'repeated' => true,
  127. ),
  128. 'userProcessFilter.deploymentId' => array(
  129. 'location' => 'query',
  130. 'type' => 'string',
  131. ),
  132. 'pageToken' => array(
  133. 'location' => 'query',
  134. 'type' => 'string',
  135. ),
  136. 'userProcessFilter.endTime' => array(
  137. 'location' => 'query',
  138. 'type' => 'string',
  139. ),
  140. 'pageSize' => array(
  141. 'location' => 'query',
  142. 'type' => 'integer',
  143. ),
  144. ),
  145. ),'listScriptProcesses' => array(
  146. 'path' => 'v1/processes:listScriptProcesses',
  147. 'httpMethod' => 'GET',
  148. 'parameters' => array(
  149. 'scriptProcessFilter.endTime' => array(
  150. 'location' => 'query',
  151. 'type' => 'string',
  152. ),
  153. 'scriptProcessFilter.userAccessLevels' => array(
  154. 'location' => 'query',
  155. 'type' => 'string',
  156. 'repeated' => true,
  157. ),
  158. 'scriptProcessFilter.statuses' => array(
  159. 'location' => 'query',
  160. 'type' => 'string',
  161. 'repeated' => true,
  162. ),
  163. 'scriptProcessFilter.startTime' => array(
  164. 'location' => 'query',
  165. 'type' => 'string',
  166. ),
  167. 'scriptProcessFilter.functionName' => array(
  168. 'location' => 'query',
  169. 'type' => 'string',
  170. ),
  171. 'scriptProcessFilter.deploymentId' => array(
  172. 'location' => 'query',
  173. 'type' => 'string',
  174. ),
  175. 'scriptId' => array(
  176. 'location' => 'query',
  177. 'type' => 'string',
  178. ),
  179. 'scriptProcessFilter.types' => array(
  180. 'location' => 'query',
  181. 'type' => 'string',
  182. 'repeated' => true,
  183. ),
  184. 'pageToken' => array(
  185. 'location' => 'query',
  186. 'type' => 'string',
  187. ),
  188. 'pageSize' => array(
  189. 'location' => 'query',
  190. 'type' => 'integer',
  191. ),
  192. ),
  193. ),
  194. )
  195. )
  196. );
  197. $this->projects = new Google_Service_Script_Resource_Projects(
  198. $this,
  199. $this->serviceName,
  200. 'projects',
  201. array(
  202. 'methods' => array(
  203. 'create' => array(
  204. 'path' => 'v1/projects',
  205. 'httpMethod' => 'POST',
  206. 'parameters' => array(),
  207. ),'get' => array(
  208. 'path' => 'v1/projects/{scriptId}',
  209. 'httpMethod' => 'GET',
  210. 'parameters' => array(
  211. 'scriptId' => array(
  212. 'location' => 'path',
  213. 'type' => 'string',
  214. 'required' => true,
  215. ),
  216. ),
  217. ),'getContent' => array(
  218. 'path' => 'v1/projects/{scriptId}/content',
  219. 'httpMethod' => 'GET',
  220. 'parameters' => array(
  221. 'scriptId' => array(
  222. 'location' => 'path',
  223. 'type' => 'string',
  224. 'required' => true,
  225. ),
  226. 'versionNumber' => array(
  227. 'location' => 'query',
  228. 'type' => 'integer',
  229. ),
  230. ),
  231. ),'getMetrics' => array(
  232. 'path' => 'v1/projects/{scriptId}/metrics',
  233. 'httpMethod' => 'GET',
  234. 'parameters' => array(
  235. 'scriptId' => array(
  236. 'location' => 'path',
  237. 'type' => 'string',
  238. 'required' => true,
  239. ),
  240. 'metricsGranularity' => array(
  241. 'location' => 'query',
  242. 'type' => 'string',
  243. ),
  244. 'metricsFilter.deploymentId' => array(
  245. 'location' => 'query',
  246. 'type' => 'string',
  247. ),
  248. ),
  249. ),'updateContent' => array(
  250. 'path' => 'v1/projects/{scriptId}/content',
  251. 'httpMethod' => 'PUT',
  252. 'parameters' => array(
  253. 'scriptId' => array(
  254. 'location' => 'path',
  255. 'type' => 'string',
  256. 'required' => true,
  257. ),
  258. ),
  259. ),
  260. )
  261. )
  262. );
  263. $this->projects_deployments = new Google_Service_Script_Resource_ProjectsDeployments(
  264. $this,
  265. $this->serviceName,
  266. 'deployments',
  267. array(
  268. 'methods' => array(
  269. 'create' => array(
  270. 'path' => 'v1/projects/{scriptId}/deployments',
  271. 'httpMethod' => 'POST',
  272. 'parameters' => array(
  273. 'scriptId' => array(
  274. 'location' => 'path',
  275. 'type' => 'string',
  276. 'required' => true,
  277. ),
  278. ),
  279. ),'delete' => array(
  280. 'path' => 'v1/projects/{scriptId}/deployments/{deploymentId}',
  281. 'httpMethod' => 'DELETE',
  282. 'parameters' => array(
  283. 'scriptId' => array(
  284. 'location' => 'path',
  285. 'type' => 'string',
  286. 'required' => true,
  287. ),
  288. 'deploymentId' => array(
  289. 'location' => 'path',
  290. 'type' => 'string',
  291. 'required' => true,
  292. ),
  293. ),
  294. ),'get' => array(
  295. 'path' => 'v1/projects/{scriptId}/deployments/{deploymentId}',
  296. 'httpMethod' => 'GET',
  297. 'parameters' => array(
  298. 'scriptId' => array(
  299. 'location' => 'path',
  300. 'type' => 'string',
  301. 'required' => true,
  302. ),
  303. 'deploymentId' => array(
  304. 'location' => 'path',
  305. 'type' => 'string',
  306. 'required' => true,
  307. ),
  308. ),
  309. ),'list' => array(
  310. 'path' => 'v1/projects/{scriptId}/deployments',
  311. 'httpMethod' => 'GET',
  312. 'parameters' => array(
  313. 'scriptId' => array(
  314. 'location' => 'path',
  315. 'type' => 'string',
  316. 'required' => true,
  317. ),
  318. 'pageSize' => array(
  319. 'location' => 'query',
  320. 'type' => 'integer',
  321. ),
  322. 'pageToken' => array(
  323. 'location' => 'query',
  324. 'type' => 'string',
  325. ),
  326. ),
  327. ),'update' => array(
  328. 'path' => 'v1/projects/{scriptId}/deployments/{deploymentId}',
  329. 'httpMethod' => 'PUT',
  330. 'parameters' => array(
  331. 'scriptId' => array(
  332. 'location' => 'path',
  333. 'type' => 'string',
  334. 'required' => true,
  335. ),
  336. 'deploymentId' => array(
  337. 'location' => 'path',
  338. 'type' => 'string',
  339. 'required' => true,
  340. ),
  341. ),
  342. ),
  343. )
  344. )
  345. );
  346. $this->projects_versions = new Google_Service_Script_Resource_ProjectsVersions(
  347. $this,
  348. $this->serviceName,
  349. 'versions',
  350. array(
  351. 'methods' => array(
  352. 'create' => array(
  353. 'path' => 'v1/projects/{scriptId}/versions',
  354. 'httpMethod' => 'POST',
  355. 'parameters' => array(
  356. 'scriptId' => array(
  357. 'location' => 'path',
  358. 'type' => 'string',
  359. 'required' => true,
  360. ),
  361. ),
  362. ),'get' => array(
  363. 'path' => 'v1/projects/{scriptId}/versions/{versionNumber}',
  364. 'httpMethod' => 'GET',
  365. 'parameters' => array(
  366. 'scriptId' => array(
  367. 'location' => 'path',
  368. 'type' => 'string',
  369. 'required' => true,
  370. ),
  371. 'versionNumber' => array(
  372. 'location' => 'path',
  373. 'type' => 'integer',
  374. 'required' => true,
  375. ),
  376. ),
  377. ),'list' => array(
  378. 'path' => 'v1/projects/{scriptId}/versions',
  379. 'httpMethod' => 'GET',
  380. 'parameters' => array(
  381. 'scriptId' => array(
  382. 'location' => 'path',
  383. 'type' => 'string',
  384. 'required' => true,
  385. ),
  386. 'pageToken' => array(
  387. 'location' => 'query',
  388. 'type' => 'string',
  389. ),
  390. 'pageSize' => array(
  391. 'location' => 'query',
  392. 'type' => 'integer',
  393. ),
  394. ),
  395. ),
  396. )
  397. )
  398. );
  399. $this->scripts = new Google_Service_Script_Resource_Scripts(
  400. $this,
  401. $this->serviceName,
  402. 'scripts',
  403. array(
  404. 'methods' => array(
  405. 'run' => array(
  406. 'path' => 'v1/scripts/{scriptId}:run',
  407. 'httpMethod' => 'POST',
  408. 'parameters' => array(
  409. 'scriptId' => array(
  410. 'location' => 'path',
  411. 'type' => 'string',
  412. 'required' => true,
  413. ),
  414. ),
  415. ),
  416. )
  417. )
  418. );
  419. }
  420. }