PubsubLite.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  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;
  18. use Google\Client;
  19. /**
  20. * Service definition for PubsubLite (v1).
  21. *
  22. * <p>
  23. </p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://cloud.google.com/pubsub/lite/docs" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class PubsubLite extends \Google\Service
  33. {
  34. /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
  35. const CLOUD_PLATFORM =
  36. "https://www.googleapis.com/auth/cloud-platform";
  37. public $admin_projects_locations_operations;
  38. public $admin_projects_locations_reservations;
  39. public $admin_projects_locations_reservations_topics;
  40. public $admin_projects_locations_subscriptions;
  41. public $admin_projects_locations_topics;
  42. public $admin_projects_locations_topics_subscriptions;
  43. public $cursor_projects_locations_subscriptions;
  44. public $cursor_projects_locations_subscriptions_cursors;
  45. public $topicStats_projects_locations_topics;
  46. /**
  47. * Constructs the internal representation of the PubsubLite service.
  48. *
  49. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  50. * config array to pass to a new Client instance.
  51. * @param string $rootUrl The root URL used for requests to the service.
  52. */
  53. public function __construct($clientOrConfig = [], $rootUrl = null)
  54. {
  55. parent::__construct($clientOrConfig);
  56. $this->rootUrl = $rootUrl ?: 'https://pubsublite.googleapis.com/';
  57. $this->servicePath = '';
  58. $this->batchPath = 'batch';
  59. $this->version = 'v1';
  60. $this->serviceName = 'pubsublite';
  61. $this->admin_projects_locations_operations = new PubsubLite\Resource\AdminProjectsLocationsOperations(
  62. $this,
  63. $this->serviceName,
  64. 'operations',
  65. [
  66. 'methods' => [
  67. 'cancel' => [
  68. 'path' => 'v1/admin/{+name}:cancel',
  69. 'httpMethod' => 'POST',
  70. 'parameters' => [
  71. 'name' => [
  72. 'location' => 'path',
  73. 'type' => 'string',
  74. 'required' => true,
  75. ],
  76. ],
  77. ],'delete' => [
  78. 'path' => 'v1/admin/{+name}',
  79. 'httpMethod' => 'DELETE',
  80. 'parameters' => [
  81. 'name' => [
  82. 'location' => 'path',
  83. 'type' => 'string',
  84. 'required' => true,
  85. ],
  86. ],
  87. ],'get' => [
  88. 'path' => 'v1/admin/{+name}',
  89. 'httpMethod' => 'GET',
  90. 'parameters' => [
  91. 'name' => [
  92. 'location' => 'path',
  93. 'type' => 'string',
  94. 'required' => true,
  95. ],
  96. ],
  97. ],'list' => [
  98. 'path' => 'v1/admin/{+name}/operations',
  99. 'httpMethod' => 'GET',
  100. 'parameters' => [
  101. 'name' => [
  102. 'location' => 'path',
  103. 'type' => 'string',
  104. 'required' => true,
  105. ],
  106. 'filter' => [
  107. 'location' => 'query',
  108. 'type' => 'string',
  109. ],
  110. 'pageSize' => [
  111. 'location' => 'query',
  112. 'type' => 'integer',
  113. ],
  114. 'pageToken' => [
  115. 'location' => 'query',
  116. 'type' => 'string',
  117. ],
  118. ],
  119. ],
  120. ]
  121. ]
  122. );
  123. $this->admin_projects_locations_reservations = new PubsubLite\Resource\AdminProjectsLocationsReservations(
  124. $this,
  125. $this->serviceName,
  126. 'reservations',
  127. [
  128. 'methods' => [
  129. 'create' => [
  130. 'path' => 'v1/admin/{+parent}/reservations',
  131. 'httpMethod' => 'POST',
  132. 'parameters' => [
  133. 'parent' => [
  134. 'location' => 'path',
  135. 'type' => 'string',
  136. 'required' => true,
  137. ],
  138. 'reservationId' => [
  139. 'location' => 'query',
  140. 'type' => 'string',
  141. ],
  142. ],
  143. ],'delete' => [
  144. 'path' => 'v1/admin/{+name}',
  145. 'httpMethod' => 'DELETE',
  146. 'parameters' => [
  147. 'name' => [
  148. 'location' => 'path',
  149. 'type' => 'string',
  150. 'required' => true,
  151. ],
  152. ],
  153. ],'get' => [
  154. 'path' => 'v1/admin/{+name}',
  155. 'httpMethod' => 'GET',
  156. 'parameters' => [
  157. 'name' => [
  158. 'location' => 'path',
  159. 'type' => 'string',
  160. 'required' => true,
  161. ],
  162. ],
  163. ],'list' => [
  164. 'path' => 'v1/admin/{+parent}/reservations',
  165. 'httpMethod' => 'GET',
  166. 'parameters' => [
  167. 'parent' => [
  168. 'location' => 'path',
  169. 'type' => 'string',
  170. 'required' => true,
  171. ],
  172. 'pageSize' => [
  173. 'location' => 'query',
  174. 'type' => 'integer',
  175. ],
  176. 'pageToken' => [
  177. 'location' => 'query',
  178. 'type' => 'string',
  179. ],
  180. ],
  181. ],'patch' => [
  182. 'path' => 'v1/admin/{+name}',
  183. 'httpMethod' => 'PATCH',
  184. 'parameters' => [
  185. 'name' => [
  186. 'location' => 'path',
  187. 'type' => 'string',
  188. 'required' => true,
  189. ],
  190. 'updateMask' => [
  191. 'location' => 'query',
  192. 'type' => 'string',
  193. ],
  194. ],
  195. ],
  196. ]
  197. ]
  198. );
  199. $this->admin_projects_locations_reservations_topics = new PubsubLite\Resource\AdminProjectsLocationsReservationsTopics(
  200. $this,
  201. $this->serviceName,
  202. 'topics',
  203. [
  204. 'methods' => [
  205. 'list' => [
  206. 'path' => 'v1/admin/{+name}/topics',
  207. 'httpMethod' => 'GET',
  208. 'parameters' => [
  209. 'name' => [
  210. 'location' => 'path',
  211. 'type' => 'string',
  212. 'required' => true,
  213. ],
  214. 'pageSize' => [
  215. 'location' => 'query',
  216. 'type' => 'integer',
  217. ],
  218. 'pageToken' => [
  219. 'location' => 'query',
  220. 'type' => 'string',
  221. ],
  222. ],
  223. ],
  224. ]
  225. ]
  226. );
  227. $this->admin_projects_locations_subscriptions = new PubsubLite\Resource\AdminProjectsLocationsSubscriptions(
  228. $this,
  229. $this->serviceName,
  230. 'subscriptions',
  231. [
  232. 'methods' => [
  233. 'create' => [
  234. 'path' => 'v1/admin/{+parent}/subscriptions',
  235. 'httpMethod' => 'POST',
  236. 'parameters' => [
  237. 'parent' => [
  238. 'location' => 'path',
  239. 'type' => 'string',
  240. 'required' => true,
  241. ],
  242. 'skipBacklog' => [
  243. 'location' => 'query',
  244. 'type' => 'boolean',
  245. ],
  246. 'subscriptionId' => [
  247. 'location' => 'query',
  248. 'type' => 'string',
  249. ],
  250. ],
  251. ],'delete' => [
  252. 'path' => 'v1/admin/{+name}',
  253. 'httpMethod' => 'DELETE',
  254. 'parameters' => [
  255. 'name' => [
  256. 'location' => 'path',
  257. 'type' => 'string',
  258. 'required' => true,
  259. ],
  260. ],
  261. ],'get' => [
  262. 'path' => 'v1/admin/{+name}',
  263. 'httpMethod' => 'GET',
  264. 'parameters' => [
  265. 'name' => [
  266. 'location' => 'path',
  267. 'type' => 'string',
  268. 'required' => true,
  269. ],
  270. ],
  271. ],'list' => [
  272. 'path' => 'v1/admin/{+parent}/subscriptions',
  273. 'httpMethod' => 'GET',
  274. 'parameters' => [
  275. 'parent' => [
  276. 'location' => 'path',
  277. 'type' => 'string',
  278. 'required' => true,
  279. ],
  280. 'pageSize' => [
  281. 'location' => 'query',
  282. 'type' => 'integer',
  283. ],
  284. 'pageToken' => [
  285. 'location' => 'query',
  286. 'type' => 'string',
  287. ],
  288. ],
  289. ],'patch' => [
  290. 'path' => 'v1/admin/{+name}',
  291. 'httpMethod' => 'PATCH',
  292. 'parameters' => [
  293. 'name' => [
  294. 'location' => 'path',
  295. 'type' => 'string',
  296. 'required' => true,
  297. ],
  298. 'updateMask' => [
  299. 'location' => 'query',
  300. 'type' => 'string',
  301. ],
  302. ],
  303. ],'seek' => [
  304. 'path' => 'v1/admin/{+name}:seek',
  305. 'httpMethod' => 'POST',
  306. 'parameters' => [
  307. 'name' => [
  308. 'location' => 'path',
  309. 'type' => 'string',
  310. 'required' => true,
  311. ],
  312. ],
  313. ],
  314. ]
  315. ]
  316. );
  317. $this->admin_projects_locations_topics = new PubsubLite\Resource\AdminProjectsLocationsTopics(
  318. $this,
  319. $this->serviceName,
  320. 'topics',
  321. [
  322. 'methods' => [
  323. 'create' => [
  324. 'path' => 'v1/admin/{+parent}/topics',
  325. 'httpMethod' => 'POST',
  326. 'parameters' => [
  327. 'parent' => [
  328. 'location' => 'path',
  329. 'type' => 'string',
  330. 'required' => true,
  331. ],
  332. 'topicId' => [
  333. 'location' => 'query',
  334. 'type' => 'string',
  335. ],
  336. ],
  337. ],'delete' => [
  338. 'path' => 'v1/admin/{+name}',
  339. 'httpMethod' => 'DELETE',
  340. 'parameters' => [
  341. 'name' => [
  342. 'location' => 'path',
  343. 'type' => 'string',
  344. 'required' => true,
  345. ],
  346. ],
  347. ],'get' => [
  348. 'path' => 'v1/admin/{+name}',
  349. 'httpMethod' => 'GET',
  350. 'parameters' => [
  351. 'name' => [
  352. 'location' => 'path',
  353. 'type' => 'string',
  354. 'required' => true,
  355. ],
  356. ],
  357. ],'getPartitions' => [
  358. 'path' => 'v1/admin/{+name}/partitions',
  359. 'httpMethod' => 'GET',
  360. 'parameters' => [
  361. 'name' => [
  362. 'location' => 'path',
  363. 'type' => 'string',
  364. 'required' => true,
  365. ],
  366. ],
  367. ],'list' => [
  368. 'path' => 'v1/admin/{+parent}/topics',
  369. 'httpMethod' => 'GET',
  370. 'parameters' => [
  371. 'parent' => [
  372. 'location' => 'path',
  373. 'type' => 'string',
  374. 'required' => true,
  375. ],
  376. 'pageSize' => [
  377. 'location' => 'query',
  378. 'type' => 'integer',
  379. ],
  380. 'pageToken' => [
  381. 'location' => 'query',
  382. 'type' => 'string',
  383. ],
  384. ],
  385. ],'patch' => [
  386. 'path' => 'v1/admin/{+name}',
  387. 'httpMethod' => 'PATCH',
  388. 'parameters' => [
  389. 'name' => [
  390. 'location' => 'path',
  391. 'type' => 'string',
  392. 'required' => true,
  393. ],
  394. 'updateMask' => [
  395. 'location' => 'query',
  396. 'type' => 'string',
  397. ],
  398. ],
  399. ],
  400. ]
  401. ]
  402. );
  403. $this->admin_projects_locations_topics_subscriptions = new PubsubLite\Resource\AdminProjectsLocationsTopicsSubscriptions(
  404. $this,
  405. $this->serviceName,
  406. 'subscriptions',
  407. [
  408. 'methods' => [
  409. 'list' => [
  410. 'path' => 'v1/admin/{+name}/subscriptions',
  411. 'httpMethod' => 'GET',
  412. 'parameters' => [
  413. 'name' => [
  414. 'location' => 'path',
  415. 'type' => 'string',
  416. 'required' => true,
  417. ],
  418. 'pageSize' => [
  419. 'location' => 'query',
  420. 'type' => 'integer',
  421. ],
  422. 'pageToken' => [
  423. 'location' => 'query',
  424. 'type' => 'string',
  425. ],
  426. ],
  427. ],
  428. ]
  429. ]
  430. );
  431. $this->cursor_projects_locations_subscriptions = new PubsubLite\Resource\CursorProjectsLocationsSubscriptions(
  432. $this,
  433. $this->serviceName,
  434. 'subscriptions',
  435. [
  436. 'methods' => [
  437. 'commitCursor' => [
  438. 'path' => 'v1/cursor/{+subscription}:commitCursor',
  439. 'httpMethod' => 'POST',
  440. 'parameters' => [
  441. 'subscription' => [
  442. 'location' => 'path',
  443. 'type' => 'string',
  444. 'required' => true,
  445. ],
  446. ],
  447. ],
  448. ]
  449. ]
  450. );
  451. $this->cursor_projects_locations_subscriptions_cursors = new PubsubLite\Resource\CursorProjectsLocationsSubscriptionsCursors(
  452. $this,
  453. $this->serviceName,
  454. 'cursors',
  455. [
  456. 'methods' => [
  457. 'list' => [
  458. 'path' => 'v1/cursor/{+parent}/cursors',
  459. 'httpMethod' => 'GET',
  460. 'parameters' => [
  461. 'parent' => [
  462. 'location' => 'path',
  463. 'type' => 'string',
  464. 'required' => true,
  465. ],
  466. 'pageSize' => [
  467. 'location' => 'query',
  468. 'type' => 'integer',
  469. ],
  470. 'pageToken' => [
  471. 'location' => 'query',
  472. 'type' => 'string',
  473. ],
  474. ],
  475. ],
  476. ]
  477. ]
  478. );
  479. $this->topicStats_projects_locations_topics = new PubsubLite\Resource\TopicStatsProjectsLocationsTopics(
  480. $this,
  481. $this->serviceName,
  482. 'topics',
  483. [
  484. 'methods' => [
  485. 'computeHeadCursor' => [
  486. 'path' => 'v1/topicStats/{+topic}:computeHeadCursor',
  487. 'httpMethod' => 'POST',
  488. 'parameters' => [
  489. 'topic' => [
  490. 'location' => 'path',
  491. 'type' => 'string',
  492. 'required' => true,
  493. ],
  494. ],
  495. ],'computeMessageStats' => [
  496. 'path' => 'v1/topicStats/{+topic}:computeMessageStats',
  497. 'httpMethod' => 'POST',
  498. 'parameters' => [
  499. 'topic' => [
  500. 'location' => 'path',
  501. 'type' => 'string',
  502. 'required' => true,
  503. ],
  504. ],
  505. ],'computeTimeCursor' => [
  506. 'path' => 'v1/topicStats/{+topic}:computeTimeCursor',
  507. 'httpMethod' => 'POST',
  508. 'parameters' => [
  509. 'topic' => [
  510. 'location' => 'path',
  511. 'type' => 'string',
  512. 'required' => true,
  513. ],
  514. ],
  515. ],
  516. ]
  517. ]
  518. );
  519. }
  520. }
  521. // Adding a class alias for backwards compatibility with the previous class name.
  522. class_alias(PubsubLite::class, 'Google_Service_PubsubLite');