/plus_comments/google_api/contrib/apiBuzzService.php
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
- <?php
- /*
- * Copyright (c) 2010 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
- require_once 'service/apiModel.php';
- require_once 'service/apiService.php';
- require_once 'service/apiServiceRequest.php';
- /**
- * The "activities" collection of methods.
- * Typical usage is:
- * <code>
- * $buzzService = new apiBuzzService(...);
- * $activities = $buzzService->activities;
- * </code>
- */
- class ActivitiesServiceResource extends apiServiceResource {
- /**
- * Get a count of link shares (activities.count)
- *
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string url URLs for which to get share counts.
- * @opt_param string hl Language code to limit language results.
- * @return CountFeed
- */
- public function count($optParams = array()) {
- $params = array();
- $params = array_merge($params, $optParams);
- $data = $this->__call('count', array($params));
- if ($this->useObjects()) {
- return new CountFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * Create a new activity (activities.insert)
- *
- * @param string $userId ID of the user being referenced.
- * @param $postBody the {@link Activity}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param bool preview If true, only preview the action.
- * @opt_param string hl Language code to limit language results.
- * @return Activity
- */
- public function insert($userId, Activity $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('insert', array($params));
- if ($this->useObjects()) {
- return new Activity($data);
- } else {
- return $data;
- }
- }
- /**
- * Search for activities (activities.search)
- *
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param string pid ID of a place to use in a geographic location query.
- * @opt_param string lon Longitude to use in a geographic location query.
- * @opt_param string q Full-text search query string.
- * @opt_param bool truncateAtom Truncate the value of the atom:content element.
- * @opt_param string radius Radius to use in a geographic location query.
- * @opt_param string bbox Bounding box to use in a geographic location query.
- * @opt_param string hl Language code to limit language results.
- * @opt_param string lat Latitude to use in a geographic location query.
- * @return ActivityFeed
- */
- public function search($optParams = array()) {
- $params = array();
- $params = array_merge($params, $optParams);
- $data = $this->__call('search', array($params));
- if ($this->useObjects()) {
- return new ActivityFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * Get an activity (activities.get)
- *
- * @param string $userId ID of the user whose post to get.
- * @param string $postId ID of the post to get.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param bool truncateAtom Truncate the value of the atom:content element.
- * @opt_param string max-comments Maximum number of comments to include.
- * @opt_param string hl Language code to limit language results.
- * @opt_param string max-liked Maximum number of likes to include.
- * @return Activity
- */
- public function get($userId, $postId, $optParams = array()) {
- $params = array('userId' => $userId, 'postId' => $postId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('get', array($params));
- if ($this->useObjects()) {
- return new Activity($data);
- } else {
- return $data;
- }
- }
- /**
- * Get real-time activity tracking information (activities.track)
- *
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param string pid ID of a place to use in a geographic location query.
- * @opt_param string lon Longitude to use in a geographic location query.
- * @opt_param string q Full-text search query string.
- * @opt_param string radius Radius to use in a geographic location query.
- * @opt_param string bbox Bounding box to use in a geographic location query.
- * @opt_param string hl Language code to limit language results.
- * @opt_param string lat Latitude to use in a geographic location query.
- * @return ActivityFeed
- */
- public function track($optParams = array()) {
- $params = array();
- $params = array_merge($params, $optParams);
- $data = $this->__call('track', array($params));
- if ($this->useObjects()) {
- return new ActivityFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * List activities (activities.list)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $scope The collection of activities to list.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param bool truncateAtom Truncate the value of the atom:content element.
- * @opt_param string max-comments Maximum number of comments to include.
- * @opt_param string hl Language code to limit language results.
- * @opt_param string max-liked Maximum number of likes to include.
- * @return ActivityFeed
- */
- public function listActivities($userId, $scope, $optParams = array()) {
- $params = array('userId' => $userId, 'scope' => $scope);
- $params = array_merge($params, $optParams);
- $data = $this->__call('list', array($params));
- if ($this->useObjects()) {
- return new ActivityFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * Update an activity (activities.update)
- *
- * @param string $userId ID of the user whose post to update.
- * @param string $scope The collection to which the activity belongs.
- * @param string $postId ID of the activity to update.
- * @param $postBody the {@link Activity}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string abuseType
- * @opt_param string hl Language code to limit language results.
- * @return Activity
- */
- public function update($userId, $scope, $postId, Activity $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('update', array($params));
- if ($this->useObjects()) {
- return new Activity($data);
- } else {
- return $data;
- }
- }
- /**
- * Update an activity. This method supports patch semantics. (activities.patch)
- *
- * @param string $userId ID of the user whose post to update.
- * @param string $scope The collection to which the activity belongs.
- * @param string $postId ID of the activity to update.
- * @param $postBody the {@link Activity}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string abuseType
- * @opt_param string hl Language code to limit language results.
- * @return Activity
- */
- public function patch($userId, $scope, $postId, Activity $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('patch', array($params));
- if ($this->useObjects()) {
- return new Activity($data);
- } else {
- return $data;
- }
- }
- /**
- * Search for people by topic (activities.extractPeopleFromSearch)
- *
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param string pid ID of a place to use in a geographic location query.
- * @opt_param string lon Longitude to use in a geographic location query.
- * @opt_param string q Full-text search query string.
- * @opt_param string radius Radius to use in a geographic location query.
- * @opt_param string bbox Bounding box to use in a geographic location query.
- * @opt_param string hl Language code to limit language results.
- * @opt_param string lat Latitude to use in a geographic location query.
- * @return PeopleFeed
- */
- public function extractPeopleFromSearch($optParams = array()) {
- $params = array();
- $params = array_merge($params, $optParams);
- $data = $this->__call('extractPeopleFromSearch', array($params));
- if ($this->useObjects()) {
- return new PeopleFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * Delete an activity (activities.delete)
- *
- * @param string $userId ID of the user whose post to delete.
- * @param string $scope The collection to which the activity belongs.
- * @param string $postId ID of the activity to delete.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- */
- public function delete($userId, $scope, $postId, $optParams = array()) {
- $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('delete', array($params));
- return $data;
- }
- }
- /**
- * The "people" collection of methods.
- * Typical usage is:
- * <code>
- * $buzzService = new apiBuzzService(...);
- * $people = $buzzService->people;
- * </code>
- */
- class PeopleServiceResource extends apiServiceResource {
- /**
- * Get people who liked an activity (people.liked)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $scope
- * @param string $postId ID of the activity that was liked.
- * @param string $groupId
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param string hl Language code to limit language results.
- * @return PeopleFeed
- */
- public function liked($userId, $scope, $postId, $groupId, $optParams = array()) {
- $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId, 'groupId' => $groupId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('liked', array($params));
- if ($this->useObjects()) {
- return new PeopleFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * Get a user profile (people.get)
- *
- * @param string $userId ID of the user being referenced.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return Person
- */
- public function get($userId, $optParams = array()) {
- $params = array('userId' => $userId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('get', array($params));
- if ($this->useObjects()) {
- return new Person($data);
- } else {
- return $data;
- }
- }
- /**
- * Add a person to a group (people.update)
- *
- * @param string $userId ID of the owner of the group.
- * @param string $groupId ID of the group to which to add the person.
- * @param string $personId ID of the person to add to the group.
- * @param $postBody the {@link Person}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return Person
- */
- public function update($userId, $groupId, $personId, Person $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'groupId' => $groupId, 'personId' => $personId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('update', array($params));
- if ($this->useObjects()) {
- return new Person($data);
- } else {
- return $data;
- }
- }
- /**
- * Get people in a group (people.list)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $groupId ID of the group for which to list users.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param string hl Language code to limit language results.
- * @return PeopleFeed
- */
- public function listPeople($userId, $groupId, $optParams = array()) {
- $params = array('userId' => $userId, 'groupId' => $groupId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('list', array($params));
- if ($this->useObjects()) {
- return new PeopleFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * Search for people (people.search)
- *
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string q Full-text search query string.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param string hl Language code to limit language results.
- * @return PeopleFeed
- */
- public function search($optParams = array()) {
- $params = array();
- $params = array_merge($params, $optParams);
- $data = $this->__call('search', array($params));
- if ($this->useObjects()) {
- return new PeopleFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * Add a person to a group. This method supports patch semantics. (people.patch)
- *
- * @param string $userId ID of the owner of the group.
- * @param string $groupId ID of the group to which to add the person.
- * @param string $personId ID of the person to add to the group.
- * @param $postBody the {@link Person}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return Person
- */
- public function patch($userId, $groupId, $personId, Person $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'groupId' => $groupId, 'personId' => $personId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('patch', array($params));
- if ($this->useObjects()) {
- return new Person($data);
- } else {
- return $data;
- }
- }
- /**
- * Get people who reshared an activity (people.reshared)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $scope
- * @param string $postId ID of the activity that was reshared.
- * @param string $groupId
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param string hl Language code to limit language results.
- * @return PeopleFeed
- */
- public function reshared($userId, $scope, $postId, $groupId, $optParams = array()) {
- $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId, 'groupId' => $groupId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('reshared', array($params));
- if ($this->useObjects()) {
- return new PeopleFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * Remove a person from a group (people.delete)
- *
- * @param string $userId ID of the owner of the group.
- * @param string $groupId ID of the group from which to remove the person.
- * @param string $personId ID of the person to remove from the group.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- */
- public function delete($userId, $groupId, $personId, $optParams = array()) {
- $params = array('userId' => $userId, 'groupId' => $groupId, 'personId' => $personId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('delete', array($params));
- return $data;
- }
- }
- /**
- * The "photoAlbums" collection of methods.
- * Typical usage is:
- * <code>
- * $buzzService = new apiBuzzService(...);
- * $photoAlbums = $buzzService->photoAlbums;
- * </code>
- */
- class PhotoAlbumsServiceResource extends apiServiceResource {
- /**
- * Create a photo album (photoAlbums.insert)
- *
- * @param string $userId ID of the user being referenced.
- * @param $postBody the {@link Album}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return Album
- */
- public function insert($userId, Album $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('insert', array($params));
- if ($this->useObjects()) {
- return new Album($data);
- } else {
- return $data;
- }
- }
- /**
- * Get a photo album (photoAlbums.get)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $albumId ID of the album to get.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return Album
- */
- public function get($userId, $albumId, $optParams = array()) {
- $params = array('userId' => $userId, 'albumId' => $albumId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('get', array($params));
- if ($this->useObjects()) {
- return new Album($data);
- } else {
- return $data;
- }
- }
- /**
- * List a user's photo albums (photoAlbums.list)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $scope The collection of albums to list.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param string hl Language code to limit language results.
- * @return AlbumsFeed
- */
- public function listPhotoAlbums($userId, $scope, $optParams = array()) {
- $params = array('userId' => $userId, 'scope' => $scope);
- $params = array_merge($params, $optParams);
- $data = $this->__call('list', array($params));
- if ($this->useObjects()) {
- return new AlbumsFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * Delete a photo album (photoAlbums.delete)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $albumId ID of the album to delete.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- */
- public function delete($userId, $albumId, $optParams = array()) {
- $params = array('userId' => $userId, 'albumId' => $albumId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('delete', array($params));
- return $data;
- }
- }
- /**
- * The "comments" collection of methods.
- * Typical usage is:
- * <code>
- * $buzzService = new apiBuzzService(...);
- * $comments = $buzzService->comments;
- * </code>
- */
- class CommentsServiceResource extends apiServiceResource {
- /**
- * Create a comment (comments.insert)
- *
- * @param string $userId ID of the user on whose behalf to comment.
- * @param string $postId ID of the activity on which to comment.
- * @param $postBody the {@link Comment}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return Comment
- */
- public function insert($userId, $postId, Comment $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'postId' => $postId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('insert', array($params));
- if ($this->useObjects()) {
- return new Comment($data);
- } else {
- return $data;
- }
- }
- /**
- * Get a comment (comments.get)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $postId ID of the activity for which to get comments.
- * @param string $commentId ID of the comment being referenced.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return Comment
- */
- public function get($userId, $postId, $commentId, $optParams = array()) {
- $params = array('userId' => $userId, 'postId' => $postId, 'commentId' => $commentId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('get', array($params));
- if ($this->useObjects()) {
- return new Comment($data);
- } else {
- return $data;
- }
- }
- /**
- * List comments (comments.list)
- *
- * @param string $userId ID of the user for whose post to get comments.
- * @param string $scope The collection to which the activity belongs.
- * @param string $postId ID of the activity for which to get comments.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param string hl Language code to limit language results.
- * @return CommentFeed
- */
- public function listComments($userId, $scope, $postId, $optParams = array()) {
- $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('list', array($params));
- if ($this->useObjects()) {
- return new CommentFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * Update a comment (comments.update)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $scope The collection to which the activity belongs.
- * @param string $postId ID of the activity for which to update the comment.
- * @param string $commentId ID of the comment being referenced.
- * @param $postBody the {@link Comment}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string abuseType
- * @opt_param string hl Language code to limit language results.
- * @return Comment
- */
- public function update($userId, $scope, $postId, $commentId, Comment $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId, 'commentId' => $commentId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('update', array($params));
- if ($this->useObjects()) {
- return new Comment($data);
- } else {
- return $data;
- }
- }
- /**
- * Update a comment. This method supports patch semantics. (comments.patch)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $scope The collection to which the activity belongs.
- * @param string $postId ID of the activity for which to update the comment.
- * @param string $commentId ID of the comment being referenced.
- * @param $postBody the {@link Comment}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string abuseType
- * @opt_param string hl Language code to limit language results.
- * @return Comment
- */
- public function patch($userId, $scope, $postId, $commentId, Comment $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId, 'commentId' => $commentId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('patch', array($params));
- if ($this->useObjects()) {
- return new Comment($data);
- } else {
- return $data;
- }
- }
- /**
- * Delete a comment (comments.delete)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $postId ID of the activity for which to delete the comment.
- * @param string $commentId ID of the comment being referenced.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- */
- public function delete($userId, $postId, $commentId, $optParams = array()) {
- $params = array('userId' => $userId, 'postId' => $postId, 'commentId' => $commentId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('delete', array($params));
- return $data;
- }
- }
- /**
- * The "photos" collection of methods.
- * Typical usage is:
- * <code>
- * $buzzService = new apiBuzzService(...);
- * $photos = $buzzService->photos;
- * </code>
- */
- class PhotosServiceResource extends apiServiceResource {
- /**
- * Upload a photo to an album (photos.insert2)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $albumId ID of the album to which to upload.
- * @param $postBody the {@link ChiliPhotosResourceJson}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return ChiliPhotosResourceJson
- */
- public function insert2($userId, $albumId, ChiliPhotosResourceJson $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'albumId' => $albumId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('insert2', array($params));
- if ($this->useObjects()) {
- return new ChiliPhotosResourceJson($data);
- } else {
- return $data;
- }
- }
- /**
- * Upload a photo to an album (photos.insert)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $albumId ID of the album to which to upload.
- * @param $postBody the {@link AlbumLite}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return AlbumLite
- */
- public function insert($userId, $albumId, AlbumLite $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'albumId' => $albumId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('insert', array($params));
- if ($this->useObjects()) {
- return new AlbumLite($data);
- } else {
- return $data;
- }
- }
- /**
- * Get photo metadata (photos.get)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $albumId ID of the album containing the photo.
- * @param string $photoId ID of the photo for which to get metadata.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return ChiliPhotosResourceJson
- */
- public function get($userId, $albumId, $photoId, $optParams = array()) {
- $params = array('userId' => $userId, 'albumId' => $albumId, 'photoId' => $photoId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('get', array($params));
- if ($this->useObjects()) {
- return new ChiliPhotosResourceJson($data);
- } else {
- return $data;
- }
- }
- /**
- * Get a user's photos (photos.listByScope)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $scope The collection of photos to list.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param string hl Language code to limit language results.
- * @return PhotosFeed
- */
- public function listByScope($userId, $scope, $optParams = array()) {
- $params = array('userId' => $userId, 'scope' => $scope);
- $params = array_merge($params, $optParams);
- $data = $this->__call('listByScope', array($params));
- if ($this->useObjects()) {
- return new PhotosFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * Delete a photo (photos.delete)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $albumId ID of the album to which to photo belongs.
- * @param string $photoId ID of the photo to delete.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- */
- public function delete($userId, $albumId, $photoId, $optParams = array()) {
- $params = array('userId' => $userId, 'albumId' => $albumId, 'photoId' => $photoId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('delete', array($params));
- return $data;
- }
- /**
- * List photos in an album (photos.listByAlbum)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $albumId ID of the album for which to list photos.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param string hl Language code to limit language results.
- * @return PhotosFeed
- */
- public function listByAlbum($userId, $albumId, $optParams = array()) {
- $params = array('userId' => $userId, 'albumId' => $albumId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('listByAlbum', array($params));
- if ($this->useObjects()) {
- return new PhotosFeed($data);
- } else {
- return $data;
- }
- }
- }
- /**
- * The "related" collection of methods.
- * Typical usage is:
- * <code>
- * $buzzService = new apiBuzzService(...);
- * $related = $buzzService->related;
- * </code>
- */
- class RelatedServiceResource extends apiServiceResource {
- /**
- * Get related links for an activity (related.list)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $scope The collection to which the activity belongs.
- * @param string $postId ID of the activity to which to get related links.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return RelatedFeed
- */
- public function listRelated($userId, $scope, $postId, $optParams = array()) {
- $params = array('userId' => $userId, 'scope' => $scope, 'postId' => $postId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('list', array($params));
- if ($this->useObjects()) {
- return new RelatedFeed($data);
- } else {
- return $data;
- }
- }
- }
- /**
- * The "groups" collection of methods.
- * Typical usage is:
- * <code>
- * $buzzService = new apiBuzzService(...);
- * $groups = $buzzService->groups;
- * </code>
- */
- class GroupsServiceResource extends apiServiceResource {
- /**
- * Create a group (groups.insert)
- *
- * @param string $userId ID of the user being referenced.
- * @param $postBody the {@link Group}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return Group
- */
- public function insert($userId, Group $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('insert', array($params));
- if ($this->useObjects()) {
- return new Group($data);
- } else {
- return $data;
- }
- }
- /**
- * Get a group (groups.get)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $groupId ID of the group to get.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return Group
- */
- public function get($userId, $groupId, $optParams = array()) {
- $params = array('userId' => $userId, 'groupId' => $groupId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('get', array($params));
- if ($this->useObjects()) {
- return new Group($data);
- } else {
- return $data;
- }
- }
- /**
- * Get a user's groups (groups.list)
- *
- * @param string $userId ID of the user being referenced.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string max-results Maximum number of results to include.
- * @opt_param string c A continuation token that allows pagination.
- * @opt_param string hl Language code to limit language results.
- * @return GroupFeed
- */
- public function listGroups($userId, $optParams = array()) {
- $params = array('userId' => $userId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('list', array($params));
- if ($this->useObjects()) {
- return new GroupFeed($data);
- } else {
- return $data;
- }
- }
- /**
- * Update a group (groups.update)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $groupId ID of the group to update.
- * @param $postBody the {@link Group}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return Group
- */
- public function update($userId, $groupId, Group $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'groupId' => $groupId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('update', array($params));
- if ($this->useObjects()) {
- return new Group($data);
- } else {
- return $data;
- }
- }
- /**
- * Update a group. This method supports patch semantics. (groups.patch)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $groupId ID of the group to update.
- * @param $postBody the {@link Group}
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- * @return Group
- */
- public function patch($userId, $groupId, Group $postBody, $optParams = array()) {
- $params = array('userId' => $userId, 'groupId' => $groupId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('patch', array($params));
- if ($this->useObjects()) {
- return new Group($data);
- } else {
- return $data;
- }
- }
- /**
- * Delete a group (groups.delete)
- *
- * @param string $userId ID of the user being referenced.
- * @param string $groupId ID of the group to delete.
- * @param array $optParams Optional parameters. Valid optional parameters are listed below.
- *
- * @opt_param string hl Language code to limit language results.
- */
- public function delete($userId, $groupId, $optParams = array()) {
- $params = array('userId' => $userId, 'groupId' => $groupId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('delete', array($params));
- return $data;
- }
- }
- /**
- * Service definition for Buzz (v1).
- *
- * <p>
- * Lets you share updates, photos, videos, and more with your friends around the world
- * </p>
- *
- * <p>
- * For more information about this service, see the
- * <a href="http://code.google.com/apis/buzz/v1/using_rest.html" target="_blank">API Documentation</a>
- * </p>
- *
- * @author Google, Inc.
- */
- class apiBuzzService extends apiService {
- public $activities;
- public $people;
- public $photoAlbums;
- public $comments;
- public $photos;
- public $related;
- public $groups;
- /**
- * Constructs the internal representation of the Buzz service.
- *
- * @param apiClient apiClient
- */
- public function __construct(apiClient $apiClient) {
- $this->rpcPath = '/rpc';
- $this->restBasePath = '/buzz/v1/';
- $this->version = 'v1';
- $this->serviceName = 'buzz';
- $this->io = $apiClient->getIo();
- $apiClient->addService($this->serviceName, $this->version);
- $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));
- $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