added google api php client

This commit is contained in:
Steffen Vogel 2012-11-18 14:21:09 +01:00
parent d8b4da8c73
commit 69c047da13
134 changed files with 86065 additions and 0 deletions

View file

@ -0,0 +1,17 @@
K 25
svn:wc:ra_dav:version-url
V 27
/svn/!svn/ver/508/trunk/src
END
Google_Client.php
K 25
svn:wc:ra_dav:version-url
V 45
/svn/!svn/ver/493/trunk/src/Google_Client.php
END
config.php
K 25
svn:wc:ra_dav:version-url
V 38
/svn/!svn/ver/474/trunk/src/config.php
END

114
google-api/.svn/entries Normal file
View file

@ -0,0 +1,114 @@
10
dir
508
http://google-api-php-client.googlecode.com/svn/trunk/src
http://google-api-php-client.googlecode.com/svn
2012-10-31T19:28:28.038275Z
508
chirags@google.com
6c5fc399-1a2c-022f-82ce-feb0d0b4916c
contrib
dir
service
dir
Google_Client.php
file
2012-11-08T10:43:28.000000Z
7b85279df4c0d845415c97a579df614e
2012-09-11T20:15:17.252315Z
493
chirags@google.com
13484
auth
dir
external
dir
cache
dir
io
dir
config.php
file
2012-11-08T10:43:28.000000Z
e817a5320f789ffafd64a85c481fdfa5
2012-08-03T00:04:28.862550Z
474
chirags@google.com
3281

View file

@ -0,0 +1,453 @@
<?php
/*
* Copyright 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.
*/
// Check for the required json and curl extensions, the Google APIs PHP Client
// won't function without them.
if (! function_exists('curl_init')) {
throw new Exception('Google PHP API Client requires the CURL PHP extension');
}
if (! function_exists('json_decode')) {
throw new Exception('Google PHP API Client requires the JSON PHP extension');
}
if (! function_exists('http_build_query')) {
throw new Exception('Google PHP API Client requires http_build_query()');
}
if (! ini_get('date.timezone') && function_exists('date_default_timezone_set')) {
date_default_timezone_set('UTC');
}
// hack around with the include paths a bit so the library 'just works'
set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());
require_once "config.php";
// If a local configuration file is found, merge it's values with the default configuration
if (file_exists(dirname(__FILE__) . '/local_config.php')) {
$defaultConfig = $apiConfig;
require_once (dirname(__FILE__) . '/local_config.php');
$apiConfig = array_merge($defaultConfig, $apiConfig);
}
// Include the top level classes, they each include their own dependencies
require_once 'service/Google_Model.php';
require_once 'service/Google_Service.php';
require_once 'service/Google_ServiceResource.php';
require_once 'auth/Google_AssertionCredentials.php';
require_once 'auth/Google_Signer.php';
require_once 'auth/Google_P12Signer.php';
require_once 'service/Google_BatchRequest.php';
require_once 'external/URITemplateParser.php';
require_once 'auth/Google_Auth.php';
require_once 'cache/Google_Cache.php';
require_once 'io/Google_IO.php';
require_once('service/Google_MediaFileUpload.php');
/**
* The Google API Client
* http://code.google.com/p/google-api-php-client/
*
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*/
class Google_Client {
/**
* @static
* @var Google_Auth $auth
*/
static $auth;
/**
* @static
* @var Google_IO $io
*/
static $io;
/**
* @static
* @var Google_Cache $cache
*/
static $cache;
/**
* @static
* @var boolean $useBatch
*/
static $useBatch = false;
/** @var array $scopes */
protected $scopes = array();
/** @var bool $useObjects */
protected $useObjects = false;
// definitions of services that are discovered.
protected $services = array();
// Used to track authenticated state, can't discover services after doing authenticate()
private $authenticated = false;
public function __construct($config = array()) {
global $apiConfig;
$apiConfig = array_merge($apiConfig, $config);
self::$cache = new $apiConfig['cacheClass']();
self::$auth = new $apiConfig['authClass']();
self::$io = new $apiConfig['ioClass']();
}
/**
* Add a service
*/
public function addService($service, $version = false) {
global $apiConfig;
if ($this->authenticated) {
throw new Google_Exception('Cant add services after having authenticated');
}
$this->services[$service] = array();
if (isset($apiConfig['services'][$service])) {
// Merge the service descriptor with the default values
$this->services[$service] = array_merge($this->services[$service], $apiConfig['services'][$service]);
}
}
public function authenticate($code = null) {
$service = $this->prepareService();
$this->authenticated = true;
return self::$auth->authenticate($service, $code);
}
/**
* @return array
* @visible For Testing
*/
public function prepareService() {
$service = array();
$scopes = array();
if ($this->scopes) {
$scopes = $this->scopes;
} else {
foreach ($this->services as $key => $val) {
if (isset($val['scope'])) {
if (is_array($val['scope'])) {
$scopes = array_merge($val['scope'], $scopes);
} else {
$scopes[] = $val['scope'];
}
} else {
$scopes[] = 'https://www.googleapis.com/auth/' . $key;
}
unset($val['discoveryURI']);
unset($val['scope']);
$service = array_merge($service, $val);
}
}
$service['scope'] = implode(' ', $scopes);
return $service;
}
/**
* Set the OAuth 2.0 access token using the string that resulted from calling authenticate()
* or Google_Client#getAccessToken().
* @param string $accessToken JSON encoded string containing in the following format:
* {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer",
* "expires_in":3600, "id_token":"TOKEN", "created":1320790426}
*/
public function setAccessToken($accessToken) {
if ($accessToken == null || 'null' == $accessToken) {
$accessToken = null;
}
self::$auth->setAccessToken($accessToken);
}
/**
* Set the type of Auth class the client should use.
* @param string $authClassName
*/
public function setAuthClass($authClassName) {
self::$auth = new $authClassName();
}
/**
* Construct the OAuth 2.0 authorization request URI.
* @return string
*/
public function createAuthUrl() {
$service = $this->prepareService();
return self::$auth->createAuthUrl($service['scope']);
}
/**
* Get the OAuth 2.0 access token.
* @return string $accessToken JSON encoded string in the following format:
* {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer",
* "expires_in":3600,"id_token":"TOKEN", "created":1320790426}
*/
public function getAccessToken() {
$token = self::$auth->getAccessToken();
return (null == $token || 'null' == $token) ? null : $token;
}
/**
* Returns if the access_token is expired.
* @return bool Returns True if the access_token is expired.
*/
public function isAccessTokenExpired() {
return self::$auth->isAccessTokenExpired();
}
/**
* Set the developer key to use, these are obtained through the API Console.
* @see http://code.google.com/apis/console-help/#generatingdevkeys
* @param string $developerKey
*/
public function setDeveloperKey($developerKey) {
self::$auth->setDeveloperKey($developerKey);
}
/**
* Set OAuth 2.0 "state" parameter to achieve per-request customization.
* @see http://tools.ietf.org/html/draft-ietf-oauth-v2-22#section-3.1.2.2
* @param string $state
*/
public function setState($state) {
self::$auth->setState($state);
}
/**
* @param string $accessType Possible values for access_type include:
* {@code "offline"} to request offline access from the user. (This is the default value)
* {@code "online"} to request online access from the user.
*/
public function setAccessType($accessType) {
self::$auth->setAccessType($accessType);
}
/**
* @param string $approvalPrompt Possible values for approval_prompt include:
* {@code "force"} to force the approval UI to appear. (This is the default value)
* {@code "auto"} to request auto-approval when possible.
*/
public function setApprovalPrompt($approvalPrompt) {
self::$auth->setApprovalPrompt($approvalPrompt);
}
/**
* Set the application name, this is included in the User-Agent HTTP header.
* @param string $applicationName
*/
public function setApplicationName($applicationName) {
global $apiConfig;
$apiConfig['application_name'] = $applicationName;
}
/**
* Set the OAuth 2.0 Client ID.
* @param string $clientId
*/
public function setClientId($clientId) {
global $apiConfig;
$apiConfig['oauth2_client_id'] = $clientId;
self::$auth->clientId = $clientId;
}
/**
* Get the OAuth 2.0 Client ID.
*/
public function getClientId() {
return self::$auth->clientId;
}
/**
* Set the OAuth 2.0 Client Secret.
* @param string $clientSecret
*/
public function setClientSecret($clientSecret) {
global $apiConfig;
$apiConfig['oauth2_client_secret'] = $clientSecret;
self::$auth->clientSecret = $clientSecret;
}
/**
* Get the OAuth 2.0 Client Secret.
*/
public function getClientSecret() {
return self::$auth->clientSecret;
}
/**
* Set the OAuth 2.0 Redirect URI.
* @param string $redirectUri
*/
public function setRedirectUri($redirectUri) {
global $apiConfig;
$apiConfig['oauth2_redirect_uri'] = $redirectUri;
self::$auth->redirectUri = $redirectUri;
}
/**
* Get the OAuth 2.0 Redirect URI.
*/
public function getRedirectUri() {
return self::$auth->redirectUri;
}
/**
* Fetches a fresh OAuth 2.0 access token with the given refresh token.
* @param string $refreshToken
* @return void
*/
public function refreshToken($refreshToken) {
self::$auth->refreshToken($refreshToken);
}
/**
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
* token, if a token isn't provided.
* @throws Google_AuthException
* @param string|null $token The token (access token or a refresh token) that should be revoked.
* @return boolean Returns True if the revocation was successful, otherwise False.
*/
public function revokeToken($token = null) {
self::$auth->revokeToken($token);
}
/**
* Verify an id_token. This method will verify the current id_token, if one
* isn't provided.
* @throws Google_AuthException
* @param string|null $token The token (id_token) that should be verified.
* @return Google_LoginTicket Returns an apiLoginTicket if the verification was
* successful.
*/
public function verifyIdToken($token = null) {
return self::$auth->verifyIdToken($token);
}
/**
* @param Google_AssertionCredentials $creds
* @return void
*/
public function setAssertionCredentials(Google_AssertionCredentials $creds) {
self::$auth->setAssertionCredentials($creds);
}
/**
* This function allows you to overrule the automatically generated scopes,
* so that you can ask for more or less permission in the auth flow
* Set this before you call authenticate() though!
* @param array $scopes, ie: array('https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/moderator')
*/
public function setScopes($scopes) {
$this->scopes = is_string($scopes) ? explode(" ", $scopes) : $scopes;
}
/**
* Declare if objects should be returned by the api service classes.
*
* @param boolean $useObjects True if objects should be returned by the service classes.
* False if associative arrays should be returned (default behavior).
* @experimental
*/
public function setUseObjects($useObjects) {
global $apiConfig;
$apiConfig['use_objects'] = $useObjects;
}
/**
* Declare if objects should be returned by the api service classes.
*
* @param boolean $useBatch True if the experimental batch support should
* be enabled. Defaults to False.
* @experimental
*/
public function setUseBatch($useBatch) {
self::$useBatch = $useBatch;
}
/**
* @static
* @return Google_Auth the implementation of apiAuth.
*/
public static function getAuth() {
return Google_Client::$auth;
}
/**
* @static
* @return Google_IO the implementation of apiIo.
*/
public static function getIo() {
return Google_Client::$io;
}
/**
* @return Google_Cache the implementation of apiCache.
*/
public function getCache() {
return Google_Client::$cache;
}
}
// Exceptions that the Google PHP API Library can throw
class Google_Exception extends Exception {}
class Google_AuthException extends Google_Exception {}
class Google_CacheException extends Google_Exception {}
class Google_IOException extends Google_Exception {}
class Google_ServiceException extends Google_Exception {
/**
* Optional list of errors returned in a JSON body of an HTTP error response.
*/
protected $errors = array();
/**
* Override default constructor to add ability to set $errors.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
* @param [{string, string}] errors List of errors returned in an HTTP
* response. Defaults to [].
*/
public function __construct($message, $code = 0, Exception $previous = null,
$errors = array()) {
if(version_compare(PHP_VERSION, '5.3.0') >= 0) {
parent::__construct($message, $code, $previous);
} else {
parent::__construct($message, $code);
}
$this->errors = $errors;
}
/**
* An example of the possible errors returned.
*
* {
* "domain": "global",
* "reason": "authError",
* "message": "Invalid Credentials",
* "locationType": "header",
* "location": "Authorization",
* }
*
* @return [{string, string}] List of errors return in an HTTP response or [].
*/
public function getErrors() {
return $this->errors;
}
}

View file

@ -0,0 +1,81 @@
<?php
/*
* Copyright 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.
*/
global $apiConfig;
$apiConfig = array(
// True if objects should be returned by the service classes.
// False if associative arrays should be returned (default behavior).
'use_objects' => false,
// The application_name is included in the User-Agent HTTP header.
'application_name' => '',
// OAuth2 Settings, you can get these keys at https://code.google.com/apis/console
'oauth2_client_id' => '',
'oauth2_client_secret' => '',
'oauth2_redirect_uri' => '',
// The developer key, you get this at https://code.google.com/apis/console
'developer_key' => '',
// Site name to show in the Google's OAuth 1 authentication screen.
'site_name' => 'www.example.org',
// Which Authentication, Storage and HTTP IO classes to use.
'authClass' => 'Google_OAuth2',
'ioClass' => 'Google_CurlIO',
'cacheClass' => 'Google_FileCache',
// Don't change these unless you're working against a special development or testing environment.
'basePath' => 'https://www.googleapis.com',
// IO Class dependent configuration, you only have to configure the values
// for the class that was configured as the ioClass above
'ioFileCache_directory' =>
(function_exists('sys_get_temp_dir') ?
sys_get_temp_dir() . '/Google_Client' :
'/tmp/Google_Client'),
// Definition of service specific values like scopes, oauth token URLs, etc
'services' => array(
'analytics' => array('scope' => 'https://www.googleapis.com/auth/analytics.readonly'),
'calendar' => array(
'scope' => array(
"https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/calendar.readonly",
)
),
'books' => array('scope' => 'https://www.googleapis.com/auth/books'),
'latitude' => array(
'scope' => array(
'https://www.googleapis.com/auth/latitude.all.best',
'https://www.googleapis.com/auth/latitude.all.city',
)
),
'moderator' => array('scope' => 'https://www.googleapis.com/auth/moderator'),
'oauth2' => array(
'scope' => array(
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/userinfo.email',
)
),
'plus' => array('scope' => 'https://www.googleapis.com/auth/plus.me'),
'siteVerification' => array('scope' => 'https://www.googleapis.com/auth/siteverification'),
'tasks' => array('scope' => 'https://www.googleapis.com/auth/tasks'),
'urlshortener' => array('scope' => 'https://www.googleapis.com/auth/urlshortener')
)
);

View file

@ -0,0 +1,453 @@
<?php
/*
* Copyright 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.
*/
// Check for the required json and curl extensions, the Google APIs PHP Client
// won't function without them.
if (! function_exists('curl_init')) {
throw new Exception('Google PHP API Client requires the CURL PHP extension');
}
if (! function_exists('json_decode')) {
throw new Exception('Google PHP API Client requires the JSON PHP extension');
}
if (! function_exists('http_build_query')) {
throw new Exception('Google PHP API Client requires http_build_query()');
}
if (! ini_get('date.timezone') && function_exists('date_default_timezone_set')) {
date_default_timezone_set('UTC');
}
// hack around with the include paths a bit so the library 'just works'
set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());
require_once "config.php";
// If a local configuration file is found, merge it's values with the default configuration
if (file_exists(dirname(__FILE__) . '/local_config.php')) {
$defaultConfig = $apiConfig;
require_once (dirname(__FILE__) . '/local_config.php');
$apiConfig = array_merge($defaultConfig, $apiConfig);
}
// Include the top level classes, they each include their own dependencies
require_once 'service/Google_Model.php';
require_once 'service/Google_Service.php';
require_once 'service/Google_ServiceResource.php';
require_once 'auth/Google_AssertionCredentials.php';
require_once 'auth/Google_Signer.php';
require_once 'auth/Google_P12Signer.php';
require_once 'service/Google_BatchRequest.php';
require_once 'external/URITemplateParser.php';
require_once 'auth/Google_Auth.php';
require_once 'cache/Google_Cache.php';
require_once 'io/Google_IO.php';
require_once('service/Google_MediaFileUpload.php');
/**
* The Google API Client
* http://code.google.com/p/google-api-php-client/
*
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*/
class Google_Client {
/**
* @static
* @var Google_Auth $auth
*/
static $auth;
/**
* @static
* @var Google_IO $io
*/
static $io;
/**
* @static
* @var Google_Cache $cache
*/
static $cache;
/**
* @static
* @var boolean $useBatch
*/
static $useBatch = false;
/** @var array $scopes */
protected $scopes = array();
/** @var bool $useObjects */
protected $useObjects = false;
// definitions of services that are discovered.
protected $services = array();
// Used to track authenticated state, can't discover services after doing authenticate()
private $authenticated = false;
public function __construct($config = array()) {
global $apiConfig;
$apiConfig = array_merge($apiConfig, $config);
self::$cache = new $apiConfig['cacheClass']();
self::$auth = new $apiConfig['authClass']();
self::$io = new $apiConfig['ioClass']();
}
/**
* Add a service
*/
public function addService($service, $version = false) {
global $apiConfig;
if ($this->authenticated) {
throw new Google_Exception('Cant add services after having authenticated');
}
$this->services[$service] = array();
if (isset($apiConfig['services'][$service])) {
// Merge the service descriptor with the default values
$this->services[$service] = array_merge($this->services[$service], $apiConfig['services'][$service]);
}
}
public function authenticate($code = null) {
$service = $this->prepareService();
$this->authenticated = true;
return self::$auth->authenticate($service, $code);
}
/**
* @return array
* @visible For Testing
*/
public function prepareService() {
$service = array();
$scopes = array();
if ($this->scopes) {
$scopes = $this->scopes;
} else {
foreach ($this->services as $key => $val) {
if (isset($val['scope'])) {
if (is_array($val['scope'])) {
$scopes = array_merge($val['scope'], $scopes);
} else {
$scopes[] = $val['scope'];
}
} else {
$scopes[] = 'https://www.googleapis.com/auth/' . $key;
}
unset($val['discoveryURI']);
unset($val['scope']);
$service = array_merge($service, $val);
}
}
$service['scope'] = implode(' ', $scopes);
return $service;
}
/**
* Set the OAuth 2.0 access token using the string that resulted from calling authenticate()
* or Google_Client#getAccessToken().
* @param string $accessToken JSON encoded string containing in the following format:
* {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer",
* "expires_in":3600, "id_token":"TOKEN", "created":1320790426}
*/
public function setAccessToken($accessToken) {
if ($accessToken == null || 'null' == $accessToken) {
$accessToken = null;
}
self::$auth->setAccessToken($accessToken);
}
/**
* Set the type of Auth class the client should use.
* @param string $authClassName
*/
public function setAuthClass($authClassName) {
self::$auth = new $authClassName();
}
/**
* Construct the OAuth 2.0 authorization request URI.
* @return string
*/
public function createAuthUrl() {
$service = $this->prepareService();
return self::$auth->createAuthUrl($service['scope']);
}
/**
* Get the OAuth 2.0 access token.
* @return string $accessToken JSON encoded string in the following format:
* {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer",
* "expires_in":3600,"id_token":"TOKEN", "created":1320790426}
*/
public function getAccessToken() {
$token = self::$auth->getAccessToken();
return (null == $token || 'null' == $token) ? null : $token;
}
/**
* Returns if the access_token is expired.
* @return bool Returns True if the access_token is expired.
*/
public function isAccessTokenExpired() {
return self::$auth->isAccessTokenExpired();
}
/**
* Set the developer key to use, these are obtained through the API Console.
* @see http://code.google.com/apis/console-help/#generatingdevkeys
* @param string $developerKey
*/
public function setDeveloperKey($developerKey) {
self::$auth->setDeveloperKey($developerKey);
}
/**
* Set OAuth 2.0 "state" parameter to achieve per-request customization.
* @see http://tools.ietf.org/html/draft-ietf-oauth-v2-22#section-3.1.2.2
* @param string $state
*/
public function setState($state) {
self::$auth->setState($state);
}
/**
* @param string $accessType Possible values for access_type include:
* {@code "offline"} to request offline access from the user. (This is the default value)
* {@code "online"} to request online access from the user.
*/
public function setAccessType($accessType) {
self::$auth->setAccessType($accessType);
}
/**
* @param string $approvalPrompt Possible values for approval_prompt include:
* {@code "force"} to force the approval UI to appear. (This is the default value)
* {@code "auto"} to request auto-approval when possible.
*/
public function setApprovalPrompt($approvalPrompt) {
self::$auth->setApprovalPrompt($approvalPrompt);
}
/**
* Set the application name, this is included in the User-Agent HTTP header.
* @param string $applicationName
*/
public function setApplicationName($applicationName) {
global $apiConfig;
$apiConfig['application_name'] = $applicationName;
}
/**
* Set the OAuth 2.0 Client ID.
* @param string $clientId
*/
public function setClientId($clientId) {
global $apiConfig;
$apiConfig['oauth2_client_id'] = $clientId;
self::$auth->clientId = $clientId;
}
/**
* Get the OAuth 2.0 Client ID.
*/
public function getClientId() {
return self::$auth->clientId;
}
/**
* Set the OAuth 2.0 Client Secret.
* @param string $clientSecret
*/
public function setClientSecret($clientSecret) {
global $apiConfig;
$apiConfig['oauth2_client_secret'] = $clientSecret;
self::$auth->clientSecret = $clientSecret;
}
/**
* Get the OAuth 2.0 Client Secret.
*/
public function getClientSecret() {
return self::$auth->clientSecret;
}
/**
* Set the OAuth 2.0 Redirect URI.
* @param string $redirectUri
*/
public function setRedirectUri($redirectUri) {
global $apiConfig;
$apiConfig['oauth2_redirect_uri'] = $redirectUri;
self::$auth->redirectUri = $redirectUri;
}
/**
* Get the OAuth 2.0 Redirect URI.
*/
public function getRedirectUri() {
return self::$auth->redirectUri;
}
/**
* Fetches a fresh OAuth 2.0 access token with the given refresh token.
* @param string $refreshToken
* @return void
*/
public function refreshToken($refreshToken) {
self::$auth->refreshToken($refreshToken);
}
/**
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
* token, if a token isn't provided.
* @throws Google_AuthException
* @param string|null $token The token (access token or a refresh token) that should be revoked.
* @return boolean Returns True if the revocation was successful, otherwise False.
*/
public function revokeToken($token = null) {
self::$auth->revokeToken($token);
}
/**
* Verify an id_token. This method will verify the current id_token, if one
* isn't provided.
* @throws Google_AuthException
* @param string|null $token The token (id_token) that should be verified.
* @return Google_LoginTicket Returns an apiLoginTicket if the verification was
* successful.
*/
public function verifyIdToken($token = null) {
return self::$auth->verifyIdToken($token);
}
/**
* @param Google_AssertionCredentials $creds
* @return void
*/
public function setAssertionCredentials(Google_AssertionCredentials $creds) {
self::$auth->setAssertionCredentials($creds);
}
/**
* This function allows you to overrule the automatically generated scopes,
* so that you can ask for more or less permission in the auth flow
* Set this before you call authenticate() though!
* @param array $scopes, ie: array('https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/moderator')
*/
public function setScopes($scopes) {
$this->scopes = is_string($scopes) ? explode(" ", $scopes) : $scopes;
}
/**
* Declare if objects should be returned by the api service classes.
*
* @param boolean $useObjects True if objects should be returned by the service classes.
* False if associative arrays should be returned (default behavior).
* @experimental
*/
public function setUseObjects($useObjects) {
global $apiConfig;
$apiConfig['use_objects'] = $useObjects;
}
/**
* Declare if objects should be returned by the api service classes.
*
* @param boolean $useBatch True if the experimental batch support should
* be enabled. Defaults to False.
* @experimental
*/
public function setUseBatch($useBatch) {
self::$useBatch = $useBatch;
}
/**
* @static
* @return Google_Auth the implementation of apiAuth.
*/
public static function getAuth() {
return Google_Client::$auth;
}
/**
* @static
* @return Google_IO the implementation of apiIo.
*/
public static function getIo() {
return Google_Client::$io;
}
/**
* @return Google_Cache the implementation of apiCache.
*/
public function getCache() {
return Google_Client::$cache;
}
}
// Exceptions that the Google PHP API Library can throw
class Google_Exception extends Exception {}
class Google_AuthException extends Google_Exception {}
class Google_CacheException extends Google_Exception {}
class Google_IOException extends Google_Exception {}
class Google_ServiceException extends Google_Exception {
/**
* Optional list of errors returned in a JSON body of an HTTP error response.
*/
protected $errors = array();
/**
* Override default constructor to add ability to set $errors.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
* @param [{string, string}] errors List of errors returned in an HTTP
* response. Defaults to [].
*/
public function __construct($message, $code = 0, Exception $previous = null,
$errors = array()) {
if(version_compare(PHP_VERSION, '5.3.0') >= 0) {
parent::__construct($message, $code, $previous);
} else {
parent::__construct($message, $code);
}
$this->errors = $errors;
}
/**
* An example of the possible errors returned.
*
* {
* "domain": "global",
* "reason": "authError",
* "message": "Invalid Credentials",
* "locationType": "header",
* "location": "Authorization",
* }
*
* @return [{string, string}] List of errors return in an HTTP response or [].
*/
public function getErrors() {
return $this->errors;
}
}

View file

@ -0,0 +1,59 @@
K 25
svn:wc:ra_dav:version-url
V 32
/svn/!svn/ver/500/trunk/src/auth
END
Google_PemVerifier.php
K 25
svn:wc:ra_dav:version-url
V 55
/svn/!svn/ver/487/trunk/src/auth/Google_PemVerifier.php
END
Google_AuthNone.php
K 25
svn:wc:ra_dav:version-url
V 52
/svn/!svn/ver/474/trunk/src/auth/Google_AuthNone.php
END
Google_Auth.php
K 25
svn:wc:ra_dav:version-url
V 48
/svn/!svn/ver/474/trunk/src/auth/Google_Auth.php
END
Google_OAuth2.php
K 25
svn:wc:ra_dav:version-url
V 50
/svn/!svn/ver/487/trunk/src/auth/Google_OAuth2.php
END
Google_AssertionCredentials.php
K 25
svn:wc:ra_dav:version-url
V 64
/svn/!svn/ver/486/trunk/src/auth/Google_AssertionCredentials.php
END
Google_Signer.php
K 25
svn:wc:ra_dav:version-url
V 50
/svn/!svn/ver/474/trunk/src/auth/Google_Signer.php
END
Google_P12Signer.php
K 25
svn:wc:ra_dav:version-url
V 53
/svn/!svn/ver/500/trunk/src/auth/Google_P12Signer.php
END
Google_Verifier.php
K 25
svn:wc:ra_dav:version-url
V 52
/svn/!svn/ver/474/trunk/src/auth/Google_Verifier.php
END
Google_LoginTicket.php
K 25
svn:wc:ra_dav:version-url
V 55
/svn/!svn/ver/474/trunk/src/auth/Google_LoginTicket.php
END

View file

@ -0,0 +1,334 @@
10
dir
508
http://google-api-php-client.googlecode.com/svn/trunk/src/auth
http://google-api-php-client.googlecode.com/svn
2012-10-09T01:06:40.112109Z
500
chirags@google.com
6c5fc399-1a2c-022f-82ce-feb0d0b4916c
Google_PemVerifier.php
file
2012-11-08T10:43:28.000000Z
e9fb745bc98981953a270e0374e77e58
2012-08-29T20:36:30.418283Z
487
chirags@google.com
1930
Google_AuthNone.php
file
2012-11-08T10:43:28.000000Z
093b237c59e2e085a97e664c0ce88ebe
2012-08-03T00:04:28.862550Z
474
chirags@google.com
1671
Google_Auth.php
file
2012-11-08T10:43:28.000000Z
15873dc9c390eadbd5da2c0297062d7c
2012-08-03T00:04:28.862550Z
474
chirags@google.com
1242
Google_OAuth2.php
file
2012-11-08T10:43:28.000000Z
39f54796674f476271ce8d5c05c9ec71
2012-08-29T20:36:30.418283Z
487
chirags@google.com
14548
Google_AssertionCredentials.php
file
2012-11-08T10:43:28.000000Z
19ec1a0bc3ffdeb07083e225f3e0ac7b
2012-08-29T18:59:29.771091Z
486
chirags@google.com
2844
Google_Signer.php
file
2012-11-08T10:43:28.000000Z
b89eb963b836860aa622c2111915e5ac
2012-08-03T00:04:28.862550Z
474
chirags@google.com
849
Google_P12Signer.php
file
2012-11-08T10:43:28.000000Z
e33e570503ed42cf7d25dd6c32d67263
2012-10-09T01:06:40.112109Z
500
chirags@google.com
2295
Google_Verifier.php
file
2012-11-08T10:43:28.000000Z
08c9de305f4824c6d94d7c40bfe7be58
2012-08-03T00:04:28.862550Z
474
chirags@google.com
910
Google_LoginTicket.php
file
2012-11-08T10:43:28.000000Z
4397ba773564c0c73f32ae118c24b5d2
2012-08-03T00:04:28.862550Z
474
chirags@google.com
1816

View file

@ -0,0 +1,95 @@
<?php
/*
* Copyright 2012 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.
*/
/**
* Credentials object used for OAuth 2.0 Signed JWT assertion grants.
*
* @author Chirag Shah <chirags@google.com>
*/
class Google_AssertionCredentials {
const MAX_TOKEN_LIFETIME_SECS = 3600;
public $serviceAccountName;
public $scopes;
public $privateKey;
public $privateKeyPassword;
public $assertionType;
public $prn;
/**
* @param $serviceAccountName
* @param $scopes array List of scopes
* @param $privateKey
* @param string $privateKeyPassword
* @param string $assertionType
* @param bool|string $prn The email address of the user for which the
* application is requesting delegated access.
*/
public function __construct(
$serviceAccountName,
$scopes,
$privateKey,
$privateKeyPassword = 'notasecret',
$assertionType = 'http://oauth.net/grant_type/jwt/1.0/bearer',
$prn = false) {
$this->serviceAccountName = $serviceAccountName;
$this->scopes = is_string($scopes) ? $scopes : implode(' ', $scopes);
$this->privateKey = $privateKey;
$this->privateKeyPassword = $privateKeyPassword;
$this->assertionType = $assertionType;
$this->prn = $prn;
}
public function generateAssertion() {
$now = time();
$jwtParams = array(
'aud' => Google_OAuth2::OAUTH2_TOKEN_URI,
'scope' => $this->scopes,
'iat' => $now,
'exp' => $now + self::MAX_TOKEN_LIFETIME_SECS,
'iss' => $this->serviceAccountName,
);
if ($this->prn !== false) {
$jwtParams['prn'] = $this->prn;
}
return $this->makeSignedJwt($jwtParams);
}
/**
* Creates a signed JWT.
* @param array $payload
* @return string The signed JWT.
*/
private function makeSignedJwt($payload) {
$header = array('typ' => 'JWT', 'alg' => 'RS256');
$segments = array(
Google_Utils::urlSafeB64Encode(json_encode($header)),
Google_Utils::urlSafeB64Encode(json_encode($payload))
);
$signingInput = implode('.', $segments);
$signer = new Google_P12Signer($this->privateKey, $this->privateKeyPassword);
$signature = $signer->sign($signingInput);
$segments[] = Google_Utils::urlSafeB64Encode($signature);
return implode(".", $segments);
}
}

View file

@ -0,0 +1,36 @@
<?php
/*
* Copyright 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 "Google_AuthNone.php";
require_once "Google_OAuth2.php";
/**
* Abstract class for the Authentication in the API client
* @author Chris Chabot <chabotc@google.com>
*
*/
abstract class Google_Auth {
abstract public function authenticate($service);
abstract public function sign(Google_HttpRequest $request);
abstract public function createAuthUrl($scope);
abstract public function getAccessToken();
abstract public function setAccessToken($accessToken);
abstract public function setDeveloperKey($developerKey);
abstract public function refreshToken($refreshToken);
abstract public function revokeToken();
}

View file

@ -0,0 +1,48 @@
<?php
/*
* Copyright 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.
*/
/**
* Do-nothing authentication implementation, use this if you want to make un-authenticated calls
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*/
class Google_AuthNone extends Google_Auth {
public $key = null;
public function __construct() {
global $apiConfig;
if (!empty($apiConfig['developer_key'])) {
$this->setDeveloperKey($apiConfig['developer_key']);
}
}
public function setDeveloperKey($key) {$this->key = $key;}
public function authenticate($service) {/*noop*/}
public function setAccessToken($accessToken) {/* noop*/}
public function getAccessToken() {return null;}
public function createAuthUrl($scope) {return null;}
public function refreshToken($refreshToken) {/* noop*/}
public function revokeToken() {/* noop*/}
public function sign(Google_HttpRequest $request) {
if ($this->key) {
$request->setUrl($request->getUrl() . ((strpos($request->getUrl(), '?') === false) ? '?' : '&')
. 'key='.urlencode($this->key));
}
return $request;
}
}

View file

@ -0,0 +1,63 @@
<?php
/*
* Copyright 2011 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.
*/
/**
* Class to hold information about an authenticated login.
*
* @author Brian Eaton <beaton@google.com>
*/
class Google_LoginTicket {
const USER_ATTR = "id";
// Information from id token envelope.
private $envelope;
// Information from id token payload.
private $payload;
/**
* Creates a user based on the supplied token.
*
* @param string $envelope Header from a verified authentication token.
* @param string $payload Information from a verified authentication token.
*/
public function __construct($envelope, $payload) {
$this->envelope = $envelope;
$this->payload = $payload;
}
/**
* Returns the numeric identifier for the user.
* @throws Google_AuthException
* @return
*/
public function getUserId() {
if (array_key_exists(self::USER_ATTR, $this->payload)) {
return $this->payload[self::USER_ATTR];
}
throw new Google_AuthException("No user_id in token");
}
/**
* Returns attributes from the login ticket. This can contain
* various information about the user session.
* @return array
*/
public function getAttributes() {
return array("envelope" => $this->envelope, "payload" => $this->payload);
}
}

View file

@ -0,0 +1,444 @@
<?php
/*
* Copyright 2008 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 "Google_Verifier.php";
require_once "Google_LoginTicket.php";
require_once "service/Google_Utils.php";
/**
* Authentication class that deals with the OAuth 2 web-server authentication flow
*
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*
*/
class Google_OAuth2 extends Google_Auth {
public $clientId;
public $clientSecret;
public $developerKey;
public $token;
public $redirectUri;
public $state;
public $accessType = 'offline';
public $approvalPrompt = 'force';
/** @var Google_AssertionCredentials $assertionCredentials */
public $assertionCredentials;
const OAUTH2_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke';
const OAUTH2_TOKEN_URI = 'https://accounts.google.com/o/oauth2/token';
const OAUTH2_AUTH_URL = 'https://accounts.google.com/o/oauth2/auth';
const OAUTH2_FEDERATED_SIGNON_CERTS_URL = 'https://www.googleapis.com/oauth2/v1/certs';
const CLOCK_SKEW_SECS = 300; // five minutes in seconds
const AUTH_TOKEN_LIFETIME_SECS = 300; // five minutes in seconds
const MAX_TOKEN_LIFETIME_SECS = 86400; // one day in seconds
/**
* Instantiates the class, but does not initiate the login flow, leaving it
* to the discretion of the caller (which is done by calling authenticate()).
*/
public function __construct() {
global $apiConfig;
if (! empty($apiConfig['developer_key'])) {
$this->developerKey = $apiConfig['developer_key'];
}
if (! empty($apiConfig['oauth2_client_id'])) {
$this->clientId = $apiConfig['oauth2_client_id'];
}
if (! empty($apiConfig['oauth2_client_secret'])) {
$this->clientSecret = $apiConfig['oauth2_client_secret'];
}
if (! empty($apiConfig['oauth2_redirect_uri'])) {
$this->redirectUri = $apiConfig['oauth2_redirect_uri'];
}
if (! empty($apiConfig['oauth2_access_type'])) {
$this->accessType = $apiConfig['oauth2_access_type'];
}
if (! empty($apiConfig['oauth2_approval_prompt'])) {
$this->approvalPrompt = $apiConfig['oauth2_approval_prompt'];
}
}
/**
* @param $service
* @param string|null $code
* @throws Google_AuthException
* @return string
*/
public function authenticate($service, $code = null) {
if (!$code && isset($_GET['code'])) {
$code = $_GET['code'];
}
if ($code) {
// We got here from the redirect from a successful authorization grant, fetch the access token
$request = Google_Client::$io->makeRequest(new Google_HttpRequest(self::OAUTH2_TOKEN_URI, 'POST', array(), array(
'code' => $code,
'grant_type' => 'authorization_code',
'redirect_uri' => $this->redirectUri,
'client_id' => $this->clientId,
'client_secret' => $this->clientSecret
)));
if ($request->getResponseHttpCode() == 200) {
$this->setAccessToken($request->getResponseBody());
$this->token['created'] = time();
return $this->getAccessToken();
} else {
$response = $request->getResponseBody();
$decodedResponse = json_decode($response, true);
if ($decodedResponse != null && $decodedResponse['error']) {
$response = $decodedResponse['error'];
}
throw new Google_AuthException("Error fetching OAuth2 access token, message: '$response'", $request->getResponseHttpCode());
}
}
$authUrl = $this->createAuthUrl($service['scope']);
header('Location: ' . $authUrl);
return true;
}
/**
* Create a URL to obtain user authorization.
* The authorization endpoint allows the user to first
* authenticate, and then grant/deny the access request.
* @param string $scope The scope is expressed as a list of space-delimited strings.
* @return string
*/
public function createAuthUrl($scope) {
$params = array(
'response_type=code',
'redirect_uri=' . urlencode($this->redirectUri),
'client_id=' . urlencode($this->clientId),
'scope=' . urlencode($scope),
'access_type=' . urlencode($this->accessType),
'approval_prompt=' . urlencode($this->approvalPrompt)
);
if (isset($this->state)) {
$params[] = 'state=' . urlencode($this->state);
}
$params = implode('&', $params);
return self::OAUTH2_AUTH_URL . "?$params";
}
/**
* @param string $token
* @throws Google_AuthException
*/
public function setAccessToken($token) {
$token = json_decode($token, true);
if ($token == null) {
throw new Google_AuthException('Could not json decode the token');
}
if (! isset($token['access_token'])) {
throw new Google_AuthException("Invalid token format");
}
$this->token = $token;
}
public function getAccessToken() {
return json_encode($this->token);
}
public function setDeveloperKey($developerKey) {
$this->developerKey = $developerKey;
}
public function setState($state) {
$this->state = $state;
}
public function setAccessType($accessType) {
$this->accessType = $accessType;
}
public function setApprovalPrompt($approvalPrompt) {
$this->approvalPrompt = $approvalPrompt;
}
public function setAssertionCredentials(Google_AssertionCredentials $creds) {
$this->assertionCredentials = $creds;
}
/**
* Include an accessToken in a given apiHttpRequest.
* @param Google_HttpRequest $request
* @return Google_HttpRequest
* @throws Google_AuthException
*/
public function sign(Google_HttpRequest $request) {
// add the developer key to the request before signing it
if ($this->developerKey) {
$requestUrl = $request->getUrl();
$requestUrl .= (strpos($request->getUrl(), '?') === false) ? '?' : '&';
$requestUrl .= 'key=' . urlencode($this->developerKey);
$request->setUrl($requestUrl);
}
// Cannot sign the request without an OAuth access token.
if (null == $this->token && null == $this->assertionCredentials) {
return $request;
}
// Check if the token is set to expire in the next 30 seconds
// (or has already expired).
if ($this->isAccessTokenExpired()) {
if ($this->assertionCredentials) {
$this->refreshTokenWithAssertion();
} else {
if (! array_key_exists('refresh_token', $this->token)) {
throw new Google_AuthException("The OAuth 2.0 access token has expired, "
. "and a refresh token is not available. Refresh tokens are not "
. "returned for responses that were auto-approved.");
}
$this->refreshToken($this->token['refresh_token']);
}
}
// Add the OAuth2 header to the request
$request->setRequestHeaders(
array('Authorization' => 'Bearer ' . $this->token['access_token'])
);
return $request;
}
/**
* Fetches a fresh access token with the given refresh token.
* @param string $refreshToken
* @return void
*/
public function refreshToken($refreshToken) {
$this->refreshTokenRequest(array(
'client_id' => $this->clientId,
'client_secret' => $this->clientSecret,
'refresh_token' => $refreshToken,
'grant_type' => 'refresh_token'
));
}
/**
* Fetches a fresh access token with a given assertion token.
* @param Google_AssertionCredentials $assertionCredentials optional.
* @return void
*/
public function refreshTokenWithAssertion($assertionCredentials = null) {
if (!$assertionCredentials) {
$assertionCredentials = $this->assertionCredentials;
}
$this->refreshTokenRequest(array(
'grant_type' => 'assertion',
'assertion_type' => $assertionCredentials->assertionType,
'assertion' => $assertionCredentials->generateAssertion(),
));
}
private function refreshTokenRequest($params) {
$http = new Google_HttpRequest(self::OAUTH2_TOKEN_URI, 'POST', array(), $params);
$request = Google_Client::$io->makeRequest($http);
$code = $request->getResponseHttpCode();
$body = $request->getResponseBody();
if (200 == $code) {
$token = json_decode($body, true);
if ($token == null) {
throw new Google_AuthException("Could not json decode the access token");
}
if (! isset($token['access_token']) || ! isset($token['expires_in'])) {
throw new Google_AuthException("Invalid token format");
}
$this->token['access_token'] = $token['access_token'];
$this->token['expires_in'] = $token['expires_in'];
$this->token['created'] = time();
} else {
throw new Google_AuthException("Error refreshing the OAuth2 token, message: '$body'", $code);
}
}
/**
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
* token, if a token isn't provided.
* @throws Google_AuthException
* @param string|null $token The token (access token or a refresh token) that should be revoked.
* @return boolean Returns True if the revocation was successful, otherwise False.
*/
public function revokeToken($token = null) {
if (!$token) {
$token = $this->token['access_token'];
}
$request = new Google_HttpRequest(self::OAUTH2_REVOKE_URI, 'POST', array(), "token=$token");
$response = Google_Client::$io->makeRequest($request);
$code = $response->getResponseHttpCode();
if ($code == 200) {
$this->token = null;
return true;
}
return false;
}
/**
* Returns if the access_token is expired.
* @return bool Returns True if the access_token is expired.
*/
public function isAccessTokenExpired() {
if (null == $this->token) {
return true;
}
// If the token is set to expire in the next 30 seconds.
$expired = ($this->token['created']
+ ($this->token['expires_in'] - 30)) < time();
return $expired;
}
// Gets federated sign-on certificates to use for verifying identity tokens.
// Returns certs as array structure, where keys are key ids, and values
// are PEM encoded certificates.
private function getFederatedSignOnCerts() {
// This relies on makeRequest caching certificate responses.
$request = Google_Client::$io->makeRequest(new Google_HttpRequest(
self::OAUTH2_FEDERATED_SIGNON_CERTS_URL));
if ($request->getResponseHttpCode() == 200) {
$certs = json_decode($request->getResponseBody(), true);
if ($certs) {
return $certs;
}
}
throw new Google_AuthException(
"Failed to retrieve verification certificates: '" .
$request->getResponseBody() . "'.",
$request->getResponseHttpCode());
}
/**
* Verifies an id token and returns the authenticated apiLoginTicket.
* Throws an exception if the id token is not valid.
* The audience parameter can be used to control which id tokens are
* accepted. By default, the id token must have been issued to this OAuth2 client.
*
* @param $id_token
* @param $audience
* @return Google_LoginTicket
*/
public function verifyIdToken($id_token = null, $audience = null) {
if (!$id_token) {
$id_token = $this->token['id_token'];
}
$certs = $this->getFederatedSignonCerts();
if (!$audience) {
$audience = $this->clientId;
}
return $this->verifySignedJwtWithCerts($id_token, $certs, $audience);
}
// Verifies the id token, returns the verified token contents.
// Visible for testing.
function verifySignedJwtWithCerts($jwt, $certs, $required_audience) {
$segments = explode(".", $jwt);
if (count($segments) != 3) {
throw new Google_AuthException("Wrong number of segments in token: $jwt");
}
$signed = $segments[0] . "." . $segments[1];
$signature = Google_Utils::urlSafeB64Decode($segments[2]);
// Parse envelope.
$envelope = json_decode(Google_Utils::urlSafeB64Decode($segments[0]), true);
if (!$envelope) {
throw new Google_AuthException("Can't parse token envelope: " . $segments[0]);
}
// Parse token
$json_body = Google_Utils::urlSafeB64Decode($segments[1]);
$payload = json_decode($json_body, true);
if (!$payload) {
throw new Google_AuthException("Can't parse token payload: " . $segments[1]);
}
// Check signature
$verified = false;
foreach ($certs as $keyName => $pem) {
$public_key = new Google_PemVerifier($pem);
if ($public_key->verify($signed, $signature)) {
$verified = true;
break;
}
}
if (!$verified) {
throw new Google_AuthException("Invalid token signature: $jwt");
}
// Check issued-at timestamp
$iat = 0;
if (array_key_exists("iat", $payload)) {
$iat = $payload["iat"];
}
if (!$iat) {
throw new Google_AuthException("No issue time in token: $json_body");
}
$earliest = $iat - self::CLOCK_SKEW_SECS;
// Check expiration timestamp
$now = time();
$exp = 0;
if (array_key_exists("exp", $payload)) {
$exp = $payload["exp"];
}
if (!$exp) {
throw new Google_AuthException("No expiration time in token: $json_body");
}
if ($exp >= $now + self::MAX_TOKEN_LIFETIME_SECS) {
throw new Google_AuthException(
"Expiration time too far in future: $json_body");
}
$latest = $exp + self::CLOCK_SKEW_SECS;
if ($now < $earliest) {
throw new Google_AuthException(
"Token used too early, $now < $earliest: $json_body");
}
if ($now > $latest) {
throw new Google_AuthException(
"Token used too late, $now > $latest: $json_body");
}
// TODO(beaton): check issuer field?
// Check audience
$aud = $payload["aud"];
if ($aud != $required_audience) {
throw new Google_AuthException("Wrong recipient, $aud != $required_audience: $json_body");
}
// All good.
return new Google_LoginTicket($envelope, $payload);
}
}

View file

@ -0,0 +1,70 @@
<?php
/*
* Copyright 2011 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.
*/
/**
* Signs data.
*
* Only used for testing.
*
* @author Brian Eaton <beaton@google.com>
*/
class Google_P12Signer extends Google_Signer {
// OpenSSL private key resource
private $privateKey;
// Creates a new signer from a .p12 file.
function __construct($p12, $password) {
if (!function_exists('openssl_x509_read')) {
throw new Exception(
'The Google PHP API library needs the openssl PHP extension');
}
// This throws on error
$certs = array();
if (!openssl_pkcs12_read($p12, $certs, $password)) {
throw new Google_AuthException("Unable to parse the p12 file. " .
"Is this a .p12 file? Is the password correct? OpenSSL error: " .
openssl_error_string());
}
// TODO(beaton): is this part of the contract for the openssl_pkcs12_read
// method? What happens if there are multiple private keys? Do we care?
if (!array_key_exists("pkey", $certs) || !$certs["pkey"]) {
throw new Google_AuthException("No private key found in p12 file.");
}
$this->privateKey = openssl_pkey_get_private($certs["pkey"]);
if (!$this->privateKey) {
throw new Google_AuthException("Unable to load private key in ");
}
}
function __destruct() {
if ($this->privateKey) {
openssl_pkey_free($this->privateKey);
}
}
function sign($data) {
if(version_compare(PHP_VERSION, '5.3.0') < 0) {
throw new Google_AuthException(
"PHP 5.3.0 or higher is required to use service accounts.");
}
if (!openssl_sign($data, $signature, $this->privateKey, "sha256")) {
throw new Google_AuthException("Unable to sign data");
}
return $signature;
}
}

View file

@ -0,0 +1,66 @@
<?php
/*
* Copyright 2011 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.
*/
/**
* Verifies signatures using PEM encoded certificates.
*
* @author Brian Eaton <beaton@google.com>
*/
class Google_PemVerifier extends Google_Verifier {
private $publicKey;
/**
* Constructs a verifier from the supplied PEM-encoded certificate.
*
* $pem: a PEM encoded certificate (not a file).
* @param $pem
* @throws Google_AuthException
* @throws Google_Exception
*/
function __construct($pem) {
if (!function_exists('openssl_x509_read')) {
throw new Google_Exception('Google API PHP client needs the openssl PHP extension');
}
$this->publicKey = openssl_x509_read($pem);
if (!$this->publicKey) {
throw new Google_AuthException("Unable to parse PEM: $pem");
}
}
function __destruct() {
if ($this->publicKey) {
openssl_x509_free($this->publicKey);
}
}
/**
* Verifies the signature on data.
*
* Returns true if the signature is valid, false otherwise.
* @param $data
* @param $signature
* @throws Google_AuthException
* @return bool
*/
function verify($data, $signature) {
$status = openssl_verify($data, $signature, $this->publicKey, "sha256");
if ($status === -1) {
throw new Google_AuthException('Signature verification error: ' . openssl_error_string());
}
return $status === 1;
}
}

View file

@ -0,0 +1,30 @@
<?php
/*
* Copyright 2011 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 "Google_P12Signer.php";
/**
* Signs data.
*
* @author Brian Eaton <beaton@google.com>
*/
abstract class Google_Signer {
/**
* Signs data, returns the signature as binary data.
*/
abstract public function sign($data);
}

View file

@ -0,0 +1,31 @@
<?php
/*
* Copyright 2011 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 "Google_PemVerifier.php";
/**
* Verifies signatures.
*
* @author Brian Eaton <beaton@google.com>
*/
abstract class Google_Verifier {
/**
* Checks a signature, returns true if the signature is correct,
* false otherwise.
*/
abstract public function verify($data, $signature);
}

View file

@ -0,0 +1,95 @@
<?php
/*
* Copyright 2012 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.
*/
/**
* Credentials object used for OAuth 2.0 Signed JWT assertion grants.
*
* @author Chirag Shah <chirags@google.com>
*/
class Google_AssertionCredentials {
const MAX_TOKEN_LIFETIME_SECS = 3600;
public $serviceAccountName;
public $scopes;
public $privateKey;
public $privateKeyPassword;
public $assertionType;
public $prn;
/**
* @param $serviceAccountName
* @param $scopes array List of scopes
* @param $privateKey
* @param string $privateKeyPassword
* @param string $assertionType
* @param bool|string $prn The email address of the user for which the
* application is requesting delegated access.
*/
public function __construct(
$serviceAccountName,
$scopes,
$privateKey,
$privateKeyPassword = 'notasecret',
$assertionType = 'http://oauth.net/grant_type/jwt/1.0/bearer',
$prn = false) {
$this->serviceAccountName = $serviceAccountName;
$this->scopes = is_string($scopes) ? $scopes : implode(' ', $scopes);
$this->privateKey = $privateKey;
$this->privateKeyPassword = $privateKeyPassword;
$this->assertionType = $assertionType;
$this->prn = $prn;
}
public function generateAssertion() {
$now = time();
$jwtParams = array(
'aud' => Google_OAuth2::OAUTH2_TOKEN_URI,
'scope' => $this->scopes,
'iat' => $now,
'exp' => $now + self::MAX_TOKEN_LIFETIME_SECS,
'iss' => $this->serviceAccountName,
);
if ($this->prn !== false) {
$jwtParams['prn'] = $this->prn;
}
return $this->makeSignedJwt($jwtParams);
}
/**
* Creates a signed JWT.
* @param array $payload
* @return string The signed JWT.
*/
private function makeSignedJwt($payload) {
$header = array('typ' => 'JWT', 'alg' => 'RS256');
$segments = array(
Google_Utils::urlSafeB64Encode(json_encode($header)),
Google_Utils::urlSafeB64Encode(json_encode($payload))
);
$signingInput = implode('.', $segments);
$signer = new Google_P12Signer($this->privateKey, $this->privateKeyPassword);
$signature = $signer->sign($signingInput);
$segments[] = Google_Utils::urlSafeB64Encode($signature);
return implode(".", $segments);
}
}

View file

@ -0,0 +1,36 @@
<?php
/*
* Copyright 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 "Google_AuthNone.php";
require_once "Google_OAuth2.php";
/**
* Abstract class for the Authentication in the API client
* @author Chris Chabot <chabotc@google.com>
*
*/
abstract class Google_Auth {
abstract public function authenticate($service);
abstract public function sign(Google_HttpRequest $request);
abstract public function createAuthUrl($scope);
abstract public function getAccessToken();
abstract public function setAccessToken($accessToken);
abstract public function setDeveloperKey($developerKey);
abstract public function refreshToken($refreshToken);
abstract public function revokeToken();
}

View file

@ -0,0 +1,48 @@
<?php
/*
* Copyright 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.
*/
/**
* Do-nothing authentication implementation, use this if you want to make un-authenticated calls
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*/
class Google_AuthNone extends Google_Auth {
public $key = null;
public function __construct() {
global $apiConfig;
if (!empty($apiConfig['developer_key'])) {
$this->setDeveloperKey($apiConfig['developer_key']);
}
}
public function setDeveloperKey($key) {$this->key = $key;}
public function authenticate($service) {/*noop*/}
public function setAccessToken($accessToken) {/* noop*/}
public function getAccessToken() {return null;}
public function createAuthUrl($scope) {return null;}
public function refreshToken($refreshToken) {/* noop*/}
public function revokeToken() {/* noop*/}
public function sign(Google_HttpRequest $request) {
if ($this->key) {
$request->setUrl($request->getUrl() . ((strpos($request->getUrl(), '?') === false) ? '?' : '&')
. 'key='.urlencode($this->key));
}
return $request;
}
}

View file

@ -0,0 +1,63 @@
<?php
/*
* Copyright 2011 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.
*/
/**
* Class to hold information about an authenticated login.
*
* @author Brian Eaton <beaton@google.com>
*/
class Google_LoginTicket {
const USER_ATTR = "id";
// Information from id token envelope.
private $envelope;
// Information from id token payload.
private $payload;
/**
* Creates a user based on the supplied token.
*
* @param string $envelope Header from a verified authentication token.
* @param string $payload Information from a verified authentication token.
*/
public function __construct($envelope, $payload) {
$this->envelope = $envelope;
$this->payload = $payload;
}
/**
* Returns the numeric identifier for the user.
* @throws Google_AuthException
* @return
*/
public function getUserId() {
if (array_key_exists(self::USER_ATTR, $this->payload)) {
return $this->payload[self::USER_ATTR];
}
throw new Google_AuthException("No user_id in token");
}
/**
* Returns attributes from the login ticket. This can contain
* various information about the user session.
* @return array
*/
public function getAttributes() {
return array("envelope" => $this->envelope, "payload" => $this->payload);
}
}

View file

@ -0,0 +1,444 @@
<?php
/*
* Copyright 2008 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 "Google_Verifier.php";
require_once "Google_LoginTicket.php";
require_once "service/Google_Utils.php";
/**
* Authentication class that deals with the OAuth 2 web-server authentication flow
*
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*
*/
class Google_OAuth2 extends Google_Auth {
public $clientId;
public $clientSecret;
public $developerKey;
public $token;
public $redirectUri;
public $state;
public $accessType = 'offline';
public $approvalPrompt = 'force';
/** @var Google_AssertionCredentials $assertionCredentials */
public $assertionCredentials;
const OAUTH2_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke';
const OAUTH2_TOKEN_URI = 'https://accounts.google.com/o/oauth2/token';
const OAUTH2_AUTH_URL = 'https://accounts.google.com/o/oauth2/auth';
const OAUTH2_FEDERATED_SIGNON_CERTS_URL = 'https://www.googleapis.com/oauth2/v1/certs';
const CLOCK_SKEW_SECS = 300; // five minutes in seconds
const AUTH_TOKEN_LIFETIME_SECS = 300; // five minutes in seconds
const MAX_TOKEN_LIFETIME_SECS = 86400; // one day in seconds
/**
* Instantiates the class, but does not initiate the login flow, leaving it
* to the discretion of the caller (which is done by calling authenticate()).
*/
public function __construct() {
global $apiConfig;
if (! empty($apiConfig['developer_key'])) {
$this->developerKey = $apiConfig['developer_key'];
}
if (! empty($apiConfig['oauth2_client_id'])) {
$this->clientId = $apiConfig['oauth2_client_id'];
}
if (! empty($apiConfig['oauth2_client_secret'])) {
$this->clientSecret = $apiConfig['oauth2_client_secret'];
}
if (! empty($apiConfig['oauth2_redirect_uri'])) {
$this->redirectUri = $apiConfig['oauth2_redirect_uri'];
}
if (! empty($apiConfig['oauth2_access_type'])) {
$this->accessType = $apiConfig['oauth2_access_type'];
}
if (! empty($apiConfig['oauth2_approval_prompt'])) {
$this->approvalPrompt = $apiConfig['oauth2_approval_prompt'];
}
}
/**
* @param $service
* @param string|null $code
* @throws Google_AuthException
* @return string
*/
public function authenticate($service, $code = null) {
if (!$code && isset($_GET['code'])) {
$code = $_GET['code'];
}
if ($code) {
// We got here from the redirect from a successful authorization grant, fetch the access token
$request = Google_Client::$io->makeRequest(new Google_HttpRequest(self::OAUTH2_TOKEN_URI, 'POST', array(), array(
'code' => $code,
'grant_type' => 'authorization_code',
'redirect_uri' => $this->redirectUri,
'client_id' => $this->clientId,
'client_secret' => $this->clientSecret
)));
if ($request->getResponseHttpCode() == 200) {
$this->setAccessToken($request->getResponseBody());
$this->token['created'] = time();
return $this->getAccessToken();
} else {
$response = $request->getResponseBody();
$decodedResponse = json_decode($response, true);
if ($decodedResponse != null && $decodedResponse['error']) {
$response = $decodedResponse['error'];
}
throw new Google_AuthException("Error fetching OAuth2 access token, message: '$response'", $request->getResponseHttpCode());
}
}
$authUrl = $this->createAuthUrl($service['scope']);
header('Location: ' . $authUrl);
return true;
}
/**
* Create a URL to obtain user authorization.
* The authorization endpoint allows the user to first
* authenticate, and then grant/deny the access request.
* @param string $scope The scope is expressed as a list of space-delimited strings.
* @return string
*/
public function createAuthUrl($scope) {
$params = array(
'response_type=code',
'redirect_uri=' . urlencode($this->redirectUri),
'client_id=' . urlencode($this->clientId),
'scope=' . urlencode($scope),
'access_type=' . urlencode($this->accessType),
'approval_prompt=' . urlencode($this->approvalPrompt)
);
if (isset($this->state)) {
$params[] = 'state=' . urlencode($this->state);
}
$params = implode('&', $params);
return self::OAUTH2_AUTH_URL . "?$params";
}
/**
* @param string $token
* @throws Google_AuthException
*/
public function setAccessToken($token) {
$token = json_decode($token, true);
if ($token == null) {
throw new Google_AuthException('Could not json decode the token');
}
if (! isset($token['access_token'])) {
throw new Google_AuthException("Invalid token format");
}
$this->token = $token;
}
public function getAccessToken() {
return json_encode($this->token);
}
public function setDeveloperKey($developerKey) {
$this->developerKey = $developerKey;
}
public function setState($state) {
$this->state = $state;
}
public function setAccessType($accessType) {
$this->accessType = $accessType;
}
public function setApprovalPrompt($approvalPrompt) {
$this->approvalPrompt = $approvalPrompt;
}
public function setAssertionCredentials(Google_AssertionCredentials $creds) {
$this->assertionCredentials = $creds;
}
/**
* Include an accessToken in a given apiHttpRequest.
* @param Google_HttpRequest $request
* @return Google_HttpRequest
* @throws Google_AuthException
*/
public function sign(Google_HttpRequest $request) {
// add the developer key to the request before signing it
if ($this->developerKey) {
$requestUrl = $request->getUrl();
$requestUrl .= (strpos($request->getUrl(), '?') === false) ? '?' : '&';
$requestUrl .= 'key=' . urlencode($this->developerKey);
$request->setUrl($requestUrl);
}
// Cannot sign the request without an OAuth access token.
if (null == $this->token && null == $this->assertionCredentials) {
return $request;
}
// Check if the token is set to expire in the next 30 seconds
// (or has already expired).
if ($this->isAccessTokenExpired()) {
if ($this->assertionCredentials) {
$this->refreshTokenWithAssertion();
} else {
if (! array_key_exists('refresh_token', $this->token)) {
throw new Google_AuthException("The OAuth 2.0 access token has expired, "
. "and a refresh token is not available. Refresh tokens are not "
. "returned for responses that were auto-approved.");
}
$this->refreshToken($this->token['refresh_token']);
}
}
// Add the OAuth2 header to the request
$request->setRequestHeaders(
array('Authorization' => 'Bearer ' . $this->token['access_token'])
);
return $request;
}
/**
* Fetches a fresh access token with the given refresh token.
* @param string $refreshToken
* @return void
*/
public function refreshToken($refreshToken) {
$this->refreshTokenRequest(array(
'client_id' => $this->clientId,
'client_secret' => $this->clientSecret,
'refresh_token' => $refreshToken,
'grant_type' => 'refresh_token'
));
}
/**
* Fetches a fresh access token with a given assertion token.
* @param Google_AssertionCredentials $assertionCredentials optional.
* @return void
*/
public function refreshTokenWithAssertion($assertionCredentials = null) {
if (!$assertionCredentials) {
$assertionCredentials = $this->assertionCredentials;
}
$this->refreshTokenRequest(array(
'grant_type' => 'assertion',
'assertion_type' => $assertionCredentials->assertionType,
'assertion' => $assertionCredentials->generateAssertion(),
));
}
private function refreshTokenRequest($params) {
$http = new Google_HttpRequest(self::OAUTH2_TOKEN_URI, 'POST', array(), $params);
$request = Google_Client::$io->makeRequest($http);
$code = $request->getResponseHttpCode();
$body = $request->getResponseBody();
if (200 == $code) {
$token = json_decode($body, true);
if ($token == null) {
throw new Google_AuthException("Could not json decode the access token");
}
if (! isset($token['access_token']) || ! isset($token['expires_in'])) {
throw new Google_AuthException("Invalid token format");
}
$this->token['access_token'] = $token['access_token'];
$this->token['expires_in'] = $token['expires_in'];
$this->token['created'] = time();
} else {
throw new Google_AuthException("Error refreshing the OAuth2 token, message: '$body'", $code);
}
}
/**
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
* token, if a token isn't provided.
* @throws Google_AuthException
* @param string|null $token The token (access token or a refresh token) that should be revoked.
* @return boolean Returns True if the revocation was successful, otherwise False.
*/
public function revokeToken($token = null) {
if (!$token) {
$token = $this->token['access_token'];
}
$request = new Google_HttpRequest(self::OAUTH2_REVOKE_URI, 'POST', array(), "token=$token");
$response = Google_Client::$io->makeRequest($request);
$code = $response->getResponseHttpCode();
if ($code == 200) {
$this->token = null;
return true;
}
return false;
}
/**
* Returns if the access_token is expired.
* @return bool Returns True if the access_token is expired.
*/
public function isAccessTokenExpired() {
if (null == $this->token) {
return true;
}
// If the token is set to expire in the next 30 seconds.
$expired = ($this->token['created']
+ ($this->token['expires_in'] - 30)) < time();
return $expired;
}
// Gets federated sign-on certificates to use for verifying identity tokens.
// Returns certs as array structure, where keys are key ids, and values
// are PEM encoded certificates.
private function getFederatedSignOnCerts() {
// This relies on makeRequest caching certificate responses.
$request = Google_Client::$io->makeRequest(new Google_HttpRequest(
self::OAUTH2_FEDERATED_SIGNON_CERTS_URL));
if ($request->getResponseHttpCode() == 200) {
$certs = json_decode($request->getResponseBody(), true);
if ($certs) {
return $certs;
}
}
throw new Google_AuthException(
"Failed to retrieve verification certificates: '" .
$request->getResponseBody() . "'.",
$request->getResponseHttpCode());
}
/**
* Verifies an id token and returns the authenticated apiLoginTicket.
* Throws an exception if the id token is not valid.
* The audience parameter can be used to control which id tokens are
* accepted. By default, the id token must have been issued to this OAuth2 client.
*
* @param $id_token
* @param $audience
* @return Google_LoginTicket
*/
public function verifyIdToken($id_token = null, $audience = null) {
if (!$id_token) {
$id_token = $this->token['id_token'];
}
$certs = $this->getFederatedSignonCerts();
if (!$audience) {
$audience = $this->clientId;
}
return $this->verifySignedJwtWithCerts($id_token, $certs, $audience);
}
// Verifies the id token, returns the verified token contents.
// Visible for testing.
function verifySignedJwtWithCerts($jwt, $certs, $required_audience) {
$segments = explode(".", $jwt);
if (count($segments) != 3) {
throw new Google_AuthException("Wrong number of segments in token: $jwt");
}
$signed = $segments[0] . "." . $segments[1];
$signature = Google_Utils::urlSafeB64Decode($segments[2]);
// Parse envelope.
$envelope = json_decode(Google_Utils::urlSafeB64Decode($segments[0]), true);
if (!$envelope) {
throw new Google_AuthException("Can't parse token envelope: " . $segments[0]);
}
// Parse token
$json_body = Google_Utils::urlSafeB64Decode($segments[1]);
$payload = json_decode($json_body, true);
if (!$payload) {
throw new Google_AuthException("Can't parse token payload: " . $segments[1]);
}
// Check signature
$verified = false;
foreach ($certs as $keyName => $pem) {
$public_key = new Google_PemVerifier($pem);
if ($public_key->verify($signed, $signature)) {
$verified = true;
break;
}
}
if (!$verified) {
throw new Google_AuthException("Invalid token signature: $jwt");
}
// Check issued-at timestamp
$iat = 0;
if (array_key_exists("iat", $payload)) {
$iat = $payload["iat"];
}
if (!$iat) {
throw new Google_AuthException("No issue time in token: $json_body");
}
$earliest = $iat - self::CLOCK_SKEW_SECS;
// Check expiration timestamp
$now = time();
$exp = 0;
if (array_key_exists("exp", $payload)) {
$exp = $payload["exp"];
}
if (!$exp) {
throw new Google_AuthException("No expiration time in token: $json_body");
}
if ($exp >= $now + self::MAX_TOKEN_LIFETIME_SECS) {
throw new Google_AuthException(
"Expiration time too far in future: $json_body");
}
$latest = $exp + self::CLOCK_SKEW_SECS;
if ($now < $earliest) {
throw new Google_AuthException(
"Token used too early, $now < $earliest: $json_body");
}
if ($now > $latest) {
throw new Google_AuthException(
"Token used too late, $now > $latest: $json_body");
}
// TODO(beaton): check issuer field?
// Check audience
$aud = $payload["aud"];
if ($aud != $required_audience) {
throw new Google_AuthException("Wrong recipient, $aud != $required_audience: $json_body");
}
// All good.
return new Google_LoginTicket($envelope, $payload);
}
}

View file

@ -0,0 +1,70 @@
<?php
/*
* Copyright 2011 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.
*/
/**
* Signs data.
*
* Only used for testing.
*
* @author Brian Eaton <beaton@google.com>
*/
class Google_P12Signer extends Google_Signer {
// OpenSSL private key resource
private $privateKey;
// Creates a new signer from a .p12 file.
function __construct($p12, $password) {
if (!function_exists('openssl_x509_read')) {
throw new Exception(
'The Google PHP API library needs the openssl PHP extension');
}
// This throws on error
$certs = array();
if (!openssl_pkcs12_read($p12, $certs, $password)) {
throw new Google_AuthException("Unable to parse the p12 file. " .
"Is this a .p12 file? Is the password correct? OpenSSL error: " .
openssl_error_string());
}
// TODO(beaton): is this part of the contract for the openssl_pkcs12_read
// method? What happens if there are multiple private keys? Do we care?
if (!array_key_exists("pkey", $certs) || !$certs["pkey"]) {
throw new Google_AuthException("No private key found in p12 file.");
}
$this->privateKey = openssl_pkey_get_private($certs["pkey"]);
if (!$this->privateKey) {
throw new Google_AuthException("Unable to load private key in ");
}
}
function __destruct() {
if ($this->privateKey) {
openssl_pkey_free($this->privateKey);
}
}
function sign($data) {
if(version_compare(PHP_VERSION, '5.3.0') < 0) {
throw new Google_AuthException(
"PHP 5.3.0 or higher is required to use service accounts.");
}
if (!openssl_sign($data, $signature, $this->privateKey, "sha256")) {
throw new Google_AuthException("Unable to sign data");
}
return $signature;
}
}

View file

@ -0,0 +1,66 @@
<?php
/*
* Copyright 2011 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.
*/
/**
* Verifies signatures using PEM encoded certificates.
*
* @author Brian Eaton <beaton@google.com>
*/
class Google_PemVerifier extends Google_Verifier {
private $publicKey;
/**
* Constructs a verifier from the supplied PEM-encoded certificate.
*
* $pem: a PEM encoded certificate (not a file).
* @param $pem
* @throws Google_AuthException
* @throws Google_Exception
*/
function __construct($pem) {
if (!function_exists('openssl_x509_read')) {
throw new Google_Exception('Google API PHP client needs the openssl PHP extension');
}
$this->publicKey = openssl_x509_read($pem);
if (!$this->publicKey) {
throw new Google_AuthException("Unable to parse PEM: $pem");
}
}
function __destruct() {
if ($this->publicKey) {
openssl_x509_free($this->publicKey);
}
}
/**
* Verifies the signature on data.
*
* Returns true if the signature is valid, false otherwise.
* @param $data
* @param $signature
* @throws Google_AuthException
* @return bool
*/
function verify($data, $signature) {
$status = openssl_verify($data, $signature, $this->publicKey, "sha256");
if ($status === -1) {
throw new Google_AuthException('Signature verification error: ' . openssl_error_string());
}
return $status === 1;
}
}

View file

@ -0,0 +1,30 @@
<?php
/*
* Copyright 2011 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 "Google_P12Signer.php";
/**
* Signs data.
*
* @author Brian Eaton <beaton@google.com>
*/
abstract class Google_Signer {
/**
* Signs data, returns the signature as binary data.
*/
abstract public function sign($data);
}

View file

@ -0,0 +1,31 @@
<?php
/*
* Copyright 2011 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 "Google_PemVerifier.php";
/**
* Verifies signatures.
*
* @author Brian Eaton <beaton@google.com>
*/
abstract class Google_Verifier {
/**
* Checks a signature, returns true if the signature is correct,
* false otherwise.
*/
abstract public function verify($data, $signature);
}

29
google-api/cache/.svn/all-wcprops vendored Normal file
View file

@ -0,0 +1,29 @@
K 25
svn:wc:ra_dav:version-url
V 33
/svn/!svn/ver/486/trunk/src/cache
END
Google_FileCache.php
K 25
svn:wc:ra_dav:version-url
V 54
/svn/!svn/ver/474/trunk/src/cache/Google_FileCache.php
END
Google_Cache.php
K 25
svn:wc:ra_dav:version-url
V 50
/svn/!svn/ver/474/trunk/src/cache/Google_Cache.php
END
Google_MemcacheCache.php
K 25
svn:wc:ra_dav:version-url
V 58
/svn/!svn/ver/486/trunk/src/cache/Google_MemcacheCache.php
END
Google_ApcCache.php
K 25
svn:wc:ra_dav:version-url
V 53
/svn/!svn/ver/486/trunk/src/cache/Google_ApcCache.php
END

164
google-api/cache/.svn/entries vendored Normal file
View file

@ -0,0 +1,164 @@
10
dir
508
http://google-api-php-client.googlecode.com/svn/trunk/src/cache
http://google-api-php-client.googlecode.com/svn
2012-08-29T18:59:29.771091Z
486
chirags@google.com
6c5fc399-1a2c-022f-82ce-feb0d0b4916c
Google_FileCache.php
file
2012-11-08T10:43:28.000000Z
7cb3f047c1e3774474de8e8b2f5bd638
2012-08-03T00:04:28.862550Z
474
chirags@google.com
4919
Google_Cache.php
file
2012-11-08T10:43:28.000000Z
98c92b5d919c9143e68230e612298a9b
2012-08-03T00:04:28.862550Z
474
chirags@google.com
1438
Google_MemcacheCache.php
file
2012-11-08T10:43:28.000000Z
48f2b20eb2481b40954d0a7a130fa766
2012-08-29T18:59:29.771091Z
486
chirags@google.com
3984
Google_ApcCache.php
file
2012-11-08T10:43:28.000000Z
38942168cb94c15a9064aa8faa6c1817
2012-08-29T18:59:29.771091Z
486
chirags@google.com
2759

View file

@ -0,0 +1,98 @@
<?php
/*
* Copyright 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.
*/
/**
* A persistent storage class based on the APC cache, which is not
* really very persistent, as soon as you restart your web server
* the storage will be wiped, however for debugging and/or speed
* it can be useful, kinda, and cache is a lot cheaper then storage.
*
* @author Chris Chabot <chabotc@google.com>
*/
class googleApcCache extends Google_Cache {
public function __construct() {
if (! function_exists('apc_add')) {
throw new Google_CacheException("Apc functions not available");
}
}
private function isLocked($key) {
if ((@apc_fetch($key . '.lock')) === false) {
return false;
}
return true;
}
private function createLock($key) {
// the interesting thing is that this could fail if the lock was created in the meantime..
// but we'll ignore that out of convenience
@apc_add($key . '.lock', '', 5);
}
private function removeLock($key) {
// suppress all warnings, if some other process removed it that's ok too
@apc_delete($key . '.lock');
}
private function waitForLock($key) {
// 20 x 250 = 5 seconds
$tries = 20;
$cnt = 0;
do {
// 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks..
usleep(250);
$cnt ++;
} while ($cnt <= $tries && $this->isLocked($key));
if ($this->isLocked($key)) {
// 5 seconds passed, assume the owning process died off and remove it
$this->removeLock($key);
}
}
/**
* @inheritDoc
*/
public function get($key, $expiration = false) {
if (($ret = @apc_fetch($key)) === false) {
return false;
}
if (!$expiration || (time() - $ret['time'] > $expiration)) {
$this->delete($key);
return false;
}
return unserialize($ret['data']);
}
/**
* @inheritDoc
*/
public function set($key, $value) {
if (@apc_store($key, array('time' => time(), 'data' => serialize($value))) == false) {
throw new Google_CacheException("Couldn't store data");
}
}
/**
* @inheritDoc
* @param String $key
*/
public function delete($key) {
@apc_delete($key);
}
}

View file

@ -0,0 +1,55 @@
<?php
/*
* Copyright 2008 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 "Google_FileCache.php";
require_once "Google_MemcacheCache.php";
/**
* Abstract storage class
*
* @author Chris Chabot <chabotc@google.com>
*/
abstract class Google_Cache {
/**
* Retrieves the data for the given key, or false if they
* key is unknown or expired
*
* @param String $key The key who's data to retrieve
* @param boolean|int $expiration Expiration time in seconds
*
*/
abstract function get($key, $expiration = false);
/**
* Store the key => $value set. The $value is serialized
* by this function so can be of any type
*
* @param string $key Key of the data
* @param string $value data
*/
abstract function set($key, $value);
/**
* Removes the key/data pair for the given $key
*
* @param String $key
*/
abstract function delete($key);
}

View file

@ -0,0 +1,137 @@
<?php
/*
* Copyright 2008 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.
*/
/*
* This class implements a basic on disk storage. While that does
* work quite well it's not the most elegant and scalable solution.
* It will also get you into a heap of trouble when you try to run
* this in a clustered environment. In those cases please use the
* MySql back-end
*
* @author Chris Chabot <chabotc@google.com>
*/
class Google_FileCache extends Google_Cache {
private $path;
public function __construct() {
global $apiConfig;
$this->path = $apiConfig['ioFileCache_directory'];
}
private function isLocked($storageFile) {
// our lock file convention is simple: /the/file/path.lock
return file_exists($storageFile . '.lock');
}
private function createLock($storageFile) {
$storageDir = dirname($storageFile);
if (! is_dir($storageDir)) {
// @codeCoverageIgnoreStart
if (! @mkdir($storageDir, 0755, true)) {
// make sure the failure isn't because of a concurrency issue
if (! is_dir($storageDir)) {
throw new Google_CacheException("Could not create storage directory: $storageDir");
}
}
// @codeCoverageIgnoreEnd
}
@touch($storageFile . '.lock');
}
private function removeLock($storageFile) {
// suppress all warnings, if some other process removed it that's ok too
@unlink($storageFile . '.lock');
}
private function waitForLock($storageFile) {
// 20 x 250 = 5 seconds
$tries = 20;
$cnt = 0;
do {
// make sure PHP picks up on file changes. This is an expensive action but really can't be avoided
clearstatcache();
// 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks..
usleep(250);
$cnt ++;
} while ($cnt <= $tries && $this->isLocked($storageFile));
if ($this->isLocked($storageFile)) {
// 5 seconds passed, assume the owning process died off and remove it
$this->removeLock($storageFile);
}
}
private function getCacheDir($hash) {
// use the first 2 characters of the hash as a directory prefix
// this should prevent slowdowns due to huge directory listings
// and thus give some basic amount of scalability
return $this->path . '/' . substr($hash, 0, 2);
}
private function getCacheFile($hash) {
return $this->getCacheDir($hash) . '/' . $hash;
}
public function get($key, $expiration = false) {
$storageFile = $this->getCacheFile(md5($key));
// See if this storage file is locked, if so we wait upto 5 seconds for the lock owning process to
// complete it's work. If the lock is not released within that time frame, it's cleaned up.
// This should give us a fair amount of 'Cache Stampeding' protection
if ($this->isLocked($storageFile)) {
$this->waitForLock($storageFile);
}
if (file_exists($storageFile) && is_readable($storageFile)) {
$now = time();
if (! $expiration || (($mtime = @filemtime($storageFile)) !== false && ($now - $mtime) < $expiration)) {
if (($data = @file_get_contents($storageFile)) !== false) {
$data = unserialize($data);
return $data;
}
}
}
return false;
}
public function set($key, $value) {
$storageDir = $this->getCacheDir(md5($key));
$storageFile = $this->getCacheFile(md5($key));
if ($this->isLocked($storageFile)) {
// some other process is writing to this file too, wait until it's done to prevent hickups
$this->waitForLock($storageFile);
}
if (! is_dir($storageDir)) {
if (! @mkdir($storageDir, 0755, true)) {
throw new Google_CacheException("Could not create storage directory: $storageDir");
}
}
// we serialize the whole request object, since we don't only want the
// responseContent but also the postBody used, headers, size, etc
$data = serialize($value);
$this->createLock($storageFile);
if (! @file_put_contents($storageFile, $data)) {
$this->removeLock($storageFile);
throw new Google_CacheException("Could not store data in the file");
}
$this->removeLock($storageFile);
}
public function delete($key) {
$file = $this->getCacheFile(md5($key));
if (! @unlink($file)) {
throw new Google_CacheException("Cache file could not be deleted");
}
}
}

View file

@ -0,0 +1,130 @@
<?php
/*
* Copyright 2008 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.
*/
/**
* A persistent storage class based on the memcache, which is not
* really very persistent, as soon as you restart your memcache daemon
* the storage will be wiped, however for debugging and/or speed
* it can be useful, kinda, and cache is a lot cheaper then storage.
*
* @author Chris Chabot <chabotc@google.com>
*/
class Google_MemcacheCache extends Google_Cache {
private $connection = false;
public function __construct() {
global $apiConfig;
if (! function_exists('memcache_connect')) {
throw new Google_CacheException("Memcache functions not available");
}
$this->host = $apiConfig['ioMemCacheCache_host'];
$this->port = $apiConfig['ioMemCacheCache_port'];
if (empty($this->host) || empty($this->port)) {
throw new Google_CacheException("You need to supply a valid memcache host and port");
}
}
private function isLocked($key) {
$this->check();
if ((@memcache_get($this->connection, $key . '.lock')) === false) {
return false;
}
return true;
}
private function createLock($key) {
$this->check();
// the interesting thing is that this could fail if the lock was created in the meantime..
// but we'll ignore that out of convenience
@memcache_add($this->connection, $key . '.lock', '', 0, 5);
}
private function removeLock($key) {
$this->check();
// suppress all warnings, if some other process removed it that's ok too
@memcache_delete($this->connection, $key . '.lock');
}
private function waitForLock($key) {
$this->check();
// 20 x 250 = 5 seconds
$tries = 20;
$cnt = 0;
do {
// 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks..
usleep(250);
$cnt ++;
} while ($cnt <= $tries && $this->isLocked($key));
if ($this->isLocked($key)) {
// 5 seconds passed, assume the owning process died off and remove it
$this->removeLock($key);
}
}
// I prefer lazy initialization since the cache isn't used every request
// so this potentially saves a lot of overhead
private function connect() {
if (! $this->connection = @memcache_pconnect($this->host, $this->port)) {
throw new Google_CacheException("Couldn't connect to memcache server");
}
}
private function check() {
if (! $this->connection) {
$this->connect();
}
}
/**
* @inheritDoc
*/
public function get($key, $expiration = false) {
$this->check();
if (($ret = @memcache_get($this->connection, $key)) === false) {
return false;
}
if (! $expiration || (time() - $ret['time'] > $expiration)) {
$this->delete($key);
return false;
}
return $ret['data'];
}
/**
* @inheritDoc
* @param string $key
* @param string $value
* @throws Google_CacheException
*/
public function set($key, $value) {
$this->check();
// we store it with the cache_time default expiration so objects will at least get cleaned eventually.
if (@memcache_set($this->connection, $key, array('time' => time(),
'data' => $value), false) == false) {
throw new Google_CacheException("Couldn't store data in cache");
}
}
/**
* @inheritDoc
* @param String $key
*/
public function delete($key) {
$this->check();
@memcache_delete($this->connection, $key);
}
}

98
google-api/cache/Google_ApcCache.php vendored Normal file
View file

@ -0,0 +1,98 @@
<?php
/*
* Copyright 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.
*/
/**
* A persistent storage class based on the APC cache, which is not
* really very persistent, as soon as you restart your web server
* the storage will be wiped, however for debugging and/or speed
* it can be useful, kinda, and cache is a lot cheaper then storage.
*
* @author Chris Chabot <chabotc@google.com>
*/
class googleApcCache extends Google_Cache {
public function __construct() {
if (! function_exists('apc_add')) {
throw new Google_CacheException("Apc functions not available");
}
}
private function isLocked($key) {
if ((@apc_fetch($key . '.lock')) === false) {
return false;
}
return true;
}
private function createLock($key) {
// the interesting thing is that this could fail if the lock was created in the meantime..
// but we'll ignore that out of convenience
@apc_add($key . '.lock', '', 5);
}
private function removeLock($key) {
// suppress all warnings, if some other process removed it that's ok too
@apc_delete($key . '.lock');
}
private function waitForLock($key) {
// 20 x 250 = 5 seconds
$tries = 20;
$cnt = 0;
do {
// 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks..
usleep(250);
$cnt ++;
} while ($cnt <= $tries && $this->isLocked($key));
if ($this->isLocked($key)) {
// 5 seconds passed, assume the owning process died off and remove it
$this->removeLock($key);
}
}
/**
* @inheritDoc
*/
public function get($key, $expiration = false) {
if (($ret = @apc_fetch($key)) === false) {
return false;
}
if (!$expiration || (time() - $ret['time'] > $expiration)) {
$this->delete($key);
return false;
}
return unserialize($ret['data']);
}
/**
* @inheritDoc
*/
public function set($key, $value) {
if (@apc_store($key, array('time' => time(), 'data' => serialize($value))) == false) {
throw new Google_CacheException("Couldn't store data");
}
}
/**
* @inheritDoc
* @param String $key
*/
public function delete($key) {
@apc_delete($key);
}
}

55
google-api/cache/Google_Cache.php vendored Normal file
View file

@ -0,0 +1,55 @@
<?php
/*
* Copyright 2008 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 "Google_FileCache.php";
require_once "Google_MemcacheCache.php";
/**
* Abstract storage class
*
* @author Chris Chabot <chabotc@google.com>
*/
abstract class Google_Cache {
/**
* Retrieves the data for the given key, or false if they
* key is unknown or expired
*
* @param String $key The key who's data to retrieve
* @param boolean|int $expiration Expiration time in seconds
*
*/
abstract function get($key, $expiration = false);
/**
* Store the key => $value set. The $value is serialized
* by this function so can be of any type
*
* @param string $key Key of the data
* @param string $value data
*/
abstract function set($key, $value);
/**
* Removes the key/data pair for the given $key
*
* @param String $key
*/
abstract function delete($key);
}

137
google-api/cache/Google_FileCache.php vendored Normal file
View file

@ -0,0 +1,137 @@
<?php
/*
* Copyright 2008 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.
*/
/*
* This class implements a basic on disk storage. While that does
* work quite well it's not the most elegant and scalable solution.
* It will also get you into a heap of trouble when you try to run
* this in a clustered environment. In those cases please use the
* MySql back-end
*
* @author Chris Chabot <chabotc@google.com>
*/
class Google_FileCache extends Google_Cache {
private $path;
public function __construct() {
global $apiConfig;
$this->path = $apiConfig['ioFileCache_directory'];
}
private function isLocked($storageFile) {
// our lock file convention is simple: /the/file/path.lock
return file_exists($storageFile . '.lock');
}
private function createLock($storageFile) {
$storageDir = dirname($storageFile);
if (! is_dir($storageDir)) {
// @codeCoverageIgnoreStart
if (! @mkdir($storageDir, 0755, true)) {
// make sure the failure isn't because of a concurrency issue
if (! is_dir($storageDir)) {
throw new Google_CacheException("Could not create storage directory: $storageDir");
}
}
// @codeCoverageIgnoreEnd
}
@touch($storageFile . '.lock');
}
private function removeLock($storageFile) {
// suppress all warnings, if some other process removed it that's ok too
@unlink($storageFile . '.lock');
}
private function waitForLock($storageFile) {
// 20 x 250 = 5 seconds
$tries = 20;
$cnt = 0;
do {
// make sure PHP picks up on file changes. This is an expensive action but really can't be avoided
clearstatcache();
// 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks..
usleep(250);
$cnt ++;
} while ($cnt <= $tries && $this->isLocked($storageFile));
if ($this->isLocked($storageFile)) {
// 5 seconds passed, assume the owning process died off and remove it
$this->removeLock($storageFile);
}
}
private function getCacheDir($hash) {
// use the first 2 characters of the hash as a directory prefix
// this should prevent slowdowns due to huge directory listings
// and thus give some basic amount of scalability
return $this->path . '/' . substr($hash, 0, 2);
}
private function getCacheFile($hash) {
return $this->getCacheDir($hash) . '/' . $hash;
}
public function get($key, $expiration = false) {
$storageFile = $this->getCacheFile(md5($key));
// See if this storage file is locked, if so we wait upto 5 seconds for the lock owning process to
// complete it's work. If the lock is not released within that time frame, it's cleaned up.
// This should give us a fair amount of 'Cache Stampeding' protection
if ($this->isLocked($storageFile)) {
$this->waitForLock($storageFile);
}
if (file_exists($storageFile) && is_readable($storageFile)) {
$now = time();
if (! $expiration || (($mtime = @filemtime($storageFile)) !== false && ($now - $mtime) < $expiration)) {
if (($data = @file_get_contents($storageFile)) !== false) {
$data = unserialize($data);
return $data;
}
}
}
return false;
}
public function set($key, $value) {
$storageDir = $this->getCacheDir(md5($key));
$storageFile = $this->getCacheFile(md5($key));
if ($this->isLocked($storageFile)) {
// some other process is writing to this file too, wait until it's done to prevent hickups
$this->waitForLock($storageFile);
}
if (! is_dir($storageDir)) {
if (! @mkdir($storageDir, 0755, true)) {
throw new Google_CacheException("Could not create storage directory: $storageDir");
}
}
// we serialize the whole request object, since we don't only want the
// responseContent but also the postBody used, headers, size, etc
$data = serialize($value);
$this->createLock($storageFile);
if (! @file_put_contents($storageFile, $data)) {
$this->removeLock($storageFile);
throw new Google_CacheException("Could not store data in the file");
}
$this->removeLock($storageFile);
}
public function delete($key) {
$file = $this->getCacheFile(md5($key));
if (! @unlink($file)) {
throw new Google_CacheException("Cache file could not be deleted");
}
}
}

View file

@ -0,0 +1,130 @@
<?php
/*
* Copyright 2008 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.
*/
/**
* A persistent storage class based on the memcache, which is not
* really very persistent, as soon as you restart your memcache daemon
* the storage will be wiped, however for debugging and/or speed
* it can be useful, kinda, and cache is a lot cheaper then storage.
*
* @author Chris Chabot <chabotc@google.com>
*/
class Google_MemcacheCache extends Google_Cache {
private $connection = false;
public function __construct() {
global $apiConfig;
if (! function_exists('memcache_connect')) {
throw new Google_CacheException("Memcache functions not available");
}
$this->host = $apiConfig['ioMemCacheCache_host'];
$this->port = $apiConfig['ioMemCacheCache_port'];
if (empty($this->host) || empty($this->port)) {
throw new Google_CacheException("You need to supply a valid memcache host and port");
}
}
private function isLocked($key) {
$this->check();
if ((@memcache_get($this->connection, $key . '.lock')) === false) {
return false;
}
return true;
}
private function createLock($key) {
$this->check();
// the interesting thing is that this could fail if the lock was created in the meantime..
// but we'll ignore that out of convenience
@memcache_add($this->connection, $key . '.lock', '', 0, 5);
}
private function removeLock($key) {
$this->check();
// suppress all warnings, if some other process removed it that's ok too
@memcache_delete($this->connection, $key . '.lock');
}
private function waitForLock($key) {
$this->check();
// 20 x 250 = 5 seconds
$tries = 20;
$cnt = 0;
do {
// 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks..
usleep(250);
$cnt ++;
} while ($cnt <= $tries && $this->isLocked($key));
if ($this->isLocked($key)) {
// 5 seconds passed, assume the owning process died off and remove it
$this->removeLock($key);
}
}
// I prefer lazy initialization since the cache isn't used every request
// so this potentially saves a lot of overhead
private function connect() {
if (! $this->connection = @memcache_pconnect($this->host, $this->port)) {
throw new Google_CacheException("Couldn't connect to memcache server");
}
}
private function check() {
if (! $this->connection) {
$this->connect();
}
}
/**
* @inheritDoc
*/
public function get($key, $expiration = false) {
$this->check();
if (($ret = @memcache_get($this->connection, $key)) === false) {
return false;
}
if (! $expiration || (time() - $ret['time'] > $expiration)) {
$this->delete($key);
return false;
}
return $ret['data'];
}
/**
* @inheritDoc
* @param string $key
* @param string $value
* @throws Google_CacheException
*/
public function set($key, $value) {
$this->check();
// we store it with the cache_time default expiration so objects will at least get cleaned eventually.
if (@memcache_set($this->connection, $key, array('time' => time(),
'data' => $value), false) == false) {
throw new Google_CacheException("Couldn't store data in cache");
}
}
/**
* @inheritDoc
* @param String $key
*/
public function delete($key) {
$this->check();
@memcache_delete($this->connection, $key);
}
}

81
google-api/config.php Normal file
View file

@ -0,0 +1,81 @@
<?php
/*
* Copyright 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.
*/
global $apiConfig;
$apiConfig = array(
// True if objects should be returned by the service classes.
// False if associative arrays should be returned (default behavior).
'use_objects' => false,
// The application_name is included in the User-Agent HTTP header.
'application_name' => '',
// OAuth2 Settings, you can get these keys at https://code.google.com/apis/console
'oauth2_client_id' => '',
'oauth2_client_secret' => '',
'oauth2_redirect_uri' => '',
// The developer key, you get this at https://code.google.com/apis/console
'developer_key' => '',
// Site name to show in the Google's OAuth 1 authentication screen.
'site_name' => 'www.example.org',
// Which Authentication, Storage and HTTP IO classes to use.
'authClass' => 'Google_OAuth2',
'ioClass' => 'Google_CurlIO',
'cacheClass' => 'Google_FileCache',
// Don't change these unless you're working against a special development or testing environment.
'basePath' => 'https://www.googleapis.com',
// IO Class dependent configuration, you only have to configure the values
// for the class that was configured as the ioClass above
'ioFileCache_directory' =>
(function_exists('sys_get_temp_dir') ?
sys_get_temp_dir() . '/Google_Client' :
'/tmp/Google_Client'),
// Definition of service specific values like scopes, oauth token URLs, etc
'services' => array(
'analytics' => array('scope' => 'https://www.googleapis.com/auth/analytics.readonly'),
'calendar' => array(
'scope' => array(
"https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/calendar.readonly",
)
),
'books' => array('scope' => 'https://www.googleapis.com/auth/books'),
'latitude' => array(
'scope' => array(
'https://www.googleapis.com/auth/latitude.all.best',
'https://www.googleapis.com/auth/latitude.all.city',
)
),
'moderator' => array('scope' => 'https://www.googleapis.com/auth/moderator'),
'oauth2' => array(
'scope' => array(
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/userinfo.email',
)
),
'plus' => array('scope' => 'https://www.googleapis.com/auth/plus.me'),
'siteVerification' => array('scope' => 'https://www.googleapis.com/auth/siteverification'),
'tasks' => array('scope' => 'https://www.googleapis.com/auth/tasks'),
'urlshortener' => array('scope' => 'https://www.googleapis.com/auth/urlshortener')
)
);

View file

@ -0,0 +1,197 @@
K 25
svn:wc:ra_dav:version-url
V 35
/svn/!svn/ver/508/trunk/src/contrib
END
Google_ComputeService.php
K 25
svn:wc:ra_dav:version-url
V 61
/svn/!svn/ver/507/trunk/src/contrib/Google_ComputeService.php
END
Google_AdsenseService.php
K 25
svn:wc:ra_dav:version-url
V 61
/svn/!svn/ver/501/trunk/src/contrib/Google_AdsenseService.php
END
Google_YoutubeService.php
K 25
svn:wc:ra_dav:version-url
V 61
/svn/!svn/ver/506/trunk/src/contrib/Google_YoutubeService.php
END
Google_TranslateService.php
K 25
svn:wc:ra_dav:version-url
V 63
/svn/!svn/ver/474/trunk/src/contrib/Google_TranslateService.php
END
Google_FusiontablesService.php
K 25
svn:wc:ra_dav:version-url
V 66
/svn/!svn/ver/475/trunk/src/contrib/Google_FusiontablesService.php
END
Google_PagespeedonlineService.php
K 25
svn:wc:ra_dav:version-url
V 69
/svn/!svn/ver/474/trunk/src/contrib/Google_PagespeedonlineService.php
END
Google_GanService.php
K 25
svn:wc:ra_dav:version-url
V 57
/svn/!svn/ver/508/trunk/src/contrib/Google_GanService.php
END
Google_TaskqueueService.php
K 25
svn:wc:ra_dav:version-url
V 63
/svn/!svn/ver/474/trunk/src/contrib/Google_TaskqueueService.php
END
Google_DriveService.php
K 25
svn:wc:ra_dav:version-url
V 59
/svn/!svn/ver/504/trunk/src/contrib/Google_DriveService.php
END
Google_LatitudeService.php
K 25
svn:wc:ra_dav:version-url
V 62
/svn/!svn/ver/474/trunk/src/contrib/Google_LatitudeService.php
END
Google_LicensingService.php
K 25
svn:wc:ra_dav:version-url
V 63
/svn/!svn/ver/480/trunk/src/contrib/Google_LicensingService.php
END
Google_FreebaseService.php
K 25
svn:wc:ra_dav:version-url
V 62
/svn/!svn/ver/480/trunk/src/contrib/Google_FreebaseService.php
END
Google_BooksService.php
K 25
svn:wc:ra_dav:version-url
V 59
/svn/!svn/ver/483/trunk/src/contrib/Google_BooksService.php
END
Google_AdsensehostService.php
K 25
svn:wc:ra_dav:version-url
V 65
/svn/!svn/ver/501/trunk/src/contrib/Google_AdsensehostService.php
END
Google_BloggerService.php
K 25
svn:wc:ra_dav:version-url
V 61
/svn/!svn/ver/474/trunk/src/contrib/Google_BloggerService.php
END
Google_PlusService.php
K 25
svn:wc:ra_dav:version-url
V 58
/svn/!svn/ver/501/trunk/src/contrib/Google_PlusService.php
END
Google_TasksService.php
K 25
svn:wc:ra_dav:version-url
V 59
/svn/!svn/ver/474/trunk/src/contrib/Google_TasksService.php
END
Google_PlusMomentsService.php
K 25
svn:wc:ra_dav:version-url
V 65
/svn/!svn/ver/474/trunk/src/contrib/Google_PlusMomentsService.php
END
Google_AnalyticsService.php
K 25
svn:wc:ra_dav:version-url
V 63
/svn/!svn/ver/474/trunk/src/contrib/Google_AnalyticsService.php
END
Google_ShoppingService.php
K 25
svn:wc:ra_dav:version-url
V 62
/svn/!svn/ver/474/trunk/src/contrib/Google_ShoppingService.php
END
Google_BigqueryService.php
K 25
svn:wc:ra_dav:version-url
V 62
/svn/!svn/ver/484/trunk/src/contrib/Google_BigqueryService.php
END
Google_WebfontsService.php
K 25
svn:wc:ra_dav:version-url
V 62
/svn/!svn/ver/474/trunk/src/contrib/Google_WebfontsService.php
END
Google_ModeratorService.php
K 25
svn:wc:ra_dav:version-url
V 63
/svn/!svn/ver/474/trunk/src/contrib/Google_ModeratorService.php
END
Google_UrlshortenerService.php
K 25
svn:wc:ra_dav:version-url
V 66
/svn/!svn/ver/474/trunk/src/contrib/Google_UrlshortenerService.php
END
Google_AdexchangebuyerService.php
K 25
svn:wc:ra_dav:version-url
V 69
/svn/!svn/ver/501/trunk/src/contrib/Google_AdexchangebuyerService.php
END
Google_CustomsearchService.php
K 25
svn:wc:ra_dav:version-url
V 66
/svn/!svn/ver/474/trunk/src/contrib/Google_CustomsearchService.php
END
Google_PredictionService.php
K 25
svn:wc:ra_dav:version-url
V 64
/svn/!svn/ver/474/trunk/src/contrib/Google_PredictionService.php
END
Google_Oauth2Service.php
K 25
svn:wc:ra_dav:version-url
V 60
/svn/!svn/ver/475/trunk/src/contrib/Google_Oauth2Service.php
END
Google_OrkutService.php
K 25
svn:wc:ra_dav:version-url
V 59
/svn/!svn/ver/474/trunk/src/contrib/Google_OrkutService.php
END
Google_StorageService.php
K 25
svn:wc:ra_dav:version-url
V 61
/svn/!svn/ver/474/trunk/src/contrib/Google_StorageService.php
END
Google_SiteVerificationService.php
K 25
svn:wc:ra_dav:version-url
V 70
/svn/!svn/ver/474/trunk/src/contrib/Google_SiteVerificationService.php
END
Google_CalendarService.php
K 25
svn:wc:ra_dav:version-url
V 62
/svn/!svn/ver/474/trunk/src/contrib/Google_CalendarService.php
END

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,567 @@
<?php
/*
* 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.
*/
/**
* The "directDeals" collection of methods.
* Typical usage is:
* <code>
* $adexchangebuyerService = new Google_AdexchangebuyerService(...);
* $directDeals = $adexchangebuyerService->directDeals;
* </code>
*/
class Google_DirectDealsServiceResource extends Google_ServiceResource {
/**
* Retrieves the authenticated user's list of direct deals. (directDeals.list)
*
* @param array $optParams Optional parameters.
* @return Google_DirectDealsList
*/
public function listDirectDeals($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_DirectDealsList($data);
} else {
return $data;
}
}
/**
* Gets one direct deal by ID. (directDeals.get)
*
* @param string $id The direct deal id
* @param array $optParams Optional parameters.
* @return Google_DirectDeal
*/
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 Google_DirectDeal($data);
} else {
return $data;
}
}
}
/**
* The "accounts" collection of methods.
* Typical usage is:
* <code>
* $adexchangebuyerService = new Google_AdexchangebuyerService(...);
* $accounts = $adexchangebuyerService->accounts;
* </code>
*/
class Google_AccountsServiceResource extends Google_ServiceResource {
/**
* Updates an existing account. This method supports patch semantics. (accounts.patch)
*
* @param int $id The account id
* @param Google_Account $postBody
* @param array $optParams Optional parameters.
* @return Google_Account
*/
public function patch($id, Google_Account $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 Google_Account($data);
} else {
return $data;
}
}
/**
* Retrieves the authenticated user's list of accounts. (accounts.list)
*
* @param array $optParams Optional parameters.
* @return Google_AccountsList
*/
public function listAccounts($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AccountsList($data);
} else {
return $data;
}
}
/**
* Updates an existing account. (accounts.update)
*
* @param int $id The account id
* @param Google_Account $postBody
* @param array $optParams Optional parameters.
* @return Google_Account
*/
public function update($id, Google_Account $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 Google_Account($data);
} else {
return $data;
}
}
/**
* Gets one account by ID. (accounts.get)
*
* @param int $id The account id
* @param array $optParams Optional parameters.
* @return Google_Account
*/
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 Google_Account($data);
} else {
return $data;
}
}
}
/**
* The "creatives" collection of methods.
* Typical usage is:
* <code>
* $adexchangebuyerService = new Google_AdexchangebuyerService(...);
* $creatives = $adexchangebuyerService->creatives;
* </code>
*/
class Google_CreativesServiceResource extends Google_ServiceResource {
/**
* Submit a new creative. (creatives.insert)
*
* @param Google_Creative $postBody
* @param array $optParams Optional parameters.
* @return Google_Creative
*/
public function insert(Google_Creative $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Creative($data);
} else {
return $data;
}
}
/**
* Retrieves a list of the authenticated user's active creatives. (creatives.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional.
* @opt_param string maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional.
* @return Google_CreativesList
*/
public function listCreatives($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CreativesList($data);
} else {
return $data;
}
}
/**
* Gets the status for a single creative. (creatives.get)
*
* @param int $accountId The id for the account that will serve this creative.
* @param string $buyerCreativeId The buyer-specific id for this creative.
* @param string $adgroupId The adgroup this creative belongs to.
* @param array $optParams Optional parameters.
* @return Google_Creative
*/
public function get($accountId, $buyerCreativeId, $adgroupId, $optParams = array()) {
$params = array('accountId' => $accountId, 'buyerCreativeId' => $buyerCreativeId, 'adgroupId' => $adgroupId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Creative($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Adexchangebuyer (v1).
*
* <p>
* Lets you manage your Ad Exchange Buyer account.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/ad-exchange/buyer-rest" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_AdexchangebuyerService extends Google_Service {
public $directDeals;
public $accounts;
public $creatives;
/**
* Constructs the internal representation of the Adexchangebuyer service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'adexchangebuyer/v1/';
$this->version = 'v1';
$this->serviceName = 'adexchangebuyer';
$client->addService($this->serviceName, $this->version);
$this->directDeals = new Google_DirectDealsServiceResource($this, $this->serviceName, 'directDeals', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "path": "directdeals", "response": {"$ref": "DirectDealsList"}, "id": "adexchangebuyer.directDeals.list", "httpMethod": "GET"}, "get": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"id": {"required": true, "type": "string", "location": "path", "format": "int64"}}, "id": "adexchangebuyer.directDeals.get", "httpMethod": "GET", "path": "directdeals/{id}", "response": {"$ref": "DirectDeal"}}}}', true));
$this->accounts = new Google_AccountsServiceResource($this, $this->serviceName, 'accounts', json_decode('{"methods": {"patch": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"id": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "request": {"$ref": "Account"}, "response": {"$ref": "Account"}, "httpMethod": "PATCH", "path": "accounts/{id}", "id": "adexchangebuyer.accounts.patch"}, "list": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "path": "accounts", "response": {"$ref": "AccountsList"}, "id": "adexchangebuyer.accounts.list", "httpMethod": "GET"}, "update": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"id": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "request": {"$ref": "Account"}, "response": {"$ref": "Account"}, "httpMethod": "PUT", "path": "accounts/{id}", "id": "adexchangebuyer.accounts.update"}, "get": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"id": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "id": "adexchangebuyer.accounts.get", "httpMethod": "GET", "path": "accounts/{id}", "response": {"$ref": "Account"}}}}', true));
$this->creatives = new Google_CreativesServiceResource($this, $this->serviceName, 'creatives', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "request": {"$ref": "Creative"}, "response": {"$ref": "Creative"}, "httpMethod": "POST", "path": "creatives", "id": "adexchangebuyer.creatives.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "1", "type": "integer", "maximum": "1000", "format": "uint32"}}, "response": {"$ref": "CreativesList"}, "httpMethod": "GET", "path": "creatives", "id": "adexchangebuyer.creatives.list"}, "get": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"adgroupId": {"required": true, "type": "string", "location": "query", "format": "int64"}, "buyerCreativeId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "id": "adexchangebuyer.creatives.get", "httpMethod": "GET", "path": "creatives/{accountId}/{buyerCreativeId}", "response": {"$ref": "Creative"}}}}', true));
}
}
class Google_Account extends Google_Model {
public $kind;
public $maximumTotalQps;
protected $__bidderLocationType = 'Google_AccountBidderLocation';
protected $__bidderLocationDataType = 'array';
public $bidderLocation;
public $cookieMatchingNid;
public $id;
public $cookieMatchingUrl;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setMaximumTotalQps($maximumTotalQps) {
$this->maximumTotalQps = $maximumTotalQps;
}
public function getMaximumTotalQps() {
return $this->maximumTotalQps;
}
public function setBidderLocation($bidderLocation) {
$this->assertIsArray($bidderLocation, 'Google_AccountBidderLocation', __METHOD__);
$this->bidderLocation = $bidderLocation;
}
public function getBidderLocation() {
return $this->bidderLocation;
}
public function setCookieMatchingNid($cookieMatchingNid) {
$this->cookieMatchingNid = $cookieMatchingNid;
}
public function getCookieMatchingNid() {
return $this->cookieMatchingNid;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setCookieMatchingUrl($cookieMatchingUrl) {
$this->cookieMatchingUrl = $cookieMatchingUrl;
}
public function getCookieMatchingUrl() {
return $this->cookieMatchingUrl;
}
}
class Google_AccountBidderLocation extends Google_Model {
public $url;
public $maximumQps;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setMaximumQps($maximumQps) {
$this->maximumQps = $maximumQps;
}
public function getMaximumQps() {
return $this->maximumQps;
}
}
class Google_AccountsList extends Google_Model {
protected $__itemsType = 'Google_Account';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems($items) {
$this->assertIsArray($items, 'Google_Account', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Creative extends Google_Model {
public $productCategories;
public $advertiserName;
public $adgroupId;
public $videoURL;
public $width;
public $attribute;
public $kind;
public $height;
public $advertiserId;
public $HTMLSnippet;
public $status;
public $buyerCreativeId;
public $clickThroughUrl;
public $vendorType;
public $disapprovalReasons;
public $sensitiveCategories;
public $accountId;
public function setProductCategories($productCategories) {
$this->productCategories = $productCategories;
}
public function getProductCategories() {
return $this->productCategories;
}
public function setAdvertiserName($advertiserName) {
$this->advertiserName = $advertiserName;
}
public function getAdvertiserName() {
return $this->advertiserName;
}
public function setAdgroupId($adgroupId) {
$this->adgroupId = $adgroupId;
}
public function getAdgroupId() {
return $this->adgroupId;
}
public function setVideoURL($videoURL) {
$this->videoURL = $videoURL;
}
public function getVideoURL() {
return $this->videoURL;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setAttribute($attribute) {
$this->attribute = $attribute;
}
public function getAttribute() {
return $this->attribute;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
public function setAdvertiserId($advertiserId) {
$this->advertiserId = $advertiserId;
}
public function getAdvertiserId() {
return $this->advertiserId;
}
public function setHTMLSnippet($HTMLSnippet) {
$this->HTMLSnippet = $HTMLSnippet;
}
public function getHTMLSnippet() {
return $this->HTMLSnippet;
}
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setBuyerCreativeId($buyerCreativeId) {
$this->buyerCreativeId = $buyerCreativeId;
}
public function getBuyerCreativeId() {
return $this->buyerCreativeId;
}
public function setClickThroughUrl($clickThroughUrl) {
$this->clickThroughUrl = $clickThroughUrl;
}
public function getClickThroughUrl() {
return $this->clickThroughUrl;
}
public function setVendorType($vendorType) {
$this->vendorType = $vendorType;
}
public function getVendorType() {
return $this->vendorType;
}
public function setDisapprovalReasons($disapprovalReasons) {
$this->disapprovalReasons = $disapprovalReasons;
}
public function getDisapprovalReasons() {
return $this->disapprovalReasons;
}
public function setSensitiveCategories($sensitiveCategories) {
$this->sensitiveCategories = $sensitiveCategories;
}
public function getSensitiveCategories() {
return $this->sensitiveCategories;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_CreativesList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Creative';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Creative', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_DirectDeal extends Google_Model {
public $advertiser;
public $kind;
public $currencyCode;
public $fixedCpm;
public $startTime;
public $endTime;
public $sellerNetwork;
public $id;
public $accountId;
public function setAdvertiser($advertiser) {
$this->advertiser = $advertiser;
}
public function getAdvertiser() {
return $this->advertiser;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setCurrencyCode($currencyCode) {
$this->currencyCode = $currencyCode;
}
public function getCurrencyCode() {
return $this->currencyCode;
}
public function setFixedCpm($fixedCpm) {
$this->fixedCpm = $fixedCpm;
}
public function getFixedCpm() {
return $this->fixedCpm;
}
public function setStartTime($startTime) {
$this->startTime = $startTime;
}
public function getStartTime() {
return $this->startTime;
}
public function setEndTime($endTime) {
$this->endTime = $endTime;
}
public function getEndTime() {
return $this->endTime;
}
public function setSellerNetwork($sellerNetwork) {
$this->sellerNetwork = $sellerNetwork;
}
public function getSellerNetwork() {
return $this->sellerNetwork;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_DirectDealsList extends Google_Model {
public $kind;
protected $__directDealsType = 'Google_DirectDeal';
protected $__directDealsDataType = 'array';
public $directDeals;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDirectDeals($directDeals) {
$this->assertIsArray($directDeals, 'Google_DirectDeal', __METHOD__);
$this->directDeals = $directDeals;
}
public function getDirectDeals() {
return $this->directDeals;
}
}

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 it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,836 @@
<?php
/*
* 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.
*/
/**
* The "cse" collection of methods.
* Typical usage is:
* <code>
* $customsearchService = new Google_CustomsearchService(...);
* $cse = $customsearchService->cse;
* </code>
*/
class Google_CseServiceResource extends Google_ServiceResource {
/**
* 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.
*
* @opt_param string sort The sort expression to apply to the results
* @opt_param string orTerms Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms
* @opt_param string highRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
* @opt_param string num Number of search results to return
* @opt_param string cr Country restrict(s).
* @opt_param string imgType Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.
* @opt_param string gl Geolocation of end user.
* @opt_param string relatedSite Specifies that all search results should be pages that are related to the specified URL
* @opt_param string searchType Specifies the search type: image.
* @opt_param string fileType Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...
* @opt_param string start The index of the first result to return
* @opt_param string imgDominantColor Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown.
* @opt_param string lr The language restriction for the search results
* @opt_param string siteSearch Specifies all search results should be pages from a given site
* @opt_param string cref The URL of a linked custom search engine
* @opt_param string dateRestrict Specifies all search results are from a time period
* @opt_param string safe Search safety level
* @opt_param string c2coff Turns off the translation between zh-CN and zh-TW.
* @opt_param string googlehost The local Google domain to use to perform the search.
* @opt_param string hq Appends the extra query terms to the query.
* @opt_param string exactTerms Identifies a phrase that all documents in the search results must contain
* @opt_param string hl Sets the user interface language.
* @opt_param string lowRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
* @opt_param string imgSize Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.
* @opt_param string imgColorType Returns black and white, grayscale, or color images: mono, gray, and color.
* @opt_param string rights Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.
* @opt_param string excludeTerms Identifies a word or phrase that should not appear in any documents in the search results
* @opt_param string filter Controls turning on or off the duplicate content filter.
* @opt_param string linkSite Specifies that all search results should contain a link to a particular URL
* @opt_param string cx The custom search engine ID to scope this search query
* @opt_param string siteSearchFilter Controls whether to include or exclude results from the site named in the as_sitesearch parameter
* @return Google_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 Google_Search($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_CustomsearchService extends Google_Service {
public $cse;
/**
* Constructs the internal representation of the Customsearch service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'customsearch/';
$this->version = 'v1';
$this->serviceName = 'customsearch';
$client->addService($this->serviceName, $this->version);
$this->cse = new Google_CseServiceResource($this, $this->serviceName, 'cse', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "Search"}, "id": "search.cse.list", "parameters": {"sort": {"type": "string", "location": "query"}, "orTerms": {"type": "string", "location": "query"}, "highRange": {"type": "string", "location": "query"}, "num": {"default": "10", "type": "integer", "location": "query", "format": "uint32"}, "cr": {"type": "string", "location": "query"}, "imgType": {"enum": ["clipart", "face", "lineart", "news", "photo"], "type": "string", "location": "query"}, "gl": {"type": "string", "location": "query"}, "q": {"required": true, "type": "string", "location": "query"}, "relatedSite": {"type": "string", "location": "query"}, "searchType": {"enum": ["image"], "type": "string", "location": "query"}, "fileType": {"type": "string", "location": "query"}, "start": {"type": "integer", "location": "query", "format": "uint32"}, "imgDominantColor": {"enum": ["black", "blue", "brown", "gray", "green", "pink", "purple", "teal", "white", "yellow"], "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"}, "siteSearch": {"type": "string", "location": "query"}, "cref": {"type": "string", "location": "query"}, "dateRestrict": {"type": "string", "location": "query"}, "safe": {"default": "off", "enum": ["high", "medium", "off"], "type": "string", "location": "query"}, "c2coff": {"type": "string", "location": "query"}, "googlehost": {"type": "string", "location": "query"}, "hq": {"type": "string", "location": "query"}, "exactTerms": {"type": "string", "location": "query"}, "hl": {"type": "string", "location": "query"}, "lowRange": {"type": "string", "location": "query"}, "imgSize": {"enum": ["huge", "icon", "large", "medium", "small", "xlarge", "xxlarge"], "type": "string", "location": "query"}, "imgColorType": {"enum": ["color", "gray", "mono"], "type": "string", "location": "query"}, "rights": {"type": "string", "location": "query"}, "excludeTerms": {"type": "string", "location": "query"}, "filter": {"enum": ["0", "1"], "type": "string", "location": "query"}, "linkSite": {"type": "string", "location": "query"}, "cx": {"type": "string", "location": "query"}, "siteSearchFilter": {"enum": ["e", "i"], "type": "string", "location": "query"}}, "path": "v1"}}}', true));
}
}
class Google_Context extends Google_Model {
protected $__facetsType = 'Google_ContextFacets';
protected $__facetsDataType = 'array';
public $facets;
public $title;
public function setFacets(/* array(Google_ContextFacets) */ $facets) {
$this->assertIsArray($facets, 'Google_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 Google_ContextFacets extends Google_Model {
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 Google_Promotion extends Google_Model {
public $title;
public $displayLink;
public $htmlTitle;
public $link;
protected $__bodyLinesType = 'Google_PromotionBodyLines';
protected $__bodyLinesDataType = 'array';
public $bodyLines;
protected $__imageType = 'Google_PromotionImage';
protected $__imageDataType = '';
public $image;
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 setHtmlTitle($htmlTitle) {
$this->htmlTitle = $htmlTitle;
}
public function getHtmlTitle() {
return $this->htmlTitle;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setBodyLines(/* array(Google_PromotionBodyLines) */ $bodyLines) {
$this->assertIsArray($bodyLines, 'Google_PromotionBodyLines', __METHOD__);
$this->bodyLines = $bodyLines;
}
public function getBodyLines() {
return $this->bodyLines;
}
public function setImage(Google_PromotionImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
}
class Google_PromotionBodyLines extends Google_Model {
public $url;
public $htmlTitle;
public $link;
public $title;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setHtmlTitle($htmlTitle) {
$this->htmlTitle = $htmlTitle;
}
public function getHtmlTitle() {
return $this->htmlTitle;
}
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 Google_PromotionImage extends Google_Model {
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 Google_Query extends Google_Model {
public $sort;
public $inputEncoding;
public $orTerms;
public $highRange;
public $cx;
public $startPage;
public $disableCnTwTranslation;
public $cr;
public $imgType;
public $gl;
public $relatedSite;
public $searchType;
public $title;
public $googleHost;
public $fileType;
public $imgDominantColor;
public $siteSearch;
public $cref;
public $dateRestrict;
public $safe;
public $outputEncoding;
public $hq;
public $searchTerms;
public $exactTerms;
public $language;
public $hl;
public $totalResults;
public $lowRange;
public $count;
public $imgSize;
public $imgColorType;
public $rights;
public $startIndex;
public $excludeTerms;
public $filter;
public $linkSite;
public $siteSearchFilter;
public function setSort($sort) {
$this->sort = $sort;
}
public function getSort() {
return $this->sort;
}
public function setInputEncoding($inputEncoding) {
$this->inputEncoding = $inputEncoding;
}
public function getInputEncoding() {
return $this->inputEncoding;
}
public function setOrTerms($orTerms) {
$this->orTerms = $orTerms;
}
public function getOrTerms() {
return $this->orTerms;
}
public function setHighRange($highRange) {
$this->highRange = $highRange;
}
public function getHighRange() {
return $this->highRange;
}
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 setDisableCnTwTranslation($disableCnTwTranslation) {
$this->disableCnTwTranslation = $disableCnTwTranslation;
}
public function getDisableCnTwTranslation() {
return $this->disableCnTwTranslation;
}
public function setCr($cr) {
$this->cr = $cr;
}
public function getCr() {
return $this->cr;
}
public function setImgType($imgType) {
$this->imgType = $imgType;
}
public function getImgType() {
return $this->imgType;
}
public function setGl($gl) {
$this->gl = $gl;
}
public function getGl() {
return $this->gl;
}
public function setRelatedSite($relatedSite) {
$this->relatedSite = $relatedSite;
}
public function getRelatedSite() {
return $this->relatedSite;
}
public function setSearchType($searchType) {
$this->searchType = $searchType;
}
public function getSearchType() {
return $this->searchType;
}
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 setFileType($fileType) {
$this->fileType = $fileType;
}
public function getFileType() {
return $this->fileType;
}
public function setImgDominantColor($imgDominantColor) {
$this->imgDominantColor = $imgDominantColor;
}
public function getImgDominantColor() {
return $this->imgDominantColor;
}
public function setSiteSearch($siteSearch) {
$this->siteSearch = $siteSearch;
}
public function getSiteSearch() {
return $this->siteSearch;
}
public function setCref($cref) {
$this->cref = $cref;
}
public function getCref() {
return $this->cref;
}
public function setDateRestrict($dateRestrict) {
$this->dateRestrict = $dateRestrict;
}
public function getDateRestrict() {
return $this->dateRestrict;
}
public function setSafe($safe) {
$this->safe = $safe;
}
public function getSafe() {
return $this->safe;
}
public function setOutputEncoding($outputEncoding) {
$this->outputEncoding = $outputEncoding;
}
public function getOutputEncoding() {
return $this->outputEncoding;
}
public function setHq($hq) {
$this->hq = $hq;
}
public function getHq() {
return $this->hq;
}
public function setSearchTerms($searchTerms) {
$this->searchTerms = $searchTerms;
}
public function getSearchTerms() {
return $this->searchTerms;
}
public function setExactTerms($exactTerms) {
$this->exactTerms = $exactTerms;
}
public function getExactTerms() {
return $this->exactTerms;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
public function setHl($hl) {
$this->hl = $hl;
}
public function getHl() {
return $this->hl;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
public function setLowRange($lowRange) {
$this->lowRange = $lowRange;
}
public function getLowRange() {
return $this->lowRange;
}
public function setCount($count) {
$this->count = $count;
}
public function getCount() {
return $this->count;
}
public function setImgSize($imgSize) {
$this->imgSize = $imgSize;
}
public function getImgSize() {
return $this->imgSize;
}
public function setImgColorType($imgColorType) {
$this->imgColorType = $imgColorType;
}
public function getImgColorType() {
return $this->imgColorType;
}
public function setRights($rights) {
$this->rights = $rights;
}
public function getRights() {
return $this->rights;
}
public function setStartIndex($startIndex) {
$this->startIndex = $startIndex;
}
public function getStartIndex() {
return $this->startIndex;
}
public function setExcludeTerms($excludeTerms) {
$this->excludeTerms = $excludeTerms;
}
public function getExcludeTerms() {
return $this->excludeTerms;
}
public function setFilter($filter) {
$this->filter = $filter;
}
public function getFilter() {
return $this->filter;
}
public function setLinkSite($linkSite) {
$this->linkSite = $linkSite;
}
public function getLinkSite() {
return $this->linkSite;
}
public function setSiteSearchFilter($siteSearchFilter) {
$this->siteSearchFilter = $siteSearchFilter;
}
public function getSiteSearchFilter() {
return $this->siteSearchFilter;
}
}
class Google_Result extends Google_Model {
public $snippet;
public $kind;
protected $__labelsType = 'Google_ResultLabels';
protected $__labelsDataType = 'array';
public $labels;
public $title;
public $displayLink;
public $cacheId;
public $formattedUrl;
public $htmlFormattedUrl;
public $pagemap;
public $htmlTitle;
public $htmlSnippet;
public $link;
protected $__imageType = 'Google_ResultImage';
protected $__imageDataType = '';
public $image;
public $mime;
public $fileFormat;
public function setSnippet($snippet) {
$this->snippet = $snippet;
}
public function getSnippet() {
return $this->snippet;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setLabels(/* array(Google_ResultLabels) */ $labels) {
$this->assertIsArray($labels, 'Google_ResultLabels', __METHOD__);
$this->labels = $labels;
}
public function getLabels() {
return $this->labels;
}
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 setFormattedUrl($formattedUrl) {
$this->formattedUrl = $formattedUrl;
}
public function getFormattedUrl() {
return $this->formattedUrl;
}
public function setHtmlFormattedUrl($htmlFormattedUrl) {
$this->htmlFormattedUrl = $htmlFormattedUrl;
}
public function getHtmlFormattedUrl() {
return $this->htmlFormattedUrl;
}
public function setPagemap($pagemap) {
$this->pagemap = $pagemap;
}
public function getPagemap() {
return $this->pagemap;
}
public function setHtmlTitle($htmlTitle) {
$this->htmlTitle = $htmlTitle;
}
public function getHtmlTitle() {
return $this->htmlTitle;
}
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 setImage(Google_ResultImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setMime($mime) {
$this->mime = $mime;
}
public function getMime() {
return $this->mime;
}
public function setFileFormat($fileFormat) {
$this->fileFormat = $fileFormat;
}
public function getFileFormat() {
return $this->fileFormat;
}
}
class Google_ResultImage extends Google_Model {
public $thumbnailWidth;
public $byteSize;
public $height;
public $width;
public $contextLink;
public $thumbnailLink;
public $thumbnailHeight;
public function setThumbnailWidth($thumbnailWidth) {
$this->thumbnailWidth = $thumbnailWidth;
}
public function getThumbnailWidth() {
return $this->thumbnailWidth;
}
public function setByteSize($byteSize) {
$this->byteSize = $byteSize;
}
public function getByteSize() {
return $this->byteSize;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setContextLink($contextLink) {
$this->contextLink = $contextLink;
}
public function getContextLink() {
return $this->contextLink;
}
public function setThumbnailLink($thumbnailLink) {
$this->thumbnailLink = $thumbnailLink;
}
public function getThumbnailLink() {
return $this->thumbnailLink;
}
public function setThumbnailHeight($thumbnailHeight) {
$this->thumbnailHeight = $thumbnailHeight;
}
public function getThumbnailHeight() {
return $this->thumbnailHeight;
}
}
class Google_ResultLabels extends Google_Model {
public $displayName;
public $name;
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_Search extends Google_Model {
protected $__promotionsType = 'Google_Promotion';
protected $__promotionsDataType = 'array';
public $promotions;
public $kind;
protected $__urlType = 'Google_SearchUrl';
protected $__urlDataType = '';
public $url;
protected $__itemsType = 'Google_Result';
protected $__itemsDataType = 'array';
public $items;
protected $__contextType = 'Google_Context';
protected $__contextDataType = '';
public $context;
protected $__queriesType = 'Google_Query';
protected $__queriesDataType = 'map';
public $queries;
protected $__spellingType = 'Google_SearchSpelling';
protected $__spellingDataType = '';
public $spelling;
protected $__searchInformationType = 'Google_SearchSearchInformation';
protected $__searchInformationDataType = '';
public $searchInformation;
public function setPromotions(/* array(Google_Promotion) */ $promotions) {
$this->assertIsArray($promotions, 'Google_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(Google_SearchUrl $url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setItems(/* array(Google_Result) */ $items) {
$this->assertIsArray($items, 'Google_Result', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setContext(Google_Context $context) {
$this->context = $context;
}
public function getContext() {
return $this->context;
}
public function setQueries(Google_Query $queries) {
$this->queries = $queries;
}
public function getQueries() {
return $this->queries;
}
public function setSpelling(Google_SearchSpelling $spelling) {
$this->spelling = $spelling;
}
public function getSpelling() {
return $this->spelling;
}
public function setSearchInformation(Google_SearchSearchInformation $searchInformation) {
$this->searchInformation = $searchInformation;
}
public function getSearchInformation() {
return $this->searchInformation;
}
}
class Google_SearchSearchInformation extends Google_Model {
public $formattedSearchTime;
public $formattedTotalResults;
public $totalResults;
public $searchTime;
public function setFormattedSearchTime($formattedSearchTime) {
$this->formattedSearchTime = $formattedSearchTime;
}
public function getFormattedSearchTime() {
return $this->formattedSearchTime;
}
public function setFormattedTotalResults($formattedTotalResults) {
$this->formattedTotalResults = $formattedTotalResults;
}
public function getFormattedTotalResults() {
return $this->formattedTotalResults;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
public function setSearchTime($searchTime) {
$this->searchTime = $searchTime;
}
public function getSearchTime() {
return $this->searchTime;
}
}
class Google_SearchSpelling extends Google_Model {
public $correctedQuery;
public $htmlCorrectedQuery;
public function setCorrectedQuery($correctedQuery) {
$this->correctedQuery = $correctedQuery;
}
public function getCorrectedQuery() {
return $this->correctedQuery;
}
public function setHtmlCorrectedQuery($htmlCorrectedQuery) {
$this->htmlCorrectedQuery = $htmlCorrectedQuery;
}
public function getHtmlCorrectedQuery() {
return $this->htmlCorrectedQuery;
}
}
class Google_SearchUrl extends Google_Model {
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;
}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,89 @@
<?php
/*
* 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.
*/
/**
* The "text" collection of methods.
* Typical usage is:
* <code>
* $freebaseService = new Google_FreebaseService(...);
* $text = $freebaseService->text;
* </code>
*/
class Google_TextServiceResource extends Google_ServiceResource {
/**
* 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.
*
* @opt_param string maxlength The max number of characters to return. Valid only for 'plain' format.
* @opt_param string format Sanitizing transformation.
* @return Google_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 Google_ContentserviceGet($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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/API" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_FreebaseService extends Google_Service {
public $text;
/**
* Constructs the internal representation of the Freebase service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'freebase/v1/';
$this->version = 'v1';
$this->serviceName = 'freebase';
$client->addService($this->serviceName, $this->version);
$this->text = new Google_TextServiceResource($this, $this->serviceName, 'text', json_decode('{"methods": {"get": {"httpMethod": "GET", "response": {"$ref": "ContentserviceGet"}, "id": "freebase.text.get", "parameters": {"maxlength": {"type": "integer", "location": "query", "format": "uint32"}, "id": {"repeated": true, "required": true, "type": "string", "location": "path"}, "format": {"default": "plain", "enum": ["html", "plain", "raw"], "type": "string", "location": "query"}}, "path": "text{/id*}"}}}', true));
}
}
class Google_ContentserviceGet extends Google_Model {
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

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,283 @@
<?php
/*
* 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.
*/
/**
* The "currentLocation" collection of methods.
* Typical usage is:
* <code>
* $latitudeService = new Google_LatitudeService(...);
* $currentLocation = $latitudeService->currentLocation;
* </code>
*/
class Google_CurrentLocationServiceResource extends Google_ServiceResource {
/**
* Updates or creates the user's current location. (currentLocation.insert)
*
* @param Google_Location $postBody
* @param array $optParams Optional parameters.
* @return Google_Location
*/
public function insert(Google_Location $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Location($data);
} else {
return $data;
}
}
/**
* Returns the authenticated user's current location. (currentLocation.get)
*
* @param array $optParams Optional parameters.
*
* @opt_param string granularity Granularity of the requested location.
* @return Google_Location
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Location($data);
} else {
return $data;
}
}
/**
* Deletes the authenticated user's current location. (currentLocation.delete)
*
* @param array $optParams Optional parameters.
*/
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 Google_LatitudeService(...);
* $location = $latitudeService->location;
* </code>
*/
class Google_LocationServiceResource extends Google_ServiceResource {
/**
* Inserts or updates a location in the user's location history. (location.insert)
*
* @param Google_Location $postBody
* @param array $optParams Optional parameters.
* @return Google_Location
*/
public function insert(Google_Location $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_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.
*
* @opt_param string granularity Granularity of the location to return.
* @return Google_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 Google_Location($data);
} else {
return $data;
}
}
/**
* Lists the user's location history. (location.list)
*
* @param array $optParams Optional parameters.
*
* @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 Google_LocationFeed
*/
public function listLocation($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_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).
* @param array $optParams Optional parameters.
*/
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 Google_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="https://developers.google.com/latitude/v1/using" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_LatitudeService extends Google_Service {
public $currentLocation;
public $location;
/**
* Constructs the internal representation of the Latitude service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'latitude/v1/';
$this->version = 'v1';
$this->serviceName = 'latitude';
$client->addService($this->serviceName, $this->version);
$this->currentLocation = new Google_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"}, "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": {"default": "city", "enum": ["best", "city"], "type": "string", "location": "query"}}, "response": {"$ref": "LatitudeCurrentlocationResourceJson"}, "httpMethod": "GET", "path": "currentLocation", "id": "latitude.currentLocation.get"}, "delete": {"path": "currentLocation", "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"], "id": "latitude.currentLocation.delete", "httpMethod": "DELETE"}}}', true));
$this->location = new Google_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"}, "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": {"default": "city", "enum": ["best", "city"], "type": "string", "location": "query"}}, "id": "latitude.location.get", "httpMethod": "GET", "path": "location/{locationId}", "response": {"$ref": "Location"}}, "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": {"default": "city", "enum": ["best", "city"], "type": "string", "location": "query"}}, "response": {"$ref": "LocationFeed"}, "httpMethod": "GET", "path": "location", "id": "latitude.location.list"}, "delete": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "path": "location/{locationId}", "id": "latitude.location.delete", "parameters": {"locationId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_Location extends Google_Model {
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 Google_LocationFeed extends Google_Model {
protected $__itemsType = 'Google_Location';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Location) */ $items) {
$this->assertIsArray($items, 'Google_Location', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}

View file

@ -0,0 +1,285 @@
<?php
/*
* 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.
*/
/**
* The "licenseAssignments" collection of methods.
* Typical usage is:
* <code>
* $licensingService = new Google_LicensingService(...);
* $licenseAssignments = $licensingService->licenseAssignments;
* </code>
*/
class Google_LicenseAssignmentsServiceResource extends Google_ServiceResource {
/**
* Assign License. (licenseAssignments.insert)
*
* @param string $productId Name for product
* @param string $skuId Name for sku
* @param Google_LicenseAssignmentInsert $postBody
* @param array $optParams Optional parameters.
* @return Google_LicenseAssignment
*/
public function insert($productId, $skuId, Google_LicenseAssignmentInsert $postBody, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignment($data);
} else {
return $data;
}
}
/**
* Get license assignment of a particular product and sku for a user (licenseAssignments.get)
*
* @param string $productId Name for product
* @param string $skuId Name for sku
* @param string $userId email id or unique Id of the user
* @param array $optParams Optional parameters.
* @return Google_LicenseAssignment
*/
public function get($productId, $skuId, $userId, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignment($data);
} else {
return $data;
}
}
/**
* List license assignments for given product and sku of the customer.
* (licenseAssignments.listForProductAndSku)
*
* @param string $productId Name for product
* @param string $skuId Name for sku
* @param string $customerId CustomerId represents the customer for whom licenseassignments are queried
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Token to fetch the next page.Optional. By default server will return first page
* @opt_param string maxResults Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100.
* @return Google_LicenseAssignmentList
*/
public function listForProductAndSku($productId, $skuId, $customerId, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'customerId' => $customerId);
$params = array_merge($params, $optParams);
$data = $this->__call('listForProductAndSku', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignmentList($data);
} else {
return $data;
}
}
/**
* List license assignments for given product of the customer. (licenseAssignments.listForProduct)
*
* @param string $productId Name for product
* @param string $customerId CustomerId represents the customer for whom licenseassignments are queried
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Token to fetch the next page.Optional. By default server will return first page
* @opt_param string maxResults Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100.
* @return Google_LicenseAssignmentList
*/
public function listForProduct($productId, $customerId, $optParams = array()) {
$params = array('productId' => $productId, 'customerId' => $customerId);
$params = array_merge($params, $optParams);
$data = $this->__call('listForProduct', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignmentList($data);
} else {
return $data;
}
}
/**
* Assign License. (licenseAssignments.update)
*
* @param string $productId Name for product
* @param string $skuId Name for sku for which license would be revoked
* @param string $userId email id or unique Id of the user
* @param Google_LicenseAssignment $postBody
* @param array $optParams Optional parameters.
* @return Google_LicenseAssignment
*/
public function update($productId, $skuId, $userId, Google_LicenseAssignment $postBody, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignment($data);
} else {
return $data;
}
}
/**
* Assign License. This method supports patch semantics. (licenseAssignments.patch)
*
* @param string $productId Name for product
* @param string $skuId Name for sku for which license would be revoked
* @param string $userId email id or unique Id of the user
* @param Google_LicenseAssignment $postBody
* @param array $optParams Optional parameters.
* @return Google_LicenseAssignment
*/
public function patch($productId, $skuId, $userId, Google_LicenseAssignment $postBody, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignment($data);
} else {
return $data;
}
}
/**
* Revoke License. (licenseAssignments.delete)
*
* @param string $productId Name for product
* @param string $skuId Name for sku
* @param string $userId email id or unique Id of the user
* @param array $optParams Optional parameters.
*/
public function delete($productId, $skuId, $userId, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Google_Licensing (v1).
*
* <p>
* Licensing API to view and manage license for your domain.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/google-apps/licensing/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_LicensingService extends Google_Service {
public $licenseAssignments;
/**
* Constructs the internal representation of the Licensing service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'apps/licensing/v1/product/';
$this->version = 'v1';
$this->serviceName = 'licensing';
$client->addService($this->serviceName, $this->version);
$this->licenseAssignments = new Google_LicenseAssignmentsServiceResource($this, $this->serviceName, 'licenseAssignments', json_decode('{"methods": {"insert": {"parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "LicenseAssignmentInsert"}, "id": "licensing.licenseAssignments.insert", "httpMethod": "POST", "path": "{productId}/sku/{skuId}/user", "response": {"$ref": "LicenseAssignment"}}, "get": {"httpMethod": "GET", "response": {"$ref": "LicenseAssignment"}, "id": "licensing.licenseAssignments.get", "parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "path": "{productId}/sku/{skuId}/user/{userId}"}, "listForProductAndSku": {"httpMethod": "GET", "response": {"$ref": "LicenseAssignmentList"}, "id": "licensing.licenseAssignments.listForProductAndSku", "parameters": {"pageToken": {"default": "", "type": "string", "location": "query"}, "skuId": {"required": true, "type": "string", "location": "path"}, "customerId": {"required": true, "type": "string", "location": "query"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "1000", "minimum": "1", "location": "query", "type": "integer"}, "productId": {"required": true, "type": "string", "location": "path"}}, "path": "{productId}/sku/{skuId}/users"}, "listForProduct": {"httpMethod": "GET", "response": {"$ref": "LicenseAssignmentList"}, "id": "licensing.licenseAssignments.listForProduct", "parameters": {"pageToken": {"default": "", "type": "string", "location": "query"}, "customerId": {"required": true, "type": "string", "location": "query"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "1000", "minimum": "1", "location": "query", "type": "integer"}, "productId": {"required": true, "type": "string", "location": "path"}}, "path": "{productId}/users"}, "update": {"parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "LicenseAssignment"}, "id": "licensing.licenseAssignments.update", "httpMethod": "PUT", "path": "{productId}/sku/{skuId}/user/{userId}", "response": {"$ref": "LicenseAssignment"}}, "patch": {"parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "LicenseAssignment"}, "id": "licensing.licenseAssignments.patch", "httpMethod": "PATCH", "path": "{productId}/sku/{skuId}/user/{userId}", "response": {"$ref": "LicenseAssignment"}}, "delete": {"httpMethod": "DELETE", "id": "licensing.licenseAssignments.delete", "parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "path": "{productId}/sku/{skuId}/user/{userId}"}}}', true));
}
}
class Google_LicenseAssignment extends Google_Model {
public $skuId;
public $kind;
public $userId;
public $etags;
public $selfLink;
public $productId;
public function setSkuId($skuId) {
$this->skuId = $skuId;
}
public function getSkuId() {
return $this->skuId;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setUserId($userId) {
$this->userId = $userId;
}
public function getUserId() {
return $this->userId;
}
public function setEtags($etags) {
$this->etags = $etags;
}
public function getEtags() {
return $this->etags;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setProductId($productId) {
$this->productId = $productId;
}
public function getProductId() {
return $this->productId;
}
}
class Google_LicenseAssignmentInsert extends Google_Model {
public $userId;
public function setUserId($userId) {
$this->userId = $userId;
}
public function getUserId() {
return $this->userId;
}
}
class Google_LicenseAssignmentList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_LicenseAssignment';
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(Google_LicenseAssignment) */ $items) {
$this->assertIsArray($items, 'Google_LicenseAssignment', __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;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,265 @@
<?php
/*
* 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.
*/
/**
* The "userinfo" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new Google_Oauth2Service(...);
* $userinfo = $oauth2Service->userinfo;
* </code>
*/
class Google_UserinfoServiceResource extends Google_ServiceResource {
/**
* (userinfo.get)
*
* @param array $optParams Optional parameters.
* @return Google_Userinfo
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Userinfo($data);
} else {
return $data;
}
}
}
/**
* The "v2" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new Google_Oauth2Service(...);
* $v2 = $oauth2Service->v2;
* </code>
*/
class Google_UserinfoV2ServiceResource extends Google_ServiceResource {
}
/**
* The "me" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new Google_Oauth2Service(...);
* $me = $oauth2Service->me;
* </code>
*/
class Google_UserinfoV2MeServiceResource extends Google_ServiceResource {
/**
* (me.get)
*
* @param array $optParams Optional parameters.
* @return Google_Userinfo
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Userinfo($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_Oauth2Service extends Google_Service {
public $userinfo;
public $userinfo_v2_me;
/**
* Constructs the internal representation of the Oauth2 service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = '';
$this->version = 'v2';
$this->serviceName = 'oauth2';
$client->addService($this->serviceName, $this->version);
$this->userinfo = new Google_UserinfoServiceResource($this, $this->serviceName, 'userinfo', json_decode('{"methods": {"get": {"path": "oauth2/v2/userinfo", "scopes": ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"], "id": "oauth2.userinfo.get", "httpMethod": "GET", "response": {"$ref": "Userinfo"}}}}', true));
$this->userinfo_v2_me = new Google_UserinfoV2MeServiceResource($this, $this->serviceName, 'me', json_decode('{"methods": {"get": {"path": "userinfo/v2/me", "scopes": ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"], "id": "oauth2.userinfo.v2.me.get", "httpMethod": "GET", "response": {"$ref": "Userinfo"}}}}', true));
}
}
class Google_Tokeninfo extends Google_Model {
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 Google_Userinfo extends Google_Model {
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,474 @@
<?php
/*
* 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.
*/
/**
* The "pagespeedapi" collection of methods.
* Typical usage is:
* <code>
* $pagespeedonlineService = new Google_PagespeedonlineService(...);
* $pagespeedapi = $pagespeedonlineService->pagespeedapi;
* </code>
*/
class Google_PagespeedapiServiceResource extends Google_ServiceResource {
/**
* 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.
*
* @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 Google_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 Google_Result($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_PagespeedonlineService extends Google_Service {
public $pagespeedapi;
/**
* Constructs the internal representation of the Pagespeedonline service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'pagespeedonline/v1/';
$this->version = 'v1';
$this->serviceName = 'pagespeedonline';
$client->addService($this->serviceName, $this->version);
$this->pagespeedapi = new Google_PagespeedapiServiceResource($this, $this->serviceName, 'pagespeedapi', json_decode('{"methods": {"runpagespeed": {"httpMethod": "GET", "response": {"$ref": "Result"}, "id": "pagespeedonline.pagespeedapi.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"}}, "path": "runPagespeed"}}}', true));
}
}
class Google_Result extends Google_Model {
public $kind;
protected $__formattedResultsType = 'Google_ResultFormattedResults';
protected $__formattedResultsDataType = '';
public $formattedResults;
public $title;
protected $__versionType = 'Google_ResultVersion';
protected $__versionDataType = '';
public $version;
public $score;
public $responseCode;
public $invalidRules;
protected $__pageStatsType = 'Google_ResultPageStats';
protected $__pageStatsDataType = '';
public $pageStats;
public $id;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setFormattedResults(Google_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(Google_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(Google_string) */ $invalidRules) {
$this->assertIsArray($invalidRules, 'Google_string', __METHOD__);
$this->invalidRules = $invalidRules;
}
public function getInvalidRules() {
return $this->invalidRules;
}
public function setPageStats(Google_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 Google_ResultFormattedResults extends Google_Model {
public $locale;
protected $__ruleResultsType = 'Google_ResultFormattedResultsRuleResults';
protected $__ruleResultsDataType = 'map';
public $ruleResults;
public function setLocale($locale) {
$this->locale = $locale;
}
public function getLocale() {
return $this->locale;
}
public function setRuleResults(Google_ResultFormattedResultsRuleResults $ruleResults) {
$this->ruleResults = $ruleResults;
}
public function getRuleResults() {
return $this->ruleResults;
}
}
class Google_ResultFormattedResultsRuleResults extends Google_Model {
public $localizedRuleName;
protected $__urlBlocksType = 'Google_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(Google_ResultFormattedResultsRuleResultsUrlBlocks) */ $urlBlocks) {
$this->assertIsArray($urlBlocks, 'Google_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 Google_ResultFormattedResultsRuleResultsUrlBlocks extends Google_Model {
protected $__headerType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksHeader';
protected $__headerDataType = '';
public $header;
protected $__urlsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrls';
protected $__urlsDataType = 'array';
public $urls;
public function setHeader(Google_ResultFormattedResultsRuleResultsUrlBlocksHeader $header) {
$this->header = $header;
}
public function getHeader() {
return $this->header;
}
public function setUrls(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrls) */ $urls) {
$this->assertIsArray($urls, 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrls', __METHOD__);
$this->urls = $urls;
}
public function getUrls() {
return $this->urls;
}
}
class Google_ResultFormattedResultsRuleResultsUrlBlocksHeader extends Google_Model {
protected $__argsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs';
protected $__argsDataType = 'array';
public $args;
public $format;
public function setArgs(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs) */ $args) {
$this->assertIsArray($args, 'Google_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 Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs extends Google_Model {
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 Google_ResultFormattedResultsRuleResultsUrlBlocksUrls extends Google_Model {
protected $__detailsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails';
protected $__detailsDataType = 'array';
public $details;
protected $__resultType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResult';
protected $__resultDataType = '';
public $result;
public function setDetails(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails) */ $details) {
$this->assertIsArray($details, 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails', __METHOD__);
$this->details = $details;
}
public function getDetails() {
return $this->details;
}
public function setResult(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResult $result) {
$this->result = $result;
}
public function getResult() {
return $this->result;
}
}
class Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails extends Google_Model {
protected $__argsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs';
protected $__argsDataType = 'array';
public $args;
public $format;
public function setArgs(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs) */ $args) {
$this->assertIsArray($args, 'Google_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 Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs extends Google_Model {
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 Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResult extends Google_Model {
protected $__argsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs';
protected $__argsDataType = 'array';
public $args;
public $format;
public function setArgs(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs) */ $args) {
$this->assertIsArray($args, 'Google_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 Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs extends Google_Model {
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 Google_ResultPageStats extends Google_Model {
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 Google_ResultVersion extends Google_Model {
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;
}
}

View file

@ -0,0 +1,567 @@
<?php
/*
* 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.
*/
/**
* The "moments" collection of methods.
* Typical usage is:
* <code>
* $plusService = new Google_PlusMomentsService(...);
* $moments = $plusService->moments;
* </code>
*/
class Google_MomentsServiceResource extends Google_ServiceResource {
/**
* Record a user activity (e.g Bill watched a video on Youtube) (moments.insert)
*
* @param string $userId The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user.
* @param string $collection The collection to which to write moments.
* @param Google_Moment $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool debug Return the moment as written. Should be used only for debugging.
* @return Google_Moment
*/
public function insert($userId, $collection, Google_Moment $postBody, $optParams = array()) {
$params = array('userId' => $userId, 'collection' => $collection, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Moment($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Plus (v1moments).
*
* <p>
* The Google+ API enables developers to build on top of the Google+ platform.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/+/history/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_PlusMomentsService extends Google_Service {
public $moments;
/**
* Constructs the internal representation of the Plus service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'plus/v1moments/people/';
$this->version = 'v1moments';
$this->serviceName = 'plus';
$client->addService($this->serviceName, $this->version);
$this->moments = new Google_MomentsServiceResource($this, $this->serviceName, 'moments',
json_decode('{"methods": {"insert": {"parameters": {"debug": {"type": "boolean", "location": "query"}, "userId": {"required": true, "type": "string", "location": "path"}, "collection": {"required": true, "type": "string", "location": "path", "enum": ["vault"]}}, "request": {"$ref": "Moment"}, "response": {"$ref": "Moment"}, "httpMethod": "POST", "path": "{userId}/moments/{collection}", "id": "plus.moments.insert"}}}', true));
}
}
class Google_ItemScope extends Google_Model {
public $startDate;
public $endDate;
public $text;
public $image;
protected $__addressType = 'Google_ItemScope';
protected $__addressDataType = '';
public $address;
public $birthDate;
public $datePublished;
public $addressLocality;
public $duration;
public $additionalName;
public $worstRating;
protected $__contributorType = 'Google_ItemScope';
protected $__contributorDataType = 'array';
public $contributor;
public $thumbnailUrl;
public $id;
public $postOfficeBoxNumber;
protected $__attendeesType = 'Google_ItemScope';
protected $__attendeesDataType = 'array';
public $attendees;
protected $__authorType = 'Google_ItemScope';
protected $__authorDataType = 'array';
public $author;
protected $__associated_mediaType = 'Google_ItemScope';
protected $__associated_mediaDataType = 'array';
public $associated_media;
public $bestRating;
public $addressCountry;
public $width;
public $streetAddress;
protected $__locationType = 'Google_ItemScope';
protected $__locationDataType = '';
public $location;
public $latitude;
protected $__byArtistType = 'Google_ItemScope';
protected $__byArtistDataType = '';
public $byArtist;
public $type;
public $dateModified;
public $contentSize;
public $contentUrl;
protected $__partOfTVSeriesType = 'Google_ItemScope';
protected $__partOfTVSeriesDataType = '';
public $partOfTVSeries;
public $description;
public $familyName;
public $kind;
public $dateCreated;
public $postalCode;
public $attendeeCount;
protected $__inAlbumType = 'Google_ItemScope';
protected $__inAlbumDataType = '';
public $inAlbum;
public $addressRegion;
public $height;
protected $__geoType = 'Google_ItemScope';
protected $__geoDataType = '';
public $geo;
public $embedUrl;
public $tickerSymbol;
public $playerType;
protected $__aboutType = 'Google_ItemScope';
protected $__aboutDataType = '';
public $about;
public $givenName;
public $name;
protected $__performersType = 'Google_ItemScope';
protected $__performersDataType = 'array';
public $performers;
public $url;
public $gender;
public $longitude;
protected $__thumbnailType = 'Google_ItemScope';
protected $__thumbnailDataType = '';
public $thumbnail;
public $caption;
public $ratingValue;
protected $__reviewRatingType = 'Google_ItemScope';
protected $__reviewRatingDataType = '';
public $reviewRating;
protected $__audioType = 'Google_ItemScope';
protected $__audioDataType = '';
public $audio;
public function setStartDate($startDate) {
$this->startDate = $startDate;
}
public function getStartDate() {
return $this->startDate;
}
public function setEndDate($endDate) {
$this->endDate = $endDate;
}
public function getEndDate() {
return $this->endDate;
}
public function setText($text) {
$this->text = $text;
}
public function getText() {
return $this->text;
}
public function setImage($image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setAddress(Google_ItemScope $address) {
$this->address = $address;
}
public function getAddress() {
return $this->address;
}
public function setBirthDate($birthDate) {
$this->birthDate = $birthDate;
}
public function getBirthDate() {
return $this->birthDate;
}
public function setDatePublished($datePublished) {
$this->datePublished = $datePublished;
}
public function getDatePublished() {
return $this->datePublished;
}
public function setAddressLocality($addressLocality) {
$this->addressLocality = $addressLocality;
}
public function getAddressLocality() {
return $this->addressLocality;
}
public function setDuration($duration) {
$this->duration = $duration;
}
public function getDuration() {
return $this->duration;
}
public function setAdditionalName(/* array(Google_string) */ $additionalName) {
$this->assertIsArray($additionalName, 'Google_string', __METHOD__);
$this->additionalName = $additionalName;
}
public function getAdditionalName() {
return $this->additionalName;
}
public function setWorstRating($worstRating) {
$this->worstRating = $worstRating;
}
public function getWorstRating() {
return $this->worstRating;
}
public function setContributor(/* array(Google_ItemScope) */ $contributor) {
$this->assertIsArray($contributor, 'Google_ItemScope', __METHOD__);
$this->contributor = $contributor;
}
public function getContributor() {
return $this->contributor;
}
public function setThumbnailUrl($thumbnailUrl) {
$this->thumbnailUrl = $thumbnailUrl;
}
public function getThumbnailUrl() {
return $this->thumbnailUrl;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setPostOfficeBoxNumber($postOfficeBoxNumber) {
$this->postOfficeBoxNumber = $postOfficeBoxNumber;
}
public function getPostOfficeBoxNumber() {
return $this->postOfficeBoxNumber;
}
public function setAttendees(/* array(Google_ItemScope) */ $attendees) {
$this->assertIsArray($attendees, 'Google_ItemScope', __METHOD__);
$this->attendees = $attendees;
}
public function getAttendees() {
return $this->attendees;
}
public function setAuthor(/* array(Google_ItemScope) */ $author) {
$this->assertIsArray($author, 'Google_ItemScope', __METHOD__);
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
public function setAssociated_media(/* array(Google_ItemScope) */ $associated_media) {
$this->assertIsArray($associated_media, 'Google_ItemScope', __METHOD__);
$this->associated_media = $associated_media;
}
public function getAssociated_media() {
return $this->associated_media;
}
public function setBestRating($bestRating) {
$this->bestRating = $bestRating;
}
public function getBestRating() {
return $this->bestRating;
}
public function setAddressCountry($addressCountry) {
$this->addressCountry = $addressCountry;
}
public function getAddressCountry() {
return $this->addressCountry;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setStreetAddress($streetAddress) {
$this->streetAddress = $streetAddress;
}
public function getStreetAddress() {
return $this->streetAddress;
}
public function setLocation(Google_ItemScope $location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setLatitude($latitude) {
$this->latitude = $latitude;
}
public function getLatitude() {
return $this->latitude;
}
public function setByArtist(Google_ItemScope $byArtist) {
$this->byArtist = $byArtist;
}
public function getByArtist() {
return $this->byArtist;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setDateModified($dateModified) {
$this->dateModified = $dateModified;
}
public function getDateModified() {
return $this->dateModified;
}
public function setContentSize($contentSize) {
$this->contentSize = $contentSize;
}
public function getContentSize() {
return $this->contentSize;
}
public function setContentUrl($contentUrl) {
$this->contentUrl = $contentUrl;
}
public function getContentUrl() {
return $this->contentUrl;
}
public function setPartOfTVSeries(Google_ItemScope $partOfTVSeries) {
$this->partOfTVSeries = $partOfTVSeries;
}
public function getPartOfTVSeries() {
return $this->partOfTVSeries;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setFamilyName($familyName) {
$this->familyName = $familyName;
}
public function getFamilyName() {
return $this->familyName;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDateCreated($dateCreated) {
$this->dateCreated = $dateCreated;
}
public function getDateCreated() {
return $this->dateCreated;
}
public function setPostalCode($postalCode) {
$this->postalCode = $postalCode;
}
public function getPostalCode() {
return $this->postalCode;
}
public function setAttendeeCount($attendeeCount) {
$this->attendeeCount = $attendeeCount;
}
public function getAttendeeCount() {
return $this->attendeeCount;
}
public function setInAlbum(Google_ItemScope $inAlbum) {
$this->inAlbum = $inAlbum;
}
public function getInAlbum() {
return $this->inAlbum;
}
public function setAddressRegion($addressRegion) {
$this->addressRegion = $addressRegion;
}
public function getAddressRegion() {
return $this->addressRegion;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
public function setGeo(Google_ItemScope $geo) {
$this->geo = $geo;
}
public function getGeo() {
return $this->geo;
}
public function setEmbedUrl($embedUrl) {
$this->embedUrl = $embedUrl;
}
public function getEmbedUrl() {
return $this->embedUrl;
}
public function setTickerSymbol($tickerSymbol) {
$this->tickerSymbol = $tickerSymbol;
}
public function getTickerSymbol() {
return $this->tickerSymbol;
}
public function setPlayerType($playerType) {
$this->playerType = $playerType;
}
public function getPlayerType() {
return $this->playerType;
}
public function setAbout(Google_ItemScope $about) {
$this->about = $about;
}
public function getAbout() {
return $this->about;
}
public function setGivenName($givenName) {
$this->givenName = $givenName;
}
public function getGivenName() {
return $this->givenName;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setPerformers(/* array(Google_ItemScope) */ $performers) {
$this->assertIsArray($performers, 'Google_ItemScope', __METHOD__);
$this->performers = $performers;
}
public function getPerformers() {
return $this->performers;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setGender($gender) {
$this->gender = $gender;
}
public function getGender() {
return $this->gender;
}
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
return $this->longitude;
}
public function setThumbnail(Google_ItemScope $thumbnail) {
$this->thumbnail = $thumbnail;
}
public function getThumbnail() {
return $this->thumbnail;
}
public function setCaption($caption) {
$this->caption = $caption;
}
public function getCaption() {
return $this->caption;
}
public function setRatingValue($ratingValue) {
$this->ratingValue = $ratingValue;
}
public function getRatingValue() {
return $this->ratingValue;
}
public function setReviewRating(Google_ItemScope $reviewRating) {
$this->reviewRating = $reviewRating;
}
public function getReviewRating() {
return $this->reviewRating;
}
public function setAudio(Google_ItemScope $audio) {
$this->audio = $audio;
}
public function getAudio() {
return $this->audio;
}
}
class Google_Moment extends Google_Model {
public $startDate;
public $kind;
protected $__targetType = 'Google_ItemScope';
protected $__targetDataType = '';
public $target;
protected $__verbType = 'Google_MomentVerb';
protected $__verbDataType = '';
public $verb;
protected $__resultType = 'Google_ItemScope';
protected $__resultDataType = '';
public $result;
public $type;
public function setStartDate($startDate) {
$this->startDate = $startDate;
}
public function getStartDate() {
return $this->startDate;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTarget(Google_ItemScope $target) {
$this->target = $target;
}
public function getTarget() {
return $this->target;
}
public function setVerb(Google_MomentVerb $verb) {
$this->verb = $verb;
}
public function getVerb() {
return $this->verb;
}
public function setResult(Google_ItemScope $result) {
$this->result = $result;
}
public function getResult() {
return $this->result;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_MomentVerb extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,429 @@
<?php
/*
* 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.
*/
/**
* The "trainedmodels" collection of methods.
* Typical usage is:
* <code>
* $predictionService = new Google_PredictionService(...);
* $trainedmodels = $predictionService->trainedmodels;
* </code>
*/
class Google_TrainedmodelsServiceResource extends Google_ServiceResource {
/**
* Submit model id and request a prediction (trainedmodels.predict)
*
* @param string $id The unique name for the predictive model.
* @param Google_Input $postBody
* @param array $optParams Optional parameters.
* @return Google_Output
*/
public function predict($id, Google_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 Google_Output($data);
} else {
return $data;
}
}
/**
* Begin training your model. (trainedmodels.insert)
*
* @param Google_Training $postBody
* @param array $optParams Optional parameters.
* @return Google_Training
*/
public function insert(Google_Training $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Training($data);
} else {
return $data;
}
}
/**
* Check training status of your model. (trainedmodels.get)
*
* @param string $id The unique name for the predictive model.
* @param array $optParams Optional parameters.
* @return Google_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 Google_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 Google_Update $postBody
* @param array $optParams Optional parameters.
* @return Google_Training
*/
public function update($id, Google_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 Google_Training($data);
} else {
return $data;
}
}
/**
* Delete a trained model. (trainedmodels.delete)
*
* @param string $id The unique name for the predictive model.
* @param array $optParams Optional parameters.
*/
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 Google_PredictionService(...);
* $hostedmodels = $predictionService->hostedmodels;
* </code>
*/
class Google_HostedmodelsServiceResource extends Google_ServiceResource {
/**
* Submit input and request an output against a hosted model. (hostedmodels.predict)
*
* @param string $hostedModelName The name of a hosted model.
* @param Google_Input $postBody
* @param array $optParams Optional parameters.
* @return Google_Output
*/
public function predict($hostedModelName, Google_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 Google_Output($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_PredictionService extends Google_Service {
public $trainedmodels;
public $hostedmodels;
/**
* Constructs the internal representation of the Prediction service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'prediction/v1.4/';
$this->version = 'v1.4';
$this->serviceName = 'prediction';
$client->addService($this->serviceName, $this->version);
$this->trainedmodels = new Google_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"}, "response": {"$ref": "Output"}, "httpMethod": "POST", "path": "trainedmodels/{id}/predict", "id": "prediction.trainedmodels.predict"}, "insert": {"scopes": ["https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/prediction"], "request": {"$ref": "Training"}, "response": {"$ref": "Training"}, "httpMethod": "POST", "path": "trainedmodels", "id": "prediction.trainedmodels.insert"}, "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"}}, "update": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Update"}, "response": {"$ref": "Training"}, "httpMethod": "PUT", "path": "trainedmodels/{id}", "id": "prediction.trainedmodels.update"}, "delete": {"scopes": ["https://www.googleapis.com/auth/prediction"], "path": "trainedmodels/{id}", "id": "prediction.trainedmodels.delete", "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->hostedmodels = new Google_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"}, "response": {"$ref": "Output"}, "httpMethod": "POST", "path": "hostedmodels/{hostedModelName}/predict", "id": "prediction.hostedmodels.predict"}}}', true));
}
}
class Google_Input extends Google_Model {
protected $__inputType = 'Google_InputInput';
protected $__inputDataType = '';
public $input;
public function setInput(Google_InputInput $input) {
$this->input = $input;
}
public function getInput() {
return $this->input;
}
}
class Google_InputInput extends Google_Model {
public $csvInstance;
public function setCsvInstance(/* array(Google_object) */ $csvInstance) {
$this->assertIsArray($csvInstance, 'Google_object', __METHOD__);
$this->csvInstance = $csvInstance;
}
public function getCsvInstance() {
return $this->csvInstance;
}
}
class Google_Output extends Google_Model {
public $kind;
public $outputLabel;
public $id;
protected $__outputMultiType = 'Google_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(Google_OutputOutputMulti) */ $outputMulti) {
$this->assertIsArray($outputMulti, 'Google_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 Google_OutputOutputMulti extends Google_Model {
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 Google_Training extends Google_Model {
public $kind;
public $storageDataLocation;
public $storagePMMLModelLocation;
protected $__dataAnalysisType = 'Google_TrainingDataAnalysis';
protected $__dataAnalysisDataType = '';
public $dataAnalysis;
public $trainingStatus;
protected $__modelInfoType = 'Google_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(Google_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(Google_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(Google_double) */ $utility) {
$this->assertIsArray($utility, 'Google_double', __METHOD__);
$this->utility = $utility;
}
public function getUtility() {
return $this->utility;
}
}
class Google_TrainingDataAnalysis extends Google_Model {
public $warnings;
public function setWarnings(/* array(Google_string) */ $warnings) {
$this->assertIsArray($warnings, 'Google_string', __METHOD__);
$this->warnings = $warnings;
}
public function getWarnings() {
return $this->warnings;
}
}
class Google_TrainingModelInfo extends Google_Model {
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 Google_Update extends Google_Model {
public $csvInstance;
public $label;
public function setCsvInstance(/* array(Google_object) */ $csvInstance) {
$this->assertIsArray($csvInstance, 'Google_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,287 @@
<?php
/*
* 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.
*/
/**
* The "webResource" collection of methods.
* Typical usage is:
* <code>
* $siteVerificationService = new Google_SiteVerificationService(...);
* $webResource = $siteVerificationService->webResource;
* </code>
*/
class Google_WebResourceServiceResource extends Google_ServiceResource {
/**
* Attempt verification of a website or domain. (webResource.insert)
*
* @param string $verificationMethod The method to use for verifying a site or domain.
* @param Google_SiteVerificationWebResourceResource $postBody
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceResource
*/
public function insert($verificationMethod, Google_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 Google_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.
* @param array $optParams Optional parameters.
* @return Google_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 Google_SiteVerificationWebResourceResource($data);
} else {
return $data;
}
}
/**
* Get the list of your verified websites and domains. (webResource.list)
*
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceListResponse
*/
public function listWebResource($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_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 Google_SiteVerificationWebResourceResource $postBody
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceResource
*/
public function update($id, Google_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 Google_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 Google_SiteVerificationWebResourceResource $postBody
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceResource
*/
public function patch($id, Google_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 Google_SiteVerificationWebResourceResource($data);
} else {
return $data;
}
}
/**
* Get a verification token for placing on a website or domain. (webResource.getToken)
*
* @param Google_SiteVerificationWebResourceGettokenRequest $postBody
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceGettokenResponse
*/
public function getToken(Google_SiteVerificationWebResourceGettokenRequest $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('getToken', array($params));
if ($this->useObjects()) {
return new Google_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.
* @param array $optParams Optional parameters.
*/
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 Google_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 Google_SiteVerificationService extends Google_Service {
public $webResource;
/**
* Constructs the internal representation of the SiteVerification service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'siteVerification/v1/';
$this->version = 'v1';
$this->serviceName = 'siteVerification';
$client->addService($this->serviceName, $this->version);
$this->webResource = new Google_WebResourceServiceResource($this, $this->serviceName, 'webResource', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/siteverification", "https://www.googleapis.com/auth/siteverification.verify_only"], "parameters": {"verificationMethod": {"required": true, "type": "string", "location": "query"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "response": {"$ref": "SiteVerificationWebResourceResource"}, "httpMethod": "POST", "path": "webResource", "id": "siteVerification.webResource.insert"}, "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"], "path": "webResource", "response": {"$ref": "SiteVerificationWebResourceListResponse"}, "id": "siteVerification.webResource.list", "httpMethod": "GET"}, "update": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "response": {"$ref": "SiteVerificationWebResourceResource"}, "httpMethod": "PUT", "path": "webResource/{id}", "id": "siteVerification.webResource.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "response": {"$ref": "SiteVerificationWebResourceResource"}, "httpMethod": "PATCH", "path": "webResource/{id}", "id": "siteVerification.webResource.patch"}, "getToken": {"scopes": ["https://www.googleapis.com/auth/siteverification", "https://www.googleapis.com/auth/siteverification.verify_only"], "request": {"$ref": "SiteVerificationWebResourceGettokenRequest"}, "response": {"$ref": "SiteVerificationWebResourceGettokenResponse"}, "httpMethod": "POST", "path": "token", "id": "siteVerification.webResource.getToken"}, "delete": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "path": "webResource/{id}", "id": "siteVerification.webResource.delete", "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_SiteVerificationWebResourceGettokenRequest extends Google_Model {
public $verificationMethod;
protected $__siteType = 'Google_SiteVerificationWebResourceGettokenRequestSite';
protected $__siteDataType = '';
public $site;
public function setVerificationMethod($verificationMethod) {
$this->verificationMethod = $verificationMethod;
}
public function getVerificationMethod() {
return $this->verificationMethod;
}
public function setSite(Google_SiteVerificationWebResourceGettokenRequestSite $site) {
$this->site = $site;
}
public function getSite() {
return $this->site;
}
}
class Google_SiteVerificationWebResourceGettokenRequestSite extends Google_Model {
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 Google_SiteVerificationWebResourceGettokenResponse extends Google_Model {
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 Google_SiteVerificationWebResourceListResponse extends Google_Model {
protected $__itemsType = 'Google_SiteVerificationWebResourceResource';
protected $__itemsDataType = 'array';
public $items;
public function setItems(/* array(Google_SiteVerificationWebResourceResource) */ $items) {
$this->assertIsArray($items, 'Google_SiteVerificationWebResourceResource', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
}
class Google_SiteVerificationWebResourceResource extends Google_Model {
public $owners;
public $id;
protected $__siteType = 'Google_SiteVerificationWebResourceResourceSite';
protected $__siteDataType = '';
public $site;
public function setOwners(/* array(Google_string) */ $owners) {
$this->assertIsArray($owners, 'Google_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(Google_SiteVerificationWebResourceResourceSite $site) {
$this->site = $site;
}
public function getSite() {
return $this->site;
}
}
class Google_SiteVerificationWebResourceResourceSite extends Google_Model {
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;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,423 @@
<?php
/*
* 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.
*/
/**
* The "taskqueues" collection of methods.
* Typical usage is:
* <code>
* $taskqueueService = new Google_TaskqueueService(...);
* $taskqueues = $taskqueueService->taskqueues;
* </code>
*/
class Google_TaskqueuesServiceResource extends Google_ServiceResource {
/**
* Get detailed information about a TaskQueue. (taskqueues.get)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The id of the taskqueue to get the properties of.
* @param array $optParams Optional parameters.
*
* @opt_param bool getStats Whether to get stats. Optional.
* @return Google_TaskQueue
*/
public function get($project, $taskqueue, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_TaskQueue($data);
} else {
return $data;
}
}
}
/**
* The "tasks" collection of methods.
* Typical usage is:
* <code>
* $taskqueueService = new Google_TaskqueueService(...);
* $tasks = $taskqueueService->tasks;
* </code>
*/
class Google_TasksServiceResource extends Google_ServiceResource {
/**
* Insert a new task in a TaskQueue (tasks.insert)
*
* @param string $project The project under which the queue lies
* @param string $taskqueue The taskqueue to insert the task into
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function insert($project, $taskqueue, Google_Task $postBody, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Get a particular task from a TaskQueue. (tasks.get)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The taskqueue in which the task belongs.
* @param string $task The task to get properties of.
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function get($project, $taskqueue, $task, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* List Tasks in a TaskQueue (tasks.list)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The id of the taskqueue to list tasks from.
* @param array $optParams Optional parameters.
* @return Google_Tasks2
*/
public function listTasks($project, $taskqueue, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Tasks2($data);
} else {
return $data;
}
}
/**
* Update tasks that are leased out of a TaskQueue. (tasks.update)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue
* @param string $task
* @param int $newLeaseSeconds The new lease in seconds.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function update($project, $taskqueue, $task, $newLeaseSeconds, Google_Task $postBody, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task, 'newLeaseSeconds' => $newLeaseSeconds, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Update tasks that are leased out of a TaskQueue. This method supports patch semantics.
* (tasks.patch)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue
* @param string $task
* @param int $newLeaseSeconds The new lease in seconds.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function patch($project, $taskqueue, $task, $newLeaseSeconds, Google_Task $postBody, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task, 'newLeaseSeconds' => $newLeaseSeconds, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Delete a task from a TaskQueue. (tasks.delete)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The taskqueue to delete a task from.
* @param string $task The id of the task to delete.
* @param array $optParams Optional parameters.
*/
public function delete($project, $taskqueue, $task, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
/**
* Lease 1 or more tasks from a TaskQueue. (tasks.lease)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The taskqueue to lease a task from.
* @param int $numTasks The number of tasks to lease.
* @param int $leaseSecs The lease in seconds.
* @param array $optParams Optional parameters.
*
* @opt_param bool groupByTag When true, all returned tasks will have the same tag
* @opt_param string tag The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e. the first available tag
* @return Google_Tasks
*/
public function lease($project, $taskqueue, $numTasks, $leaseSecs, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'numTasks' => $numTasks, 'leaseSecs' => $leaseSecs);
$params = array_merge($params, $optParams);
$data = $this->__call('lease', array($params));
if ($this->useObjects()) {
return new Google_Tasks($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Taskqueue (v1beta2).
*
* <p>
* Lets you access a Google App Engine Pull Task Queue over REST.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/appengine/docs/python/taskqueue/rest.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_TaskqueueService extends Google_Service {
public $taskqueues;
public $tasks;
/**
* Constructs the internal representation of the Taskqueue service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'taskqueue/v1beta2/projects/';
$this->version = 'v1beta2';
$this->serviceName = 'taskqueue';
$client->addService($this->serviceName, $this->version);
$this->taskqueues = new Google_TaskqueuesServiceResource($this, $this->serviceName, 'taskqueues', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "getStats": {"type": "boolean", "location": "query"}}, "id": "taskqueue.taskqueues.get", "httpMethod": "GET", "path": "{project}/taskqueues/{taskqueue}", "response": {"$ref": "TaskQueue"}}}}', true));
$this->tasks = new Google_TasksServiceResource($this, $this->serviceName, 'tasks', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "POST", "path": "{project}/taskqueues/{taskqueue}/tasks", "id": "taskqueue.tasks.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "id": "taskqueue.tasks.get", "httpMethod": "GET", "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "response": {"$ref": "Task"}}, "list": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}}, "id": "taskqueue.tasks.list", "httpMethod": "GET", "path": "{project}/taskqueues/{taskqueue}/tasks", "response": {"$ref": "Tasks2"}}, "update": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}, "newLeaseSeconds": {"required": true, "type": "integer", "location": "query", "format": "int32"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "POST", "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "id": "taskqueue.tasks.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}, "newLeaseSeconds": {"required": true, "type": "integer", "location": "query", "format": "int32"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "PATCH", "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "id": "taskqueue.tasks.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "id": "taskqueue.tasks.delete", "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}, "lease": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"groupByTag": {"type": "boolean", "location": "query"}, "leaseSecs": {"required": true, "type": "integer", "location": "query", "format": "int32"}, "project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "tag": {"type": "string", "location": "query"}, "numTasks": {"required": true, "type": "integer", "location": "query", "format": "int32"}}, "id": "taskqueue.tasks.lease", "httpMethod": "POST", "path": "{project}/taskqueues/{taskqueue}/tasks/lease", "response": {"$ref": "Tasks"}}}}', true));
}
}
class Google_Task extends Google_Model {
public $kind;
public $leaseTimestamp;
public $id;
public $tag;
public $payloadBase64;
public $queueName;
public $enqueueTimestamp;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setLeaseTimestamp($leaseTimestamp) {
$this->leaseTimestamp = $leaseTimestamp;
}
public function getLeaseTimestamp() {
return $this->leaseTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setTag($tag) {
$this->tag = $tag;
}
public function getTag() {
return $this->tag;
}
public function setPayloadBase64($payloadBase64) {
$this->payloadBase64 = $payloadBase64;
}
public function getPayloadBase64() {
return $this->payloadBase64;
}
public function setQueueName($queueName) {
$this->queueName = $queueName;
}
public function getQueueName() {
return $this->queueName;
}
public function setEnqueueTimestamp($enqueueTimestamp) {
$this->enqueueTimestamp = $enqueueTimestamp;
}
public function getEnqueueTimestamp() {
return $this->enqueueTimestamp;
}
}
class Google_TaskQueue extends Google_Model {
public $kind;
protected $__statsType = 'Google_TaskQueueStats';
protected $__statsDataType = '';
public $stats;
public $id;
public $maxLeases;
protected $__aclType = 'Google_TaskQueueAcl';
protected $__aclDataType = '';
public $acl;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setStats(Google_TaskQueueStats $stats) {
$this->stats = $stats;
}
public function getStats() {
return $this->stats;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setMaxLeases($maxLeases) {
$this->maxLeases = $maxLeases;
}
public function getMaxLeases() {
return $this->maxLeases;
}
public function setAcl(Google_TaskQueueAcl $acl) {
$this->acl = $acl;
}
public function getAcl() {
return $this->acl;
}
}
class Google_TaskQueueAcl extends Google_Model {
public $consumerEmails;
public $producerEmails;
public $adminEmails;
public function setConsumerEmails(/* array(Google_string) */ $consumerEmails) {
$this->assertIsArray($consumerEmails, 'Google_string', __METHOD__);
$this->consumerEmails = $consumerEmails;
}
public function getConsumerEmails() {
return $this->consumerEmails;
}
public function setProducerEmails(/* array(Google_string) */ $producerEmails) {
$this->assertIsArray($producerEmails, 'Google_string', __METHOD__);
$this->producerEmails = $producerEmails;
}
public function getProducerEmails() {
return $this->producerEmails;
}
public function setAdminEmails(/* array(Google_string) */ $adminEmails) {
$this->assertIsArray($adminEmails, 'Google_string', __METHOD__);
$this->adminEmails = $adminEmails;
}
public function getAdminEmails() {
return $this->adminEmails;
}
}
class Google_TaskQueueStats extends Google_Model {
public $oldestTask;
public $leasedLastMinute;
public $totalTasks;
public $leasedLastHour;
public function setOldestTask($oldestTask) {
$this->oldestTask = $oldestTask;
}
public function getOldestTask() {
return $this->oldestTask;
}
public function setLeasedLastMinute($leasedLastMinute) {
$this->leasedLastMinute = $leasedLastMinute;
}
public function getLeasedLastMinute() {
return $this->leasedLastMinute;
}
public function setTotalTasks($totalTasks) {
$this->totalTasks = $totalTasks;
}
public function getTotalTasks() {
return $this->totalTasks;
}
public function setLeasedLastHour($leasedLastHour) {
$this->leasedLastHour = $leasedLastHour;
}
public function getLeasedLastHour() {
return $this->leasedLastHour;
}
}
class Google_Tasks extends Google_Model {
protected $__itemsType = 'Google_Task';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Task) */ $items) {
$this->assertIsArray($items, 'Google_Task', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Tasks2 extends Google_Model {
protected $__itemsType = 'Google_Task';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Task) */ $items) {
$this->assertIsArray($items, 'Google_Task', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}

View file

@ -0,0 +1,580 @@
<?php
/*
* 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.
*/
/**
* The "tasks" collection of methods.
* Typical usage is:
* <code>
* $tasksService = new Google_TasksService(...);
* $tasks = $tasksService->tasks;
* </code>
*/
class Google_TasksServiceResource extends Google_ServiceResource {
/**
* Creates a new task on the specified task list. (tasks.insert)
*
* @param string $tasklist Task list identifier.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
*
* @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 Google_Task
*/
public function insert($tasklist, Google_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 Google_Task($data);
} else {
return $data;
}
}
/**
* Returns the specified task. (tasks.get)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @param array $optParams Optional parameters.
* @return Google_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 Google_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.
* @param array $optParams Optional parameters.
*/
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.
*
* @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 Google_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 Google_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.
*
* @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 Google_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 Google_Tasks($data);
} else {
return $data;
}
}
/**
* Updates the specified task. (tasks.update)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function update($tasklist, $task, Google_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 Google_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 Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function patch($tasklist, $task, Google_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 Google_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.
* @param array $optParams Optional parameters.
*/
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 Google_TasksService(...);
* $tasklists = $tasksService->tasklists;
* </code>
*/
class Google_TasklistsServiceResource extends Google_ServiceResource {
/**
* Creates a new task list and adds it to the authenticated user's task lists. (tasklists.insert)
*
* @param Google_TaskList $postBody
* @param array $optParams Optional parameters.
* @return Google_TaskList
*/
public function insert(Google_TaskList $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_TaskList($data);
} else {
return $data;
}
}
/**
* Returns the authenticated user's specified task list. (tasklists.get)
*
* @param string $tasklist Task list identifier.
* @param array $optParams Optional parameters.
* @return Google_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 Google_TaskList($data);
} else {
return $data;
}
}
/**
* Returns all the authenticated user's task lists. (tasklists.list)
*
* @param array $optParams Optional parameters.
*
* @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 Google_TaskLists
*/
public function listTasklists($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_TaskLists($data);
} else {
return $data;
}
}
/**
* Updates the authenticated user's specified task list. (tasklists.update)
*
* @param string $tasklist Task list identifier.
* @param Google_TaskList $postBody
* @param array $optParams Optional parameters.
* @return Google_TaskList
*/
public function update($tasklist, Google_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 Google_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 Google_TaskList $postBody
* @param array $optParams Optional parameters.
* @return Google_TaskList
*/
public function patch($tasklist, Google_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 Google_TaskList($data);
} else {
return $data;
}
}
/**
* Deletes the authenticated user's specified task list. (tasklists.delete)
*
* @param string $tasklist Task list identifier.
* @param array $optParams Optional parameters.
*/
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 Google_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 Google_TasksService extends Google_Service {
public $tasks;
public $tasklists;
/**
* Constructs the internal representation of the Tasks service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'tasks/v1/';
$this->version = 'v1';
$this->serviceName = 'tasks';
$client->addService($this->serviceName, $this->version);
$this->tasks = new Google_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"}, "response": {"$ref": "Task"}, "httpMethod": "POST", "path": "lists/{tasklist}/tasks", "id": "tasks.tasks.insert"}, "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"], "path": "lists/{tasklist}/clear", "id": "tasks.tasks.clear", "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "POST"}, "move": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"task": {"required": true, "type": "string", "location": "path"}, "tasklist": {"required": true, "type": "string", "location": "path"}, "parent": {"type": "string", "location": "query"}, "previous": {"type": "string", "location": "query"}}, "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"}, "showDeleted": {"type": "boolean", "location": "query"}, "updatedMin": {"type": "string", "location": "query"}, "completedMin": {"type": "string", "location": "query"}, "maxResults": {"type": "string", "location": "query", "format": "int64"}, "showCompleted": {"type": "boolean", "location": "query"}, "pageToken": {"type": "string", "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"}, "response": {"$ref": "Task"}, "httpMethod": "PUT", "path": "lists/{tasklist}/tasks/{task}", "id": "tasks.tasks.update"}, "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"}, "response": {"$ref": "Task"}, "httpMethod": "PATCH", "path": "lists/{tasklist}/tasks/{task}", "id": "tasks.tasks.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/tasks"], "path": "lists/{tasklist}/tasks/{task}", "id": "tasks.tasks.delete", "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->tasklists = new Google_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": {"type": "string", "location": "query", "format": "int64"}}, "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"}, "response": {"$ref": "TaskList"}, "httpMethod": "PUT", "path": "users/@me/lists/{tasklist}", "id": "tasks.tasklists.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "TaskList"}, "response": {"$ref": "TaskList"}, "httpMethod": "PATCH", "path": "users/@me/lists/{tasklist}", "id": "tasks.tasklists.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/tasks"], "path": "users/@me/lists/{tasklist}", "id": "tasks.tasklists.delete", "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_Task extends Google_Model {
public $status;
public $kind;
public $updated;
public $parent;
protected $__linksType = 'Google_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(Google_TaskLinks) */ $links) {
$this->assertIsArray($links, 'Google_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 Google_TaskLinks extends Google_Model {
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 Google_TaskList extends Google_Model {
public $kind;
public $title;
public $updated;
public $etag;
public $id;
public $selfLink;
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 setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
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;
}
}
class Google_TaskLists extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_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(Google_TaskList) */ $items) {
$this->assertIsArray($items, 'Google_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 Google_Tasks extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_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(Google_Task) */ $items) {
$this->assertIsArray($items, 'Google_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,244 @@
<?php
/*
* 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.
*/
/**
* The "languages" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google_TranslateService(...);
* $languages = $translateService->languages;
* </code>
*/
class Google_LanguagesServiceResource extends Google_ServiceResource {
/**
* List the source/target languages supported by the API (languages.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string target the language and collation in which the localized results should be returned
* @return Google_LanguagesListResponse
*/
public function listLanguages($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_LanguagesListResponse($data);
} else {
return $data;
}
}
}
/**
* The "detections" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google_TranslateService(...);
* $detections = $translateService->detections;
* </code>
*/
class Google_DetectionsServiceResource extends Google_ServiceResource {
/**
* Detect the language of text. (detections.list)
*
* @param string $q The text to detect
* @param array $optParams Optional parameters.
* @return Google_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 Google_DetectionsListResponse($data);
} else {
return $data;
}
}
}
/**
* The "translations" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google_TranslateService(...);
* $translations = $translateService->translations;
* </code>
*/
class Google_TranslationsServiceResource extends Google_ServiceResource {
/**
* 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.
*
* @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 Google_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 Google_TranslationsListResponse($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_TranslateService extends Google_Service {
public $languages;
public $detections;
public $translations;
/**
* Constructs the internal representation of the Translate service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'language/translate/';
$this->version = 'v2';
$this->serviceName = 'translate';
$client->addService($this->serviceName, $this->version);
$this->languages = new Google_LanguagesServiceResource($this, $this->serviceName, 'languages', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "LanguagesListResponse"}, "id": "language.languages.list", "parameters": {"target": {"type": "string", "location": "query"}}, "path": "v2/languages"}}}', true));
$this->detections = new Google_DetectionsServiceResource($this, $this->serviceName, 'detections', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "DetectionsListResponse"}, "id": "language.detections.list", "parameters": {"q": {"repeated": true, "required": true, "type": "string", "location": "query"}}, "path": "v2/detect"}}}', true));
$this->translations = new Google_TranslationsServiceResource($this, $this->serviceName, 'translations', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "TranslationsListResponse"}, "id": "language.translations.list", "parameters": {"q": {"repeated": true, "required": true, "type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "format": {"enum": ["html", "text"], "type": "string", "location": "query"}, "target": {"required": true, "type": "string", "location": "query"}, "cid": {"repeated": true, "type": "string", "location": "query"}}, "path": "v2"}}}', true));
}
}
class Google_DetectionsListResponse extends Google_Model {
protected $__detectionsType = 'Google_DetectionsResourceItems';
protected $__detectionsDataType = 'array';
public $detections;
public function setDetections(/* array(Google_DetectionsResourceItems) */ $detections) {
$this->assertIsArray($detections, 'Google_DetectionsResourceItems', __METHOD__);
$this->detections = $detections;
}
public function getDetections() {
return $this->detections;
}
}
class Google_DetectionsResourceItems extends Google_Model {
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 Google_LanguagesListResponse extends Google_Model {
protected $__languagesType = 'Google_LanguagesResource';
protected $__languagesDataType = 'array';
public $languages;
public function setLanguages(/* array(Google_LanguagesResource) */ $languages) {
$this->assertIsArray($languages, 'Google_LanguagesResource', __METHOD__);
$this->languages = $languages;
}
public function getLanguages() {
return $this->languages;
}
}
class Google_LanguagesResource extends Google_Model {
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 Google_TranslationsListResponse extends Google_Model {
protected $__translationsType = 'Google_TranslationsResource';
protected $__translationsDataType = 'array';
public $translations;
public function setTranslations(/* array(Google_TranslationsResource) */ $translations) {
$this->assertIsArray($translations, 'Google_TranslationsResource', __METHOD__);
$this->translations = $translations;
}
public function getTranslations() {
return $this->translations;
}
}
class Google_TranslationsResource extends Google_Model {
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,325 @@
<?php
/*
* 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.
*/
/**
* The "url" collection of methods.
* Typical usage is:
* <code>
* $urlshortenerService = new Google_UrlshortenerService(...);
* $url = $urlshortenerService->url;
* </code>
*/
class Google_UrlServiceResource extends Google_ServiceResource {
/**
* Creates a new short URL. (url.insert)
*
* @param Google_Url $postBody
* @param array $optParams Optional parameters.
* @return Google_Url
*/
public function insert(Google_Url $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Url($data);
} else {
return $data;
}
}
/**
* Retrieves a list of URLs shortened by a user. (url.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string start-token Token for requesting successive pages of results.
* @opt_param string projection Additional information to return.
* @return Google_UrlHistory
*/
public function listUrl($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_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.
*
* @opt_param string projection Additional information to return.
* @return Google_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 Google_Url($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_UrlshortenerService extends Google_Service {
public $url;
/**
* Constructs the internal representation of the Urlshortener service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'urlshortener/v1/';
$this->version = 'v1';
$this->serviceName = 'urlshortener';
$client->addService($this->serviceName, $this->version);
$this->url = new Google_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": {"httpMethod": "GET", "response": {"$ref": "Url"}, "id": "urlshortener.url.get", "parameters": {"shortUrl": {"required": true, "type": "string", "location": "query"}, "projection": {"enum": ["ANALYTICS_CLICKS", "ANALYTICS_TOP_STRINGS", "FULL"], "type": "string", "location": "query"}}, "path": "url"}}}', true));
}
}
class Google_AnalyticsSnapshot extends Google_Model {
public $shortUrlClicks;
protected $__countriesType = 'Google_StringCount';
protected $__countriesDataType = 'array';
public $countries;
protected $__platformsType = 'Google_StringCount';
protected $__platformsDataType = 'array';
public $platforms;
protected $__browsersType = 'Google_StringCount';
protected $__browsersDataType = 'array';
public $browsers;
protected $__referrersType = 'Google_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(Google_StringCount) */ $countries) {
$this->assertIsArray($countries, 'Google_StringCount', __METHOD__);
$this->countries = $countries;
}
public function getCountries() {
return $this->countries;
}
public function setPlatforms(/* array(Google_StringCount) */ $platforms) {
$this->assertIsArray($platforms, 'Google_StringCount', __METHOD__);
$this->platforms = $platforms;
}
public function getPlatforms() {
return $this->platforms;
}
public function setBrowsers(/* array(Google_StringCount) */ $browsers) {
$this->assertIsArray($browsers, 'Google_StringCount', __METHOD__);
$this->browsers = $browsers;
}
public function getBrowsers() {
return $this->browsers;
}
public function setReferrers(/* array(Google_StringCount) */ $referrers) {
$this->assertIsArray($referrers, 'Google_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 Google_AnalyticsSummary extends Google_Model {
protected $__weekType = 'Google_AnalyticsSnapshot';
protected $__weekDataType = '';
public $week;
protected $__allTimeType = 'Google_AnalyticsSnapshot';
protected $__allTimeDataType = '';
public $allTime;
protected $__twoHoursType = 'Google_AnalyticsSnapshot';
protected $__twoHoursDataType = '';
public $twoHours;
protected $__dayType = 'Google_AnalyticsSnapshot';
protected $__dayDataType = '';
public $day;
protected $__monthType = 'Google_AnalyticsSnapshot';
protected $__monthDataType = '';
public $month;
public function setWeek(Google_AnalyticsSnapshot $week) {
$this->week = $week;
}
public function getWeek() {
return $this->week;
}
public function setAllTime(Google_AnalyticsSnapshot $allTime) {
$this->allTime = $allTime;
}
public function getAllTime() {
return $this->allTime;
}
public function setTwoHours(Google_AnalyticsSnapshot $twoHours) {
$this->twoHours = $twoHours;
}
public function getTwoHours() {
return $this->twoHours;
}
public function setDay(Google_AnalyticsSnapshot $day) {
$this->day = $day;
}
public function getDay() {
return $this->day;
}
public function setMonth(Google_AnalyticsSnapshot $month) {
$this->month = $month;
}
public function getMonth() {
return $this->month;
}
}
class Google_StringCount extends Google_Model {
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 Google_Url extends Google_Model {
public $status;
public $kind;
public $created;
protected $__analyticsType = 'Google_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(Google_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 Google_UrlHistory extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_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(Google_Url) */ $items) {
$this->assertIsArray($items, 'Google_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,130 @@
<?php
/*
* 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.
*/
/**
* The "webfonts" collection of methods.
* Typical usage is:
* <code>
* $webfontsService = new Google_WebfontsService(...);
* $webfonts = $webfontsService->webfonts;
* </code>
*/
class Google_WebfontsServiceResource extends Google_ServiceResource {
/**
* Retrieves the list of fonts currently served by the Google Web Fonts Developer API
* (webfonts.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string sort Enables sorting of the list
* @return Google_WebfontList
*/
public function listWebfonts($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_WebfontList($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_WebfontsService extends Google_Service {
public $webfonts;
/**
* Constructs the internal representation of the Webfonts service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'webfonts/v1/';
$this->version = 'v1';
$this->serviceName = 'webfonts';
$client->addService($this->serviceName, $this->version);
$this->webfonts = new Google_WebfontsServiceResource($this, $this->serviceName, 'webfonts', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "WebfontList"}, "id": "webfonts.webfonts.list", "parameters": {"sort": {"enum": ["alpha", "date", "popularity", "style", "trending"], "type": "string", "location": "query"}}, "path": "webfonts"}}}', true));
}
}
class Google_Webfont extends Google_Model {
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 Google_WebfontList extends Google_Model {
protected $__itemsType = 'Google_Webfont';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Webfont) */ $items) {
$this->assertIsArray($items, 'Google_Webfont', __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,567 @@
<?php
/*
* 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.
*/
/**
* The "directDeals" collection of methods.
* Typical usage is:
* <code>
* $adexchangebuyerService = new Google_AdexchangebuyerService(...);
* $directDeals = $adexchangebuyerService->directDeals;
* </code>
*/
class Google_DirectDealsServiceResource extends Google_ServiceResource {
/**
* Retrieves the authenticated user's list of direct deals. (directDeals.list)
*
* @param array $optParams Optional parameters.
* @return Google_DirectDealsList
*/
public function listDirectDeals($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_DirectDealsList($data);
} else {
return $data;
}
}
/**
* Gets one direct deal by ID. (directDeals.get)
*
* @param string $id The direct deal id
* @param array $optParams Optional parameters.
* @return Google_DirectDeal
*/
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 Google_DirectDeal($data);
} else {
return $data;
}
}
}
/**
* The "accounts" collection of methods.
* Typical usage is:
* <code>
* $adexchangebuyerService = new Google_AdexchangebuyerService(...);
* $accounts = $adexchangebuyerService->accounts;
* </code>
*/
class Google_AccountsServiceResource extends Google_ServiceResource {
/**
* Updates an existing account. This method supports patch semantics. (accounts.patch)
*
* @param int $id The account id
* @param Google_Account $postBody
* @param array $optParams Optional parameters.
* @return Google_Account
*/
public function patch($id, Google_Account $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 Google_Account($data);
} else {
return $data;
}
}
/**
* Retrieves the authenticated user's list of accounts. (accounts.list)
*
* @param array $optParams Optional parameters.
* @return Google_AccountsList
*/
public function listAccounts($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AccountsList($data);
} else {
return $data;
}
}
/**
* Updates an existing account. (accounts.update)
*
* @param int $id The account id
* @param Google_Account $postBody
* @param array $optParams Optional parameters.
* @return Google_Account
*/
public function update($id, Google_Account $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 Google_Account($data);
} else {
return $data;
}
}
/**
* Gets one account by ID. (accounts.get)
*
* @param int $id The account id
* @param array $optParams Optional parameters.
* @return Google_Account
*/
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 Google_Account($data);
} else {
return $data;
}
}
}
/**
* The "creatives" collection of methods.
* Typical usage is:
* <code>
* $adexchangebuyerService = new Google_AdexchangebuyerService(...);
* $creatives = $adexchangebuyerService->creatives;
* </code>
*/
class Google_CreativesServiceResource extends Google_ServiceResource {
/**
* Submit a new creative. (creatives.insert)
*
* @param Google_Creative $postBody
* @param array $optParams Optional parameters.
* @return Google_Creative
*/
public function insert(Google_Creative $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Creative($data);
} else {
return $data;
}
}
/**
* Retrieves a list of the authenticated user's active creatives. (creatives.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional.
* @opt_param string maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional.
* @return Google_CreativesList
*/
public function listCreatives($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CreativesList($data);
} else {
return $data;
}
}
/**
* Gets the status for a single creative. (creatives.get)
*
* @param int $accountId The id for the account that will serve this creative.
* @param string $buyerCreativeId The buyer-specific id for this creative.
* @param string $adgroupId The adgroup this creative belongs to.
* @param array $optParams Optional parameters.
* @return Google_Creative
*/
public function get($accountId, $buyerCreativeId, $adgroupId, $optParams = array()) {
$params = array('accountId' => $accountId, 'buyerCreativeId' => $buyerCreativeId, 'adgroupId' => $adgroupId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Creative($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Adexchangebuyer (v1).
*
* <p>
* Lets you manage your Ad Exchange Buyer account.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/ad-exchange/buyer-rest" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_AdexchangebuyerService extends Google_Service {
public $directDeals;
public $accounts;
public $creatives;
/**
* Constructs the internal representation of the Adexchangebuyer service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'adexchangebuyer/v1/';
$this->version = 'v1';
$this->serviceName = 'adexchangebuyer';
$client->addService($this->serviceName, $this->version);
$this->directDeals = new Google_DirectDealsServiceResource($this, $this->serviceName, 'directDeals', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "path": "directdeals", "response": {"$ref": "DirectDealsList"}, "id": "adexchangebuyer.directDeals.list", "httpMethod": "GET"}, "get": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"id": {"required": true, "type": "string", "location": "path", "format": "int64"}}, "id": "adexchangebuyer.directDeals.get", "httpMethod": "GET", "path": "directdeals/{id}", "response": {"$ref": "DirectDeal"}}}}', true));
$this->accounts = new Google_AccountsServiceResource($this, $this->serviceName, 'accounts', json_decode('{"methods": {"patch": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"id": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "request": {"$ref": "Account"}, "response": {"$ref": "Account"}, "httpMethod": "PATCH", "path": "accounts/{id}", "id": "adexchangebuyer.accounts.patch"}, "list": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "path": "accounts", "response": {"$ref": "AccountsList"}, "id": "adexchangebuyer.accounts.list", "httpMethod": "GET"}, "update": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"id": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "request": {"$ref": "Account"}, "response": {"$ref": "Account"}, "httpMethod": "PUT", "path": "accounts/{id}", "id": "adexchangebuyer.accounts.update"}, "get": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"id": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "id": "adexchangebuyer.accounts.get", "httpMethod": "GET", "path": "accounts/{id}", "response": {"$ref": "Account"}}}}', true));
$this->creatives = new Google_CreativesServiceResource($this, $this->serviceName, 'creatives', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "request": {"$ref": "Creative"}, "response": {"$ref": "Creative"}, "httpMethod": "POST", "path": "creatives", "id": "adexchangebuyer.creatives.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "1", "type": "integer", "maximum": "1000", "format": "uint32"}}, "response": {"$ref": "CreativesList"}, "httpMethod": "GET", "path": "creatives", "id": "adexchangebuyer.creatives.list"}, "get": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"adgroupId": {"required": true, "type": "string", "location": "query", "format": "int64"}, "buyerCreativeId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "id": "adexchangebuyer.creatives.get", "httpMethod": "GET", "path": "creatives/{accountId}/{buyerCreativeId}", "response": {"$ref": "Creative"}}}}', true));
}
}
class Google_Account extends Google_Model {
public $kind;
public $maximumTotalQps;
protected $__bidderLocationType = 'Google_AccountBidderLocation';
protected $__bidderLocationDataType = 'array';
public $bidderLocation;
public $cookieMatchingNid;
public $id;
public $cookieMatchingUrl;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setMaximumTotalQps($maximumTotalQps) {
$this->maximumTotalQps = $maximumTotalQps;
}
public function getMaximumTotalQps() {
return $this->maximumTotalQps;
}
public function setBidderLocation($bidderLocation) {
$this->assertIsArray($bidderLocation, 'Google_AccountBidderLocation', __METHOD__);
$this->bidderLocation = $bidderLocation;
}
public function getBidderLocation() {
return $this->bidderLocation;
}
public function setCookieMatchingNid($cookieMatchingNid) {
$this->cookieMatchingNid = $cookieMatchingNid;
}
public function getCookieMatchingNid() {
return $this->cookieMatchingNid;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setCookieMatchingUrl($cookieMatchingUrl) {
$this->cookieMatchingUrl = $cookieMatchingUrl;
}
public function getCookieMatchingUrl() {
return $this->cookieMatchingUrl;
}
}
class Google_AccountBidderLocation extends Google_Model {
public $url;
public $maximumQps;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setMaximumQps($maximumQps) {
$this->maximumQps = $maximumQps;
}
public function getMaximumQps() {
return $this->maximumQps;
}
}
class Google_AccountsList extends Google_Model {
protected $__itemsType = 'Google_Account';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems($items) {
$this->assertIsArray($items, 'Google_Account', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Creative extends Google_Model {
public $productCategories;
public $advertiserName;
public $adgroupId;
public $videoURL;
public $width;
public $attribute;
public $kind;
public $height;
public $advertiserId;
public $HTMLSnippet;
public $status;
public $buyerCreativeId;
public $clickThroughUrl;
public $vendorType;
public $disapprovalReasons;
public $sensitiveCategories;
public $accountId;
public function setProductCategories($productCategories) {
$this->productCategories = $productCategories;
}
public function getProductCategories() {
return $this->productCategories;
}
public function setAdvertiserName($advertiserName) {
$this->advertiserName = $advertiserName;
}
public function getAdvertiserName() {
return $this->advertiserName;
}
public function setAdgroupId($adgroupId) {
$this->adgroupId = $adgroupId;
}
public function getAdgroupId() {
return $this->adgroupId;
}
public function setVideoURL($videoURL) {
$this->videoURL = $videoURL;
}
public function getVideoURL() {
return $this->videoURL;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setAttribute($attribute) {
$this->attribute = $attribute;
}
public function getAttribute() {
return $this->attribute;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
public function setAdvertiserId($advertiserId) {
$this->advertiserId = $advertiserId;
}
public function getAdvertiserId() {
return $this->advertiserId;
}
public function setHTMLSnippet($HTMLSnippet) {
$this->HTMLSnippet = $HTMLSnippet;
}
public function getHTMLSnippet() {
return $this->HTMLSnippet;
}
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setBuyerCreativeId($buyerCreativeId) {
$this->buyerCreativeId = $buyerCreativeId;
}
public function getBuyerCreativeId() {
return $this->buyerCreativeId;
}
public function setClickThroughUrl($clickThroughUrl) {
$this->clickThroughUrl = $clickThroughUrl;
}
public function getClickThroughUrl() {
return $this->clickThroughUrl;
}
public function setVendorType($vendorType) {
$this->vendorType = $vendorType;
}
public function getVendorType() {
return $this->vendorType;
}
public function setDisapprovalReasons($disapprovalReasons) {
$this->disapprovalReasons = $disapprovalReasons;
}
public function getDisapprovalReasons() {
return $this->disapprovalReasons;
}
public function setSensitiveCategories($sensitiveCategories) {
$this->sensitiveCategories = $sensitiveCategories;
}
public function getSensitiveCategories() {
return $this->sensitiveCategories;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_CreativesList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Creative';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Creative', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_DirectDeal extends Google_Model {
public $advertiser;
public $kind;
public $currencyCode;
public $fixedCpm;
public $startTime;
public $endTime;
public $sellerNetwork;
public $id;
public $accountId;
public function setAdvertiser($advertiser) {
$this->advertiser = $advertiser;
}
public function getAdvertiser() {
return $this->advertiser;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setCurrencyCode($currencyCode) {
$this->currencyCode = $currencyCode;
}
public function getCurrencyCode() {
return $this->currencyCode;
}
public function setFixedCpm($fixedCpm) {
$this->fixedCpm = $fixedCpm;
}
public function getFixedCpm() {
return $this->fixedCpm;
}
public function setStartTime($startTime) {
$this->startTime = $startTime;
}
public function getStartTime() {
return $this->startTime;
}
public function setEndTime($endTime) {
$this->endTime = $endTime;
}
public function getEndTime() {
return $this->endTime;
}
public function setSellerNetwork($sellerNetwork) {
$this->sellerNetwork = $sellerNetwork;
}
public function getSellerNetwork() {
return $this->sellerNetwork;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_DirectDealsList extends Google_Model {
public $kind;
protected $__directDealsType = 'Google_DirectDeal';
protected $__directDealsDataType = 'array';
public $directDeals;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDirectDeals($directDeals) {
$this->assertIsArray($directDeals, 'Google_DirectDeal', __METHOD__);
$this->directDeals = $directDeals;
}
public function getDirectDeals() {
return $this->directDeals;
}
}

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 it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,836 @@
<?php
/*
* 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.
*/
/**
* The "cse" collection of methods.
* Typical usage is:
* <code>
* $customsearchService = new Google_CustomsearchService(...);
* $cse = $customsearchService->cse;
* </code>
*/
class Google_CseServiceResource extends Google_ServiceResource {
/**
* 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.
*
* @opt_param string sort The sort expression to apply to the results
* @opt_param string orTerms Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms
* @opt_param string highRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
* @opt_param string num Number of search results to return
* @opt_param string cr Country restrict(s).
* @opt_param string imgType Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.
* @opt_param string gl Geolocation of end user.
* @opt_param string relatedSite Specifies that all search results should be pages that are related to the specified URL
* @opt_param string searchType Specifies the search type: image.
* @opt_param string fileType Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...
* @opt_param string start The index of the first result to return
* @opt_param string imgDominantColor Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown.
* @opt_param string lr The language restriction for the search results
* @opt_param string siteSearch Specifies all search results should be pages from a given site
* @opt_param string cref The URL of a linked custom search engine
* @opt_param string dateRestrict Specifies all search results are from a time period
* @opt_param string safe Search safety level
* @opt_param string c2coff Turns off the translation between zh-CN and zh-TW.
* @opt_param string googlehost The local Google domain to use to perform the search.
* @opt_param string hq Appends the extra query terms to the query.
* @opt_param string exactTerms Identifies a phrase that all documents in the search results must contain
* @opt_param string hl Sets the user interface language.
* @opt_param string lowRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
* @opt_param string imgSize Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.
* @opt_param string imgColorType Returns black and white, grayscale, or color images: mono, gray, and color.
* @opt_param string rights Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.
* @opt_param string excludeTerms Identifies a word or phrase that should not appear in any documents in the search results
* @opt_param string filter Controls turning on or off the duplicate content filter.
* @opt_param string linkSite Specifies that all search results should contain a link to a particular URL
* @opt_param string cx The custom search engine ID to scope this search query
* @opt_param string siteSearchFilter Controls whether to include or exclude results from the site named in the as_sitesearch parameter
* @return Google_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 Google_Search($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_CustomsearchService extends Google_Service {
public $cse;
/**
* Constructs the internal representation of the Customsearch service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'customsearch/';
$this->version = 'v1';
$this->serviceName = 'customsearch';
$client->addService($this->serviceName, $this->version);
$this->cse = new Google_CseServiceResource($this, $this->serviceName, 'cse', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "Search"}, "id": "search.cse.list", "parameters": {"sort": {"type": "string", "location": "query"}, "orTerms": {"type": "string", "location": "query"}, "highRange": {"type": "string", "location": "query"}, "num": {"default": "10", "type": "integer", "location": "query", "format": "uint32"}, "cr": {"type": "string", "location": "query"}, "imgType": {"enum": ["clipart", "face", "lineart", "news", "photo"], "type": "string", "location": "query"}, "gl": {"type": "string", "location": "query"}, "q": {"required": true, "type": "string", "location": "query"}, "relatedSite": {"type": "string", "location": "query"}, "searchType": {"enum": ["image"], "type": "string", "location": "query"}, "fileType": {"type": "string", "location": "query"}, "start": {"type": "integer", "location": "query", "format": "uint32"}, "imgDominantColor": {"enum": ["black", "blue", "brown", "gray", "green", "pink", "purple", "teal", "white", "yellow"], "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"}, "siteSearch": {"type": "string", "location": "query"}, "cref": {"type": "string", "location": "query"}, "dateRestrict": {"type": "string", "location": "query"}, "safe": {"default": "off", "enum": ["high", "medium", "off"], "type": "string", "location": "query"}, "c2coff": {"type": "string", "location": "query"}, "googlehost": {"type": "string", "location": "query"}, "hq": {"type": "string", "location": "query"}, "exactTerms": {"type": "string", "location": "query"}, "hl": {"type": "string", "location": "query"}, "lowRange": {"type": "string", "location": "query"}, "imgSize": {"enum": ["huge", "icon", "large", "medium", "small", "xlarge", "xxlarge"], "type": "string", "location": "query"}, "imgColorType": {"enum": ["color", "gray", "mono"], "type": "string", "location": "query"}, "rights": {"type": "string", "location": "query"}, "excludeTerms": {"type": "string", "location": "query"}, "filter": {"enum": ["0", "1"], "type": "string", "location": "query"}, "linkSite": {"type": "string", "location": "query"}, "cx": {"type": "string", "location": "query"}, "siteSearchFilter": {"enum": ["e", "i"], "type": "string", "location": "query"}}, "path": "v1"}}}', true));
}
}
class Google_Context extends Google_Model {
protected $__facetsType = 'Google_ContextFacets';
protected $__facetsDataType = 'array';
public $facets;
public $title;
public function setFacets(/* array(Google_ContextFacets) */ $facets) {
$this->assertIsArray($facets, 'Google_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 Google_ContextFacets extends Google_Model {
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 Google_Promotion extends Google_Model {
public $title;
public $displayLink;
public $htmlTitle;
public $link;
protected $__bodyLinesType = 'Google_PromotionBodyLines';
protected $__bodyLinesDataType = 'array';
public $bodyLines;
protected $__imageType = 'Google_PromotionImage';
protected $__imageDataType = '';
public $image;
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 setHtmlTitle($htmlTitle) {
$this->htmlTitle = $htmlTitle;
}
public function getHtmlTitle() {
return $this->htmlTitle;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setBodyLines(/* array(Google_PromotionBodyLines) */ $bodyLines) {
$this->assertIsArray($bodyLines, 'Google_PromotionBodyLines', __METHOD__);
$this->bodyLines = $bodyLines;
}
public function getBodyLines() {
return $this->bodyLines;
}
public function setImage(Google_PromotionImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
}
class Google_PromotionBodyLines extends Google_Model {
public $url;
public $htmlTitle;
public $link;
public $title;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setHtmlTitle($htmlTitle) {
$this->htmlTitle = $htmlTitle;
}
public function getHtmlTitle() {
return $this->htmlTitle;
}
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 Google_PromotionImage extends Google_Model {
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 Google_Query extends Google_Model {
public $sort;
public $inputEncoding;
public $orTerms;
public $highRange;
public $cx;
public $startPage;
public $disableCnTwTranslation;
public $cr;
public $imgType;
public $gl;
public $relatedSite;
public $searchType;
public $title;
public $googleHost;
public $fileType;
public $imgDominantColor;
public $siteSearch;
public $cref;
public $dateRestrict;
public $safe;
public $outputEncoding;
public $hq;
public $searchTerms;
public $exactTerms;
public $language;
public $hl;
public $totalResults;
public $lowRange;
public $count;
public $imgSize;
public $imgColorType;
public $rights;
public $startIndex;
public $excludeTerms;
public $filter;
public $linkSite;
public $siteSearchFilter;
public function setSort($sort) {
$this->sort = $sort;
}
public function getSort() {
return $this->sort;
}
public function setInputEncoding($inputEncoding) {
$this->inputEncoding = $inputEncoding;
}
public function getInputEncoding() {
return $this->inputEncoding;
}
public function setOrTerms($orTerms) {
$this->orTerms = $orTerms;
}
public function getOrTerms() {
return $this->orTerms;
}
public function setHighRange($highRange) {
$this->highRange = $highRange;
}
public function getHighRange() {
return $this->highRange;
}
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 setDisableCnTwTranslation($disableCnTwTranslation) {
$this->disableCnTwTranslation = $disableCnTwTranslation;
}
public function getDisableCnTwTranslation() {
return $this->disableCnTwTranslation;
}
public function setCr($cr) {
$this->cr = $cr;
}
public function getCr() {
return $this->cr;
}
public function setImgType($imgType) {
$this->imgType = $imgType;
}
public function getImgType() {
return $this->imgType;
}
public function setGl($gl) {
$this->gl = $gl;
}
public function getGl() {
return $this->gl;
}
public function setRelatedSite($relatedSite) {
$this->relatedSite = $relatedSite;
}
public function getRelatedSite() {
return $this->relatedSite;
}
public function setSearchType($searchType) {
$this->searchType = $searchType;
}
public function getSearchType() {
return $this->searchType;
}
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 setFileType($fileType) {
$this->fileType = $fileType;
}
public function getFileType() {
return $this->fileType;
}
public function setImgDominantColor($imgDominantColor) {
$this->imgDominantColor = $imgDominantColor;
}
public function getImgDominantColor() {
return $this->imgDominantColor;
}
public function setSiteSearch($siteSearch) {
$this->siteSearch = $siteSearch;
}
public function getSiteSearch() {
return $this->siteSearch;
}
public function setCref($cref) {
$this->cref = $cref;
}
public function getCref() {
return $this->cref;
}
public function setDateRestrict($dateRestrict) {
$this->dateRestrict = $dateRestrict;
}
public function getDateRestrict() {
return $this->dateRestrict;
}
public function setSafe($safe) {
$this->safe = $safe;
}
public function getSafe() {
return $this->safe;
}
public function setOutputEncoding($outputEncoding) {
$this->outputEncoding = $outputEncoding;
}
public function getOutputEncoding() {
return $this->outputEncoding;
}
public function setHq($hq) {
$this->hq = $hq;
}
public function getHq() {
return $this->hq;
}
public function setSearchTerms($searchTerms) {
$this->searchTerms = $searchTerms;
}
public function getSearchTerms() {
return $this->searchTerms;
}
public function setExactTerms($exactTerms) {
$this->exactTerms = $exactTerms;
}
public function getExactTerms() {
return $this->exactTerms;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
public function setHl($hl) {
$this->hl = $hl;
}
public function getHl() {
return $this->hl;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
public function setLowRange($lowRange) {
$this->lowRange = $lowRange;
}
public function getLowRange() {
return $this->lowRange;
}
public function setCount($count) {
$this->count = $count;
}
public function getCount() {
return $this->count;
}
public function setImgSize($imgSize) {
$this->imgSize = $imgSize;
}
public function getImgSize() {
return $this->imgSize;
}
public function setImgColorType($imgColorType) {
$this->imgColorType = $imgColorType;
}
public function getImgColorType() {
return $this->imgColorType;
}
public function setRights($rights) {
$this->rights = $rights;
}
public function getRights() {
return $this->rights;
}
public function setStartIndex($startIndex) {
$this->startIndex = $startIndex;
}
public function getStartIndex() {
return $this->startIndex;
}
public function setExcludeTerms($excludeTerms) {
$this->excludeTerms = $excludeTerms;
}
public function getExcludeTerms() {
return $this->excludeTerms;
}
public function setFilter($filter) {
$this->filter = $filter;
}
public function getFilter() {
return $this->filter;
}
public function setLinkSite($linkSite) {
$this->linkSite = $linkSite;
}
public function getLinkSite() {
return $this->linkSite;
}
public function setSiteSearchFilter($siteSearchFilter) {
$this->siteSearchFilter = $siteSearchFilter;
}
public function getSiteSearchFilter() {
return $this->siteSearchFilter;
}
}
class Google_Result extends Google_Model {
public $snippet;
public $kind;
protected $__labelsType = 'Google_ResultLabels';
protected $__labelsDataType = 'array';
public $labels;
public $title;
public $displayLink;
public $cacheId;
public $formattedUrl;
public $htmlFormattedUrl;
public $pagemap;
public $htmlTitle;
public $htmlSnippet;
public $link;
protected $__imageType = 'Google_ResultImage';
protected $__imageDataType = '';
public $image;
public $mime;
public $fileFormat;
public function setSnippet($snippet) {
$this->snippet = $snippet;
}
public function getSnippet() {
return $this->snippet;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setLabels(/* array(Google_ResultLabels) */ $labels) {
$this->assertIsArray($labels, 'Google_ResultLabels', __METHOD__);
$this->labels = $labels;
}
public function getLabels() {
return $this->labels;
}
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 setFormattedUrl($formattedUrl) {
$this->formattedUrl = $formattedUrl;
}
public function getFormattedUrl() {
return $this->formattedUrl;
}
public function setHtmlFormattedUrl($htmlFormattedUrl) {
$this->htmlFormattedUrl = $htmlFormattedUrl;
}
public function getHtmlFormattedUrl() {
return $this->htmlFormattedUrl;
}
public function setPagemap($pagemap) {
$this->pagemap = $pagemap;
}
public function getPagemap() {
return $this->pagemap;
}
public function setHtmlTitle($htmlTitle) {
$this->htmlTitle = $htmlTitle;
}
public function getHtmlTitle() {
return $this->htmlTitle;
}
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 setImage(Google_ResultImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setMime($mime) {
$this->mime = $mime;
}
public function getMime() {
return $this->mime;
}
public function setFileFormat($fileFormat) {
$this->fileFormat = $fileFormat;
}
public function getFileFormat() {
return $this->fileFormat;
}
}
class Google_ResultImage extends Google_Model {
public $thumbnailWidth;
public $byteSize;
public $height;
public $width;
public $contextLink;
public $thumbnailLink;
public $thumbnailHeight;
public function setThumbnailWidth($thumbnailWidth) {
$this->thumbnailWidth = $thumbnailWidth;
}
public function getThumbnailWidth() {
return $this->thumbnailWidth;
}
public function setByteSize($byteSize) {
$this->byteSize = $byteSize;
}
public function getByteSize() {
return $this->byteSize;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setContextLink($contextLink) {
$this->contextLink = $contextLink;
}
public function getContextLink() {
return $this->contextLink;
}
public function setThumbnailLink($thumbnailLink) {
$this->thumbnailLink = $thumbnailLink;
}
public function getThumbnailLink() {
return $this->thumbnailLink;
}
public function setThumbnailHeight($thumbnailHeight) {
$this->thumbnailHeight = $thumbnailHeight;
}
public function getThumbnailHeight() {
return $this->thumbnailHeight;
}
}
class Google_ResultLabels extends Google_Model {
public $displayName;
public $name;
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_Search extends Google_Model {
protected $__promotionsType = 'Google_Promotion';
protected $__promotionsDataType = 'array';
public $promotions;
public $kind;
protected $__urlType = 'Google_SearchUrl';
protected $__urlDataType = '';
public $url;
protected $__itemsType = 'Google_Result';
protected $__itemsDataType = 'array';
public $items;
protected $__contextType = 'Google_Context';
protected $__contextDataType = '';
public $context;
protected $__queriesType = 'Google_Query';
protected $__queriesDataType = 'map';
public $queries;
protected $__spellingType = 'Google_SearchSpelling';
protected $__spellingDataType = '';
public $spelling;
protected $__searchInformationType = 'Google_SearchSearchInformation';
protected $__searchInformationDataType = '';
public $searchInformation;
public function setPromotions(/* array(Google_Promotion) */ $promotions) {
$this->assertIsArray($promotions, 'Google_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(Google_SearchUrl $url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setItems(/* array(Google_Result) */ $items) {
$this->assertIsArray($items, 'Google_Result', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setContext(Google_Context $context) {
$this->context = $context;
}
public function getContext() {
return $this->context;
}
public function setQueries(Google_Query $queries) {
$this->queries = $queries;
}
public function getQueries() {
return $this->queries;
}
public function setSpelling(Google_SearchSpelling $spelling) {
$this->spelling = $spelling;
}
public function getSpelling() {
return $this->spelling;
}
public function setSearchInformation(Google_SearchSearchInformation $searchInformation) {
$this->searchInformation = $searchInformation;
}
public function getSearchInformation() {
return $this->searchInformation;
}
}
class Google_SearchSearchInformation extends Google_Model {
public $formattedSearchTime;
public $formattedTotalResults;
public $totalResults;
public $searchTime;
public function setFormattedSearchTime($formattedSearchTime) {
$this->formattedSearchTime = $formattedSearchTime;
}
public function getFormattedSearchTime() {
return $this->formattedSearchTime;
}
public function setFormattedTotalResults($formattedTotalResults) {
$this->formattedTotalResults = $formattedTotalResults;
}
public function getFormattedTotalResults() {
return $this->formattedTotalResults;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
public function setSearchTime($searchTime) {
$this->searchTime = $searchTime;
}
public function getSearchTime() {
return $this->searchTime;
}
}
class Google_SearchSpelling extends Google_Model {
public $correctedQuery;
public $htmlCorrectedQuery;
public function setCorrectedQuery($correctedQuery) {
$this->correctedQuery = $correctedQuery;
}
public function getCorrectedQuery() {
return $this->correctedQuery;
}
public function setHtmlCorrectedQuery($htmlCorrectedQuery) {
$this->htmlCorrectedQuery = $htmlCorrectedQuery;
}
public function getHtmlCorrectedQuery() {
return $this->htmlCorrectedQuery;
}
}
class Google_SearchUrl extends Google_Model {
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;
}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,89 @@
<?php
/*
* 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.
*/
/**
* The "text" collection of methods.
* Typical usage is:
* <code>
* $freebaseService = new Google_FreebaseService(...);
* $text = $freebaseService->text;
* </code>
*/
class Google_TextServiceResource extends Google_ServiceResource {
/**
* 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.
*
* @opt_param string maxlength The max number of characters to return. Valid only for 'plain' format.
* @opt_param string format Sanitizing transformation.
* @return Google_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 Google_ContentserviceGet($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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/API" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_FreebaseService extends Google_Service {
public $text;
/**
* Constructs the internal representation of the Freebase service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'freebase/v1/';
$this->version = 'v1';
$this->serviceName = 'freebase';
$client->addService($this->serviceName, $this->version);
$this->text = new Google_TextServiceResource($this, $this->serviceName, 'text', json_decode('{"methods": {"get": {"httpMethod": "GET", "response": {"$ref": "ContentserviceGet"}, "id": "freebase.text.get", "parameters": {"maxlength": {"type": "integer", "location": "query", "format": "uint32"}, "id": {"repeated": true, "required": true, "type": "string", "location": "path"}, "format": {"default": "plain", "enum": ["html", "plain", "raw"], "type": "string", "location": "query"}}, "path": "text{/id*}"}}}', true));
}
}
class Google_ContentserviceGet extends Google_Model {
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

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,283 @@
<?php
/*
* 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.
*/
/**
* The "currentLocation" collection of methods.
* Typical usage is:
* <code>
* $latitudeService = new Google_LatitudeService(...);
* $currentLocation = $latitudeService->currentLocation;
* </code>
*/
class Google_CurrentLocationServiceResource extends Google_ServiceResource {
/**
* Updates or creates the user's current location. (currentLocation.insert)
*
* @param Google_Location $postBody
* @param array $optParams Optional parameters.
* @return Google_Location
*/
public function insert(Google_Location $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Location($data);
} else {
return $data;
}
}
/**
* Returns the authenticated user's current location. (currentLocation.get)
*
* @param array $optParams Optional parameters.
*
* @opt_param string granularity Granularity of the requested location.
* @return Google_Location
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Location($data);
} else {
return $data;
}
}
/**
* Deletes the authenticated user's current location. (currentLocation.delete)
*
* @param array $optParams Optional parameters.
*/
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 Google_LatitudeService(...);
* $location = $latitudeService->location;
* </code>
*/
class Google_LocationServiceResource extends Google_ServiceResource {
/**
* Inserts or updates a location in the user's location history. (location.insert)
*
* @param Google_Location $postBody
* @param array $optParams Optional parameters.
* @return Google_Location
*/
public function insert(Google_Location $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_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.
*
* @opt_param string granularity Granularity of the location to return.
* @return Google_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 Google_Location($data);
} else {
return $data;
}
}
/**
* Lists the user's location history. (location.list)
*
* @param array $optParams Optional parameters.
*
* @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 Google_LocationFeed
*/
public function listLocation($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_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).
* @param array $optParams Optional parameters.
*/
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 Google_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="https://developers.google.com/latitude/v1/using" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_LatitudeService extends Google_Service {
public $currentLocation;
public $location;
/**
* Constructs the internal representation of the Latitude service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'latitude/v1/';
$this->version = 'v1';
$this->serviceName = 'latitude';
$client->addService($this->serviceName, $this->version);
$this->currentLocation = new Google_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"}, "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": {"default": "city", "enum": ["best", "city"], "type": "string", "location": "query"}}, "response": {"$ref": "LatitudeCurrentlocationResourceJson"}, "httpMethod": "GET", "path": "currentLocation", "id": "latitude.currentLocation.get"}, "delete": {"path": "currentLocation", "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"], "id": "latitude.currentLocation.delete", "httpMethod": "DELETE"}}}', true));
$this->location = new Google_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"}, "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": {"default": "city", "enum": ["best", "city"], "type": "string", "location": "query"}}, "id": "latitude.location.get", "httpMethod": "GET", "path": "location/{locationId}", "response": {"$ref": "Location"}}, "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": {"default": "city", "enum": ["best", "city"], "type": "string", "location": "query"}}, "response": {"$ref": "LocationFeed"}, "httpMethod": "GET", "path": "location", "id": "latitude.location.list"}, "delete": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "path": "location/{locationId}", "id": "latitude.location.delete", "parameters": {"locationId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_Location extends Google_Model {
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 Google_LocationFeed extends Google_Model {
protected $__itemsType = 'Google_Location';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Location) */ $items) {
$this->assertIsArray($items, 'Google_Location', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}

View file

@ -0,0 +1,285 @@
<?php
/*
* 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.
*/
/**
* The "licenseAssignments" collection of methods.
* Typical usage is:
* <code>
* $licensingService = new Google_LicensingService(...);
* $licenseAssignments = $licensingService->licenseAssignments;
* </code>
*/
class Google_LicenseAssignmentsServiceResource extends Google_ServiceResource {
/**
* Assign License. (licenseAssignments.insert)
*
* @param string $productId Name for product
* @param string $skuId Name for sku
* @param Google_LicenseAssignmentInsert $postBody
* @param array $optParams Optional parameters.
* @return Google_LicenseAssignment
*/
public function insert($productId, $skuId, Google_LicenseAssignmentInsert $postBody, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignment($data);
} else {
return $data;
}
}
/**
* Get license assignment of a particular product and sku for a user (licenseAssignments.get)
*
* @param string $productId Name for product
* @param string $skuId Name for sku
* @param string $userId email id or unique Id of the user
* @param array $optParams Optional parameters.
* @return Google_LicenseAssignment
*/
public function get($productId, $skuId, $userId, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignment($data);
} else {
return $data;
}
}
/**
* List license assignments for given product and sku of the customer.
* (licenseAssignments.listForProductAndSku)
*
* @param string $productId Name for product
* @param string $skuId Name for sku
* @param string $customerId CustomerId represents the customer for whom licenseassignments are queried
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Token to fetch the next page.Optional. By default server will return first page
* @opt_param string maxResults Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100.
* @return Google_LicenseAssignmentList
*/
public function listForProductAndSku($productId, $skuId, $customerId, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'customerId' => $customerId);
$params = array_merge($params, $optParams);
$data = $this->__call('listForProductAndSku', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignmentList($data);
} else {
return $data;
}
}
/**
* List license assignments for given product of the customer. (licenseAssignments.listForProduct)
*
* @param string $productId Name for product
* @param string $customerId CustomerId represents the customer for whom licenseassignments are queried
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Token to fetch the next page.Optional. By default server will return first page
* @opt_param string maxResults Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100.
* @return Google_LicenseAssignmentList
*/
public function listForProduct($productId, $customerId, $optParams = array()) {
$params = array('productId' => $productId, 'customerId' => $customerId);
$params = array_merge($params, $optParams);
$data = $this->__call('listForProduct', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignmentList($data);
} else {
return $data;
}
}
/**
* Assign License. (licenseAssignments.update)
*
* @param string $productId Name for product
* @param string $skuId Name for sku for which license would be revoked
* @param string $userId email id or unique Id of the user
* @param Google_LicenseAssignment $postBody
* @param array $optParams Optional parameters.
* @return Google_LicenseAssignment
*/
public function update($productId, $skuId, $userId, Google_LicenseAssignment $postBody, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignment($data);
} else {
return $data;
}
}
/**
* Assign License. This method supports patch semantics. (licenseAssignments.patch)
*
* @param string $productId Name for product
* @param string $skuId Name for sku for which license would be revoked
* @param string $userId email id or unique Id of the user
* @param Google_LicenseAssignment $postBody
* @param array $optParams Optional parameters.
* @return Google_LicenseAssignment
*/
public function patch($productId, $skuId, $userId, Google_LicenseAssignment $postBody, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignment($data);
} else {
return $data;
}
}
/**
* Revoke License. (licenseAssignments.delete)
*
* @param string $productId Name for product
* @param string $skuId Name for sku
* @param string $userId email id or unique Id of the user
* @param array $optParams Optional parameters.
*/
public function delete($productId, $skuId, $userId, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Google_Licensing (v1).
*
* <p>
* Licensing API to view and manage license for your domain.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/google-apps/licensing/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_LicensingService extends Google_Service {
public $licenseAssignments;
/**
* Constructs the internal representation of the Licensing service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'apps/licensing/v1/product/';
$this->version = 'v1';
$this->serviceName = 'licensing';
$client->addService($this->serviceName, $this->version);
$this->licenseAssignments = new Google_LicenseAssignmentsServiceResource($this, $this->serviceName, 'licenseAssignments', json_decode('{"methods": {"insert": {"parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "LicenseAssignmentInsert"}, "id": "licensing.licenseAssignments.insert", "httpMethod": "POST", "path": "{productId}/sku/{skuId}/user", "response": {"$ref": "LicenseAssignment"}}, "get": {"httpMethod": "GET", "response": {"$ref": "LicenseAssignment"}, "id": "licensing.licenseAssignments.get", "parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "path": "{productId}/sku/{skuId}/user/{userId}"}, "listForProductAndSku": {"httpMethod": "GET", "response": {"$ref": "LicenseAssignmentList"}, "id": "licensing.licenseAssignments.listForProductAndSku", "parameters": {"pageToken": {"default": "", "type": "string", "location": "query"}, "skuId": {"required": true, "type": "string", "location": "path"}, "customerId": {"required": true, "type": "string", "location": "query"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "1000", "minimum": "1", "location": "query", "type": "integer"}, "productId": {"required": true, "type": "string", "location": "path"}}, "path": "{productId}/sku/{skuId}/users"}, "listForProduct": {"httpMethod": "GET", "response": {"$ref": "LicenseAssignmentList"}, "id": "licensing.licenseAssignments.listForProduct", "parameters": {"pageToken": {"default": "", "type": "string", "location": "query"}, "customerId": {"required": true, "type": "string", "location": "query"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "1000", "minimum": "1", "location": "query", "type": "integer"}, "productId": {"required": true, "type": "string", "location": "path"}}, "path": "{productId}/users"}, "update": {"parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "LicenseAssignment"}, "id": "licensing.licenseAssignments.update", "httpMethod": "PUT", "path": "{productId}/sku/{skuId}/user/{userId}", "response": {"$ref": "LicenseAssignment"}}, "patch": {"parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "LicenseAssignment"}, "id": "licensing.licenseAssignments.patch", "httpMethod": "PATCH", "path": "{productId}/sku/{skuId}/user/{userId}", "response": {"$ref": "LicenseAssignment"}}, "delete": {"httpMethod": "DELETE", "id": "licensing.licenseAssignments.delete", "parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "path": "{productId}/sku/{skuId}/user/{userId}"}}}', true));
}
}
class Google_LicenseAssignment extends Google_Model {
public $skuId;
public $kind;
public $userId;
public $etags;
public $selfLink;
public $productId;
public function setSkuId($skuId) {
$this->skuId = $skuId;
}
public function getSkuId() {
return $this->skuId;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setUserId($userId) {
$this->userId = $userId;
}
public function getUserId() {
return $this->userId;
}
public function setEtags($etags) {
$this->etags = $etags;
}
public function getEtags() {
return $this->etags;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setProductId($productId) {
$this->productId = $productId;
}
public function getProductId() {
return $this->productId;
}
}
class Google_LicenseAssignmentInsert extends Google_Model {
public $userId;
public function setUserId($userId) {
$this->userId = $userId;
}
public function getUserId() {
return $this->userId;
}
}
class Google_LicenseAssignmentList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_LicenseAssignment';
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(Google_LicenseAssignment) */ $items) {
$this->assertIsArray($items, 'Google_LicenseAssignment', __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;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,265 @@
<?php
/*
* 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.
*/
/**
* The "userinfo" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new Google_Oauth2Service(...);
* $userinfo = $oauth2Service->userinfo;
* </code>
*/
class Google_UserinfoServiceResource extends Google_ServiceResource {
/**
* (userinfo.get)
*
* @param array $optParams Optional parameters.
* @return Google_Userinfo
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Userinfo($data);
} else {
return $data;
}
}
}
/**
* The "v2" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new Google_Oauth2Service(...);
* $v2 = $oauth2Service->v2;
* </code>
*/
class Google_UserinfoV2ServiceResource extends Google_ServiceResource {
}
/**
* The "me" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new Google_Oauth2Service(...);
* $me = $oauth2Service->me;
* </code>
*/
class Google_UserinfoV2MeServiceResource extends Google_ServiceResource {
/**
* (me.get)
*
* @param array $optParams Optional parameters.
* @return Google_Userinfo
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Userinfo($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_Oauth2Service extends Google_Service {
public $userinfo;
public $userinfo_v2_me;
/**
* Constructs the internal representation of the Oauth2 service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = '';
$this->version = 'v2';
$this->serviceName = 'oauth2';
$client->addService($this->serviceName, $this->version);
$this->userinfo = new Google_UserinfoServiceResource($this, $this->serviceName, 'userinfo', json_decode('{"methods": {"get": {"path": "oauth2/v2/userinfo", "scopes": ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"], "id": "oauth2.userinfo.get", "httpMethod": "GET", "response": {"$ref": "Userinfo"}}}}', true));
$this->userinfo_v2_me = new Google_UserinfoV2MeServiceResource($this, $this->serviceName, 'me', json_decode('{"methods": {"get": {"path": "userinfo/v2/me", "scopes": ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"], "id": "oauth2.userinfo.v2.me.get", "httpMethod": "GET", "response": {"$ref": "Userinfo"}}}}', true));
}
}
class Google_Tokeninfo extends Google_Model {
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 Google_Userinfo extends Google_Model {
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,474 @@
<?php
/*
* 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.
*/
/**
* The "pagespeedapi" collection of methods.
* Typical usage is:
* <code>
* $pagespeedonlineService = new Google_PagespeedonlineService(...);
* $pagespeedapi = $pagespeedonlineService->pagespeedapi;
* </code>
*/
class Google_PagespeedapiServiceResource extends Google_ServiceResource {
/**
* 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.
*
* @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 Google_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 Google_Result($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_PagespeedonlineService extends Google_Service {
public $pagespeedapi;
/**
* Constructs the internal representation of the Pagespeedonline service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'pagespeedonline/v1/';
$this->version = 'v1';
$this->serviceName = 'pagespeedonline';
$client->addService($this->serviceName, $this->version);
$this->pagespeedapi = new Google_PagespeedapiServiceResource($this, $this->serviceName, 'pagespeedapi', json_decode('{"methods": {"runpagespeed": {"httpMethod": "GET", "response": {"$ref": "Result"}, "id": "pagespeedonline.pagespeedapi.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"}}, "path": "runPagespeed"}}}', true));
}
}
class Google_Result extends Google_Model {
public $kind;
protected $__formattedResultsType = 'Google_ResultFormattedResults';
protected $__formattedResultsDataType = '';
public $formattedResults;
public $title;
protected $__versionType = 'Google_ResultVersion';
protected $__versionDataType = '';
public $version;
public $score;
public $responseCode;
public $invalidRules;
protected $__pageStatsType = 'Google_ResultPageStats';
protected $__pageStatsDataType = '';
public $pageStats;
public $id;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setFormattedResults(Google_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(Google_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(Google_string) */ $invalidRules) {
$this->assertIsArray($invalidRules, 'Google_string', __METHOD__);
$this->invalidRules = $invalidRules;
}
public function getInvalidRules() {
return $this->invalidRules;
}
public function setPageStats(Google_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 Google_ResultFormattedResults extends Google_Model {
public $locale;
protected $__ruleResultsType = 'Google_ResultFormattedResultsRuleResults';
protected $__ruleResultsDataType = 'map';
public $ruleResults;
public function setLocale($locale) {
$this->locale = $locale;
}
public function getLocale() {
return $this->locale;
}
public function setRuleResults(Google_ResultFormattedResultsRuleResults $ruleResults) {
$this->ruleResults = $ruleResults;
}
public function getRuleResults() {
return $this->ruleResults;
}
}
class Google_ResultFormattedResultsRuleResults extends Google_Model {
public $localizedRuleName;
protected $__urlBlocksType = 'Google_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(Google_ResultFormattedResultsRuleResultsUrlBlocks) */ $urlBlocks) {
$this->assertIsArray($urlBlocks, 'Google_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 Google_ResultFormattedResultsRuleResultsUrlBlocks extends Google_Model {
protected $__headerType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksHeader';
protected $__headerDataType = '';
public $header;
protected $__urlsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrls';
protected $__urlsDataType = 'array';
public $urls;
public function setHeader(Google_ResultFormattedResultsRuleResultsUrlBlocksHeader $header) {
$this->header = $header;
}
public function getHeader() {
return $this->header;
}
public function setUrls(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrls) */ $urls) {
$this->assertIsArray($urls, 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrls', __METHOD__);
$this->urls = $urls;
}
public function getUrls() {
return $this->urls;
}
}
class Google_ResultFormattedResultsRuleResultsUrlBlocksHeader extends Google_Model {
protected $__argsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs';
protected $__argsDataType = 'array';
public $args;
public $format;
public function setArgs(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs) */ $args) {
$this->assertIsArray($args, 'Google_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 Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs extends Google_Model {
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 Google_ResultFormattedResultsRuleResultsUrlBlocksUrls extends Google_Model {
protected $__detailsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails';
protected $__detailsDataType = 'array';
public $details;
protected $__resultType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResult';
protected $__resultDataType = '';
public $result;
public function setDetails(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails) */ $details) {
$this->assertIsArray($details, 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails', __METHOD__);
$this->details = $details;
}
public function getDetails() {
return $this->details;
}
public function setResult(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResult $result) {
$this->result = $result;
}
public function getResult() {
return $this->result;
}
}
class Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails extends Google_Model {
protected $__argsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs';
protected $__argsDataType = 'array';
public $args;
public $format;
public function setArgs(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs) */ $args) {
$this->assertIsArray($args, 'Google_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 Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs extends Google_Model {
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 Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResult extends Google_Model {
protected $__argsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs';
protected $__argsDataType = 'array';
public $args;
public $format;
public function setArgs(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs) */ $args) {
$this->assertIsArray($args, 'Google_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 Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs extends Google_Model {
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 Google_ResultPageStats extends Google_Model {
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 Google_ResultVersion extends Google_Model {
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;
}
}

View file

@ -0,0 +1,567 @@
<?php
/*
* 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.
*/
/**
* The "moments" collection of methods.
* Typical usage is:
* <code>
* $plusService = new Google_PlusMomentsService(...);
* $moments = $plusService->moments;
* </code>
*/
class Google_MomentsServiceResource extends Google_ServiceResource {
/**
* Record a user activity (e.g Bill watched a video on Youtube) (moments.insert)
*
* @param string $userId The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user.
* @param string $collection The collection to which to write moments.
* @param Google_Moment $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool debug Return the moment as written. Should be used only for debugging.
* @return Google_Moment
*/
public function insert($userId, $collection, Google_Moment $postBody, $optParams = array()) {
$params = array('userId' => $userId, 'collection' => $collection, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Moment($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Plus (v1moments).
*
* <p>
* The Google+ API enables developers to build on top of the Google+ platform.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/+/history/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_PlusMomentsService extends Google_Service {
public $moments;
/**
* Constructs the internal representation of the Plus service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'plus/v1moments/people/';
$this->version = 'v1moments';
$this->serviceName = 'plus';
$client->addService($this->serviceName, $this->version);
$this->moments = new Google_MomentsServiceResource($this, $this->serviceName, 'moments',
json_decode('{"methods": {"insert": {"parameters": {"debug": {"type": "boolean", "location": "query"}, "userId": {"required": true, "type": "string", "location": "path"}, "collection": {"required": true, "type": "string", "location": "path", "enum": ["vault"]}}, "request": {"$ref": "Moment"}, "response": {"$ref": "Moment"}, "httpMethod": "POST", "path": "{userId}/moments/{collection}", "id": "plus.moments.insert"}}}', true));
}
}
class Google_ItemScope extends Google_Model {
public $startDate;
public $endDate;
public $text;
public $image;
protected $__addressType = 'Google_ItemScope';
protected $__addressDataType = '';
public $address;
public $birthDate;
public $datePublished;
public $addressLocality;
public $duration;
public $additionalName;
public $worstRating;
protected $__contributorType = 'Google_ItemScope';
protected $__contributorDataType = 'array';
public $contributor;
public $thumbnailUrl;
public $id;
public $postOfficeBoxNumber;
protected $__attendeesType = 'Google_ItemScope';
protected $__attendeesDataType = 'array';
public $attendees;
protected $__authorType = 'Google_ItemScope';
protected $__authorDataType = 'array';
public $author;
protected $__associated_mediaType = 'Google_ItemScope';
protected $__associated_mediaDataType = 'array';
public $associated_media;
public $bestRating;
public $addressCountry;
public $width;
public $streetAddress;
protected $__locationType = 'Google_ItemScope';
protected $__locationDataType = '';
public $location;
public $latitude;
protected $__byArtistType = 'Google_ItemScope';
protected $__byArtistDataType = '';
public $byArtist;
public $type;
public $dateModified;
public $contentSize;
public $contentUrl;
protected $__partOfTVSeriesType = 'Google_ItemScope';
protected $__partOfTVSeriesDataType = '';
public $partOfTVSeries;
public $description;
public $familyName;
public $kind;
public $dateCreated;
public $postalCode;
public $attendeeCount;
protected $__inAlbumType = 'Google_ItemScope';
protected $__inAlbumDataType = '';
public $inAlbum;
public $addressRegion;
public $height;
protected $__geoType = 'Google_ItemScope';
protected $__geoDataType = '';
public $geo;
public $embedUrl;
public $tickerSymbol;
public $playerType;
protected $__aboutType = 'Google_ItemScope';
protected $__aboutDataType = '';
public $about;
public $givenName;
public $name;
protected $__performersType = 'Google_ItemScope';
protected $__performersDataType = 'array';
public $performers;
public $url;
public $gender;
public $longitude;
protected $__thumbnailType = 'Google_ItemScope';
protected $__thumbnailDataType = '';
public $thumbnail;
public $caption;
public $ratingValue;
protected $__reviewRatingType = 'Google_ItemScope';
protected $__reviewRatingDataType = '';
public $reviewRating;
protected $__audioType = 'Google_ItemScope';
protected $__audioDataType = '';
public $audio;
public function setStartDate($startDate) {
$this->startDate = $startDate;
}
public function getStartDate() {
return $this->startDate;
}
public function setEndDate($endDate) {
$this->endDate = $endDate;
}
public function getEndDate() {
return $this->endDate;
}
public function setText($text) {
$this->text = $text;
}
public function getText() {
return $this->text;
}
public function setImage($image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setAddress(Google_ItemScope $address) {
$this->address = $address;
}
public function getAddress() {
return $this->address;
}
public function setBirthDate($birthDate) {
$this->birthDate = $birthDate;
}
public function getBirthDate() {
return $this->birthDate;
}
public function setDatePublished($datePublished) {
$this->datePublished = $datePublished;
}
public function getDatePublished() {
return $this->datePublished;
}
public function setAddressLocality($addressLocality) {
$this->addressLocality = $addressLocality;
}
public function getAddressLocality() {
return $this->addressLocality;
}
public function setDuration($duration) {
$this->duration = $duration;
}
public function getDuration() {
return $this->duration;
}
public function setAdditionalName(/* array(Google_string) */ $additionalName) {
$this->assertIsArray($additionalName, 'Google_string', __METHOD__);
$this->additionalName = $additionalName;
}
public function getAdditionalName() {
return $this->additionalName;
}
public function setWorstRating($worstRating) {
$this->worstRating = $worstRating;
}
public function getWorstRating() {
return $this->worstRating;
}
public function setContributor(/* array(Google_ItemScope) */ $contributor) {
$this->assertIsArray($contributor, 'Google_ItemScope', __METHOD__);
$this->contributor = $contributor;
}
public function getContributor() {
return $this->contributor;
}
public function setThumbnailUrl($thumbnailUrl) {
$this->thumbnailUrl = $thumbnailUrl;
}
public function getThumbnailUrl() {
return $this->thumbnailUrl;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setPostOfficeBoxNumber($postOfficeBoxNumber) {
$this->postOfficeBoxNumber = $postOfficeBoxNumber;
}
public function getPostOfficeBoxNumber() {
return $this->postOfficeBoxNumber;
}
public function setAttendees(/* array(Google_ItemScope) */ $attendees) {
$this->assertIsArray($attendees, 'Google_ItemScope', __METHOD__);
$this->attendees = $attendees;
}
public function getAttendees() {
return $this->attendees;
}
public function setAuthor(/* array(Google_ItemScope) */ $author) {
$this->assertIsArray($author, 'Google_ItemScope', __METHOD__);
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
public function setAssociated_media(/* array(Google_ItemScope) */ $associated_media) {
$this->assertIsArray($associated_media, 'Google_ItemScope', __METHOD__);
$this->associated_media = $associated_media;
}
public function getAssociated_media() {
return $this->associated_media;
}
public function setBestRating($bestRating) {
$this->bestRating = $bestRating;
}
public function getBestRating() {
return $this->bestRating;
}
public function setAddressCountry($addressCountry) {
$this->addressCountry = $addressCountry;
}
public function getAddressCountry() {
return $this->addressCountry;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setStreetAddress($streetAddress) {
$this->streetAddress = $streetAddress;
}
public function getStreetAddress() {
return $this->streetAddress;
}
public function setLocation(Google_ItemScope $location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setLatitude($latitude) {
$this->latitude = $latitude;
}
public function getLatitude() {
return $this->latitude;
}
public function setByArtist(Google_ItemScope $byArtist) {
$this->byArtist = $byArtist;
}
public function getByArtist() {
return $this->byArtist;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setDateModified($dateModified) {
$this->dateModified = $dateModified;
}
public function getDateModified() {
return $this->dateModified;
}
public function setContentSize($contentSize) {
$this->contentSize = $contentSize;
}
public function getContentSize() {
return $this->contentSize;
}
public function setContentUrl($contentUrl) {
$this->contentUrl = $contentUrl;
}
public function getContentUrl() {
return $this->contentUrl;
}
public function setPartOfTVSeries(Google_ItemScope $partOfTVSeries) {
$this->partOfTVSeries = $partOfTVSeries;
}
public function getPartOfTVSeries() {
return $this->partOfTVSeries;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setFamilyName($familyName) {
$this->familyName = $familyName;
}
public function getFamilyName() {
return $this->familyName;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDateCreated($dateCreated) {
$this->dateCreated = $dateCreated;
}
public function getDateCreated() {
return $this->dateCreated;
}
public function setPostalCode($postalCode) {
$this->postalCode = $postalCode;
}
public function getPostalCode() {
return $this->postalCode;
}
public function setAttendeeCount($attendeeCount) {
$this->attendeeCount = $attendeeCount;
}
public function getAttendeeCount() {
return $this->attendeeCount;
}
public function setInAlbum(Google_ItemScope $inAlbum) {
$this->inAlbum = $inAlbum;
}
public function getInAlbum() {
return $this->inAlbum;
}
public function setAddressRegion($addressRegion) {
$this->addressRegion = $addressRegion;
}
public function getAddressRegion() {
return $this->addressRegion;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
public function setGeo(Google_ItemScope $geo) {
$this->geo = $geo;
}
public function getGeo() {
return $this->geo;
}
public function setEmbedUrl($embedUrl) {
$this->embedUrl = $embedUrl;
}
public function getEmbedUrl() {
return $this->embedUrl;
}
public function setTickerSymbol($tickerSymbol) {
$this->tickerSymbol = $tickerSymbol;
}
public function getTickerSymbol() {
return $this->tickerSymbol;
}
public function setPlayerType($playerType) {
$this->playerType = $playerType;
}
public function getPlayerType() {
return $this->playerType;
}
public function setAbout(Google_ItemScope $about) {
$this->about = $about;
}
public function getAbout() {
return $this->about;
}
public function setGivenName($givenName) {
$this->givenName = $givenName;
}
public function getGivenName() {
return $this->givenName;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setPerformers(/* array(Google_ItemScope) */ $performers) {
$this->assertIsArray($performers, 'Google_ItemScope', __METHOD__);
$this->performers = $performers;
}
public function getPerformers() {
return $this->performers;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setGender($gender) {
$this->gender = $gender;
}
public function getGender() {
return $this->gender;
}
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
return $this->longitude;
}
public function setThumbnail(Google_ItemScope $thumbnail) {
$this->thumbnail = $thumbnail;
}
public function getThumbnail() {
return $this->thumbnail;
}
public function setCaption($caption) {
$this->caption = $caption;
}
public function getCaption() {
return $this->caption;
}
public function setRatingValue($ratingValue) {
$this->ratingValue = $ratingValue;
}
public function getRatingValue() {
return $this->ratingValue;
}
public function setReviewRating(Google_ItemScope $reviewRating) {
$this->reviewRating = $reviewRating;
}
public function getReviewRating() {
return $this->reviewRating;
}
public function setAudio(Google_ItemScope $audio) {
$this->audio = $audio;
}
public function getAudio() {
return $this->audio;
}
}
class Google_Moment extends Google_Model {
public $startDate;
public $kind;
protected $__targetType = 'Google_ItemScope';
protected $__targetDataType = '';
public $target;
protected $__verbType = 'Google_MomentVerb';
protected $__verbDataType = '';
public $verb;
protected $__resultType = 'Google_ItemScope';
protected $__resultDataType = '';
public $result;
public $type;
public function setStartDate($startDate) {
$this->startDate = $startDate;
}
public function getStartDate() {
return $this->startDate;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTarget(Google_ItemScope $target) {
$this->target = $target;
}
public function getTarget() {
return $this->target;
}
public function setVerb(Google_MomentVerb $verb) {
$this->verb = $verb;
}
public function getVerb() {
return $this->verb;
}
public function setResult(Google_ItemScope $result) {
$this->result = $result;
}
public function getResult() {
return $this->result;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_MomentVerb extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,429 @@
<?php
/*
* 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.
*/
/**
* The "trainedmodels" collection of methods.
* Typical usage is:
* <code>
* $predictionService = new Google_PredictionService(...);
* $trainedmodels = $predictionService->trainedmodels;
* </code>
*/
class Google_TrainedmodelsServiceResource extends Google_ServiceResource {
/**
* Submit model id and request a prediction (trainedmodels.predict)
*
* @param string $id The unique name for the predictive model.
* @param Google_Input $postBody
* @param array $optParams Optional parameters.
* @return Google_Output
*/
public function predict($id, Google_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 Google_Output($data);
} else {
return $data;
}
}
/**
* Begin training your model. (trainedmodels.insert)
*
* @param Google_Training $postBody
* @param array $optParams Optional parameters.
* @return Google_Training
*/
public function insert(Google_Training $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Training($data);
} else {
return $data;
}
}
/**
* Check training status of your model. (trainedmodels.get)
*
* @param string $id The unique name for the predictive model.
* @param array $optParams Optional parameters.
* @return Google_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 Google_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 Google_Update $postBody
* @param array $optParams Optional parameters.
* @return Google_Training
*/
public function update($id, Google_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 Google_Training($data);
} else {
return $data;
}
}
/**
* Delete a trained model. (trainedmodels.delete)
*
* @param string $id The unique name for the predictive model.
* @param array $optParams Optional parameters.
*/
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 Google_PredictionService(...);
* $hostedmodels = $predictionService->hostedmodels;
* </code>
*/
class Google_HostedmodelsServiceResource extends Google_ServiceResource {
/**
* Submit input and request an output against a hosted model. (hostedmodels.predict)
*
* @param string $hostedModelName The name of a hosted model.
* @param Google_Input $postBody
* @param array $optParams Optional parameters.
* @return Google_Output
*/
public function predict($hostedModelName, Google_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 Google_Output($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_PredictionService extends Google_Service {
public $trainedmodels;
public $hostedmodels;
/**
* Constructs the internal representation of the Prediction service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'prediction/v1.4/';
$this->version = 'v1.4';
$this->serviceName = 'prediction';
$client->addService($this->serviceName, $this->version);
$this->trainedmodels = new Google_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"}, "response": {"$ref": "Output"}, "httpMethod": "POST", "path": "trainedmodels/{id}/predict", "id": "prediction.trainedmodels.predict"}, "insert": {"scopes": ["https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/prediction"], "request": {"$ref": "Training"}, "response": {"$ref": "Training"}, "httpMethod": "POST", "path": "trainedmodels", "id": "prediction.trainedmodels.insert"}, "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"}}, "update": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Update"}, "response": {"$ref": "Training"}, "httpMethod": "PUT", "path": "trainedmodels/{id}", "id": "prediction.trainedmodels.update"}, "delete": {"scopes": ["https://www.googleapis.com/auth/prediction"], "path": "trainedmodels/{id}", "id": "prediction.trainedmodels.delete", "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->hostedmodels = new Google_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"}, "response": {"$ref": "Output"}, "httpMethod": "POST", "path": "hostedmodels/{hostedModelName}/predict", "id": "prediction.hostedmodels.predict"}}}', true));
}
}
class Google_Input extends Google_Model {
protected $__inputType = 'Google_InputInput';
protected $__inputDataType = '';
public $input;
public function setInput(Google_InputInput $input) {
$this->input = $input;
}
public function getInput() {
return $this->input;
}
}
class Google_InputInput extends Google_Model {
public $csvInstance;
public function setCsvInstance(/* array(Google_object) */ $csvInstance) {
$this->assertIsArray($csvInstance, 'Google_object', __METHOD__);
$this->csvInstance = $csvInstance;
}
public function getCsvInstance() {
return $this->csvInstance;
}
}
class Google_Output extends Google_Model {
public $kind;
public $outputLabel;
public $id;
protected $__outputMultiType = 'Google_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(Google_OutputOutputMulti) */ $outputMulti) {
$this->assertIsArray($outputMulti, 'Google_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 Google_OutputOutputMulti extends Google_Model {
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 Google_Training extends Google_Model {
public $kind;
public $storageDataLocation;
public $storagePMMLModelLocation;
protected $__dataAnalysisType = 'Google_TrainingDataAnalysis';
protected $__dataAnalysisDataType = '';
public $dataAnalysis;
public $trainingStatus;
protected $__modelInfoType = 'Google_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(Google_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(Google_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(Google_double) */ $utility) {
$this->assertIsArray($utility, 'Google_double', __METHOD__);
$this->utility = $utility;
}
public function getUtility() {
return $this->utility;
}
}
class Google_TrainingDataAnalysis extends Google_Model {
public $warnings;
public function setWarnings(/* array(Google_string) */ $warnings) {
$this->assertIsArray($warnings, 'Google_string', __METHOD__);
$this->warnings = $warnings;
}
public function getWarnings() {
return $this->warnings;
}
}
class Google_TrainingModelInfo extends Google_Model {
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 Google_Update extends Google_Model {
public $csvInstance;
public $label;
public function setCsvInstance(/* array(Google_object) */ $csvInstance) {
$this->assertIsArray($csvInstance, 'Google_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,287 @@
<?php
/*
* 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.
*/
/**
* The "webResource" collection of methods.
* Typical usage is:
* <code>
* $siteVerificationService = new Google_SiteVerificationService(...);
* $webResource = $siteVerificationService->webResource;
* </code>
*/
class Google_WebResourceServiceResource extends Google_ServiceResource {
/**
* Attempt verification of a website or domain. (webResource.insert)
*
* @param string $verificationMethod The method to use for verifying a site or domain.
* @param Google_SiteVerificationWebResourceResource $postBody
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceResource
*/
public function insert($verificationMethod, Google_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 Google_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.
* @param array $optParams Optional parameters.
* @return Google_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 Google_SiteVerificationWebResourceResource($data);
} else {
return $data;
}
}
/**
* Get the list of your verified websites and domains. (webResource.list)
*
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceListResponse
*/
public function listWebResource($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_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 Google_SiteVerificationWebResourceResource $postBody
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceResource
*/
public function update($id, Google_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 Google_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 Google_SiteVerificationWebResourceResource $postBody
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceResource
*/
public function patch($id, Google_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 Google_SiteVerificationWebResourceResource($data);
} else {
return $data;
}
}
/**
* Get a verification token for placing on a website or domain. (webResource.getToken)
*
* @param Google_SiteVerificationWebResourceGettokenRequest $postBody
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceGettokenResponse
*/
public function getToken(Google_SiteVerificationWebResourceGettokenRequest $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('getToken', array($params));
if ($this->useObjects()) {
return new Google_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.
* @param array $optParams Optional parameters.
*/
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 Google_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 Google_SiteVerificationService extends Google_Service {
public $webResource;
/**
* Constructs the internal representation of the SiteVerification service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'siteVerification/v1/';
$this->version = 'v1';
$this->serviceName = 'siteVerification';
$client->addService($this->serviceName, $this->version);
$this->webResource = new Google_WebResourceServiceResource($this, $this->serviceName, 'webResource', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/siteverification", "https://www.googleapis.com/auth/siteverification.verify_only"], "parameters": {"verificationMethod": {"required": true, "type": "string", "location": "query"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "response": {"$ref": "SiteVerificationWebResourceResource"}, "httpMethod": "POST", "path": "webResource", "id": "siteVerification.webResource.insert"}, "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"], "path": "webResource", "response": {"$ref": "SiteVerificationWebResourceListResponse"}, "id": "siteVerification.webResource.list", "httpMethod": "GET"}, "update": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "response": {"$ref": "SiteVerificationWebResourceResource"}, "httpMethod": "PUT", "path": "webResource/{id}", "id": "siteVerification.webResource.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "response": {"$ref": "SiteVerificationWebResourceResource"}, "httpMethod": "PATCH", "path": "webResource/{id}", "id": "siteVerification.webResource.patch"}, "getToken": {"scopes": ["https://www.googleapis.com/auth/siteverification", "https://www.googleapis.com/auth/siteverification.verify_only"], "request": {"$ref": "SiteVerificationWebResourceGettokenRequest"}, "response": {"$ref": "SiteVerificationWebResourceGettokenResponse"}, "httpMethod": "POST", "path": "token", "id": "siteVerification.webResource.getToken"}, "delete": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "path": "webResource/{id}", "id": "siteVerification.webResource.delete", "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_SiteVerificationWebResourceGettokenRequest extends Google_Model {
public $verificationMethod;
protected $__siteType = 'Google_SiteVerificationWebResourceGettokenRequestSite';
protected $__siteDataType = '';
public $site;
public function setVerificationMethod($verificationMethod) {
$this->verificationMethod = $verificationMethod;
}
public function getVerificationMethod() {
return $this->verificationMethod;
}
public function setSite(Google_SiteVerificationWebResourceGettokenRequestSite $site) {
$this->site = $site;
}
public function getSite() {
return $this->site;
}
}
class Google_SiteVerificationWebResourceGettokenRequestSite extends Google_Model {
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 Google_SiteVerificationWebResourceGettokenResponse extends Google_Model {
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 Google_SiteVerificationWebResourceListResponse extends Google_Model {
protected $__itemsType = 'Google_SiteVerificationWebResourceResource';
protected $__itemsDataType = 'array';
public $items;
public function setItems(/* array(Google_SiteVerificationWebResourceResource) */ $items) {
$this->assertIsArray($items, 'Google_SiteVerificationWebResourceResource', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
}
class Google_SiteVerificationWebResourceResource extends Google_Model {
public $owners;
public $id;
protected $__siteType = 'Google_SiteVerificationWebResourceResourceSite';
protected $__siteDataType = '';
public $site;
public function setOwners(/* array(Google_string) */ $owners) {
$this->assertIsArray($owners, 'Google_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(Google_SiteVerificationWebResourceResourceSite $site) {
$this->site = $site;
}
public function getSite() {
return $this->site;
}
}
class Google_SiteVerificationWebResourceResourceSite extends Google_Model {
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;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,423 @@
<?php
/*
* 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.
*/
/**
* The "taskqueues" collection of methods.
* Typical usage is:
* <code>
* $taskqueueService = new Google_TaskqueueService(...);
* $taskqueues = $taskqueueService->taskqueues;
* </code>
*/
class Google_TaskqueuesServiceResource extends Google_ServiceResource {
/**
* Get detailed information about a TaskQueue. (taskqueues.get)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The id of the taskqueue to get the properties of.
* @param array $optParams Optional parameters.
*
* @opt_param bool getStats Whether to get stats. Optional.
* @return Google_TaskQueue
*/
public function get($project, $taskqueue, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_TaskQueue($data);
} else {
return $data;
}
}
}
/**
* The "tasks" collection of methods.
* Typical usage is:
* <code>
* $taskqueueService = new Google_TaskqueueService(...);
* $tasks = $taskqueueService->tasks;
* </code>
*/
class Google_TasksServiceResource extends Google_ServiceResource {
/**
* Insert a new task in a TaskQueue (tasks.insert)
*
* @param string $project The project under which the queue lies
* @param string $taskqueue The taskqueue to insert the task into
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function insert($project, $taskqueue, Google_Task $postBody, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Get a particular task from a TaskQueue. (tasks.get)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The taskqueue in which the task belongs.
* @param string $task The task to get properties of.
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function get($project, $taskqueue, $task, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* List Tasks in a TaskQueue (tasks.list)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The id of the taskqueue to list tasks from.
* @param array $optParams Optional parameters.
* @return Google_Tasks2
*/
public function listTasks($project, $taskqueue, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Tasks2($data);
} else {
return $data;
}
}
/**
* Update tasks that are leased out of a TaskQueue. (tasks.update)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue
* @param string $task
* @param int $newLeaseSeconds The new lease in seconds.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function update($project, $taskqueue, $task, $newLeaseSeconds, Google_Task $postBody, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task, 'newLeaseSeconds' => $newLeaseSeconds, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Update tasks that are leased out of a TaskQueue. This method supports patch semantics.
* (tasks.patch)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue
* @param string $task
* @param int $newLeaseSeconds The new lease in seconds.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function patch($project, $taskqueue, $task, $newLeaseSeconds, Google_Task $postBody, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task, 'newLeaseSeconds' => $newLeaseSeconds, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Delete a task from a TaskQueue. (tasks.delete)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The taskqueue to delete a task from.
* @param string $task The id of the task to delete.
* @param array $optParams Optional parameters.
*/
public function delete($project, $taskqueue, $task, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
/**
* Lease 1 or more tasks from a TaskQueue. (tasks.lease)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The taskqueue to lease a task from.
* @param int $numTasks The number of tasks to lease.
* @param int $leaseSecs The lease in seconds.
* @param array $optParams Optional parameters.
*
* @opt_param bool groupByTag When true, all returned tasks will have the same tag
* @opt_param string tag The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e. the first available tag
* @return Google_Tasks
*/
public function lease($project, $taskqueue, $numTasks, $leaseSecs, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'numTasks' => $numTasks, 'leaseSecs' => $leaseSecs);
$params = array_merge($params, $optParams);
$data = $this->__call('lease', array($params));
if ($this->useObjects()) {
return new Google_Tasks($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Taskqueue (v1beta2).
*
* <p>
* Lets you access a Google App Engine Pull Task Queue over REST.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/appengine/docs/python/taskqueue/rest.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_TaskqueueService extends Google_Service {
public $taskqueues;
public $tasks;
/**
* Constructs the internal representation of the Taskqueue service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'taskqueue/v1beta2/projects/';
$this->version = 'v1beta2';
$this->serviceName = 'taskqueue';
$client->addService($this->serviceName, $this->version);
$this->taskqueues = new Google_TaskqueuesServiceResource($this, $this->serviceName, 'taskqueues', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "getStats": {"type": "boolean", "location": "query"}}, "id": "taskqueue.taskqueues.get", "httpMethod": "GET", "path": "{project}/taskqueues/{taskqueue}", "response": {"$ref": "TaskQueue"}}}}', true));
$this->tasks = new Google_TasksServiceResource($this, $this->serviceName, 'tasks', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "POST", "path": "{project}/taskqueues/{taskqueue}/tasks", "id": "taskqueue.tasks.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "id": "taskqueue.tasks.get", "httpMethod": "GET", "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "response": {"$ref": "Task"}}, "list": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}}, "id": "taskqueue.tasks.list", "httpMethod": "GET", "path": "{project}/taskqueues/{taskqueue}/tasks", "response": {"$ref": "Tasks2"}}, "update": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}, "newLeaseSeconds": {"required": true, "type": "integer", "location": "query", "format": "int32"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "POST", "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "id": "taskqueue.tasks.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}, "newLeaseSeconds": {"required": true, "type": "integer", "location": "query", "format": "int32"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "PATCH", "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "id": "taskqueue.tasks.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "id": "taskqueue.tasks.delete", "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}, "lease": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"groupByTag": {"type": "boolean", "location": "query"}, "leaseSecs": {"required": true, "type": "integer", "location": "query", "format": "int32"}, "project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "tag": {"type": "string", "location": "query"}, "numTasks": {"required": true, "type": "integer", "location": "query", "format": "int32"}}, "id": "taskqueue.tasks.lease", "httpMethod": "POST", "path": "{project}/taskqueues/{taskqueue}/tasks/lease", "response": {"$ref": "Tasks"}}}}', true));
}
}
class Google_Task extends Google_Model {
public $kind;
public $leaseTimestamp;
public $id;
public $tag;
public $payloadBase64;
public $queueName;
public $enqueueTimestamp;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setLeaseTimestamp($leaseTimestamp) {
$this->leaseTimestamp = $leaseTimestamp;
}
public function getLeaseTimestamp() {
return $this->leaseTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setTag($tag) {
$this->tag = $tag;
}
public function getTag() {
return $this->tag;
}
public function setPayloadBase64($payloadBase64) {
$this->payloadBase64 = $payloadBase64;
}
public function getPayloadBase64() {
return $this->payloadBase64;
}
public function setQueueName($queueName) {
$this->queueName = $queueName;
}
public function getQueueName() {
return $this->queueName;
}
public function setEnqueueTimestamp($enqueueTimestamp) {
$this->enqueueTimestamp = $enqueueTimestamp;
}
public function getEnqueueTimestamp() {
return $this->enqueueTimestamp;
}
}
class Google_TaskQueue extends Google_Model {
public $kind;
protected $__statsType = 'Google_TaskQueueStats';
protected $__statsDataType = '';
public $stats;
public $id;
public $maxLeases;
protected $__aclType = 'Google_TaskQueueAcl';
protected $__aclDataType = '';
public $acl;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setStats(Google_TaskQueueStats $stats) {
$this->stats = $stats;
}
public function getStats() {
return $this->stats;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setMaxLeases($maxLeases) {
$this->maxLeases = $maxLeases;
}
public function getMaxLeases() {
return $this->maxLeases;
}
public function setAcl(Google_TaskQueueAcl $acl) {
$this->acl = $acl;
}
public function getAcl() {
return $this->acl;
}
}
class Google_TaskQueueAcl extends Google_Model {
public $consumerEmails;
public $producerEmails;
public $adminEmails;
public function setConsumerEmails(/* array(Google_string) */ $consumerEmails) {
$this->assertIsArray($consumerEmails, 'Google_string', __METHOD__);
$this->consumerEmails = $consumerEmails;
}
public function getConsumerEmails() {
return $this->consumerEmails;
}
public function setProducerEmails(/* array(Google_string) */ $producerEmails) {
$this->assertIsArray($producerEmails, 'Google_string', __METHOD__);
$this->producerEmails = $producerEmails;
}
public function getProducerEmails() {
return $this->producerEmails;
}
public function setAdminEmails(/* array(Google_string) */ $adminEmails) {
$this->assertIsArray($adminEmails, 'Google_string', __METHOD__);
$this->adminEmails = $adminEmails;
}
public function getAdminEmails() {
return $this->adminEmails;
}
}
class Google_TaskQueueStats extends Google_Model {
public $oldestTask;
public $leasedLastMinute;
public $totalTasks;
public $leasedLastHour;
public function setOldestTask($oldestTask) {
$this->oldestTask = $oldestTask;
}
public function getOldestTask() {
return $this->oldestTask;
}
public function setLeasedLastMinute($leasedLastMinute) {
$this->leasedLastMinute = $leasedLastMinute;
}
public function getLeasedLastMinute() {
return $this->leasedLastMinute;
}
public function setTotalTasks($totalTasks) {
$this->totalTasks = $totalTasks;
}
public function getTotalTasks() {
return $this->totalTasks;
}
public function setLeasedLastHour($leasedLastHour) {
$this->leasedLastHour = $leasedLastHour;
}
public function getLeasedLastHour() {
return $this->leasedLastHour;
}
}
class Google_Tasks extends Google_Model {
protected $__itemsType = 'Google_Task';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Task) */ $items) {
$this->assertIsArray($items, 'Google_Task', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Tasks2 extends Google_Model {
protected $__itemsType = 'Google_Task';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Task) */ $items) {
$this->assertIsArray($items, 'Google_Task', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}

View file

@ -0,0 +1,580 @@
<?php
/*
* 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.
*/
/**
* The "tasks" collection of methods.
* Typical usage is:
* <code>
* $tasksService = new Google_TasksService(...);
* $tasks = $tasksService->tasks;
* </code>
*/
class Google_TasksServiceResource extends Google_ServiceResource {
/**
* Creates a new task on the specified task list. (tasks.insert)
*
* @param string $tasklist Task list identifier.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
*
* @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 Google_Task
*/
public function insert($tasklist, Google_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 Google_Task($data);
} else {
return $data;
}
}
/**
* Returns the specified task. (tasks.get)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @param array $optParams Optional parameters.
* @return Google_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 Google_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.
* @param array $optParams Optional parameters.
*/
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.
*
* @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 Google_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 Google_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.
*
* @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 Google_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 Google_Tasks($data);
} else {
return $data;
}
}
/**
* Updates the specified task. (tasks.update)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function update($tasklist, $task, Google_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 Google_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 Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function patch($tasklist, $task, Google_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 Google_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.
* @param array $optParams Optional parameters.
*/
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 Google_TasksService(...);
* $tasklists = $tasksService->tasklists;
* </code>
*/
class Google_TasklistsServiceResource extends Google_ServiceResource {
/**
* Creates a new task list and adds it to the authenticated user's task lists. (tasklists.insert)
*
* @param Google_TaskList $postBody
* @param array $optParams Optional parameters.
* @return Google_TaskList
*/
public function insert(Google_TaskList $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_TaskList($data);
} else {
return $data;
}
}
/**
* Returns the authenticated user's specified task list. (tasklists.get)
*
* @param string $tasklist Task list identifier.
* @param array $optParams Optional parameters.
* @return Google_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 Google_TaskList($data);
} else {
return $data;
}
}
/**
* Returns all the authenticated user's task lists. (tasklists.list)
*
* @param array $optParams Optional parameters.
*
* @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 Google_TaskLists
*/
public function listTasklists($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_TaskLists($data);
} else {
return $data;
}
}
/**
* Updates the authenticated user's specified task list. (tasklists.update)
*
* @param string $tasklist Task list identifier.
* @param Google_TaskList $postBody
* @param array $optParams Optional parameters.
* @return Google_TaskList
*/
public function update($tasklist, Google_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 Google_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 Google_TaskList $postBody
* @param array $optParams Optional parameters.
* @return Google_TaskList
*/
public function patch($tasklist, Google_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 Google_TaskList($data);
} else {
return $data;
}
}
/**
* Deletes the authenticated user's specified task list. (tasklists.delete)
*
* @param string $tasklist Task list identifier.
* @param array $optParams Optional parameters.
*/
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 Google_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 Google_TasksService extends Google_Service {
public $tasks;
public $tasklists;
/**
* Constructs the internal representation of the Tasks service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'tasks/v1/';
$this->version = 'v1';
$this->serviceName = 'tasks';
$client->addService($this->serviceName, $this->version);
$this->tasks = new Google_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"}, "response": {"$ref": "Task"}, "httpMethod": "POST", "path": "lists/{tasklist}/tasks", "id": "tasks.tasks.insert"}, "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"], "path": "lists/{tasklist}/clear", "id": "tasks.tasks.clear", "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "POST"}, "move": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"task": {"required": true, "type": "string", "location": "path"}, "tasklist": {"required": true, "type": "string", "location": "path"}, "parent": {"type": "string", "location": "query"}, "previous": {"type": "string", "location": "query"}}, "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"}, "showDeleted": {"type": "boolean", "location": "query"}, "updatedMin": {"type": "string", "location": "query"}, "completedMin": {"type": "string", "location": "query"}, "maxResults": {"type": "string", "location": "query", "format": "int64"}, "showCompleted": {"type": "boolean", "location": "query"}, "pageToken": {"type": "string", "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"}, "response": {"$ref": "Task"}, "httpMethod": "PUT", "path": "lists/{tasklist}/tasks/{task}", "id": "tasks.tasks.update"}, "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"}, "response": {"$ref": "Task"}, "httpMethod": "PATCH", "path": "lists/{tasklist}/tasks/{task}", "id": "tasks.tasks.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/tasks"], "path": "lists/{tasklist}/tasks/{task}", "id": "tasks.tasks.delete", "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->tasklists = new Google_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": {"type": "string", "location": "query", "format": "int64"}}, "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"}, "response": {"$ref": "TaskList"}, "httpMethod": "PUT", "path": "users/@me/lists/{tasklist}", "id": "tasks.tasklists.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "TaskList"}, "response": {"$ref": "TaskList"}, "httpMethod": "PATCH", "path": "users/@me/lists/{tasklist}", "id": "tasks.tasklists.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/tasks"], "path": "users/@me/lists/{tasklist}", "id": "tasks.tasklists.delete", "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_Task extends Google_Model {
public $status;
public $kind;
public $updated;
public $parent;
protected $__linksType = 'Google_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(Google_TaskLinks) */ $links) {
$this->assertIsArray($links, 'Google_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 Google_TaskLinks extends Google_Model {
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 Google_TaskList extends Google_Model {
public $kind;
public $title;
public $updated;
public $etag;
public $id;
public $selfLink;
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 setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
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;
}
}
class Google_TaskLists extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_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(Google_TaskList) */ $items) {
$this->assertIsArray($items, 'Google_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 Google_Tasks extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_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(Google_Task) */ $items) {
$this->assertIsArray($items, 'Google_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,244 @@
<?php
/*
* 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.
*/
/**
* The "languages" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google_TranslateService(...);
* $languages = $translateService->languages;
* </code>
*/
class Google_LanguagesServiceResource extends Google_ServiceResource {
/**
* List the source/target languages supported by the API (languages.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string target the language and collation in which the localized results should be returned
* @return Google_LanguagesListResponse
*/
public function listLanguages($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_LanguagesListResponse($data);
} else {
return $data;
}
}
}
/**
* The "detections" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google_TranslateService(...);
* $detections = $translateService->detections;
* </code>
*/
class Google_DetectionsServiceResource extends Google_ServiceResource {
/**
* Detect the language of text. (detections.list)
*
* @param string $q The text to detect
* @param array $optParams Optional parameters.
* @return Google_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 Google_DetectionsListResponse($data);
} else {
return $data;
}
}
}
/**
* The "translations" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google_TranslateService(...);
* $translations = $translateService->translations;
* </code>
*/
class Google_TranslationsServiceResource extends Google_ServiceResource {
/**
* 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.
*
* @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 Google_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 Google_TranslationsListResponse($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_TranslateService extends Google_Service {
public $languages;
public $detections;
public $translations;
/**
* Constructs the internal representation of the Translate service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'language/translate/';
$this->version = 'v2';
$this->serviceName = 'translate';
$client->addService($this->serviceName, $this->version);
$this->languages = new Google_LanguagesServiceResource($this, $this->serviceName, 'languages', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "LanguagesListResponse"}, "id": "language.languages.list", "parameters": {"target": {"type": "string", "location": "query"}}, "path": "v2/languages"}}}', true));
$this->detections = new Google_DetectionsServiceResource($this, $this->serviceName, 'detections', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "DetectionsListResponse"}, "id": "language.detections.list", "parameters": {"q": {"repeated": true, "required": true, "type": "string", "location": "query"}}, "path": "v2/detect"}}}', true));
$this->translations = new Google_TranslationsServiceResource($this, $this->serviceName, 'translations', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "TranslationsListResponse"}, "id": "language.translations.list", "parameters": {"q": {"repeated": true, "required": true, "type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "format": {"enum": ["html", "text"], "type": "string", "location": "query"}, "target": {"required": true, "type": "string", "location": "query"}, "cid": {"repeated": true, "type": "string", "location": "query"}}, "path": "v2"}}}', true));
}
}
class Google_DetectionsListResponse extends Google_Model {
protected $__detectionsType = 'Google_DetectionsResourceItems';
protected $__detectionsDataType = 'array';
public $detections;
public function setDetections(/* array(Google_DetectionsResourceItems) */ $detections) {
$this->assertIsArray($detections, 'Google_DetectionsResourceItems', __METHOD__);
$this->detections = $detections;
}
public function getDetections() {
return $this->detections;
}
}
class Google_DetectionsResourceItems extends Google_Model {
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 Google_LanguagesListResponse extends Google_Model {
protected $__languagesType = 'Google_LanguagesResource';
protected $__languagesDataType = 'array';
public $languages;
public function setLanguages(/* array(Google_LanguagesResource) */ $languages) {
$this->assertIsArray($languages, 'Google_LanguagesResource', __METHOD__);
$this->languages = $languages;
}
public function getLanguages() {
return $this->languages;
}
}
class Google_LanguagesResource extends Google_Model {
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 Google_TranslationsListResponse extends Google_Model {
protected $__translationsType = 'Google_TranslationsResource';
protected $__translationsDataType = 'array';
public $translations;
public function setTranslations(/* array(Google_TranslationsResource) */ $translations) {
$this->assertIsArray($translations, 'Google_TranslationsResource', __METHOD__);
$this->translations = $translations;
}
public function getTranslations() {
return $this->translations;
}
}
class Google_TranslationsResource extends Google_Model {
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,325 @@
<?php
/*
* 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.
*/
/**
* The "url" collection of methods.
* Typical usage is:
* <code>
* $urlshortenerService = new Google_UrlshortenerService(...);
* $url = $urlshortenerService->url;
* </code>
*/
class Google_UrlServiceResource extends Google_ServiceResource {
/**
* Creates a new short URL. (url.insert)
*
* @param Google_Url $postBody
* @param array $optParams Optional parameters.
* @return Google_Url
*/
public function insert(Google_Url $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Url($data);
} else {
return $data;
}
}
/**
* Retrieves a list of URLs shortened by a user. (url.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string start-token Token for requesting successive pages of results.
* @opt_param string projection Additional information to return.
* @return Google_UrlHistory
*/
public function listUrl($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_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.
*
* @opt_param string projection Additional information to return.
* @return Google_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 Google_Url($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_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 Google_UrlshortenerService extends Google_Service {
public $url;
/**
* Constructs the internal representation of the Urlshortener service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'urlshortener/v1/';
$this->version = 'v1';
$this->serviceName = 'urlshortener';
$client->addService($this->serviceName, $this->version);
$this->url = new Google_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": {"httpMethod": "GET", "response": {"$ref": "Url"}, "id": "urlshortener.url.get", "parameters": {"shortUrl": {"required": true, "type": "string", "location": "query"}, "projection": {"enum": ["ANALYTICS_CLICKS", "ANALYTICS_TOP_STRINGS", "FULL"], "type": "string", "location": "query"}}, "path": "url"}}}', true));
}
}
class Google_AnalyticsSnapshot extends Google_Model {
public $shortUrlClicks;
protected $__countriesType = 'Google_StringCount';
protected $__countriesDataType = 'array';
public $countries;
protected $__platformsType = 'Google_StringCount';
protected $__platformsDataType = 'array';
public $platforms;
protected $__browsersType = 'Google_StringCount';
protected $__browsersDataType = 'array';
public $browsers;
protected $__referrersType = 'Google_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(Google_StringCount) */ $countries) {
$this->assertIsArray($countries, 'Google_StringCount', __METHOD__);
$this->countries = $countries;
}
public function getCountries() {
return $this->countries;
}
public function setPlatforms(/* array(Google_StringCount) */ $platforms) {
$this->assertIsArray($platforms, 'Google_StringCount', __METHOD__);
$this->platforms = $platforms;
}
public function getPlatforms() {
return $this->platforms;
}
public function setBrowsers(/* array(Google_StringCount) */ $browsers) {
$this->assertIsArray($browsers, 'Google_StringCount', __METHOD__);
$this->browsers = $browsers;
}
public function getBrowsers() {
return $this->browsers;
}
public function setReferrers(/* array(Google_StringCount) */ $referrers) {
$this->assertIsArray($referrers, 'Google_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 Google_AnalyticsSummary extends Google_Model {
protected $__weekType = 'Google_AnalyticsSnapshot';
protected $__weekDataType = '';
public $week;
protected $__allTimeType = 'Google_AnalyticsSnapshot';
protected $__allTimeDataType = '';
public $allTime;
protected $__twoHoursType = 'Google_AnalyticsSnapshot';
protected $__twoHoursDataType = '';
public $twoHours;
protected $__dayType = 'Google_AnalyticsSnapshot';
protected $__dayDataType = '';
public $day;
protected $__monthType = 'Google_AnalyticsSnapshot';
protected $__monthDataType = '';
public $month;
public function setWeek(Google_AnalyticsSnapshot $week) {
$this->week = $week;
}
public function getWeek() {
return $this->week;
}
public function setAllTime(Google_AnalyticsSnapshot $allTime) {
$this->allTime = $allTime;
}
public function getAllTime() {
return $this->allTime;
}
public function setTwoHours(Google_AnalyticsSnapshot $twoHours) {
$this->twoHours = $twoHours;
}
public function getTwoHours() {
return $this->twoHours;
}
public function setDay(Google_AnalyticsSnapshot $day) {
$this->day = $day;
}
public function getDay() {
return $this->day;
}
public function setMonth(Google_AnalyticsSnapshot $month) {
$this->month = $month;
}
public function getMonth() {
return $this->month;
}
}
class Google_StringCount extends Google_Model {
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 Google_Url extends Google_Model {
public $status;
public $kind;
public $created;
protected $__analyticsType = 'Google_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(Google_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 Google_UrlHistory extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_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(Google_Url) */ $items) {
$this->assertIsArray($items, 'Google_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;
}
}

Some files were not shown because too many files have changed in this diff Show more