暫無描述

Bigquery.php 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  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 Bigquery (v2).
  19. *
  20. * <p>
  21. * A data platform for customers to create, manage, share and query data.</p>
  22. *
  23. * <p>
  24. * For more information about this service, see the API
  25. * <a href="https://cloud.google.com/bigquery/" target="_blank">Documentation</a>
  26. * </p>
  27. *
  28. * @author Google, Inc.
  29. */
  30. class Google_Service_Bigquery extends Google_Service
  31. {
  32. /** View and manage your data in Google BigQuery. */
  33. const BIGQUERY =
  34. "https://www.googleapis.com/auth/bigquery";
  35. /** Insert data into Google BigQuery. */
  36. const BIGQUERY_INSERTDATA =
  37. "https://www.googleapis.com/auth/bigquery.insertdata";
  38. /** View and manage your data across Google Cloud Platform services. */
  39. const CLOUD_PLATFORM =
  40. "https://www.googleapis.com/auth/cloud-platform";
  41. /** View your data across Google Cloud Platform services. */
  42. const CLOUD_PLATFORM_READ_ONLY =
  43. "https://www.googleapis.com/auth/cloud-platform.read-only";
  44. /** Manage your data and permissions in Google Cloud Storage. */
  45. const DEVSTORAGE_FULL_CONTROL =
  46. "https://www.googleapis.com/auth/devstorage.full_control";
  47. /** View your data in Google Cloud Storage. */
  48. const DEVSTORAGE_READ_ONLY =
  49. "https://www.googleapis.com/auth/devstorage.read_only";
  50. /** Manage your data in Google Cloud Storage. */
  51. const DEVSTORAGE_READ_WRITE =
  52. "https://www.googleapis.com/auth/devstorage.read_write";
  53. public $datasets;
  54. public $jobs;
  55. public $projects;
  56. public $tabledata;
  57. public $tables;
  58. /**
  59. * Constructs the internal representation of the Bigquery service.
  60. *
  61. * @param Google_Client $client
  62. */
  63. public function __construct(Google_Client $client)
  64. {
  65. parent::__construct($client);
  66. $this->rootUrl = 'https://www.googleapis.com/';
  67. $this->servicePath = 'bigquery/v2/';
  68. $this->version = 'v2';
  69. $this->serviceName = 'bigquery';
  70. $this->datasets = new Google_Service_Bigquery_Resource_Datasets(
  71. $this,
  72. $this->serviceName,
  73. 'datasets',
  74. array(
  75. 'methods' => array(
  76. 'delete' => array(
  77. 'path' => 'projects/{projectId}/datasets/{datasetId}',
  78. 'httpMethod' => 'DELETE',
  79. 'parameters' => array(
  80. 'projectId' => array(
  81. 'location' => 'path',
  82. 'type' => 'string',
  83. 'required' => true,
  84. ),
  85. 'datasetId' => array(
  86. 'location' => 'path',
  87. 'type' => 'string',
  88. 'required' => true,
  89. ),
  90. 'deleteContents' => array(
  91. 'location' => 'query',
  92. 'type' => 'boolean',
  93. ),
  94. ),
  95. ),'get' => array(
  96. 'path' => 'projects/{projectId}/datasets/{datasetId}',
  97. 'httpMethod' => 'GET',
  98. 'parameters' => array(
  99. 'projectId' => array(
  100. 'location' => 'path',
  101. 'type' => 'string',
  102. 'required' => true,
  103. ),
  104. 'datasetId' => array(
  105. 'location' => 'path',
  106. 'type' => 'string',
  107. 'required' => true,
  108. ),
  109. ),
  110. ),'insert' => array(
  111. 'path' => 'projects/{projectId}/datasets',
  112. 'httpMethod' => 'POST',
  113. 'parameters' => array(
  114. 'projectId' => array(
  115. 'location' => 'path',
  116. 'type' => 'string',
  117. 'required' => true,
  118. ),
  119. ),
  120. ),'list' => array(
  121. 'path' => 'projects/{projectId}/datasets',
  122. 'httpMethod' => 'GET',
  123. 'parameters' => array(
  124. 'projectId' => array(
  125. 'location' => 'path',
  126. 'type' => 'string',
  127. 'required' => true,
  128. ),
  129. 'all' => array(
  130. 'location' => 'query',
  131. 'type' => 'boolean',
  132. ),
  133. 'filter' => array(
  134. 'location' => 'query',
  135. 'type' => 'string',
  136. ),
  137. 'maxResults' => array(
  138. 'location' => 'query',
  139. 'type' => 'integer',
  140. ),
  141. 'pageToken' => array(
  142. 'location' => 'query',
  143. 'type' => 'string',
  144. ),
  145. ),
  146. ),'patch' => array(
  147. 'path' => 'projects/{projectId}/datasets/{datasetId}',
  148. 'httpMethod' => 'PATCH',
  149. 'parameters' => array(
  150. 'projectId' => array(
  151. 'location' => 'path',
  152. 'type' => 'string',
  153. 'required' => true,
  154. ),
  155. 'datasetId' => array(
  156. 'location' => 'path',
  157. 'type' => 'string',
  158. 'required' => true,
  159. ),
  160. ),
  161. ),'update' => array(
  162. 'path' => 'projects/{projectId}/datasets/{datasetId}',
  163. 'httpMethod' => 'PUT',
  164. 'parameters' => array(
  165. 'projectId' => array(
  166. 'location' => 'path',
  167. 'type' => 'string',
  168. 'required' => true,
  169. ),
  170. 'datasetId' => array(
  171. 'location' => 'path',
  172. 'type' => 'string',
  173. 'required' => true,
  174. ),
  175. ),
  176. ),
  177. )
  178. )
  179. );
  180. $this->jobs = new Google_Service_Bigquery_Resource_Jobs(
  181. $this,
  182. $this->serviceName,
  183. 'jobs',
  184. array(
  185. 'methods' => array(
  186. 'cancel' => array(
  187. 'path' => 'projects/{projectId}/jobs/{jobId}/cancel',
  188. 'httpMethod' => 'POST',
  189. 'parameters' => array(
  190. 'projectId' => array(
  191. 'location' => 'path',
  192. 'type' => 'string',
  193. 'required' => true,
  194. ),
  195. 'jobId' => array(
  196. 'location' => 'path',
  197. 'type' => 'string',
  198. 'required' => true,
  199. ),
  200. 'location' => array(
  201. 'location' => 'query',
  202. 'type' => 'string',
  203. ),
  204. ),
  205. ),'get' => array(
  206. 'path' => 'projects/{projectId}/jobs/{jobId}',
  207. 'httpMethod' => 'GET',
  208. 'parameters' => array(
  209. 'projectId' => array(
  210. 'location' => 'path',
  211. 'type' => 'string',
  212. 'required' => true,
  213. ),
  214. 'jobId' => array(
  215. 'location' => 'path',
  216. 'type' => 'string',
  217. 'required' => true,
  218. ),
  219. 'location' => array(
  220. 'location' => 'query',
  221. 'type' => 'string',
  222. ),
  223. ),
  224. ),'getQueryResults' => array(
  225. 'path' => 'projects/{projectId}/queries/{jobId}',
  226. 'httpMethod' => 'GET',
  227. 'parameters' => array(
  228. 'projectId' => array(
  229. 'location' => 'path',
  230. 'type' => 'string',
  231. 'required' => true,
  232. ),
  233. 'jobId' => array(
  234. 'location' => 'path',
  235. 'type' => 'string',
  236. 'required' => true,
  237. ),
  238. 'location' => array(
  239. 'location' => 'query',
  240. 'type' => 'string',
  241. ),
  242. 'maxResults' => array(
  243. 'location' => 'query',
  244. 'type' => 'integer',
  245. ),
  246. 'pageToken' => array(
  247. 'location' => 'query',
  248. 'type' => 'string',
  249. ),
  250. 'startIndex' => array(
  251. 'location' => 'query',
  252. 'type' => 'string',
  253. ),
  254. 'timeoutMs' => array(
  255. 'location' => 'query',
  256. 'type' => 'integer',
  257. ),
  258. ),
  259. ),'insert' => array(
  260. 'path' => 'projects/{projectId}/jobs',
  261. 'httpMethod' => 'POST',
  262. 'parameters' => array(
  263. 'projectId' => array(
  264. 'location' => 'path',
  265. 'type' => 'string',
  266. 'required' => true,
  267. ),
  268. ),
  269. ),'list' => array(
  270. 'path' => 'projects/{projectId}/jobs',
  271. 'httpMethod' => 'GET',
  272. 'parameters' => array(
  273. 'projectId' => array(
  274. 'location' => 'path',
  275. 'type' => 'string',
  276. 'required' => true,
  277. ),
  278. 'allUsers' => array(
  279. 'location' => 'query',
  280. 'type' => 'boolean',
  281. ),
  282. 'maxCreationTime' => array(
  283. 'location' => 'query',
  284. 'type' => 'string',
  285. ),
  286. 'maxResults' => array(
  287. 'location' => 'query',
  288. 'type' => 'integer',
  289. ),
  290. 'minCreationTime' => array(
  291. 'location' => 'query',
  292. 'type' => 'string',
  293. ),
  294. 'pageToken' => array(
  295. 'location' => 'query',
  296. 'type' => 'string',
  297. ),
  298. 'projection' => array(
  299. 'location' => 'query',
  300. 'type' => 'string',
  301. ),
  302. 'stateFilter' => array(
  303. 'location' => 'query',
  304. 'type' => 'string',
  305. 'repeated' => true,
  306. ),
  307. ),
  308. ),'query' => array(
  309. 'path' => 'projects/{projectId}/queries',
  310. 'httpMethod' => 'POST',
  311. 'parameters' => array(
  312. 'projectId' => array(
  313. 'location' => 'path',
  314. 'type' => 'string',
  315. 'required' => true,
  316. ),
  317. ),
  318. ),
  319. )
  320. )
  321. );
  322. $this->projects = new Google_Service_Bigquery_Resource_Projects(
  323. $this,
  324. $this->serviceName,
  325. 'projects',
  326. array(
  327. 'methods' => array(
  328. 'getServiceAccount' => array(
  329. 'path' => 'projects/{projectId}/serviceAccount',
  330. 'httpMethod' => 'GET',
  331. 'parameters' => array(
  332. 'projectId' => array(
  333. 'location' => 'path',
  334. 'type' => 'string',
  335. 'required' => true,
  336. ),
  337. ),
  338. ),'list' => array(
  339. 'path' => 'projects',
  340. 'httpMethod' => 'GET',
  341. 'parameters' => array(
  342. 'maxResults' => array(
  343. 'location' => 'query',
  344. 'type' => 'integer',
  345. ),
  346. 'pageToken' => array(
  347. 'location' => 'query',
  348. 'type' => 'string',
  349. ),
  350. ),
  351. ),
  352. )
  353. )
  354. );
  355. $this->tabledata = new Google_Service_Bigquery_Resource_Tabledata(
  356. $this,
  357. $this->serviceName,
  358. 'tabledata',
  359. array(
  360. 'methods' => array(
  361. 'insertAll' => array(
  362. 'path' => 'projects/{projectId}/datasets/{datasetId}/tables/{tableId}/insertAll',
  363. 'httpMethod' => 'POST',
  364. 'parameters' => array(
  365. 'projectId' => array(
  366. 'location' => 'path',
  367. 'type' => 'string',
  368. 'required' => true,
  369. ),
  370. 'datasetId' => array(
  371. 'location' => 'path',
  372. 'type' => 'string',
  373. 'required' => true,
  374. ),
  375. 'tableId' => array(
  376. 'location' => 'path',
  377. 'type' => 'string',
  378. 'required' => true,
  379. ),
  380. ),
  381. ),'list' => array(
  382. 'path' => 'projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data',
  383. 'httpMethod' => 'GET',
  384. 'parameters' => array(
  385. 'projectId' => array(
  386. 'location' => 'path',
  387. 'type' => 'string',
  388. 'required' => true,
  389. ),
  390. 'datasetId' => array(
  391. 'location' => 'path',
  392. 'type' => 'string',
  393. 'required' => true,
  394. ),
  395. 'tableId' => array(
  396. 'location' => 'path',
  397. 'type' => 'string',
  398. 'required' => true,
  399. ),
  400. 'maxResults' => array(
  401. 'location' => 'query',
  402. 'type' => 'integer',
  403. ),
  404. 'pageToken' => array(
  405. 'location' => 'query',
  406. 'type' => 'string',
  407. ),
  408. 'selectedFields' => array(
  409. 'location' => 'query',
  410. 'type' => 'string',
  411. ),
  412. 'startIndex' => array(
  413. 'location' => 'query',
  414. 'type' => 'string',
  415. ),
  416. ),
  417. ),
  418. )
  419. )
  420. );
  421. $this->tables = new Google_Service_Bigquery_Resource_Tables(
  422. $this,
  423. $this->serviceName,
  424. 'tables',
  425. array(
  426. 'methods' => array(
  427. 'delete' => array(
  428. 'path' => 'projects/{projectId}/datasets/{datasetId}/tables/{tableId}',
  429. 'httpMethod' => 'DELETE',
  430. 'parameters' => array(
  431. 'projectId' => array(
  432. 'location' => 'path',
  433. 'type' => 'string',
  434. 'required' => true,
  435. ),
  436. 'datasetId' => array(
  437. 'location' => 'path',
  438. 'type' => 'string',
  439. 'required' => true,
  440. ),
  441. 'tableId' => array(
  442. 'location' => 'path',
  443. 'type' => 'string',
  444. 'required' => true,
  445. ),
  446. ),
  447. ),'get' => array(
  448. 'path' => 'projects/{projectId}/datasets/{datasetId}/tables/{tableId}',
  449. 'httpMethod' => 'GET',
  450. 'parameters' => array(
  451. 'projectId' => array(
  452. 'location' => 'path',
  453. 'type' => 'string',
  454. 'required' => true,
  455. ),
  456. 'datasetId' => array(
  457. 'location' => 'path',
  458. 'type' => 'string',
  459. 'required' => true,
  460. ),
  461. 'tableId' => array(
  462. 'location' => 'path',
  463. 'type' => 'string',
  464. 'required' => true,
  465. ),
  466. 'selectedFields' => array(
  467. 'location' => 'query',
  468. 'type' => 'string',
  469. ),
  470. ),
  471. ),'insert' => array(
  472. 'path' => 'projects/{projectId}/datasets/{datasetId}/tables',
  473. 'httpMethod' => 'POST',
  474. 'parameters' => array(
  475. 'projectId' => array(
  476. 'location' => 'path',
  477. 'type' => 'string',
  478. 'required' => true,
  479. ),
  480. 'datasetId' => array(
  481. 'location' => 'path',
  482. 'type' => 'string',
  483. 'required' => true,
  484. ),
  485. ),
  486. ),'list' => array(
  487. 'path' => 'projects/{projectId}/datasets/{datasetId}/tables',
  488. 'httpMethod' => 'GET',
  489. 'parameters' => array(
  490. 'projectId' => array(
  491. 'location' => 'path',
  492. 'type' => 'string',
  493. 'required' => true,
  494. ),
  495. 'datasetId' => array(
  496. 'location' => 'path',
  497. 'type' => 'string',
  498. 'required' => true,
  499. ),
  500. 'maxResults' => array(
  501. 'location' => 'query',
  502. 'type' => 'integer',
  503. ),
  504. 'pageToken' => array(
  505. 'location' => 'query',
  506. 'type' => 'string',
  507. ),
  508. ),
  509. ),'patch' => array(
  510. 'path' => 'projects/{projectId}/datasets/{datasetId}/tables/{tableId}',
  511. 'httpMethod' => 'PATCH',
  512. 'parameters' => array(
  513. 'projectId' => array(
  514. 'location' => 'path',
  515. 'type' => 'string',
  516. 'required' => true,
  517. ),
  518. 'datasetId' => array(
  519. 'location' => 'path',
  520. 'type' => 'string',
  521. 'required' => true,
  522. ),
  523. 'tableId' => array(
  524. 'location' => 'path',
  525. 'type' => 'string',
  526. 'required' => true,
  527. ),
  528. ),
  529. ),'update' => array(
  530. 'path' => 'projects/{projectId}/datasets/{datasetId}/tables/{tableId}',
  531. 'httpMethod' => 'PUT',
  532. 'parameters' => array(
  533. 'projectId' => array(
  534. 'location' => 'path',
  535. 'type' => 'string',
  536. 'required' => true,
  537. ),
  538. 'datasetId' => array(
  539. 'location' => 'path',
  540. 'type' => 'string',
  541. 'required' => true,
  542. ),
  543. 'tableId' => array(
  544. 'location' => 'path',
  545. 'type' => 'string',
  546. 'required' => true,
  547. ),
  548. ),
  549. ),
  550. )
  551. )
  552. );
  553. }
  554. }