PageRenderTime 51ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/plus_comments/google_api/contrib/apiBuzzService.php

https://github.com/marmat/PlusComments
PHP | 3530 lines | 2876 code | 83 blank | 571 comment | 70 complexity | ea278eb115b03ff9d55f23e605c1dd13 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /*
  3. * Copyright (c) 2010 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. require_once 'service/apiModel.php';
  18. require_once 'service/apiService.php';
  19. require_once 'service/apiServiceRequest.php';
  20. /**
  21. * The "activities" collection of methods.
  22. * Typical usage is:
  23. * <code>
  24. * $buzzService = new apiBuzzService(...);
  25. * $activities = $buzzService->activities;
  26. * </code>
  27. */
  28. class ActivitiesServiceResource extends apiServiceResource {
  29. /**
  30. * Get a count of link shares (activities.count)
  31. *
  32. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  33. *
  34. * @opt_param string url URLs for which to get share counts.
  35. * @opt_param string hl Language code to limit language results.
  36. * @return CountFeed
  37. */
  38. public function count($optParams = array()) {
  39. $params = array();
  40. $params = array_merge($params, $optParams);
  41. $data = $this->__call('count', array($params));
  42. if ($this->useObjects()) {
  43. return new CountFeed($data);
  44. } else {
  45. return $data;
  46. }
  47. }
  48. /**
  49. * Create a new activity (activities.insert)
  50. *
  51. * @param string $userId ID of the user being referenced.
  52. * @param $postBody the {@link Activity}
  53. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  54. *
  55. * @opt_param bool preview If true, only preview the action.
  56. * @opt_param string hl Language code to limit language results.
  57. * @return Activity
  58. */
  59. public function insert($userId, Activity $postBody, $optParams = array()) {
  60. $params = array('userId' => $userId, 'postBody' => $postBody);
  61. $params = array_merge($params, $optParams);
  62. $data = $this->__call('insert', array($params));
  63. if ($this->useObjects()) {
  64. return new Activity($data);
  65. } else {
  66. return $data;
  67. }
  68. }
  69. /**
  70. * Search for activities (activities.search)
  71. *
  72. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  73. *
  74. * @opt_param string max-results Maximum number of results to include.
  75. * @opt_param string c A continuation token that allows pagination.
  76. * @opt_param string pid ID of a place to use in a geographic location query.
  77. * @opt_param string lon Longitude to use in a geographic location query.
  78. * @opt_param string q Full-text search query string.
  79. * @opt_param bool truncateAtom Truncate the value of the atom:content element.
  80. * @opt_param string radius Radius to use in a geographic location query.
  81. * @opt_param string bbox Bounding box to use in a geographic location query.
  82. * @opt_param string hl Language code to limit language results.
  83. * @opt_param string lat Latitude to use in a geographic location query.
  84. * @return ActivityFeed
  85. */
  86. public function search($optParams = array()) {
  87. $params = array();
  88. $params = array_merge($params, $optParams);
  89. $data = $this->__call('search', array($params));
  90. if ($this->useObjects()) {
  91. return new ActivityFeed($data);
  92. } else {
  93. return $data;
  94. }
  95. }
  96. /**
  97. * Get an activity (activities.get)
  98. *
  99. * @param string $userId ID of the user whose post to get.
  100. * @param string $postId ID of the post to get.
  101. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  102. *
  103. * @opt_param bool truncateAtom Truncate the value of the atom:content element.
  104. * @opt_param string max-comments Maximum number of comments to include.
  105. * @opt_param string hl Language code to limit language results.
  106. * @opt_param string max-liked Maximum number of likes to include.
  107. * @return Activity
  108. */
  109. public function get($userId, $postId, $optParams = array()) {
  110. $params = array('userId' => $userId, 'postId' => $postId);
  111. $params = array_merge($params, $optParams);
  112. $data = $this->__call('get', array($params));
  113. if ($this->useObjects()) {
  114. return new Activity($data);
  115. } else {
  116. return $data;
  117. }
  118. }
  119. /**
  120. * Get real-time activity tracking information (activities.track)
  121. *
  122. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  123. *
  124. * @opt_param string max-results Maximum number of results to include.
  125. * @opt_param string c A continuation token that allows pagination.
  126. * @opt_param string pid ID of a place to use in a geographic location query.
  127. * @opt_param string lon Longitude to use in a geographic location query.
  128. * @opt_param string q Full-text search query string.
  129. * @opt_param string radius Radius to use in a geographic location query.
  130. * @opt_param string bbox Bounding box to use in a geographic location query.
  131. * @opt_param string hl Language code to limit language results.
  132. * @opt_param string lat Latitude to use in a geographic location query.
  133. * @return ActivityFeed
  134. */
  135. public function track($optParams = array()) {
  136. $params = array();
  137. $params = array_merge($params, $optParams);
  138. $data = $this->__call('track', array($params));
  139. if ($this->useObjects()) {
  140. return new ActivityFeed($data);
  141. } else {
  142. return $data;
  143. }
  144. }
  145. /**
  146. * List activities (activities.list)
  147. *
  148. * @param string $userId ID of the user being referenced.
  149. * @param string $scope The collection of activities to list.
  150. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  151. *
  152. * @opt_param string max-results Maximum number of results to include.
  153. * @opt_param string c A continuation token that allows pagination.
  154. * @opt_param bool truncateAtom Truncate the value of the atom:content element.
  155. * @opt_param string max-comments Maximum number of comments to include.
  156. * @opt_param string hl Language code to limit language results.
  157. * @opt_param string max-liked Maximum number of likes to include.
  158. * @return ActivityFeed
  159. */
  160. public function listActivities($userId, $scope, $optParams = array()) {
  161. $params = array('userId' => $userId, 'scope' => $scope);
  162. $params = array_merge($params, $optParams);
  163. $data = $this->__call('list', array($params));
  164. if ($this->useObjects()) {
  165. return new ActivityFeed($data);
  166. } else {
  167. return $data;
  168. }
  169. }
  170. /**
  171. * Update an activity (activities.update)
  172. *
  173. * @param string $userId ID of the user whose post to update.
  174. * @param string $scope The collection to which the activity belongs.
  175. * @param string $postId ID of the activity to update.
  176. * @param $postBody the {@link Activity}
  177. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  178. *
  179. * @opt_param string abuseType
  180. * @opt_param string hl Language code to limit language results.
  181. * @return Activity
  182. */
  183. public function update($userId, $scope, $postId, Activity $postBody, $optParams = array()) {
  184. $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId, 'postBody' => $postBody);
  185. $params = array_merge($params, $optParams);
  186. $data = $this->__call('update', array($params));
  187. if ($this->useObjects()) {
  188. return new Activity($data);
  189. } else {
  190. return $data;
  191. }
  192. }
  193. /**
  194. * Update an activity. This method supports patch semantics. (activities.patch)
  195. *
  196. * @param string $userId ID of the user whose post to update.
  197. * @param string $scope The collection to which the activity belongs.
  198. * @param string $postId ID of the activity to update.
  199. * @param $postBody the {@link Activity}
  200. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  201. *
  202. * @opt_param string abuseType
  203. * @opt_param string hl Language code to limit language results.
  204. * @return Activity
  205. */
  206. public function patch($userId, $scope, $postId, Activity $postBody, $optParams = array()) {
  207. $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId, 'postBody' => $postBody);
  208. $params = array_merge($params, $optParams);
  209. $data = $this->__call('patch', array($params));
  210. if ($this->useObjects()) {
  211. return new Activity($data);
  212. } else {
  213. return $data;
  214. }
  215. }
  216. /**
  217. * Search for people by topic (activities.extractPeopleFromSearch)
  218. *
  219. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  220. *
  221. * @opt_param string max-results Maximum number of results to include.
  222. * @opt_param string c A continuation token that allows pagination.
  223. * @opt_param string pid ID of a place to use in a geographic location query.
  224. * @opt_param string lon Longitude to use in a geographic location query.
  225. * @opt_param string q Full-text search query string.
  226. * @opt_param string radius Radius to use in a geographic location query.
  227. * @opt_param string bbox Bounding box to use in a geographic location query.
  228. * @opt_param string hl Language code to limit language results.
  229. * @opt_param string lat Latitude to use in a geographic location query.
  230. * @return PeopleFeed
  231. */
  232. public function extractPeopleFromSearch($optParams = array()) {
  233. $params = array();
  234. $params = array_merge($params, $optParams);
  235. $data = $this->__call('extractPeopleFromSearch', array($params));
  236. if ($this->useObjects()) {
  237. return new PeopleFeed($data);
  238. } else {
  239. return $data;
  240. }
  241. }
  242. /**
  243. * Delete an activity (activities.delete)
  244. *
  245. * @param string $userId ID of the user whose post to delete.
  246. * @param string $scope The collection to which the activity belongs.
  247. * @param string $postId ID of the activity to delete.
  248. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  249. *
  250. * @opt_param string hl Language code to limit language results.
  251. */
  252. public function delete($userId, $scope, $postId, $optParams = array()) {
  253. $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId);
  254. $params = array_merge($params, $optParams);
  255. $data = $this->__call('delete', array($params));
  256. return $data;
  257. }
  258. }
  259. /**
  260. * The "people" collection of methods.
  261. * Typical usage is:
  262. * <code>
  263. * $buzzService = new apiBuzzService(...);
  264. * $people = $buzzService->people;
  265. * </code>
  266. */
  267. class PeopleServiceResource extends apiServiceResource {
  268. /**
  269. * Get people who liked an activity (people.liked)
  270. *
  271. * @param string $userId ID of the user being referenced.
  272. * @param string $scope
  273. * @param string $postId ID of the activity that was liked.
  274. * @param string $groupId
  275. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  276. *
  277. * @opt_param string max-results Maximum number of results to include.
  278. * @opt_param string c A continuation token that allows pagination.
  279. * @opt_param string hl Language code to limit language results.
  280. * @return PeopleFeed
  281. */
  282. public function liked($userId, $scope, $postId, $groupId, $optParams = array()) {
  283. $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId, 'groupId' => $groupId);
  284. $params = array_merge($params, $optParams);
  285. $data = $this->__call('liked', array($params));
  286. if ($this->useObjects()) {
  287. return new PeopleFeed($data);
  288. } else {
  289. return $data;
  290. }
  291. }
  292. /**
  293. * Get a user profile (people.get)
  294. *
  295. * @param string $userId ID of the user being referenced.
  296. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  297. *
  298. * @opt_param string hl Language code to limit language results.
  299. * @return Person
  300. */
  301. public function get($userId, $optParams = array()) {
  302. $params = array('userId' => $userId);
  303. $params = array_merge($params, $optParams);
  304. $data = $this->__call('get', array($params));
  305. if ($this->useObjects()) {
  306. return new Person($data);
  307. } else {
  308. return $data;
  309. }
  310. }
  311. /**
  312. * Add a person to a group (people.update)
  313. *
  314. * @param string $userId ID of the owner of the group.
  315. * @param string $groupId ID of the group to which to add the person.
  316. * @param string $personId ID of the person to add to the group.
  317. * @param $postBody the {@link Person}
  318. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  319. *
  320. * @opt_param string hl Language code to limit language results.
  321. * @return Person
  322. */
  323. public function update($userId, $groupId, $personId, Person $postBody, $optParams = array()) {
  324. $params = array('userId' => $userId, 'groupId' => $groupId, 'personId' => $personId, 'postBody' => $postBody);
  325. $params = array_merge($params, $optParams);
  326. $data = $this->__call('update', array($params));
  327. if ($this->useObjects()) {
  328. return new Person($data);
  329. } else {
  330. return $data;
  331. }
  332. }
  333. /**
  334. * Get people in a group (people.list)
  335. *
  336. * @param string $userId ID of the user being referenced.
  337. * @param string $groupId ID of the group for which to list users.
  338. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  339. *
  340. * @opt_param string max-results Maximum number of results to include.
  341. * @opt_param string c A continuation token that allows pagination.
  342. * @opt_param string hl Language code to limit language results.
  343. * @return PeopleFeed
  344. */
  345. public function listPeople($userId, $groupId, $optParams = array()) {
  346. $params = array('userId' => $userId, 'groupId' => $groupId);
  347. $params = array_merge($params, $optParams);
  348. $data = $this->__call('list', array($params));
  349. if ($this->useObjects()) {
  350. return new PeopleFeed($data);
  351. } else {
  352. return $data;
  353. }
  354. }
  355. /**
  356. * Search for people (people.search)
  357. *
  358. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  359. *
  360. * @opt_param string max-results Maximum number of results to include.
  361. * @opt_param string q Full-text search query string.
  362. * @opt_param string c A continuation token that allows pagination.
  363. * @opt_param string hl Language code to limit language results.
  364. * @return PeopleFeed
  365. */
  366. public function search($optParams = array()) {
  367. $params = array();
  368. $params = array_merge($params, $optParams);
  369. $data = $this->__call('search', array($params));
  370. if ($this->useObjects()) {
  371. return new PeopleFeed($data);
  372. } else {
  373. return $data;
  374. }
  375. }
  376. /**
  377. * Add a person to a group. This method supports patch semantics. (people.patch)
  378. *
  379. * @param string $userId ID of the owner of the group.
  380. * @param string $groupId ID of the group to which to add the person.
  381. * @param string $personId ID of the person to add to the group.
  382. * @param $postBody the {@link Person}
  383. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  384. *
  385. * @opt_param string hl Language code to limit language results.
  386. * @return Person
  387. */
  388. public function patch($userId, $groupId, $personId, Person $postBody, $optParams = array()) {
  389. $params = array('userId' => $userId, 'groupId' => $groupId, 'personId' => $personId, 'postBody' => $postBody);
  390. $params = array_merge($params, $optParams);
  391. $data = $this->__call('patch', array($params));
  392. if ($this->useObjects()) {
  393. return new Person($data);
  394. } else {
  395. return $data;
  396. }
  397. }
  398. /**
  399. * Get people who reshared an activity (people.reshared)
  400. *
  401. * @param string $userId ID of the user being referenced.
  402. * @param string $scope
  403. * @param string $postId ID of the activity that was reshared.
  404. * @param string $groupId
  405. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  406. *
  407. * @opt_param string max-results Maximum number of results to include.
  408. * @opt_param string c A continuation token that allows pagination.
  409. * @opt_param string hl Language code to limit language results.
  410. * @return PeopleFeed
  411. */
  412. public function reshared($userId, $scope, $postId, $groupId, $optParams = array()) {
  413. $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId, 'groupId' => $groupId);
  414. $params = array_merge($params, $optParams);
  415. $data = $this->__call('reshared', array($params));
  416. if ($this->useObjects()) {
  417. return new PeopleFeed($data);
  418. } else {
  419. return $data;
  420. }
  421. }
  422. /**
  423. * Remove a person from a group (people.delete)
  424. *
  425. * @param string $userId ID of the owner of the group.
  426. * @param string $groupId ID of the group from which to remove the person.
  427. * @param string $personId ID of the person to remove from the group.
  428. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  429. *
  430. * @opt_param string hl Language code to limit language results.
  431. */
  432. public function delete($userId, $groupId, $personId, $optParams = array()) {
  433. $params = array('userId' => $userId, 'groupId' => $groupId, 'personId' => $personId);
  434. $params = array_merge($params, $optParams);
  435. $data = $this->__call('delete', array($params));
  436. return $data;
  437. }
  438. }
  439. /**
  440. * The "photoAlbums" collection of methods.
  441. * Typical usage is:
  442. * <code>
  443. * $buzzService = new apiBuzzService(...);
  444. * $photoAlbums = $buzzService->photoAlbums;
  445. * </code>
  446. */
  447. class PhotoAlbumsServiceResource extends apiServiceResource {
  448. /**
  449. * Create a photo album (photoAlbums.insert)
  450. *
  451. * @param string $userId ID of the user being referenced.
  452. * @param $postBody the {@link Album}
  453. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  454. *
  455. * @opt_param string hl Language code to limit language results.
  456. * @return Album
  457. */
  458. public function insert($userId, Album $postBody, $optParams = array()) {
  459. $params = array('userId' => $userId, 'postBody' => $postBody);
  460. $params = array_merge($params, $optParams);
  461. $data = $this->__call('insert', array($params));
  462. if ($this->useObjects()) {
  463. return new Album($data);
  464. } else {
  465. return $data;
  466. }
  467. }
  468. /**
  469. * Get a photo album (photoAlbums.get)
  470. *
  471. * @param string $userId ID of the user being referenced.
  472. * @param string $albumId ID of the album to get.
  473. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  474. *
  475. * @opt_param string hl Language code to limit language results.
  476. * @return Album
  477. */
  478. public function get($userId, $albumId, $optParams = array()) {
  479. $params = array('userId' => $userId, 'albumId' => $albumId);
  480. $params = array_merge($params, $optParams);
  481. $data = $this->__call('get', array($params));
  482. if ($this->useObjects()) {
  483. return new Album($data);
  484. } else {
  485. return $data;
  486. }
  487. }
  488. /**
  489. * List a user's photo albums (photoAlbums.list)
  490. *
  491. * @param string $userId ID of the user being referenced.
  492. * @param string $scope The collection of albums to list.
  493. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  494. *
  495. * @opt_param string max-results Maximum number of results to include.
  496. * @opt_param string c A continuation token that allows pagination.
  497. * @opt_param string hl Language code to limit language results.
  498. * @return AlbumsFeed
  499. */
  500. public function listPhotoAlbums($userId, $scope, $optParams = array()) {
  501. $params = array('userId' => $userId, 'scope' => $scope);
  502. $params = array_merge($params, $optParams);
  503. $data = $this->__call('list', array($params));
  504. if ($this->useObjects()) {
  505. return new AlbumsFeed($data);
  506. } else {
  507. return $data;
  508. }
  509. }
  510. /**
  511. * Delete a photo album (photoAlbums.delete)
  512. *
  513. * @param string $userId ID of the user being referenced.
  514. * @param string $albumId ID of the album to delete.
  515. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  516. *
  517. * @opt_param string hl Language code to limit language results.
  518. */
  519. public function delete($userId, $albumId, $optParams = array()) {
  520. $params = array('userId' => $userId, 'albumId' => $albumId);
  521. $params = array_merge($params, $optParams);
  522. $data = $this->__call('delete', array($params));
  523. return $data;
  524. }
  525. }
  526. /**
  527. * The "comments" collection of methods.
  528. * Typical usage is:
  529. * <code>
  530. * $buzzService = new apiBuzzService(...);
  531. * $comments = $buzzService->comments;
  532. * </code>
  533. */
  534. class CommentsServiceResource extends apiServiceResource {
  535. /**
  536. * Create a comment (comments.insert)
  537. *
  538. * @param string $userId ID of the user on whose behalf to comment.
  539. * @param string $postId ID of the activity on which to comment.
  540. * @param $postBody the {@link Comment}
  541. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  542. *
  543. * @opt_param string hl Language code to limit language results.
  544. * @return Comment
  545. */
  546. public function insert($userId, $postId, Comment $postBody, $optParams = array()) {
  547. $params = array('userId' => $userId, 'postId' => $postId, 'postBody' => $postBody);
  548. $params = array_merge($params, $optParams);
  549. $data = $this->__call('insert', array($params));
  550. if ($this->useObjects()) {
  551. return new Comment($data);
  552. } else {
  553. return $data;
  554. }
  555. }
  556. /**
  557. * Get a comment (comments.get)
  558. *
  559. * @param string $userId ID of the user being referenced.
  560. * @param string $postId ID of the activity for which to get comments.
  561. * @param string $commentId ID of the comment being referenced.
  562. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  563. *
  564. * @opt_param string hl Language code to limit language results.
  565. * @return Comment
  566. */
  567. public function get($userId, $postId, $commentId, $optParams = array()) {
  568. $params = array('userId' => $userId, 'postId' => $postId, 'commentId' => $commentId);
  569. $params = array_merge($params, $optParams);
  570. $data = $this->__call('get', array($params));
  571. if ($this->useObjects()) {
  572. return new Comment($data);
  573. } else {
  574. return $data;
  575. }
  576. }
  577. /**
  578. * List comments (comments.list)
  579. *
  580. * @param string $userId ID of the user for whose post to get comments.
  581. * @param string $scope The collection to which the activity belongs.
  582. * @param string $postId ID of the activity for which to get comments.
  583. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  584. *
  585. * @opt_param string max-results Maximum number of results to include.
  586. * @opt_param string c A continuation token that allows pagination.
  587. * @opt_param string hl Language code to limit language results.
  588. * @return CommentFeed
  589. */
  590. public function listComments($userId, $scope, $postId, $optParams = array()) {
  591. $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId);
  592. $params = array_merge($params, $optParams);
  593. $data = $this->__call('list', array($params));
  594. if ($this->useObjects()) {
  595. return new CommentFeed($data);
  596. } else {
  597. return $data;
  598. }
  599. }
  600. /**
  601. * Update a comment (comments.update)
  602. *
  603. * @param string $userId ID of the user being referenced.
  604. * @param string $scope The collection to which the activity belongs.
  605. * @param string $postId ID of the activity for which to update the comment.
  606. * @param string $commentId ID of the comment being referenced.
  607. * @param $postBody the {@link Comment}
  608. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  609. *
  610. * @opt_param string abuseType
  611. * @opt_param string hl Language code to limit language results.
  612. * @return Comment
  613. */
  614. public function update($userId, $scope, $postId, $commentId, Comment $postBody, $optParams = array()) {
  615. $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId, 'commentId' => $commentId, 'postBody' => $postBody);
  616. $params = array_merge($params, $optParams);
  617. $data = $this->__call('update', array($params));
  618. if ($this->useObjects()) {
  619. return new Comment($data);
  620. } else {
  621. return $data;
  622. }
  623. }
  624. /**
  625. * Update a comment. This method supports patch semantics. (comments.patch)
  626. *
  627. * @param string $userId ID of the user being referenced.
  628. * @param string $scope The collection to which the activity belongs.
  629. * @param string $postId ID of the activity for which to update the comment.
  630. * @param string $commentId ID of the comment being referenced.
  631. * @param $postBody the {@link Comment}
  632. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  633. *
  634. * @opt_param string abuseType
  635. * @opt_param string hl Language code to limit language results.
  636. * @return Comment
  637. */
  638. public function patch($userId, $scope, $postId, $commentId, Comment $postBody, $optParams = array()) {
  639. $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId, 'commentId' => $commentId, 'postBody' => $postBody);
  640. $params = array_merge($params, $optParams);
  641. $data = $this->__call('patch', array($params));
  642. if ($this->useObjects()) {
  643. return new Comment($data);
  644. } else {
  645. return $data;
  646. }
  647. }
  648. /**
  649. * Delete a comment (comments.delete)
  650. *
  651. * @param string $userId ID of the user being referenced.
  652. * @param string $postId ID of the activity for which to delete the comment.
  653. * @param string $commentId ID of the comment being referenced.
  654. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  655. *
  656. * @opt_param string hl Language code to limit language results.
  657. */
  658. public function delete($userId, $postId, $commentId, $optParams = array()) {
  659. $params = array('userId' => $userId, 'postId' => $postId, 'commentId' => $commentId);
  660. $params = array_merge($params, $optParams);
  661. $data = $this->__call('delete', array($params));
  662. return $data;
  663. }
  664. }
  665. /**
  666. * The "photos" collection of methods.
  667. * Typical usage is:
  668. * <code>
  669. * $buzzService = new apiBuzzService(...);
  670. * $photos = $buzzService->photos;
  671. * </code>
  672. */
  673. class PhotosServiceResource extends apiServiceResource {
  674. /**
  675. * Upload a photo to an album (photos.insert2)
  676. *
  677. * @param string $userId ID of the user being referenced.
  678. * @param string $albumId ID of the album to which to upload.
  679. * @param $postBody the {@link ChiliPhotosResourceJson}
  680. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  681. *
  682. * @opt_param string hl Language code to limit language results.
  683. * @return ChiliPhotosResourceJson
  684. */
  685. public function insert2($userId, $albumId, ChiliPhotosResourceJson $postBody, $optParams = array()) {
  686. $params = array('userId' => $userId, 'albumId' => $albumId, 'postBody' => $postBody);
  687. $params = array_merge($params, $optParams);
  688. $data = $this->__call('insert2', array($params));
  689. if ($this->useObjects()) {
  690. return new ChiliPhotosResourceJson($data);
  691. } else {
  692. return $data;
  693. }
  694. }
  695. /**
  696. * Upload a photo to an album (photos.insert)
  697. *
  698. * @param string $userId ID of the user being referenced.
  699. * @param string $albumId ID of the album to which to upload.
  700. * @param $postBody the {@link AlbumLite}
  701. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  702. *
  703. * @opt_param string hl Language code to limit language results.
  704. * @return AlbumLite
  705. */
  706. public function insert($userId, $albumId, AlbumLite $postBody, $optParams = array()) {
  707. $params = array('userId' => $userId, 'albumId' => $albumId, 'postBody' => $postBody);
  708. $params = array_merge($params, $optParams);
  709. $data = $this->__call('insert', array($params));
  710. if ($this->useObjects()) {
  711. return new AlbumLite($data);
  712. } else {
  713. return $data;
  714. }
  715. }
  716. /**
  717. * Get photo metadata (photos.get)
  718. *
  719. * @param string $userId ID of the user being referenced.
  720. * @param string $albumId ID of the album containing the photo.
  721. * @param string $photoId ID of the photo for which to get metadata.
  722. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  723. *
  724. * @opt_param string hl Language code to limit language results.
  725. * @return ChiliPhotosResourceJson
  726. */
  727. public function get($userId, $albumId, $photoId, $optParams = array()) {
  728. $params = array('userId' => $userId, 'albumId' => $albumId, 'photoId' => $photoId);
  729. $params = array_merge($params, $optParams);
  730. $data = $this->__call('get', array($params));
  731. if ($this->useObjects()) {
  732. return new ChiliPhotosResourceJson($data);
  733. } else {
  734. return $data;
  735. }
  736. }
  737. /**
  738. * Get a user's photos (photos.listByScope)
  739. *
  740. * @param string $userId ID of the user being referenced.
  741. * @param string $scope The collection of photos to list.
  742. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  743. *
  744. * @opt_param string max-results Maximum number of results to include.
  745. * @opt_param string c A continuation token that allows pagination.
  746. * @opt_param string hl Language code to limit language results.
  747. * @return PhotosFeed
  748. */
  749. public function listByScope($userId, $scope, $optParams = array()) {
  750. $params = array('userId' => $userId, 'scope' => $scope);
  751. $params = array_merge($params, $optParams);
  752. $data = $this->__call('listByScope', array($params));
  753. if ($this->useObjects()) {
  754. return new PhotosFeed($data);
  755. } else {
  756. return $data;
  757. }
  758. }
  759. /**
  760. * Delete a photo (photos.delete)
  761. *
  762. * @param string $userId ID of the user being referenced.
  763. * @param string $albumId ID of the album to which to photo belongs.
  764. * @param string $photoId ID of the photo to delete.
  765. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  766. *
  767. * @opt_param string hl Language code to limit language results.
  768. */
  769. public function delete($userId, $albumId, $photoId, $optParams = array()) {
  770. $params = array('userId' => $userId, 'albumId' => $albumId, 'photoId' => $photoId);
  771. $params = array_merge($params, $optParams);
  772. $data = $this->__call('delete', array($params));
  773. return $data;
  774. }
  775. /**
  776. * List photos in an album (photos.listByAlbum)
  777. *
  778. * @param string $userId ID of the user being referenced.
  779. * @param string $albumId ID of the album for which to list photos.
  780. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  781. *
  782. * @opt_param string max-results Maximum number of results to include.
  783. * @opt_param string c A continuation token that allows pagination.
  784. * @opt_param string hl Language code to limit language results.
  785. * @return PhotosFeed
  786. */
  787. public function listByAlbum($userId, $albumId, $optParams = array()) {
  788. $params = array('userId' => $userId, 'albumId' => $albumId);
  789. $params = array_merge($params, $optParams);
  790. $data = $this->__call('listByAlbum', array($params));
  791. if ($this->useObjects()) {
  792. return new PhotosFeed($data);
  793. } else {
  794. return $data;
  795. }
  796. }
  797. }
  798. /**
  799. * The "related" collection of methods.
  800. * Typical usage is:
  801. * <code>
  802. * $buzzService = new apiBuzzService(...);
  803. * $related = $buzzService->related;
  804. * </code>
  805. */
  806. class RelatedServiceResource extends apiServiceResource {
  807. /**
  808. * Get related links for an activity (related.list)
  809. *
  810. * @param string $userId ID of the user being referenced.
  811. * @param string $scope The collection to which the activity belongs.
  812. * @param string $postId ID of the activity to which to get related links.
  813. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  814. *
  815. * @opt_param string hl Language code to limit language results.
  816. * @return RelatedFeed
  817. */
  818. public function listRelated($userId, $scope, $postId, $optParams = array()) {
  819. $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId);
  820. $params = array_merge($params, $optParams);
  821. $data = $this->__call('list', array($params));
  822. if ($this->useObjects()) {
  823. return new RelatedFeed($data);
  824. } else {
  825. return $data;
  826. }
  827. }
  828. }
  829. /**
  830. * The "groups" collection of methods.
  831. * Typical usage is:
  832. * <code>
  833. * $buzzService = new apiBuzzService(...);
  834. * $groups = $buzzService->groups;
  835. * </code>
  836. */
  837. class GroupsServiceResource extends apiServiceResource {
  838. /**
  839. * Create a group (groups.insert)
  840. *
  841. * @param string $userId ID of the user being referenced.
  842. * @param $postBody the {@link Group}
  843. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  844. *
  845. * @opt_param string hl Language code to limit language results.
  846. * @return Group
  847. */
  848. public function insert($userId, Group $postBody, $optParams = array()) {
  849. $params = array('userId' => $userId, 'postBody' => $postBody);
  850. $params = array_merge($params, $optParams);
  851. $data = $this->__call('insert', array($params));
  852. if ($this->useObjects()) {
  853. return new Group($data);
  854. } else {
  855. return $data;
  856. }
  857. }
  858. /**
  859. * Get a group (groups.get)
  860. *
  861. * @param string $userId ID of the user being referenced.
  862. * @param string $groupId ID of the group to get.
  863. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  864. *
  865. * @opt_param string hl Language code to limit language results.
  866. * @return Group
  867. */
  868. public function get($userId, $groupId, $optParams = array()) {
  869. $params = array('userId' => $userId, 'groupId' => $groupId);
  870. $params = array_merge($params, $optParams);
  871. $data = $this->__call('get', array($params));
  872. if ($this->useObjects()) {
  873. return new Group($data);
  874. } else {
  875. return $data;
  876. }
  877. }
  878. /**
  879. * Get a user's groups (groups.list)
  880. *
  881. * @param string $userId ID of the user being referenced.
  882. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  883. *
  884. * @opt_param string max-results Maximum number of results to include.
  885. * @opt_param string c A continuation token that allows pagination.
  886. * @opt_param string hl Language code to limit language results.
  887. * @return GroupFeed
  888. */
  889. public function listGroups($userId, $optParams = array()) {
  890. $params = array('userId' => $userId);
  891. $params = array_merge($params, $optParams);
  892. $data = $this->__call('list', array($params));
  893. if ($this->useObjects()) {
  894. return new GroupFeed($data);
  895. } else {
  896. return $data;
  897. }
  898. }
  899. /**
  900. * Update a group (groups.update)
  901. *
  902. * @param string $userId ID of the user being referenced.
  903. * @param string $groupId ID of the group to update.
  904. * @param $postBody the {@link Group}
  905. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  906. *
  907. * @opt_param string hl Language code to limit language results.
  908. * @return Group
  909. */
  910. public function update($userId, $groupId, Group $postBody, $optParams = array()) {
  911. $params = array('userId' => $userId, 'groupId' => $groupId, 'postBody' => $postBody);
  912. $params = array_merge($params, $optParams);
  913. $data = $this->__call('update', array($params));
  914. if ($this->useObjects()) {
  915. return new Group($data);
  916. } else {
  917. return $data;
  918. }
  919. }
  920. /**
  921. * Update a group. This method supports patch semantics. (groups.patch)
  922. *
  923. * @param string $userId ID of the user being referenced.
  924. * @param string $groupId ID of the group to update.
  925. * @param $postBody the {@link Group}
  926. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  927. *
  928. * @opt_param string hl Language code to limit language results.
  929. * @return Group
  930. */
  931. public function patch($userId, $groupId, Group $postBody, $optParams = array()) {
  932. $params = array('userId' => $userId, 'groupId' => $groupId, 'postBody' => $postBody);
  933. $params = array_merge($params, $optParams);
  934. $data = $this->__call('patch', array($params));
  935. if ($this->useObjects()) {
  936. return new Group($data);
  937. } else {
  938. return $data;
  939. }
  940. }
  941. /**
  942. * Delete a group (groups.delete)
  943. *
  944. * @param string $userId ID of the user being referenced.
  945. * @param string $groupId ID of the group to delete.
  946. * @param array $optParams Optional parameters. Valid optional parameters are listed below.
  947. *
  948. * @opt_param string hl Language code to limit language results.
  949. */
  950. public function delete($userId, $groupId, $optParams = array()) {
  951. $params = array('userId' => $userId, 'groupId' => $groupId);
  952. $params = array_merge($params, $optParams);
  953. $data = $this->__call('delete', array($params));
  954. return $data;
  955. }
  956. }
  957. /**
  958. * Service definition for Buzz (v1).
  959. *
  960. * <p>
  961. * Lets you share updates, photos, videos, and more with your friends around the world
  962. * </p>
  963. *
  964. * <p>
  965. * For more information about this service, see the
  966. * <a href="http://code.google.com/apis/buzz/v1/using_rest.html" target="_blank">API Documentation</a>
  967. * </p>
  968. *
  969. * @author Google, Inc.
  970. */
  971. class apiBuzzService extends apiService {
  972. public $activities;
  973. public $people;
  974. public $photoAlbums;
  975. public $comments;
  976. public $photos;
  977. public $related;
  978. public $groups;
  979. /**
  980. * Constructs the internal representation of the Buzz service.
  981. *
  982. * @param apiClient apiClient
  983. */
  984. public function __construct(apiClient $apiClient) {
  985. $this->rpcPath = '/rpc';
  986. $this->restBasePath = '/buzz/v1/';
  987. $this->version = 'v1';
  988. $this->serviceName = 'buzz';
  989. $this->io = $apiClient->getIo();
  990. $apiClient->addService($this->serviceName, $this->version);
  991. $this->activities = new ActivitiesServiceResource($this, $this->serviceName, 'activities', json_decode('{"methods": {"count": {"scopes": ["https://www.googleapis.com/auth/buzz", "https://www.googleapis.com/auth/buzz.readonly"], "parameters": {"url": {"repeated": true, "type": "string", "location": "query"}, "hl": {"type": "string", "location": "query"}}, "response": {"$ref": "CountFeed"}, "httpMethod": "GET", "path": "activities/count", "id": "chili.activities.count"}, "insert": {"scopes": ["https://www.googleapis.com/auth/buzz"], "parameters": {"alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}, "preview": {"default": "false", "type": "boolean", "location": "query"}, "userId": {"required": true, "type": "string", "location": "path"}, "hl": {"type": "string", "location": "query"}}, "mediaUpload": {"maxSize": "10MB", "accept": ["image/*"], "protocols": {"simple": {"path": "/upload/buzz/v1/activities/{userId}/@self", "multipart": true}, "resumable": {"path": "/resumable/upload/buzz/v1/activities/{userId}/@self", "multipart": true}}}, "request": {"$ref": "Activity"}, "id": "chili.activities.insert", "httpMethod": "POST", "path": "activities/{userId}/@self", "response": {"$ref": "Activity"}}, "search": {"scopes": ["https://www.googleapis.com/auth/buzz", "https://www.googleapis.com/auth/buzz.readonly"], "parameters": {"max-results": {"default": "20", "format": "uint32", "type": "integer", "location": "query"}, "c": {"type": "string", "location": "query"}, "pid": {"type": "string", "location": "query"}, "lon": {"type": "string", "location": "query"}, "q": {"type": "string", "location": "query"}, "truncateAtom": {"type": "boolean", "location": "query"}, "radius": {"type": "string", "location": "query"}, "bbox": {"type": "string", "location": "query"}, "hl": {"type": "string", "location": "query"}, "lat": {"type": "string", "location": "query"}, "alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}}, "response": {"$ref": "ActivityFeed"}, "httpMethod": "GET", "path": "activities/search", "id": "chili.activities.search"}, "get": {"scopes": ["https://www.googleapis.com/auth/buzz", "https://www.googleapis.com/auth/buzz.readonly"], "parameters": {"userId": {"required": true, "type": "string", "location": "path"}, "truncateAtom": {"type": "boolean", "location": "query"}, "max-comments": {"default": "0", "format": "uint32", "type": "integer", "location": "query"}, "hl": {"type": "string", "location": "query"}, "max-liked": {"default": "0", "format": "uint32", "type": "integer", "location": "query"}, "alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}, "postId": {"required": true, "type": "string", "location": "path"}}, "id": "chili.activities.get", "httpMethod": "GET", "path": "activities/{userId}/@self/{postId}", "response": {"$ref": "Activity"}}, "track": {"scopes": ["https://www.googleapis.com/auth/buzz", "https://www.googleapis.com/auth/buzz.readonly"], "parameters": {"max-results": {"default": "20", "format": "uint32", "type": "integer", "location": "query"}, "c": {"type": "string", "location": "query"}, "pid": {"type": "string", "location": "query"}, "lon": {"type": "string", "location": "query"}, "q": {"type": "string", "location": "query"}, "radius": {"type": "string", "location": "query"}, "bbox": {"type": "string", "location": "query"}, "hl": {"type": "string", "location": "query"}, "lat": {"type": "string", "location": "query"}, "alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}}, "response": {"$ref": "ActivityFeed"}, "httpMethod": "GET", "path": "activities/track", "id": "chili.activities.track"}, "list": {"scopes": ["https://www.googleapis.com/auth/buzz", "https://www.googleapis.com/auth/buzz.readonly"], "parameters": {"max-results": {"default": "20", "format": "uint32", "type": "integer", "location": "query"}, "c": {"type": "string", "location": "query"}, "userId": {"required": true, "type": "string", "location": "path"}, "truncateAtom": {"type": "boolean", "location": "query"}, "max-comments": {"default": "0", "format": "uint32", "type": "integer", "location": "query"}, "hl": {"type": "string", "location": "query"}, "max-liked": {"default": "0", "format": "uint32", "type": "integer", "location": "query"}, "scope": {"required": true, "enum": ["@comments", "@consumption", "@liked", "@public", "@self"], "location": "path", "type": "string"}, "alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}}, "id": "chili.activities.list", "httpMethod": "GET", "path": "activities/{userId}/{scope}", "response": {"$ref": "ActivityFeed"}}, "update": {"scopes": ["https://www.googleapis.com/auth/buzz"], "parameters": {"userId": {"required": true, "type": "string", "location": "path"}, "abuseType": {"type": "string", "location": "query"}, "hl": {"type": "string", "location": "query"}, "scope": {"required": true, "enum": ["@abuse", "@liked", "@muted", "@self"], "location": "path", "type": "string"}, "alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}, "postId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Activity"}, "id": "chili.activities.update", "httpMethod": "PUT", "path": "activities/{userId}/{scope}/{postId}", "response": {"$ref": "Activity"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/buzz"], "parameters": {"userId": {"required": true, "type": "string", "location": "path"}, "abuseType": {"type": "string", "location": "query"}, "hl": {"type": "string", "location": "query"}, "scope": {"required": true, "enum": ["@abuse", "@liked", "@muted", "@self"], "location": "path", "type": "string"}, "alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}, "postId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Activity"}, "id": "chili.activities.patch", "httpMethod": "PATCH", "path": "activities/{userId}/{scope}/{postId}", "response": {"$ref": "Activity"}}, "extractPeopleFromSearch": {"scopes": ["https://www.googleapis.com/auth/buzz", "https://www.googleapis.com/auth/buzz.readonly"], "parameters": {"max-results": {"default": "20", "format": "uint32", "type": "integer", "location": "query"}, "c": {"type": "string", "location": "query"}, "pid": {"type": "string", "location": "query"}, "lon": {"type": "string", "location": "query"}, "q": {"type": "string", "location": "query"}, "radius": {"type": "string", "location": "query"}, "bbox": {"type": "string", "location": "query"}, "hl": {"type": "string", "location": "query"}, "lat": {"type": "string", "location": "query"}, "alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}}, "response": {"$ref": "PeopleFeed"}, "httpMethod": "GET", "path": "activities/search/@people", "id": "chili.activities.extractPeopleFromSearch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/buzz"], "parameters": {"scope": {"required": true, "enum": ["@liked", "@muted", "@self"], "location": "path", "type": "string"}, "alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}, "postId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "hl": {"type": "string", "location": "query"}}, "httpMethod": "DELETE", "path": "activities/{userId}/{scope}/{postId}", "id": "chili.activities.delete"}}}', true));
  992. $this->people = new PeopleServiceResource($this, $this->serviceName, 'people', json_decode('{"methods": {"search": {"scopes": ["https://www.googleapis.com/auth/buzz", "https://www.googleapis.com/auth/buzz.readonly"], "parameters": {"max-results": {"default": "20", "format": "uint32", "type": "integer", "location": "query"}, "q": {"type": "string", "location": "query"}, "alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}, "c": {"type": "string", "location": "query"}, "hl": {"type": "string", "location": "query"}}, "response": {"$ref": "PeopleFeed"}, "httpMethod": "GET", "path": "people/search", "id": "chili.people.search"}, "get": {"scopes": ["https://www.googleapis.com/auth/buzz", "https://www.googleapis.com/auth/buzz.readonly"], "parameters": {"alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}, "userId": {"required": true, "type": "string", "location": "path"}, "hl": {"type": "string", "location": "query"}}, "id": "chili.people.get", "httpMethod": "GET", "path": "people/{userId}/@self", "response": {"$ref": "Person"}}, "update": {"scopes": ["https://www.googleapis.com/auth/buzz"], "parameters": {"personId": {"required": true, "type": "string", "location": "path"}, "alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}, "userId": {"required": true, "type": "string", "location": "path"}, "groupId": {"required": true, "type": "string", "location": "path"}, "hl": {"type": "string", "location": "query"}}, "request": {"$ref": "Person"}, "id": "chili.people.update", "httpMethod": "PUT", "path": "people/{userId}/@groups/{groupId}/{personId}", "response": {"$ref": "Person"}}, "list": {"scopes": ["https://www.googleapis.com/auth/buzz", "https://www.googleapis.com/auth/buzz.readonly"], "parameters": {"max-results": {"default": "20", "format": "uint32", "type": "integer", "location": "query"}, "c": {"type": "string", "location": "query"}, "userId": {"required": true, "type": "string", "location": "path"}, "hl": {"type": "string", "location": "query"}, "alt": {"default": "atom", "enum": ["atom", "json"], "location": "query", "type": "string"}, "groupId": {"required": true, "type": "string", "location": "path"}}, "id": "chili.people.list", "httpMethod": "GET", "path": "people/{userId}/@groups/{groupId}", "response": {"$ref": "PeopleFeed"}}, "liked": {"scopes": ["https://www.googleapis.com/auth/buzz", "https://www.googleapis.com/auth/buzz.readonly"], "parameters": {"max-results": {"default": "20", "format": "uint32", "type": "integer", "location": "query"}, "c"…

Large files files are truncated, but you can click here to view the full file