added google xoauth2 support + fixed a journaling issue

This commit is contained in:
SJ
2012-09-28 10:34:04 +02:00
parent f930aacc84
commit 55de53bb26
111 changed files with 38812 additions and 4 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,488 @@
<?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 "cse" collection of methods.
* Typical usage is:
* <code>
* $customsearchService = new apiCustomsearchService(...);
* $cse = $customsearchService->cse;
* </code>
*/
class CseServiceResource extends apiServiceResource {
/**
* Returns metadata about the search performed, metadata about the custom search engine used for the
* search, and the search results. (cse.list)
*
* @param string $q Query
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string sort The sort expression to apply to the results
* @opt_param string num Number of search results to return
* @opt_param string googlehost The local Google domain to use to perform the search.
* @opt_param string safe Search safety level
* @opt_param string filter Controls turning on or off the duplicate content filter.
* @opt_param string start The index of the first result to return
* @opt_param string cx The custom search engine ID to scope this search query
* @opt_param string lr The language restriction for the search results
* @opt_param string cr Country restrict(s).
* @opt_param string gl Geolocation of end user.
* @opt_param string cref The URL of a linked custom search engine
* @return Search
*/
public function listCse($q, $optParams = array()) {
$params = array('q' => $q);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Search($data);
} else {
return $data;
}
}
}
/**
* Service definition for Customsearch (v1).
*
* <p>
* Lets you search over a website or collection of websites
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/customsearch/v1/using_rest.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class apiCustomsearchService extends apiService {
public $cse;
/**
* Constructs the internal representation of the Customsearch service.
*
* @param apiClient apiClient
*/
public function __construct(apiClient $apiClient) {
$this->rpcPath = '/rpc';
$this->restBasePath = '/customsearch/';
$this->version = 'v1';
$this->serviceName = 'customsearch';
$apiClient->addService($this->serviceName, $this->version);
$this->cse = new CseServiceResource($this, $this->serviceName, 'cse', json_decode('{"methods": {"list": {"parameters": {"sort": {"type": "string", "location": "query"}, "filter": {"enum": ["0", "1"], "type": "string", "location": "query"}, "cx": {"type": "string", "location": "query"}, "googlehost": {"type": "string", "location": "query"}, "safe": {"default": "off", "enum": ["high", "medium", "off"], "location": "query", "type": "string"}, "q": {"required": true, "type": "string", "location": "query"}, "start": {"type": "string", "location": "query"}, "num": {"default": "10", "type": "string", "location": "query"}, "lr": {"enum": ["lang_ar", "lang_bg", "lang_ca", "lang_cs", "lang_da", "lang_de", "lang_el", "lang_en", "lang_es", "lang_et", "lang_fi", "lang_fr", "lang_hr", "lang_hu", "lang_id", "lang_is", "lang_it", "lang_iw", "lang_ja", "lang_ko", "lang_lt", "lang_lv", "lang_nl", "lang_no", "lang_pl", "lang_pt", "lang_ro", "lang_ru", "lang_sk", "lang_sl", "lang_sr", "lang_sv", "lang_tr", "lang_zh-CN", "lang_zh-TW"], "type": "string", "location": "query"}, "cr": {"type": "string", "location": "query"}, "gl": {"type": "string", "location": "query"}, "cref": {"type": "string", "location": "query"}}, "id": "search.cse.list", "httpMethod": "GET", "path": "v1", "response": {"$ref": "Search"}}}}', true));
}
}
class Context extends apiModel {
protected $__facetsType = 'ContextFacets';
protected $__facetsDataType = 'array';
public $facets;
public $title;
public function setFacets(/* array(ContextFacets) */ $facets) {
$this->assertIsArray($facets, 'ContextFacets', __METHOD__);
$this->facets = $facets;
}
public function getFacets() {
return $this->facets;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
}
class ContextFacets extends apiModel {
public $anchor;
public $label;
public function setAnchor($anchor) {
$this->anchor = $anchor;
}
public function getAnchor() {
return $this->anchor;
}
public function setLabel($label) {
$this->label = $label;
}
public function getLabel() {
return $this->label;
}
}
class Promotion extends apiModel {
public $link;
public $displayLink;
protected $__imageType = 'PromotionImage';
protected $__imageDataType = '';
public $image;
protected $__bodyLinesType = 'PromotionBodyLines';
protected $__bodyLinesDataType = 'array';
public $bodyLines;
public $title;
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setDisplayLink($displayLink) {
$this->displayLink = $displayLink;
}
public function getDisplayLink() {
return $this->displayLink;
}
public function setImage(PromotionImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setBodyLines(/* array(PromotionBodyLines) */ $bodyLines) {
$this->assertIsArray($bodyLines, 'PromotionBodyLines', __METHOD__);
$this->bodyLines = $bodyLines;
}
public function getBodyLines() {
return $this->bodyLines;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
}
class PromotionBodyLines extends apiModel {
public $url;
public $link;
public $title;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
}
class PromotionImage extends apiModel {
public $source;
public $width;
public $height;
public function setSource($source) {
$this->source = $source;
}
public function getSource() {
return $this->source;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
}
class Query extends apiModel {
public $count;
public $sort;
public $outputEncoding;
public $language;
public $title;
public $googleHost;
public $safe;
public $searchTerms;
public $filter;
public $startIndex;
public $cx;
public $startPage;
public $inputEncoding;
public $cr;
public $gl;
public $totalResults;
public $cref;
public function setCount($count) {
$this->count = $count;
}
public function getCount() {
return $this->count;
}
public function setSort($sort) {
$this->sort = $sort;
}
public function getSort() {
return $this->sort;
}
public function setOutputEncoding($outputEncoding) {
$this->outputEncoding = $outputEncoding;
}
public function getOutputEncoding() {
return $this->outputEncoding;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setGoogleHost($googleHost) {
$this->googleHost = $googleHost;
}
public function getGoogleHost() {
return $this->googleHost;
}
public function setSafe($safe) {
$this->safe = $safe;
}
public function getSafe() {
return $this->safe;
}
public function setSearchTerms($searchTerms) {
$this->searchTerms = $searchTerms;
}
public function getSearchTerms() {
return $this->searchTerms;
}
public function setFilter($filter) {
$this->filter = $filter;
}
public function getFilter() {
return $this->filter;
}
public function setStartIndex($startIndex) {
$this->startIndex = $startIndex;
}
public function getStartIndex() {
return $this->startIndex;
}
public function setCx($cx) {
$this->cx = $cx;
}
public function getCx() {
return $this->cx;
}
public function setStartPage($startPage) {
$this->startPage = $startPage;
}
public function getStartPage() {
return $this->startPage;
}
public function setInputEncoding($inputEncoding) {
$this->inputEncoding = $inputEncoding;
}
public function getInputEncoding() {
return $this->inputEncoding;
}
public function setCr($cr) {
$this->cr = $cr;
}
public function getCr() {
return $this->cr;
}
public function setGl($gl) {
$this->gl = $gl;
}
public function getGl() {
return $this->gl;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
public function setCref($cref) {
$this->cref = $cref;
}
public function getCref() {
return $this->cref;
}
}
class Result extends apiModel {
public $kind;
public $title;
public $displayLink;
public $cacheId;
public $pagemap;
public $snippet;
public $htmlSnippet;
public $link;
public $htmlTitle;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setDisplayLink($displayLink) {
$this->displayLink = $displayLink;
}
public function getDisplayLink() {
return $this->displayLink;
}
public function setCacheId($cacheId) {
$this->cacheId = $cacheId;
}
public function getCacheId() {
return $this->cacheId;
}
public function setPagemap($pagemap) {
$this->pagemap = $pagemap;
}
public function getPagemap() {
return $this->pagemap;
}
public function setSnippet($snippet) {
$this->snippet = $snippet;
}
public function getSnippet() {
return $this->snippet;
}
public function setHtmlSnippet($htmlSnippet) {
$this->htmlSnippet = $htmlSnippet;
}
public function getHtmlSnippet() {
return $this->htmlSnippet;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setHtmlTitle($htmlTitle) {
$this->htmlTitle = $htmlTitle;
}
public function getHtmlTitle() {
return $this->htmlTitle;
}
}
class Search extends apiModel {
protected $__promotionsType = 'Promotion';
protected $__promotionsDataType = 'array';
public $promotions;
public $kind;
protected $__urlType = 'SearchUrl';
protected $__urlDataType = '';
public $url;
protected $__itemsType = 'Result';
protected $__itemsDataType = 'array';
public $items;
protected $__contextType = 'Context';
protected $__contextDataType = '';
public $context;
protected $__queriesType = 'Query';
protected $__queriesDataType = 'map';
public $queries;
public function setPromotions(/* array(Promotion) */ $promotions) {
$this->assertIsArray($promotions, 'Promotion', __METHOD__);
$this->promotions = $promotions;
}
public function getPromotions() {
return $this->promotions;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setUrl(SearchUrl $url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setItems(/* array(Result) */ $items) {
$this->assertIsArray($items, 'Result', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setContext(Context $context) {
$this->context = $context;
}
public function getContext() {
return $this->context;
}
public function setQueries(Query $queries) {
$this->queries = $queries;
}
public function getQueries() {
return $this->queries;
}
}
class SearchUrl extends apiModel {
public $type;
public $template;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setTemplate($template) {
$this->template = $template;
}
public function getTemplate() {
return $this->template;
}
}

View File

@ -0,0 +1,166 @@
<?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 "text" collection of methods.
* Typical usage is:
* <code>
* $freebaseService = new apiFreebaseService(...);
* $text = $freebaseService->text;
* </code>
*/
class TextServiceResource extends apiServiceResource {
/**
* Returns blob attached to node at specified id as HTML (text.get)
*
* @param string $id The id of the item that you want data about
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string maxlength The max number of characters to return. Valid only for 'plain' format.
* @opt_param string format Sanitizing transformation.
* @return ContentserviceGet
*/
public function get($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new ContentserviceGet($data);
} else {
return $data;
}
}
}
/**
* The "mqlread" collection of methods.
* Typical usage is:
* <code>
* $freebaseService = new apiFreebaseService(...);
* $mqlread = $freebaseService->mqlread;
* </code>
*/
class MqlreadServiceResource extends apiServiceResource {
/**
* Performs MQL Queries. (mqlread.mqlread)
*
* @param string $query An envelope containing a single MQL query.
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string lang The language of the results - an id of a /type/lang object.
* @opt_param bool html_escape Whether or not to escape entities.
* @opt_param string indent How many spaces to indent the json.
* @opt_param string uniqueness_failure How MQL responds to uniqueness failures.
* @opt_param string dateline The dateline that you get in a mqlwrite response to ensure consistent results.
* @opt_param string cursor The mql cursor.
* @opt_param string callback JS method name for JSONP callbacks.
* @opt_param bool cost Show the costs or not.
* @opt_param string as_of_time Run the query as it would've been run at the specified point in time.
*/
public function mqlread($query, $optParams = array()) {
$params = array('query' => $query);
$params = array_merge($params, $optParams);
$data = $this->__call('mqlread', array($params));
return $data;
}
}
/**
* The "image" collection of methods.
* Typical usage is:
* <code>
* $freebaseService = new apiFreebaseService(...);
* $image = $freebaseService->image;
* </code>
*/
class ImageServiceResource extends apiServiceResource {
/**
* Returns the scaled/cropped image attached to a freebase node. (image.image)
*
* @param string $id Freebase entity or content id, mid, or guid.
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string maxwidth Maximum width in pixels for resulting image.
* @opt_param string maxheight Maximum height in pixels for resulting image.
* @opt_param string fallbackid Use the image associated with this secondary id if no image is associated with the primary id.
* @opt_param bool pad A boolean specifying whether the resulting image should be padded up to the requested dimensions.
* @opt_param string mode Method used to scale or crop image.
*/
public function image($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('image', array($params));
return $data;
}
}
/**
* Service definition for Freebase (v1).
*
* <p>
* Lets you access the Freebase repository of open data.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://wiki.freebase.com/wiki/New_Freebase_API" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class apiFreebaseService extends apiService {
public $mqlread;
public $image;
public $text;
/**
* Constructs the internal representation of the Freebase service.
*
* @param apiClient apiClient
*/
public function __construct(apiClient $apiClient) {
$this->rpcPath = '/rpc';
$this->restBasePath = '/freebase/v1/';
$this->version = 'v1';
$this->serviceName = 'freebase';
$apiClient->addService($this->serviceName, $this->version);
$this->text = new TextServiceResource($this, $this->serviceName, 'text', json_decode('{"methods": {"get": {"parameters": {"format": {"default": "plain", "enum": ["html", "plain", "raw"], "location": "query", "type": "string"}, "id": {"repeated": true, "required": true, "type": "string", "location": "path"}, "maxlength": {"format": "uint32", "type": "integer", "location": "query"}}, "id": "freebase.text.get", "httpMethod": "GET", "path": "text{/id*}", "response": {"$ref": "ContentserviceGet"}}}}', true));
$this->mqlread = new MqlreadServiceResource($this, $this->serviceName, 'mqlread', json_decode('{"httpMethod": "GET", "parameters": {"lang": {"default": "/lang/en", "type": "string", "location": "query"}, "cursor": {"type": "string", "location": "query"}, "indent": {"format": "uint32", "default": "0", "maximum": "10", "location": "query", "type": "integer"}, "uniqueness_failure": {"default": "hard", "enum": ["hard", "soft"], "location": "query", "type": "string"}, "dateline": {"type": "string", "location": "query"}, "html_escape": {"default": "true", "type": "boolean", "location": "query"}, "callback": {"type": "string", "location": "query"}, "cost": {"default": "false", "type": "boolean", "location": "query"}, "query": {"required": true, "type": "string", "location": "query"}, "as_of_time": {"type": "string", "location": "query"}}, "path": "mqlread", "id": "freebase.mqlread"}', true));
$this->image = new ImageServiceResource($this, $this->serviceName, 'image', json_decode('{"httpMethod": "GET", "parameters": {"maxwidth": {"format": "uint32", "type": "integer", "location": "query", "maximum": "4096"}, "maxheight": {"format": "uint32", "type": "integer", "location": "query", "maximum": "4096"}, "fallbackid": {"default": "/freebase/no_image_png", "type": "string", "location": "query"}, "pad": {"default": "false", "type": "boolean", "location": "query"}, "mode": {"default": "fit", "enum": ["fill", "fillcrop", "fillcropmid", "fit"], "location": "query", "type": "string"}, "id": {"repeated": true, "required": true, "type": "string", "location": "path"}}, "path": "image{/id*}", "id": "freebase.image"}', true));
}
}
class ContentserviceGet extends apiModel {
public $result;
public function setResult($result) {
$this->result = $result;
}
public function getResult() {
return $this->result;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,287 @@
<?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 "currentLocation" collection of methods.
* Typical usage is:
* <code>
* $latitudeService = new apiLatitudeService(...);
* $currentLocation = $latitudeService->currentLocation;
* </code>
*/
class CurrentLocationServiceResource extends apiServiceResource {
/**
* Updates or creates the user's current location. (currentLocation.insert)
*
* @param Location $postBody
* @return Location
*/
public function insert(Location $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Location($data);
} else {
return $data;
}
}
/**
* Returns the authenticated user's current location. (currentLocation.get)
*
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string granularity Granularity of the requested location.
* @return Location
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Location($data);
} else {
return $data;
}
}
/**
* Deletes the authenticated user's current location. (currentLocation.delete)
*
*/
public function delete($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "location" collection of methods.
* Typical usage is:
* <code>
* $latitudeService = new apiLatitudeService(...);
* $location = $latitudeService->location;
* </code>
*/
class LocationServiceResource extends apiServiceResource {
/**
* Inserts or updates a location in the user's location history. (location.insert)
*
* @param Location $postBody
* @return Location
*/
public function insert(Location $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Location($data);
} else {
return $data;
}
}
/**
* Reads a location from the user's location history. (location.get)
*
* @param string $locationId Timestamp of the location to read (ms since epoch).
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string granularity Granularity of the location to return.
* @return Location
*/
public function get($locationId, $optParams = array()) {
$params = array('locationId' => $locationId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Location($data);
} else {
return $data;
}
}
/**
* Lists the user's location history. (location.list)
*
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string max-results Maximum number of locations to return.
* @opt_param string max-time Maximum timestamp of locations to return (ms since epoch).
* @opt_param string min-time Minimum timestamp of locations to return (ms since epoch).
* @opt_param string granularity Granularity of the requested locations.
* @return LocationFeed
*/
public function listLocation($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new LocationFeed($data);
} else {
return $data;
}
}
/**
* Deletes a location from the user's location history. (location.delete)
*
* @param string $locationId Timestamp of the location to delete (ms since epoch).
*/
public function delete($locationId, $optParams = array()) {
$params = array('locationId' => $locationId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Latitude (v1).
*
* <p>
* Lets you read and update your current location and work with your location history
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/latitude/v1/using_rest.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class apiLatitudeService extends apiService {
public $currentLocation;
public $location;
/**
* Constructs the internal representation of the Latitude service.
*
* @param apiClient apiClient
*/
public function __construct(apiClient $apiClient) {
$this->rpcPath = '/rpc';
$this->restBasePath = '/latitude/v1/';
$this->version = 'v1';
$this->serviceName = 'latitude';
$apiClient->addService($this->serviceName, $this->version);
$this->currentLocation = new CurrentLocationServiceResource($this, $this->serviceName, 'currentLocation', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city", "https://www.googleapis.com/auth/latitude.current.best", "https://www.googleapis.com/auth/latitude.current.city"], "request": {"$ref": "LatitudeCurrentlocationResourceJson"}, "response": {"$ref": "LatitudeCurrentlocationResourceJson"}, "httpMethod": "POST", "path": "currentLocation", "id": "latitude.currentLocation.insert"}, "delete": {"id": "latitude.currentLocation.delete", "path": "currentLocation", "httpMethod": "DELETE", "scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city", "https://www.googleapis.com/auth/latitude.current.best", "https://www.googleapis.com/auth/latitude.current.city"]}, "get": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city", "https://www.googleapis.com/auth/latitude.current.best", "https://www.googleapis.com/auth/latitude.current.city"], "parameters": {"granularity": {"type": "string", "location": "query"}}, "response": {"$ref": "LatitudeCurrentlocationResourceJson"}, "httpMethod": "GET", "path": "currentLocation", "id": "latitude.currentLocation.get"}}}', true));
$this->location = new LocationServiceResource($this, $this->serviceName, 'location', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "request": {"$ref": "Location"}, "response": {"$ref": "Location"}, "httpMethod": "POST", "path": "location", "id": "latitude.location.insert"}, "delete": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "parameters": {"locationId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "location/{locationId}", "id": "latitude.location.delete"}, "list": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "parameters": {"max-results": {"type": "string", "location": "query"}, "max-time": {"type": "string", "location": "query"}, "min-time": {"type": "string", "location": "query"}, "granularity": {"type": "string", "location": "query"}}, "response": {"$ref": "LocationFeed"}, "httpMethod": "GET", "path": "location", "id": "latitude.location.list"}, "get": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "parameters": {"locationId": {"required": true, "type": "string", "location": "path"}, "granularity": {"type": "string", "location": "query"}}, "id": "latitude.location.get", "httpMethod": "GET", "path": "location/{locationId}", "response": {"$ref": "Location"}}}}', true));
}
}
class Location extends apiModel {
public $kind;
public $altitude;
public $longitude;
public $activityId;
public $latitude;
public $altitudeAccuracy;
public $timestampMs;
public $speed;
public $heading;
public $accuracy;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setAltitude($altitude) {
$this->altitude = $altitude;
}
public function getAltitude() {
return $this->altitude;
}
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
return $this->longitude;
}
public function setActivityId($activityId) {
$this->activityId = $activityId;
}
public function getActivityId() {
return $this->activityId;
}
public function setLatitude($latitude) {
$this->latitude = $latitude;
}
public function getLatitude() {
return $this->latitude;
}
public function setAltitudeAccuracy($altitudeAccuracy) {
$this->altitudeAccuracy = $altitudeAccuracy;
}
public function getAltitudeAccuracy() {
return $this->altitudeAccuracy;
}
public function setTimestampMs($timestampMs) {
$this->timestampMs = $timestampMs;
}
public function getTimestampMs() {
return $this->timestampMs;
}
public function setSpeed($speed) {
$this->speed = $speed;
}
public function getSpeed() {
return $this->speed;
}
public function setHeading($heading) {
$this->heading = $heading;
}
public function getHeading() {
return $this->heading;
}
public function setAccuracy($accuracy) {
$this->accuracy = $accuracy;
}
public function getAccuracy() {
return $this->accuracy;
}
}
class LocationFeed extends apiModel {
protected $__itemsType = 'Location';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Location) */ $items) {
$this->assertIsArray($items, 'Location', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,307 @@
<?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 "userinfo" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new apiOauth2Service(...);
* $userinfo = $oauth2Service->userinfo;
* </code>
*/
class UserinfoServiceResource extends apiServiceResource {
/**
* (userinfo.get)
*
* @return Userinfo
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Userinfo($data);
} else {
return $data;
}
}
}
/**
* The "v2" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new apiOauth2Service(...);
* $v2 = $oauth2Service->v2;
* </code>
*/
class UserinfoV2ServiceResource extends apiServiceResource {
}
/**
* The "me" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new apiOauth2Service(...);
* $me = $oauth2Service->me;
* </code>
*/
class UserinfoV2MeServiceResource extends apiServiceResource {
/**
* (me.get)
*
* @return Userinfo
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Userinfo($data);
} else {
return $data;
}
}
}
/**
* The "tokeninfo" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new apiOauth2Service(...);
* $tokeninfo = $oauth2Service->tokeninfo;
* </code>
*/
class TokeninfoServiceResource extends apiServiceResource {
/**
* (tokeninfo.tokeninfo)
*
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string access_token
* @opt_param string id_token
* @return Tokeninfo
*/
public function tokeninfo($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('tokeninfo', array($params));
if ($this->useObjects()) {
return new Tokeninfo($data);
} else {
return $data;
}
}
}
/**
* Service definition for Oauth2 (v2).
*
* <p>
* OAuth2 API
* </p>
*
* <p>
* For more information about this service, see the
* <a href="" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class apiOauth2Service extends apiService {
public $tokeninfo;
public $userinfo;
public $userinfo_v2;
/**
* Constructs the internal representation of the Oauth2 service.
*
* @param apiClient apiClient
*/
public function __construct(apiClient $apiClient) {
$this->rpcPath = '/rpc';
$this->restBasePath = '/';
$this->version = 'v2';
$this->serviceName = 'oauth2';
$apiClient->addService($this->serviceName, $this->version);
$this->userinfo = new UserinfoServiceResource($this, $this->serviceName, 'userinfo', json_decode('{"methods": {"get": {"path": "oauth2/v2/userinfo", "response": {"$ref": "Userinfo"}, "httpMethod": "GET", "id": "oauth2.userinfo.get"}}}', true));
$this->userinfo_v2 = new UserinfoV2ServiceResource($this, $this->serviceName, 'v2', json_decode('{}', true));
$this->tokeninfo = new TokeninfoServiceResource($this, $this->serviceName, 'tokeninfo', json_decode('{"id": "oauth2.tokeninfo", "path": "oauth2/v2/tokeninfo", "response": {"$ref": "Tokeninfo"}, "parameters": {"access_token": {"type": "string", "location": "query"}, "id_token": {"type": "string", "location": "query"}}, "httpMethod": "GET"}', true));
}
}
class Tokeninfo extends apiModel {
public $issued_to;
public $user_id;
public $expires_in;
public $access_type;
public $audience;
public $scope;
public $email;
public $verified_email;
public function setIssued_to($issued_to) {
$this->issued_to = $issued_to;
}
public function getIssued_to() {
return $this->issued_to;
}
public function setUser_id($user_id) {
$this->user_id = $user_id;
}
public function getUser_id() {
return $this->user_id;
}
public function setExpires_in($expires_in) {
$this->expires_in = $expires_in;
}
public function getExpires_in() {
return $this->expires_in;
}
public function setAccess_type($access_type) {
$this->access_type = $access_type;
}
public function getAccess_type() {
return $this->access_type;
}
public function setAudience($audience) {
$this->audience = $audience;
}
public function getAudience() {
return $this->audience;
}
public function setScope($scope) {
$this->scope = $scope;
}
public function getScope() {
return $this->scope;
}
public function setEmail($email) {
$this->email = $email;
}
public function getEmail() {
return $this->email;
}
public function setVerified_email($verified_email) {
$this->verified_email = $verified_email;
}
public function getVerified_email() {
return $this->verified_email;
}
}
class Userinfo extends apiModel {
public $family_name;
public $name;
public $picture;
public $locale;
public $gender;
public $email;
public $birthday;
public $link;
public $given_name;
public $timezone;
public $id;
public $verified_email;
public function setFamily_name($family_name) {
$this->family_name = $family_name;
}
public function getFamily_name() {
return $this->family_name;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setPicture($picture) {
$this->picture = $picture;
}
public function getPicture() {
return $this->picture;
}
public function setLocale($locale) {
$this->locale = $locale;
}
public function getLocale() {
return $this->locale;
}
public function setGender($gender) {
$this->gender = $gender;
}
public function getGender() {
return $this->gender;
}
public function setEmail($email) {
$this->email = $email;
}
public function getEmail() {
return $this->email;
}
public function setBirthday($birthday) {
$this->birthday = $birthday;
}
public function getBirthday() {
return $this->birthday;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setGiven_name($given_name) {
$this->given_name = $given_name;
}
public function getGiven_name() {
return $this->given_name;
}
public function setTimezone($timezone) {
$this->timezone = $timezone;
}
public function getTimezone() {
return $this->timezone;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setVerified_email($verified_email) {
$this->verified_email = $verified_email;
}
public function getVerified_email() {
return $this->verified_email;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,482 @@
<?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 "pagespeedapi" collection of methods.
* Typical usage is:
* <code>
* $pagespeedonlineService = new apiPagespeedonlineService(...);
* $pagespeedapi = $pagespeedonlineService->pagespeedapi;
* </code>
*/
class PagespeedapiServiceResource extends apiServiceResource {
/**
* Runs Page Speed analysis on the page at the specified URL, and returns a Page Speed score, a list
* of suggestions to make that page faster, and other information. (pagespeedapi.runpagespeed)
*
* @param string $url The URL to fetch and analyze
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string locale The locale used to localize formatted results
* @opt_param string rule A Page Speed rule to run; if none are given, all rules are run
* @opt_param string strategy The analysis strategy to use
* @return Result
*/
public function runpagespeed($url, $optParams = array()) {
$params = array('url' => $url);
$params = array_merge($params, $optParams);
$data = $this->__call('runpagespeed', array($params));
if ($this->useObjects()) {
return new Result($data);
} else {
return $data;
}
}
}
/**
* Service definition for Pagespeedonline (v1).
*
* <p>
* Lets you analyze the performance of a web page and get tailored suggestions to make that page faster.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://code.google.com/apis/pagespeedonline/v1/getting_started.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class apiPagespeedonlineService extends apiService {
public $pagespeedapi;
/**
* Constructs the internal representation of the Pagespeedonline service.
*
* @param apiClient apiClient
*/
public function __construct(apiClient $apiClient) {
$this->rpcPath = '/rpc';
$this->restBasePath = '/pagespeedonline/v1/';
$this->version = 'v1';
$this->serviceName = 'pagespeedonline';
$apiClient->addService($this->serviceName, $this->version);
$this->pagespeedapi = new PagespeedapiServiceResource($this, $this->serviceName, 'pagespeedapi', json_decode('{"methods": {"runpagespeed": {"parameters": {"locale": {"type": "string", "location": "query"}, "url": {"required": true, "type": "string", "location": "query"}, "rule": {"repeated": true, "type": "string", "location": "query"}, "strategy": {"enum": ["desktop", "mobile"], "type": "string", "location": "query"}}, "id": "pagespeedonline.pagespeedapi.runpagespeed", "httpMethod": "GET", "path": "runPagespeed", "response": {"$ref": "Result"}}}}', true));
}
}
class Result extends apiModel {
public $kind;
protected $__formattedResultsType = 'ResultFormattedResults';
protected $__formattedResultsDataType = '';
public $formattedResults;
public $title;
protected $__versionType = 'ResultVersion';
protected $__versionDataType = '';
public $version;
public $score;
public $responseCode;
public $invalidRules;
protected $__pageStatsType = 'ResultPageStats';
protected $__pageStatsDataType = '';
public $pageStats;
public $id;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setFormattedResults(ResultFormattedResults $formattedResults) {
$this->formattedResults = $formattedResults;
}
public function getFormattedResults() {
return $this->formattedResults;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setVersion(ResultVersion $version) {
$this->version = $version;
}
public function getVersion() {
return $this->version;
}
public function setScore($score) {
$this->score = $score;
}
public function getScore() {
return $this->score;
}
public function setResponseCode($responseCode) {
$this->responseCode = $responseCode;
}
public function getResponseCode() {
return $this->responseCode;
}
public function setInvalidRules(/* array(string) */ $invalidRules) {
$this->assertIsArray($invalidRules, 'string', __METHOD__);
$this->invalidRules = $invalidRules;
}
public function getInvalidRules() {
return $this->invalidRules;
}
public function setPageStats(ResultPageStats $pageStats) {
$this->pageStats = $pageStats;
}
public function getPageStats() {
return $this->pageStats;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class ResultFormattedResults extends apiModel {
public $locale;
protected $__ruleResultsType = 'ResultFormattedResultsRuleResults';
protected $__ruleResultsDataType = 'map';
public $ruleResults;
public function setLocale($locale) {
$this->locale = $locale;
}
public function getLocale() {
return $this->locale;
}
public function setRuleResults(ResultFormattedResultsRuleResults $ruleResults) {
$this->ruleResults = $ruleResults;
}
public function getRuleResults() {
return $this->ruleResults;
}
}
class ResultFormattedResultsRuleResults extends apiModel {
public $localizedRuleName;
protected $__urlBlocksType = 'ResultFormattedResultsRuleResultsUrlBlocks';
protected $__urlBlocksDataType = 'array';
public $urlBlocks;
public $ruleScore;
public $ruleImpact;
public function setLocalizedRuleName($localizedRuleName) {
$this->localizedRuleName = $localizedRuleName;
}
public function getLocalizedRuleName() {
return $this->localizedRuleName;
}
public function setUrlBlocks(/* array(ResultFormattedResultsRuleResultsUrlBlocks) */ $urlBlocks) {
$this->assertIsArray($urlBlocks, 'ResultFormattedResultsRuleResultsUrlBlocks', __METHOD__);
$this->urlBlocks = $urlBlocks;
}
public function getUrlBlocks() {
return $this->urlBlocks;
}
public function setRuleScore($ruleScore) {
$this->ruleScore = $ruleScore;
}
public function getRuleScore() {
return $this->ruleScore;
}
public function setRuleImpact($ruleImpact) {
$this->ruleImpact = $ruleImpact;
}
public function getRuleImpact() {
return $this->ruleImpact;
}
}
class ResultFormattedResultsRuleResultsUrlBlocks extends apiModel {
protected $__headerType = 'ResultFormattedResultsRuleResultsUrlBlocksHeader';
protected $__headerDataType = '';
public $header;
protected $__urlsType = 'ResultFormattedResultsRuleResultsUrlBlocksUrls';
protected $__urlsDataType = 'array';
public $urls;
public function setHeader(ResultFormattedResultsRuleResultsUrlBlocksHeader $header) {
$this->header = $header;
}
public function getHeader() {
return $this->header;
}
public function setUrls(/* array(ResultFormattedResultsRuleResultsUrlBlocksUrls) */ $urls) {
$this->assertIsArray($urls, 'ResultFormattedResultsRuleResultsUrlBlocksUrls', __METHOD__);
$this->urls = $urls;
}
public function getUrls() {
return $this->urls;
}
}
class ResultFormattedResultsRuleResultsUrlBlocksHeader extends apiModel {
protected $__argsType = 'ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs';
protected $__argsDataType = 'array';
public $args;
public $format;
public function setArgs(/* array(ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs) */ $args) {
$this->assertIsArray($args, 'ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs', __METHOD__);
$this->args = $args;
}
public function getArgs() {
return $this->args;
}
public function setFormat($format) {
$this->format = $format;
}
public function getFormat() {
return $this->format;
}
}
class ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs extends apiModel {
public $type;
public $value;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setValue($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
}
class ResultFormattedResultsRuleResultsUrlBlocksUrls extends apiModel {
protected $__detailsType = 'ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails';
protected $__detailsDataType = 'array';
public $details;
protected $__resultType = 'ResultFormattedResultsRuleResultsUrlBlocksUrlsResult';
protected $__resultDataType = '';
public $result;
public function setDetails(/* array(ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails) */ $details) {
$this->assertIsArray($details, 'ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails', __METHOD__);
$this->details = $details;
}
public function getDetails() {
return $this->details;
}
public function setResult(ResultFormattedResultsRuleResultsUrlBlocksUrlsResult $result) {
$this->result = $result;
}
public function getResult() {
return $this->result;
}
}
class ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails extends apiModel {
protected $__argsType = 'ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs';
protected $__argsDataType = 'array';
public $args;
public $format;
public function setArgs(/* array(ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs) */ $args) {
$this->assertIsArray($args, 'ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs', __METHOD__);
$this->args = $args;
}
public function getArgs() {
return $this->args;
}
public function setFormat($format) {
$this->format = $format;
}
public function getFormat() {
return $this->format;
}
}
class ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs extends apiModel {
public $type;
public $value;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setValue($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
}
class ResultFormattedResultsRuleResultsUrlBlocksUrlsResult extends apiModel {
protected $__argsType = 'ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs';
protected $__argsDataType = 'array';
public $args;
public $format;
public function setArgs(/* array(ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs) */ $args) {
$this->assertIsArray($args, 'ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs', __METHOD__);
$this->args = $args;
}
public function getArgs() {
return $this->args;
}
public function setFormat($format) {
$this->format = $format;
}
public function getFormat() {
return $this->format;
}
}
class ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs extends apiModel {
public $type;
public $value;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setValue($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
}
class ResultPageStats extends apiModel {
public $otherResponseBytes;
public $flashResponseBytes;
public $totalRequestBytes;
public $numberCssResources;
public $numberResources;
public $cssResponseBytes;
public $javascriptResponseBytes;
public $imageResponseBytes;
public $numberHosts;
public $numberStaticResources;
public $htmlResponseBytes;
public $numberJsResources;
public $textResponseBytes;
public function setOtherResponseBytes($otherResponseBytes) {
$this->otherResponseBytes = $otherResponseBytes;
}
public function getOtherResponseBytes() {
return $this->otherResponseBytes;
}
public function setFlashResponseBytes($flashResponseBytes) {
$this->flashResponseBytes = $flashResponseBytes;
}
public function getFlashResponseBytes() {
return $this->flashResponseBytes;
}
public function setTotalRequestBytes($totalRequestBytes) {
$this->totalRequestBytes = $totalRequestBytes;
}
public function getTotalRequestBytes() {
return $this->totalRequestBytes;
}
public function setNumberCssResources($numberCssResources) {
$this->numberCssResources = $numberCssResources;
}
public function getNumberCssResources() {
return $this->numberCssResources;
}
public function setNumberResources($numberResources) {
$this->numberResources = $numberResources;
}
public function getNumberResources() {
return $this->numberResources;
}
public function setCssResponseBytes($cssResponseBytes) {
$this->cssResponseBytes = $cssResponseBytes;
}
public function getCssResponseBytes() {
return $this->cssResponseBytes;
}
public function setJavascriptResponseBytes($javascriptResponseBytes) {
$this->javascriptResponseBytes = $javascriptResponseBytes;
}
public function getJavascriptResponseBytes() {
return $this->javascriptResponseBytes;
}
public function setImageResponseBytes($imageResponseBytes) {
$this->imageResponseBytes = $imageResponseBytes;
}
public function getImageResponseBytes() {
return $this->imageResponseBytes;
}
public function setNumberHosts($numberHosts) {
$this->numberHosts = $numberHosts;
}
public function getNumberHosts() {
return $this->numberHosts;
}
public function setNumberStaticResources($numberStaticResources) {
$this->numberStaticResources = $numberStaticResources;
}
public function getNumberStaticResources() {
return $this->numberStaticResources;
}
public function setHtmlResponseBytes($htmlResponseBytes) {
$this->htmlResponseBytes = $htmlResponseBytes;
}
public function getHtmlResponseBytes() {
return $this->htmlResponseBytes;
}
public function setNumberJsResources($numberJsResources) {
$this->numberJsResources = $numberJsResources;
}
public function getNumberJsResources() {
return $this->numberJsResources;
}
public function setTextResponseBytes($textResponseBytes) {
$this->textResponseBytes = $textResponseBytes;
}
public function getTextResponseBytes() {
return $this->textResponseBytes;
}
}
class ResultVersion extends apiModel {
public $major;
public $minor;
public function setMajor($major) {
$this->major = $major;
}
public function getMajor() {
return $this->major;
}
public function setMinor($minor) {
$this->minor = $minor;
}
public function getMinor() {
return $this->minor;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,431 @@
<?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 "trainedmodels" collection of methods.
* Typical usage is:
* <code>
* $predictionService = new apiPredictionService(...);
* $trainedmodels = $predictionService->trainedmodels;
* </code>
*/
class TrainedmodelsServiceResource extends apiServiceResource {
/**
* Submit model id and request a prediction (trainedmodels.predict)
*
* @param string $id The unique name for the predictive model.
* @param Input $postBody
* @return Output
*/
public function predict($id, Input $postBody, $optParams = array()) {
$params = array('id' => $id, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('predict', array($params));
if ($this->useObjects()) {
return new Output($data);
} else {
return $data;
}
}
/**
* Begin training your model. (trainedmodels.insert)
*
* @param Training $postBody
* @return Training
*/
public function insert(Training $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Training($data);
} else {
return $data;
}
}
/**
* Check training status of your model. (trainedmodels.get)
*
* @param string $id The unique name for the predictive model.
* @return Training
*/
public function get($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Training($data);
} else {
return $data;
}
}
/**
* Add new data to a trained model. (trainedmodels.update)
*
* @param string $id The unique name for the predictive model.
* @param Update $postBody
* @return Training
*/
public function update($id, Update $postBody, $optParams = array()) {
$params = array('id' => $id, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Training($data);
} else {
return $data;
}
}
/**
* Delete a trained model. (trainedmodels.delete)
*
* @param string $id The unique name for the predictive model.
*/
public function delete($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "hostedmodels" collection of methods.
* Typical usage is:
* <code>
* $predictionService = new apiPredictionService(...);
* $hostedmodels = $predictionService->hostedmodels;
* </code>
*/
class HostedmodelsServiceResource extends apiServiceResource {
/**
* Submit input and request an output against a hosted model. (hostedmodels.predict)
*
* @param string $hostedModelName The name of a hosted model.
* @param Input $postBody
* @return Output
*/
public function predict($hostedModelName, Input $postBody, $optParams = array()) {
$params = array('hostedModelName' => $hostedModelName, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('predict', array($params));
if ($this->useObjects()) {
return new Output($data);
} else {
return $data;
}
}
}
/**
* Service definition for Prediction (v1.4).
*
* <p>
* Lets you access a cloud hosted machine learning service that makes it easy to build smart apps
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/predict/docs/developer-guide.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class apiPredictionService extends apiService {
public $trainedmodels;
public $hostedmodels;
/**
* Constructs the internal representation of the Prediction service.
*
* @param apiClient apiClient
*/
public function __construct(apiClient $apiClient) {
$this->rpcPath = '/rpc';
$this->restBasePath = '/prediction/v1.4/';
$this->version = 'v1.4';
$this->serviceName = 'prediction';
$apiClient->addService($this->serviceName, $this->version);
$this->trainedmodels = new TrainedmodelsServiceResource($this, $this->serviceName, 'trainedmodels', json_decode('{"methods": {"predict": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Input"}, "id": "prediction.trainedmodels.predict", "httpMethod": "POST", "path": "trainedmodels/{id}/predict", "response": {"$ref": "Output"}}, "insert": {"scopes": ["https://www.googleapis.com/auth/prediction"], "request": {"$ref": "Training"}, "response": {"$ref": "Training"}, "httpMethod": "POST", "path": "trainedmodels", "id": "prediction.trainedmodels.insert"}, "delete": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "trainedmodels/{id}", "id": "prediction.trainedmodels.delete"}, "update": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Update"}, "id": "prediction.trainedmodels.update", "httpMethod": "PUT", "path": "trainedmodels/{id}", "response": {"$ref": "Training"}}, "get": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "id": "prediction.trainedmodels.get", "httpMethod": "GET", "path": "trainedmodels/{id}", "response": {"$ref": "Training"}}}}', true));
$this->hostedmodels = new HostedmodelsServiceResource($this, $this->serviceName, 'hostedmodels', json_decode('{"methods": {"predict": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"hostedModelName": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Input"}, "id": "prediction.hostedmodels.predict", "httpMethod": "POST", "path": "hostedmodels/{hostedModelName}/predict", "response": {"$ref": "Output"}}}}', true));
}
}
class Input extends apiModel {
protected $__inputType = 'InputInput';
protected $__inputDataType = '';
public $input;
public function setInput(InputInput $input) {
$this->input = $input;
}
public function getInput() {
return $this->input;
}
}
class InputInput extends apiModel {
public $csvInstance;
public function setCsvInstance(/* array(object) */ $csvInstance) {
$this->assertIsArray($csvInstance, 'object', __METHOD__);
$this->csvInstance = $csvInstance;
}
public function getCsvInstance() {
return $this->csvInstance;
}
}
class Output extends apiModel {
public $kind;
public $outputLabel;
public $id;
protected $__outputMultiType = 'OutputOutputMulti';
protected $__outputMultiDataType = 'array';
public $outputMulti;
public $outputValue;
public $selfLink;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setOutputLabel($outputLabel) {
$this->outputLabel = $outputLabel;
}
public function getOutputLabel() {
return $this->outputLabel;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setOutputMulti(/* array(OutputOutputMulti) */ $outputMulti) {
$this->assertIsArray($outputMulti, 'OutputOutputMulti', __METHOD__);
$this->outputMulti = $outputMulti;
}
public function getOutputMulti() {
return $this->outputMulti;
}
public function setOutputValue($outputValue) {
$this->outputValue = $outputValue;
}
public function getOutputValue() {
return $this->outputValue;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class OutputOutputMulti extends apiModel {
public $score;
public $label;
public function setScore($score) {
$this->score = $score;
}
public function getScore() {
return $this->score;
}
public function setLabel($label) {
$this->label = $label;
}
public function getLabel() {
return $this->label;
}
}
class Training extends apiModel {
public $kind;
public $storageDataLocation;
public $storagePMMLModelLocation;
protected $__dataAnalysisType = 'TrainingDataAnalysis';
protected $__dataAnalysisDataType = '';
public $dataAnalysis;
public $trainingStatus;
protected $__modelInfoType = 'TrainingModelInfo';
protected $__modelInfoDataType = '';
public $modelInfo;
public $storagePMMLLocation;
public $id;
public $selfLink;
public $utility;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setStorageDataLocation($storageDataLocation) {
$this->storageDataLocation = $storageDataLocation;
}
public function getStorageDataLocation() {
return $this->storageDataLocation;
}
public function setStoragePMMLModelLocation($storagePMMLModelLocation) {
$this->storagePMMLModelLocation = $storagePMMLModelLocation;
}
public function getStoragePMMLModelLocation() {
return $this->storagePMMLModelLocation;
}
public function setDataAnalysis(TrainingDataAnalysis $dataAnalysis) {
$this->dataAnalysis = $dataAnalysis;
}
public function getDataAnalysis() {
return $this->dataAnalysis;
}
public function setTrainingStatus($trainingStatus) {
$this->trainingStatus = $trainingStatus;
}
public function getTrainingStatus() {
return $this->trainingStatus;
}
public function setModelInfo(TrainingModelInfo $modelInfo) {
$this->modelInfo = $modelInfo;
}
public function getModelInfo() {
return $this->modelInfo;
}
public function setStoragePMMLLocation($storagePMMLLocation) {
$this->storagePMMLLocation = $storagePMMLLocation;
}
public function getStoragePMMLLocation() {
return $this->storagePMMLLocation;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setUtility(/* array(double) */ $utility) {
$this->assertIsArray($utility, 'double', __METHOD__);
$this->utility = $utility;
}
public function getUtility() {
return $this->utility;
}
}
class TrainingDataAnalysis extends apiModel {
public $warnings;
public function setWarnings(/* array(string) */ $warnings) {
$this->assertIsArray($warnings, 'string', __METHOD__);
$this->warnings = $warnings;
}
public function getWarnings() {
return $this->warnings;
}
}
class TrainingModelInfo extends apiModel {
public $confusionMatrixRowTotals;
public $numberLabels;
public $confusionMatrix;
public $meanSquaredError;
public $modelType;
public $numberInstances;
public $classWeightedAccuracy;
public $classificationAccuracy;
public function setConfusionMatrixRowTotals($confusionMatrixRowTotals) {
$this->confusionMatrixRowTotals = $confusionMatrixRowTotals;
}
public function getConfusionMatrixRowTotals() {
return $this->confusionMatrixRowTotals;
}
public function setNumberLabels($numberLabels) {
$this->numberLabels = $numberLabels;
}
public function getNumberLabels() {
return $this->numberLabels;
}
public function setConfusionMatrix($confusionMatrix) {
$this->confusionMatrix = $confusionMatrix;
}
public function getConfusionMatrix() {
return $this->confusionMatrix;
}
public function setMeanSquaredError($meanSquaredError) {
$this->meanSquaredError = $meanSquaredError;
}
public function getMeanSquaredError() {
return $this->meanSquaredError;
}
public function setModelType($modelType) {
$this->modelType = $modelType;
}
public function getModelType() {
return $this->modelType;
}
public function setNumberInstances($numberInstances) {
$this->numberInstances = $numberInstances;
}
public function getNumberInstances() {
return $this->numberInstances;
}
public function setClassWeightedAccuracy($classWeightedAccuracy) {
$this->classWeightedAccuracy = $classWeightedAccuracy;
}
public function getClassWeightedAccuracy() {
return $this->classWeightedAccuracy;
}
public function setClassificationAccuracy($classificationAccuracy) {
$this->classificationAccuracy = $classificationAccuracy;
}
public function getClassificationAccuracy() {
return $this->classificationAccuracy;
}
}
class Update extends apiModel {
public $csvInstance;
public $label;
public function setCsvInstance(/* array(object) */ $csvInstance) {
$this->assertIsArray($csvInstance, 'object', __METHOD__);
$this->csvInstance = $csvInstance;
}
public function getCsvInstance() {
return $this->csvInstance;
}
public function setLabel($label) {
$this->label = $label;
}
public function getLabel() {
return $this->label;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,292 @@
<?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 "webResource" collection of methods.
* Typical usage is:
* <code>
* $siteVerificationService = new apiSiteVerificationService(...);
* $webResource = $siteVerificationService->webResource;
* </code>
*/
class WebResourceServiceResource extends apiServiceResource {
/**
* Attempt verification of a website or domain. (webResource.insert)
*
* @param string $verificationMethod The method to use for verifying a site or domain.
* @param SiteVerificationWebResourceResource $postBody
* @return SiteVerificationWebResourceResource
*/
public function insert($verificationMethod, SiteVerificationWebResourceResource $postBody, $optParams = array()) {
$params = array('verificationMethod' => $verificationMethod, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new SiteVerificationWebResourceResource($data);
} else {
return $data;
}
}
/**
* Get the most current data for a website or domain. (webResource.get)
*
* @param string $id The id of a verified site or domain.
* @return SiteVerificationWebResourceResource
*/
public function get($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new SiteVerificationWebResourceResource($data);
} else {
return $data;
}
}
/**
* Get the list of your verified websites and domains. (webResource.list)
*
* @return SiteVerificationWebResourceListResponse
*/
public function listWebResource($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new SiteVerificationWebResourceListResponse($data);
} else {
return $data;
}
}
/**
* Modify the list of owners for your website or domain. (webResource.update)
*
* @param string $id The id of a verified site or domain.
* @param SiteVerificationWebResourceResource $postBody
* @return SiteVerificationWebResourceResource
*/
public function update($id, SiteVerificationWebResourceResource $postBody, $optParams = array()) {
$params = array('id' => $id, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new SiteVerificationWebResourceResource($data);
} else {
return $data;
}
}
/**
* Modify the list of owners for your website or domain. This method supports patch semantics.
* (webResource.patch)
*
* @param string $id The id of a verified site or domain.
* @param SiteVerificationWebResourceResource $postBody
* @return SiteVerificationWebResourceResource
*/
public function patch($id, SiteVerificationWebResourceResource $postBody, $optParams = array()) {
$params = array('id' => $id, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new SiteVerificationWebResourceResource($data);
} else {
return $data;
}
}
/**
* Get a verification token for placing on a website or domain. (webResource.getToken)
*
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string verificationMethod The method to use for verifying a site or domain.
* @opt_param string identifier The URL or domain to verify.
* @opt_param string type Type of resource to verify. Can be 'site' (URL) or 'inet_domain' (domain name).
* @return SiteVerificationWebResourceGettokenResponse
*/
public function getToken($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('getToken', array($params));
if ($this->useObjects()) {
return new SiteVerificationWebResourceGettokenResponse($data);
} else {
return $data;
}
}
/**
* Relinquish ownership of a website or domain. (webResource.delete)
*
* @param string $id The id of a verified site or domain.
*/
public function delete($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for SiteVerification (v1).
*
* <p>
* Lets you programatically verify ownership of websites or domains with Google.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/siteverification/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class apiSiteVerificationService extends apiService {
public $webResource;
/**
* Constructs the internal representation of the SiteVerification service.
*
* @param apiClient apiClient
*/
public function __construct(apiClient $apiClient) {
$this->rpcPath = '/rpc';
$this->restBasePath = '/siteVerification/v1/';
$this->version = 'v1';
$this->serviceName = 'siteVerification';
$apiClient->addService($this->serviceName, $this->version);
$this->webResource = new WebResourceServiceResource($this, $this->serviceName, 'webResource', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"verificationMethod": {"required": true, "type": "string", "location": "query"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "id": "siteVerification.webResource.insert", "httpMethod": "POST", "path": "webResource", "response": {"$ref": "SiteVerificationWebResourceResource"}}, "get": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "id": "siteVerification.webResource.get", "httpMethod": "GET", "path": "webResource/{id}", "response": {"$ref": "SiteVerificationWebResourceResource"}}, "list": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "id": "siteVerification.webResource.list", "httpMethod": "GET", "path": "webResource", "response": {"$ref": "SiteVerificationWebResourceListResponse"}}, "update": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "id": "siteVerification.webResource.update", "httpMethod": "PUT", "path": "webResource/{id}", "response": {"$ref": "SiteVerificationWebResourceResource"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "id": "siteVerification.webResource.patch", "httpMethod": "PATCH", "path": "webResource/{id}", "response": {"$ref": "SiteVerificationWebResourceResource"}}, "getToken": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"type": {"type": "string", "location": "query"}, "identifier": {"type": "string", "location": "query"}, "verificationMethod": {"type": "string", "location": "query"}}, "response": {"$ref": "SiteVerificationWebResourceGettokenResponse"}, "httpMethod": "GET", "path": "token", "id": "siteVerification.webResource.getToken"}, "delete": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "webResource/{id}", "id": "siteVerification.webResource.delete"}}}', true));
}
}
class SiteVerificationWebResourceGettokenRequest extends apiModel {
public $verificationMethod;
protected $__siteType = 'SiteVerificationWebResourceGettokenRequestSite';
protected $__siteDataType = '';
public $site;
public function setVerificationMethod($verificationMethod) {
$this->verificationMethod = $verificationMethod;
}
public function getVerificationMethod() {
return $this->verificationMethod;
}
public function setSite(SiteVerificationWebResourceGettokenRequestSite $site) {
$this->site = $site;
}
public function getSite() {
return $this->site;
}
}
class SiteVerificationWebResourceGettokenRequestSite extends apiModel {
public $identifier;
public $type;
public function setIdentifier($identifier) {
$this->identifier = $identifier;
}
public function getIdentifier() {
return $this->identifier;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class SiteVerificationWebResourceGettokenResponse extends apiModel {
public $token;
public $method;
public function setToken($token) {
$this->token = $token;
}
public function getToken() {
return $this->token;
}
public function setMethod($method) {
$this->method = $method;
}
public function getMethod() {
return $this->method;
}
}
class SiteVerificationWebResourceListResponse extends apiModel {
protected $__itemsType = 'SiteVerificationWebResourceResource';
protected $__itemsDataType = 'array';
public $items;
public function setItems(/* array(SiteVerificationWebResourceResource) */ $items) {
$this->assertIsArray($items, 'SiteVerificationWebResourceResource', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
}
class SiteVerificationWebResourceResource extends apiModel {
public $owners;
public $id;
protected $__siteType = 'SiteVerificationWebResourceResourceSite';
protected $__siteDataType = '';
public $site;
public function setOwners(/* array(string) */ $owners) {
$this->assertIsArray($owners, 'string', __METHOD__);
$this->owners = $owners;
}
public function getOwners() {
return $this->owners;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSite(SiteVerificationWebResourceResourceSite $site) {
$this->site = $site;
}
public function getSite() {
return $this->site;
}
}
class SiteVerificationWebResourceResourceSite extends apiModel {
public $identifier;
public $type;
public function setIdentifier($identifier) {
$this->identifier = $identifier;
}
public function getIdentifier() {
return $this->identifier;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}

View File

@ -0,0 +1,571 @@
<?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 "tasks" collection of methods.
* Typical usage is:
* <code>
* $tasksService = new apiTasksService(...);
* $tasks = $tasksService->tasks;
* </code>
*/
class TasksServiceResource extends apiServiceResource {
/**
* Creates a new task on the specified task list. (tasks.insert)
*
* @param string $tasklist Task list identifier.
* @param Task $postBody
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string parent Parent task identifier. If the task is created at the top level, this parameter is omitted. Optional.
* @opt_param string previous Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional.
* @return Task
*/
public function insert($tasklist, Task $postBody, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Task($data);
} else {
return $data;
}
}
/**
* Returns the specified task. (tasks.get)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @return Task
*/
public function get($tasklist, $task, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'task' => $task);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Task($data);
} else {
return $data;
}
}
/**
* Clears all completed tasks from the specified task list. The affected tasks will be marked as
* 'hidden' and no longer be returned by default when retrieving all tasks for a task list.
* (tasks.clear)
*
* @param string $tasklist Task list identifier.
*/
public function clear($tasklist, $optParams = array()) {
$params = array('tasklist' => $tasklist);
$params = array_merge($params, $optParams);
$data = $this->__call('clear', array($params));
return $data;
}
/**
* Moves the specified task to another position in the task list. This can include putting it as a
* child task under a new parent and/or move it to a different position among its sibling tasks.
* (tasks.move)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string parent New parent task identifier. If the task is moved to the top level, this parameter is omitted. Optional.
* @opt_param string previous New previous sibling task identifier. If the task is moved to the first position among its siblings, this parameter is omitted. Optional.
* @return Task
*/
public function move($tasklist, $task, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'task' => $task);
$params = array_merge($params, $optParams);
$data = $this->__call('move', array($params));
if ($this->useObjects()) {
return new Task($data);
} else {
return $data;
}
}
/**
* Returns all tasks in the specified task list. (tasks.list)
*
* @param string $tasklist Task list identifier.
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string dueMax Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.
* @opt_param bool showDeleted Flag indicating whether deleted tasks are returned in the result. Optional. The default is False.
* @opt_param string updatedMin Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time.
* @opt_param string completedMin Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.
* @opt_param string maxResults Maximum number of task lists returned on one page. Optional. The default is 100.
* @opt_param bool showCompleted Flag indicating whether completed tasks are returned in the result. Optional. The default is True.
* @opt_param string pageToken Token specifying the result page to return. Optional.
* @opt_param string completedMax Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.
* @opt_param bool showHidden Flag indicating whether hidden tasks are returned in the result. Optional. The default is False.
* @opt_param string dueMin Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.
* @return Tasks
*/
public function listTasks($tasklist, $optParams = array()) {
$params = array('tasklist' => $tasklist);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Tasks($data);
} else {
return $data;
}
}
/**
* Updates the specified task. (tasks.update)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @param Task $postBody
* @return Task
*/
public function update($tasklist, $task, Task $postBody, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'task' => $task, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Task($data);
} else {
return $data;
}
}
/**
* Updates the specified task. This method supports patch semantics. (tasks.patch)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @param Task $postBody
* @return Task
*/
public function patch($tasklist, $task, Task $postBody, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'task' => $task, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Task($data);
} else {
return $data;
}
}
/**
* Deletes the specified task from the task list. (tasks.delete)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
*/
public function delete($tasklist, $task, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'task' => $task);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "tasklists" collection of methods.
* Typical usage is:
* <code>
* $tasksService = new apiTasksService(...);
* $tasklists = $tasksService->tasklists;
* </code>
*/
class TasklistsServiceResource extends apiServiceResource {
/**
* Creates a new task list and adds it to the authenticated user's task lists. (tasklists.insert)
*
* @param TaskList $postBody
* @return TaskList
*/
public function insert(TaskList $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new TaskList($data);
} else {
return $data;
}
}
/**
* Returns the authenticated user's specified task list. (tasklists.get)
*
* @param string $tasklist Task list identifier.
* @return TaskList
*/
public function get($tasklist, $optParams = array()) {
$params = array('tasklist' => $tasklist);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new TaskList($data);
} else {
return $data;
}
}
/**
* Returns all the authenticated user's task lists. (tasklists.list)
*
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string pageToken Token specifying the result page to return. Optional.
* @opt_param string maxResults Maximum number of task lists returned on one page. Optional. The default is 100.
* @return TaskLists
*/
public function listTasklists($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new TaskLists($data);
} else {
return $data;
}
}
/**
* Updates the authenticated user's specified task list. (tasklists.update)
*
* @param string $tasklist Task list identifier.
* @param TaskList $postBody
* @return TaskList
*/
public function update($tasklist, TaskList $postBody, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new TaskList($data);
} else {
return $data;
}
}
/**
* Updates the authenticated user's specified task list. This method supports patch semantics.
* (tasklists.patch)
*
* @param string $tasklist Task list identifier.
* @param TaskList $postBody
* @return TaskList
*/
public function patch($tasklist, TaskList $postBody, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new TaskList($data);
} else {
return $data;
}
}
/**
* Deletes the authenticated user's specified task list. (tasklists.delete)
*
* @param string $tasklist Task list identifier.
*/
public function delete($tasklist, $optParams = array()) {
$params = array('tasklist' => $tasklist);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Tasks (v1).
*
* <p>
* Lets you manage your tasks and task lists.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/tasks/v1/using.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class apiTasksService extends apiService {
public $tasks;
public $tasklists;
/**
* Constructs the internal representation of the Tasks service.
*
* @param apiClient apiClient
*/
public function __construct(apiClient $apiClient) {
$this->rpcPath = '/rpc';
$this->restBasePath = '/tasks/v1/';
$this->version = 'v1';
$this->serviceName = 'tasks';
$apiClient->addService($this->serviceName, $this->version);
$this->tasks = new TasksServiceResource($this, $this->serviceName, 'tasks', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "parent": {"type": "string", "location": "query"}, "previous": {"type": "string", "location": "query"}}, "request": {"$ref": "Task"}, "id": "tasks.tasks.insert", "httpMethod": "POST", "path": "lists/{tasklist}/tasks", "response": {"$ref": "Task"}}, "get": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "id": "tasks.tasks.get", "httpMethod": "GET", "path": "lists/{tasklist}/tasks/{task}", "response": {"$ref": "Task"}}, "clear": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "POST", "path": "lists/{tasklist}/clear", "id": "tasks.tasks.clear"}, "move": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"previous": {"type": "string", "location": "query"}, "tasklist": {"required": true, "type": "string", "location": "path"}, "parent": {"type": "string", "location": "query"}, "task": {"required": true, "type": "string", "location": "path"}}, "id": "tasks.tasks.move", "httpMethod": "POST", "path": "lists/{tasklist}/tasks/{task}/move", "response": {"$ref": "Task"}}, "list": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"dueMax": {"type": "string", "location": "query"}, "tasklist": {"required": true, "type": "string", "location": "path"}, "pageToken": {"type": "string", "location": "query"}, "updatedMin": {"type": "string", "location": "query"}, "completedMin": {"type": "string", "location": "query"}, "maxResults": {"format": "int64", "type": "string", "location": "query"}, "showCompleted": {"type": "boolean", "location": "query"}, "showDeleted": {"type": "boolean", "location": "query"}, "completedMax": {"type": "string", "location": "query"}, "showHidden": {"type": "boolean", "location": "query"}, "dueMin": {"type": "string", "location": "query"}}, "id": "tasks.tasks.list", "httpMethod": "GET", "path": "lists/{tasklist}/tasks", "response": {"$ref": "Tasks"}}, "update": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Task"}, "id": "tasks.tasks.update", "httpMethod": "PUT", "path": "lists/{tasklist}/tasks/{task}", "response": {"$ref": "Task"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Task"}, "id": "tasks.tasks.patch", "httpMethod": "PATCH", "path": "lists/{tasklist}/tasks/{task}", "response": {"$ref": "Task"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "lists/{tasklist}/tasks/{task}", "id": "tasks.tasks.delete"}}}', true));
$this->tasklists = new TasklistsServiceResource($this, $this->serviceName, 'tasklists', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/tasks"], "request": {"$ref": "TaskList"}, "response": {"$ref": "TaskList"}, "httpMethod": "POST", "path": "users/@me/lists", "id": "tasks.tasklists.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "id": "tasks.tasklists.get", "httpMethod": "GET", "path": "users/@me/lists/{tasklist}", "response": {"$ref": "TaskList"}}, "list": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"format": "int64", "type": "string", "location": "query"}}, "response": {"$ref": "TaskLists"}, "httpMethod": "GET", "path": "users/@me/lists", "id": "tasks.tasklists.list"}, "update": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "TaskList"}, "id": "tasks.tasklists.update", "httpMethod": "PUT", "path": "users/@me/lists/{tasklist}", "response": {"$ref": "TaskList"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "TaskList"}, "id": "tasks.tasklists.patch", "httpMethod": "PATCH", "path": "users/@me/lists/{tasklist}", "response": {"$ref": "TaskList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "users/@me/lists/{tasklist}", "id": "tasks.tasklists.delete"}}}', true));
}
}
class Task extends apiModel {
public $status;
public $kind;
public $updated;
public $parent;
protected $__linksType = 'TaskLinks';
protected $__linksDataType = 'array';
public $links;
public $title;
public $deleted;
public $completed;
public $due;
public $etag;
public $notes;
public $position;
public $hidden;
public $id;
public $selfLink;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setParent($parent) {
$this->parent = $parent;
}
public function getParent() {
return $this->parent;
}
public function setLinks(/* array(TaskLinks) */ $links) {
$this->assertIsArray($links, 'TaskLinks', __METHOD__);
$this->links = $links;
}
public function getLinks() {
return $this->links;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setDeleted($deleted) {
$this->deleted = $deleted;
}
public function getDeleted() {
return $this->deleted;
}
public function setCompleted($completed) {
$this->completed = $completed;
}
public function getCompleted() {
return $this->completed;
}
public function setDue($due) {
$this->due = $due;
}
public function getDue() {
return $this->due;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setNotes($notes) {
$this->notes = $notes;
}
public function getNotes() {
return $this->notes;
}
public function setPosition($position) {
$this->position = $position;
}
public function getPosition() {
return $this->position;
}
public function setHidden($hidden) {
$this->hidden = $hidden;
}
public function getHidden() {
return $this->hidden;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class TaskLinks extends apiModel {
public $type;
public $link;
public $description;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
}
class TaskList extends apiModel {
public $kind;
public $etag;
public $id;
public $selfLink;
public $title;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
}
class TaskLists extends apiModel {
public $nextPageToken;
protected $__itemsType = 'TaskList';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(TaskList) */ $items) {
$this->assertIsArray($items, 'TaskList', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Tasks extends apiModel {
public $nextPageToken;
protected $__itemsType = 'Task';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Task) */ $items) {
$this->assertIsArray($items, 'Task', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}

View File

@ -0,0 +1,254 @@
<?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 "languages" collection of methods.
* Typical usage is:
* <code>
* $translateService = new apiTranslateService(...);
* $languages = $translateService->languages;
* </code>
*/
class LanguagesServiceResource extends apiServiceResource {
/**
* List the source/target languages supported by the API (languages.list)
*
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string target the language and collation in which the localized results should be returned
* @return LanguagesListResponse
*/
public function listLanguages($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new LanguagesListResponse($data);
} else {
return $data;
}
}
}
/**
* The "detections" collection of methods.
* Typical usage is:
* <code>
* $translateService = new apiTranslateService(...);
* $detections = $translateService->detections;
* </code>
*/
class DetectionsServiceResource extends apiServiceResource {
/**
* Detect the language of text. (detections.list)
*
* @param string $q The text to detect
* @return DetectionsListResponse
*/
public function listDetections($q, $optParams = array()) {
$params = array('q' => $q);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new DetectionsListResponse($data);
} else {
return $data;
}
}
}
/**
* The "translations" collection of methods.
* Typical usage is:
* <code>
* $translateService = new apiTranslateService(...);
* $translations = $translateService->translations;
* </code>
*/
class TranslationsServiceResource extends apiServiceResource {
/**
* Returns text translations from one language to another. (translations.list)
*
* @param string $q The text to translate
* @param string $target The target language into which the text should be translated
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string source The source language of the text
* @opt_param string format The format of the text
* @opt_param string cid The customization id for translate
* @return TranslationsListResponse
*/
public function listTranslations($q, $target, $optParams = array()) {
$params = array('q' => $q, 'target' => $target);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new TranslationsListResponse($data);
} else {
return $data;
}
}
}
/**
* Service definition for Translate (v2).
*
* <p>
* Lets you translate text from one language to another
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/language/translate/v2/using_rest.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class apiTranslateService extends apiService {
public $languages;
public $detections;
public $translations;
/**
* Constructs the internal representation of the Translate service.
*
* @param apiClient apiClient
*/
public function __construct(apiClient $apiClient) {
$this->rpcPath = '/rpc';
$this->restBasePath = '/language/translate/';
$this->version = 'v2';
$this->serviceName = 'translate';
$apiClient->addService($this->serviceName, $this->version);
$this->languages = new LanguagesServiceResource($this, $this->serviceName, 'languages', json_decode('{"methods": {"list": {"parameters": {"target": {"type": "string", "location": "query"}}, "id": "language.languages.list", "httpMethod": "GET", "path": "v2/languages", "response": {"$ref": "LanguagesListResponse"}}}}', true));
$this->detections = new DetectionsServiceResource($this, $this->serviceName, 'detections', json_decode('{"methods": {"list": {"parameters": {"q": {"repeated": true, "required": true, "type": "string", "location": "query"}}, "id": "language.detections.list", "httpMethod": "GET", "path": "v2/detect", "response": {"$ref": "DetectionsListResponse"}}}}', true));
$this->translations = new TranslationsServiceResource($this, $this->serviceName, 'translations', json_decode('{"methods": {"list": {"parameters": {"q": {"repeated": true, "required": true, "type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "cid": {"repeated": true, "type": "string", "location": "query"}, "target": {"required": true, "type": "string", "location": "query"}, "format": {"enum": ["html", "text"], "type": "string", "location": "query"}}, "id": "language.translations.list", "httpMethod": "GET", "path": "v2", "response": {"$ref": "TranslationsListResponse"}}}}', true));
}
}
class DetectionsListResponse extends apiModel {
protected $__detectionsType = 'DetectionsResourceItems';
protected $__detectionsDataType = 'array';
public $detections;
public function setDetections(/* array(DetectionsResourceItems) */ $detections) {
$this->assertIsArray($detections, 'DetectionsResourceItems', __METHOD__);
$this->detections = $detections;
}
public function getDetections() {
return $this->detections;
}
}
class DetectionsResource extends apiModel {
}
class DetectionsResourceItems extends apiModel {
public $isReliable;
public $confidence;
public $language;
public function setIsReliable($isReliable) {
$this->isReliable = $isReliable;
}
public function getIsReliable() {
return $this->isReliable;
}
public function setConfidence($confidence) {
$this->confidence = $confidence;
}
public function getConfidence() {
return $this->confidence;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
}
class LanguagesListResponse extends apiModel {
protected $__languagesType = 'LanguagesResource';
protected $__languagesDataType = 'array';
public $languages;
public function setLanguages(/* array(LanguagesResource) */ $languages) {
$this->assertIsArray($languages, 'LanguagesResource', __METHOD__);
$this->languages = $languages;
}
public function getLanguages() {
return $this->languages;
}
}
class LanguagesResource extends apiModel {
public $name;
public $language;
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
}
class TranslationsListResponse extends apiModel {
protected $__translationsType = 'TranslationsResource';
protected $__translationsDataType = 'array';
public $translations;
public function setTranslations(/* array(TranslationsResource) */ $translations) {
$this->assertIsArray($translations, 'TranslationsResource', __METHOD__);
$this->translations = $translations;
}
public function getTranslations() {
return $this->translations;
}
}
class TranslationsResource extends apiModel {
public $detectedSourceLanguage;
public $translatedText;
public function setDetectedSourceLanguage($detectedSourceLanguage) {
$this->detectedSourceLanguage = $detectedSourceLanguage;
}
public function getDetectedSourceLanguage() {
return $this->detectedSourceLanguage;
}
public function setTranslatedText($translatedText) {
$this->translatedText = $translatedText;
}
public function getTranslatedText() {
return $this->translatedText;
}
}

View File

@ -0,0 +1,332 @@
<?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 "url" collection of methods.
* Typical usage is:
* <code>
* $urlshortenerService = new apiUrlshortenerService(...);
* $url = $urlshortenerService->url;
* </code>
*/
class UrlServiceResource extends apiServiceResource {
/**
* Creates a new short URL. (url.insert)
*
* @param Url $postBody
* @return Url
*/
public function insert(Url $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Url($data);
} else {
return $data;
}
}
/**
* Retrieves a list of URLs shortened by a user. (url.list)
*
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string start-token Token for requesting successive pages of results.
* @opt_param string projection Additional information to return.
* @return UrlHistory
*/
public function listUrl($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new UrlHistory($data);
} else {
return $data;
}
}
/**
* Expands a short URL or gets creation time and analytics. (url.get)
*
* @param string $shortUrl The short URL, including the protocol.
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string projection Additional information to return.
* @return Url
*/
public function get($shortUrl, $optParams = array()) {
$params = array('shortUrl' => $shortUrl);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Url($data);
} else {
return $data;
}
}
}
/**
* Service definition for Urlshortener (v1).
*
* <p>
* Lets you create, inspect, and manage goo.gl short URLs
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/urlshortener/v1/getting_started.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class apiUrlshortenerService extends apiService {
public $url;
/**
* Constructs the internal representation of the Urlshortener service.
*
* @param apiClient apiClient
*/
public function __construct(apiClient $apiClient) {
$this->rpcPath = '/rpc';
$this->restBasePath = '/urlshortener/v1/';
$this->version = 'v1';
$this->serviceName = 'urlshortener';
$apiClient->addService($this->serviceName, $this->version);
$this->url = new UrlServiceResource($this, $this->serviceName, 'url', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/urlshortener"], "request": {"$ref": "Url"}, "response": {"$ref": "Url"}, "httpMethod": "POST", "path": "url", "id": "urlshortener.url.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/urlshortener"], "parameters": {"start-token": {"type": "string", "location": "query"}, "projection": {"enum": ["ANALYTICS_CLICKS", "FULL"], "type": "string", "location": "query"}}, "response": {"$ref": "UrlHistory"}, "httpMethod": "GET", "path": "url/history", "id": "urlshortener.url.list"}, "get": {"parameters": {"shortUrl": {"required": true, "type": "string", "location": "query"}, "projection": {"enum": ["ANALYTICS_CLICKS", "ANALYTICS_TOP_STRINGS", "FULL"], "type": "string", "location": "query"}}, "id": "urlshortener.url.get", "httpMethod": "GET", "path": "url", "response": {"$ref": "Url"}}}}', true));
}
}
class AnalyticsSnapshot extends apiModel {
public $shortUrlClicks;
protected $__countriesType = 'StringCount';
protected $__countriesDataType = 'array';
public $countries;
protected $__platformsType = 'StringCount';
protected $__platformsDataType = 'array';
public $platforms;
protected $__browsersType = 'StringCount';
protected $__browsersDataType = 'array';
public $browsers;
protected $__referrersType = 'StringCount';
protected $__referrersDataType = 'array';
public $referrers;
public $longUrlClicks;
public function setShortUrlClicks($shortUrlClicks) {
$this->shortUrlClicks = $shortUrlClicks;
}
public function getShortUrlClicks() {
return $this->shortUrlClicks;
}
public function setCountries(/* array(StringCount) */ $countries) {
$this->assertIsArray($countries, 'StringCount', __METHOD__);
$this->countries = $countries;
}
public function getCountries() {
return $this->countries;
}
public function setPlatforms(/* array(StringCount) */ $platforms) {
$this->assertIsArray($platforms, 'StringCount', __METHOD__);
$this->platforms = $platforms;
}
public function getPlatforms() {
return $this->platforms;
}
public function setBrowsers(/* array(StringCount) */ $browsers) {
$this->assertIsArray($browsers, 'StringCount', __METHOD__);
$this->browsers = $browsers;
}
public function getBrowsers() {
return $this->browsers;
}
public function setReferrers(/* array(StringCount) */ $referrers) {
$this->assertIsArray($referrers, 'StringCount', __METHOD__);
$this->referrers = $referrers;
}
public function getReferrers() {
return $this->referrers;
}
public function setLongUrlClicks($longUrlClicks) {
$this->longUrlClicks = $longUrlClicks;
}
public function getLongUrlClicks() {
return $this->longUrlClicks;
}
}
class AnalyticsSummary extends apiModel {
protected $__weekType = 'AnalyticsSnapshot';
protected $__weekDataType = '';
public $week;
protected $__allTimeType = 'AnalyticsSnapshot';
protected $__allTimeDataType = '';
public $allTime;
protected $__twoHoursType = 'AnalyticsSnapshot';
protected $__twoHoursDataType = '';
public $twoHours;
protected $__dayType = 'AnalyticsSnapshot';
protected $__dayDataType = '';
public $day;
protected $__monthType = 'AnalyticsSnapshot';
protected $__monthDataType = '';
public $month;
public function setWeek(AnalyticsSnapshot $week) {
$this->week = $week;
}
public function getWeek() {
return $this->week;
}
public function setAllTime(AnalyticsSnapshot $allTime) {
$this->allTime = $allTime;
}
public function getAllTime() {
return $this->allTime;
}
public function setTwoHours(AnalyticsSnapshot $twoHours) {
$this->twoHours = $twoHours;
}
public function getTwoHours() {
return $this->twoHours;
}
public function setDay(AnalyticsSnapshot $day) {
$this->day = $day;
}
public function getDay() {
return $this->day;
}
public function setMonth(AnalyticsSnapshot $month) {
$this->month = $month;
}
public function getMonth() {
return $this->month;
}
}
class StringCount extends apiModel {
public $count;
public $id;
public function setCount($count) {
$this->count = $count;
}
public function getCount() {
return $this->count;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Url extends apiModel {
public $status;
public $kind;
public $created;
protected $__analyticsType = 'AnalyticsSummary';
protected $__analyticsDataType = '';
public $analytics;
public $longUrl;
public $id;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setAnalytics(AnalyticsSummary $analytics) {
$this->analytics = $analytics;
}
public function getAnalytics() {
return $this->analytics;
}
public function setLongUrl($longUrl) {
$this->longUrl = $longUrl;
}
public function getLongUrl() {
return $this->longUrl;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class UrlHistory extends apiModel {
public $nextPageToken;
protected $__itemsType = 'Url';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $itemsPerPage;
public $totalItems;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Url) */ $items) {
$this->assertIsArray($items, 'Url', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItemsPerPage($itemsPerPage) {
$this->itemsPerPage = $itemsPerPage;
}
public function getItemsPerPage() {
return $this->itemsPerPage;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
}

View File

@ -0,0 +1,138 @@
<?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 "webfonts" collection of methods.
* Typical usage is:
* <code>
* $webfontsService = new apiWebfontsService(...);
* $webfonts = $webfontsService->webfonts;
* </code>
*/
class WebfontsServiceResource extends apiServiceResource {
/**
* Retrieves the list of fonts currently served by the Google Web Fonts Developer API
* (webfonts.list)
*
* @param array $optParams Optional parameters. Valid optional parameters are listed below.
*
* @opt_param string sort Enables sorting of the list
* @return WebfontList
*/
public function listWebfonts($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new WebfontList($data);
} else {
return $data;
}
}
}
/**
* Service definition for Webfonts (v1).
*
* <p>
* The Google Web Fonts Developer API.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/webfonts/docs/developer_api.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class apiWebfontsService extends apiService {
public $webfonts;
/**
* Constructs the internal representation of the Webfonts service.
*
* @param apiClient apiClient
*/
public function __construct(apiClient $apiClient) {
$this->rpcPath = '/rpc';
$this->restBasePath = '/webfonts/v1/';
$this->version = 'v1';
$this->serviceName = 'webfonts';
$apiClient->addService($this->serviceName, $this->version);
$this->webfonts = new WebfontsServiceResource($this, $this->serviceName, 'webfonts', json_decode('{"methods": {"list": {"parameters": {"sort": {"enum": ["alpha", "date", "popularity", "style", "trending"], "type": "string", "location": "query"}}, "id": "webfonts.webfonts.list", "httpMethod": "GET", "path": "webfonts", "response": {"$ref": "WebfontList"}}}}', true));
}
}
class Webfont extends apiModel {
public $kind;
public $variants;
public $subsets;
public $family;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setVariants($variants) {
$this->variants = $variants;
}
public function getVariants() {
return $this->variants;
}
public function setSubsets($subsets) {
$this->subsets = $subsets;
}
public function getSubsets() {
return $this->subsets;
}
public function setFamily($family) {
$this->family = $family;
}
public function getFamily() {
return $this->family;
}
}
class WebfontList extends apiModel {
protected $__itemsType = 'Webfont';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Webfont) */ $items) {
$this->assertIsArray($items, 'Webfont', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}