diff --git a/src/GoogleApi/Auth/Auth.php b/src/GoogleApi/Auth/Auth.php index c5f95a5..419d77b 100644 --- a/src/GoogleApi/Auth/Auth.php +++ b/src/GoogleApi/Auth/Auth.php @@ -23,7 +23,7 @@ * @author Chris Chabot * */ -abstract class apiAuth { +abstract class Auth { abstract public function authenticate($service); abstract public function sign(HttpRequest $request); abstract public function createAuthUrl($scope); diff --git a/src/GoogleApi/Auth/AuthNone.php b/src/GoogleApi/Auth/AuthNone.php index 79a6183..2e772d3 100644 --- a/src/GoogleApi/Auth/AuthNone.php +++ b/src/GoogleApi/Auth/AuthNone.php @@ -17,6 +17,7 @@ namespace GoogleApi\Auth; use GoogleApi\Io\HttpRequest; +use GoogleApi\Config; /** * Do-nothing authentication implementation, use this if you want to make un-authenticated calls @@ -27,9 +28,8 @@ class AuthNone extends Auth { public $key = null; public function __construct() { - global $apiConfig; - if (!empty($apiConfig['developer_key'])) { - $this->setDeveloperKey($apiConfig['developer_key']); + if (Config::has('developer_key')) { + $this->setDeveloperKey(Config::get('developer_key')); } } diff --git a/src/GoogleApi/Auth/OAuth2.php b/src/GoogleApi/Auth/OAuth2.php index d0f18dc..740d5f9 100644 --- a/src/GoogleApi/Auth/OAuth2.php +++ b/src/GoogleApi/Auth/OAuth2.php @@ -19,6 +19,7 @@ use GoogleApi\Client; use GoogleApi\Io\HttpRequest; use GoogleApi\Service\Utils; +use GoogleApi\Config; /** * Authentication class that deals with the OAuth 2 web-server authentication flow @@ -53,7 +54,7 @@ class OAuth2 extends Auth { * to the discretion of the caller (which is done by calling authenticate()). */ public function __construct() { - global $apiConfig; + $apiConfig = Config::getAll(); if (! empty($apiConfig['developer_key'])) { $this->developerKey = $apiConfig['developer_key']; diff --git a/src/GoogleApi/Cache/FileCache.php b/src/GoogleApi/Cache/FileCache.php index 324dea3..bdb12c7 100644 --- a/src/GoogleApi/Cache/FileCache.php +++ b/src/GoogleApi/Cache/FileCache.php @@ -16,6 +16,8 @@ */ namespace GoogleApi\Cache; +use GoogleApi\Config; + /* * This class implements a basic on disk storage. While that does * work quite well it's not the most elegant and scalable solution. @@ -29,8 +31,7 @@ class FileCache extends Cache { private $path; public function __construct() { - global $apiConfig; - $this->path = $apiConfig['ioFileCache_directory']; + $this->path = Config::get('ioFileCache_directory'); } private function isLocked($storageFile) { diff --git a/src/GoogleApi/Cache/MemcacheCache.php b/src/GoogleApi/Cache/MemcacheCache.php index a5d6b08..23a4994 100644 --- a/src/GoogleApi/Cache/MemcacheCache.php +++ b/src/GoogleApi/Cache/MemcacheCache.php @@ -16,6 +16,8 @@ */ namespace GoogleApi\Cache; +use GoogleApi\Config; + /** * A persistent storage class based on the memcache, which is not * really very persistent, as soon as you restart your memcache daemon @@ -28,12 +30,11 @@ class MemcacheCache extends Cache { private $connection = false; public function __construct() { - global $apiConfig; if (! function_exists('memcache_connect')) { throw new Exception("Memcache functions not available"); } - $this->host = $apiConfig['ioMemCacheCache_host']; - $this->port = $apiConfig['ioMemCacheCache_port']; + $this->host = Config::get('ioMemCacheCache_host'); + $this->port = Config::get('ioMemCacheCache_port'); if (empty($this->host) || empty($this->port)) { throw new Exception("You need to supply a valid memcache host and port"); } diff --git a/src/GoogleApi/Client.php b/src/GoogleApi/Client.php index 2accfef..aae2f46 100644 --- a/src/GoogleApi/Client.php +++ b/src/GoogleApi/Client.php @@ -1,4 +1,5 @@ authenticated) { - throw new apiException('Cant add services after having authenticated'); + throw new \GoogleApi\Exception('Cant add services after having authenticated'); } $this->services[$service] = array(); if (isset($apiConfig['services'][$service])) { @@ -204,8 +206,7 @@ public function setApprovalPrompt($approvalPrompt) { * @param string $applicationName */ public function setApplicationName($applicationName) { - global $apiConfig; - $apiConfig['application_name'] = $applicationName; + Config::set('application_name', $applicationName); } /** @@ -213,8 +214,7 @@ public function setApplicationName($applicationName) { * @param string $clientId */ public function setClientId($clientId) { - global $apiConfig; - $apiConfig['oauth2_client_id'] = $clientId; + Config::set('oauth2_client_id', $clientId); self::$auth->clientId = $clientId; } @@ -223,8 +223,7 @@ public function setClientId($clientId) { * @param string $clientSecret */ public function setClientSecret($clientSecret) { - global $apiConfig; - $apiConfig['oauth2_client_secret'] = $clientSecret; + Config::set('oauth2_client_secret', $clientSecret); self::$auth->clientSecret = $clientSecret; } @@ -233,8 +232,7 @@ public function setClientSecret($clientSecret) { * @param string $redirectUri */ public function setRedirectUri($redirectUri) { - global $apiConfig; - $apiConfig['oauth2_redirect_uri'] = $redirectUri; + Config::set('oauth2_redirect_uri', $redirectUri); self::$auth->redirectUri = $redirectUri; } @@ -296,8 +294,7 @@ public function setScopes($scopes) { * @experimental */ public function setUseObjects($useObjects) { - global $apiConfig; - $apiConfig['use_objects'] = $useObjects; + Config::set('use_objects', $useObjects); } /** @@ -327,7 +324,7 @@ public static function getIo() { } /** - * @return Cache\Cache the implementation of Cache\Cache. + * @return \GoogleApi\Cache\Cache the implementation of Cache\Cache. */ public function getCache() { return Client::$cache; diff --git a/src/GoogleApi/Config.php b/src/GoogleApi/Config.php new file mode 100644 index 0000000..bf30d09 --- /dev/null +++ b/src/GoogleApi/Config.php @@ -0,0 +1,158 @@ + + * + */ +class Config { + protected static $apiConfig = array(); + + /** + * Initializes $apiConfig, + * Php can't parse non-trivial expressions in data-members initializers, therefore a workaround is needed. + * This method will be called to initialize $apiConfig with the default values. + * + * @static + */ + static function init() { + self::$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' => '', + + // OAuth1 Settings. + // If you're using the apiOAuth auth class, it will use these values for the oauth consumer key and secret. + // See http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.html for info on how to obtain those + 'oauth_consumer_key' => 'anonymous', + 'oauth_consumer_secret' => 'anonymous', + + // 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' => 'GoogleApi\Auth\OAuth2', + 'ioClass' => 'GoogleApi\Io\CurlIO', + 'cacheClass' => 'GoogleApi\Cache\FileCache', + + // If you want to run the test suite (by running # phpunit AllTests.php in the tests/ directory), fill in the settings below + 'oauth_test_token' => '', // the oauth access token to use (which you can get by runing authenticate() as the test user and copying the token value), ie '{"key":"foo","secret":"bar","callback_url":null}' + 'oauth_test_user' => '', // and the user ID to use, this can either be a vanity name 'testuser' or a numberic ID '123456' + + // 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() . '/apiClient' : + '/tmp/apiClient'), + 'ioMemCacheStorage_host' => '127.0.0.1', + 'ioMemcacheStorage_port' => '11211', + + // 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') + ) + ); + } + + + /** + * Returns an array which contains all of the variables that were declared. + * @static + * @return array + */ + public static function getAll() { + return self::$apiConfig; + } + + /** + * Returns the value of the wanted variable, If it doesn't exist $default will be returned. + * + * @static + * @param $variable + * @param null $default + * @return string|array + */ + public static function get($variable, $default = null) { + return isset(self::$apiConfig[$variable]) ? self::$apiConfig[$variable] : $default; + } + + /** + * Checks whether a variable exists + * @static + * @param $variable + * @return bool + */ + public static function has($variable) { + return isset(self::$apiConfig[$variable]); + } + + /** + * Sets the value of the wanted variable + * @static + * @param $variable + * @param $value + */ + public static function set($variable, $value) + { + self::$apiConfig[$variable] = $value; + } + +} +Config::init(); // Workaround to initialize the static data-member \ No newline at end of file diff --git a/src/GoogleApi/contrib/apiAdexchangebuyerService.php b/src/GoogleApi/Contrib/apiAdexchangebuyerService.php similarity index 95% rename from src/GoogleApi/contrib/apiAdexchangebuyerService.php rename to src/GoogleApi/Contrib/apiAdexchangebuyerService.php index 2914f49..cb58913 100644 --- a/src/GoogleApi/contrib/apiAdexchangebuyerService.php +++ b/src/GoogleApi/Contrib/apiAdexchangebuyerService.php @@ -15,6 +15,11 @@ * the License. */ +namespace GoogleApi\Contrib; + +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "directDeals" collection of methods. @@ -24,7 +29,7 @@ * $directDeals = $adexchangebuyerService->directDeals; * */ - class DirectDealsServiceResource extends apiServiceResource { + class DirectDealsServiceResource extends ServiceResource { /** @@ -68,7 +73,7 @@ public function get($id, $optParams = array()) { * $accounts = $adexchangebuyerService->accounts; * */ - class AccountsServiceResource extends apiServiceResource { + class AccountsServiceResource extends ServiceResource { /** @@ -146,7 +151,7 @@ public function get($id, $optParams = array()) { * $creatives = $adexchangebuyerService->creatives; * */ - class CreativesServiceResource extends apiServiceResource { + class CreativesServiceResource extends ServiceResource { /** @@ -199,22 +204,22 @@ public function get($accountId, $buyerCreativeId, $adgroupId, $optParams = array * * @author Google, Inc. */ -class apiAdexchangebuyerService extends apiService { +class apiAdexchangebuyerService extends Service { public $directDeals; public $accounts; public $creatives; /** * Constructs the internal representation of the Adexchangebuyer service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/adexchangebuyer/v1/'; $this->version = 'v1'; $this->serviceName = 'adexchangebuyer'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->directDeals = new DirectDealsServiceResource($this, $this->serviceName, 'directDeals', json_decode('{"methods": {"list": {"id": "adexchangebuyer.directDeals.list", "path": "directdeals", "httpMethod": "GET", "response": {"$ref": "DirectDealsList"}}, "get": {"parameters": {"id": {"format": "int64", "required": true, "type": "string", "location": "path"}}, "id": "adexchangebuyer.directDeals.get", "httpMethod": "GET", "path": "directdeals/{id}", "response": {"$ref": "DirectDeal"}}}}', true)); $this->accounts = new AccountsServiceResource($this, $this->serviceName, 'accounts', json_decode('{"methods": {"get": {"parameters": {"id": {"format": "int32", "required": true, "type": "integer", "location": "path"}}, "id": "adexchangebuyer.accounts.get", "httpMethod": "GET", "path": "accounts/{id}", "response": {"$ref": "Account"}}, "list": {"id": "adexchangebuyer.accounts.list", "path": "accounts", "httpMethod": "GET", "response": {"$ref": "AccountsList"}}, "update": {"parameters": {"id": {"format": "int32", "required": true, "type": "integer", "location": "path"}}, "request": {"$ref": "Account"}, "id": "adexchangebuyer.accounts.update", "httpMethod": "PUT", "path": "accounts/{id}", "response": {"$ref": "Account"}}, "patch": {"parameters": {"id": {"format": "int32", "required": true, "type": "integer", "location": "path"}}, "request": {"$ref": "Account"}, "id": "adexchangebuyer.accounts.patch", "httpMethod": "PATCH", "path": "accounts/{id}", "response": {"$ref": "Account"}}}}', true)); $this->creatives = new CreativesServiceResource($this, $this->serviceName, 'creatives', json_decode('{"methods": {"insert": {"request": {"$ref": "Creative"}, "id": "adexchangebuyer.creatives.insert", "httpMethod": "POST", "path": "creatives", "response": {"$ref": "Creative"}}, "get": {"parameters": {"adgroupId": {"format": "int64", "required": true, "type": "string", "location": "query"}, "buyerCreativeId": {"required": true, "type": "string", "location": "path"}, "accountId": {"format": "int32", "required": true, "type": "integer", "location": "path"}}, "id": "adexchangebuyer.creatives.get", "httpMethod": "GET", "path": "creatives/{accountId}/{buyerCreativeId}", "response": {"$ref": "Creative"}}}}', true)); @@ -222,7 +227,7 @@ public function __construct(apiClient $apiClient) { } } -class Account extends apiModel { +class Account extends Model { public $kind; public $maximumTotalQps; protected $__bidderLocationType = 'AccountBidderLocation'; @@ -270,7 +275,7 @@ public function getCookieMatchingUrl() { } } -class AccountBidderLocation extends apiModel { +class AccountBidderLocation extends Model { public $url; public $maximumQps; public function setUrl($url) { @@ -287,7 +292,7 @@ public function getMaximumQps() { } } -class AccountsList extends apiModel { +class AccountsList extends Model { protected $__itemsType = 'Account'; protected $__itemsDataType = 'array'; public $items; @@ -307,7 +312,7 @@ public function getKind() { } } -class Creative extends apiModel { +class Creative extends Model { public $productCategories; public $advertiserName; public $adgroupId; @@ -436,7 +441,7 @@ public function getAccountId() { } } -class DirectDeal extends apiModel { +class DirectDeal extends Model { public $advertiser; public $kind; public $currencyCode; @@ -502,7 +507,7 @@ public function getAccountId() { } } -class DirectDealsList extends apiModel { +class DirectDealsList extends Model { public $kind; protected $__directDealsType = 'DirectDeal'; protected $__directDealsDataType = 'array'; diff --git a/src/GoogleApi/contrib/apiAdsenseService.php b/src/GoogleApi/Contrib/apiAdsenseService.php similarity index 96% rename from src/GoogleApi/contrib/apiAdsenseService.php rename to src/GoogleApi/Contrib/apiAdsenseService.php index 2ecb224..dd2b530 100644 --- a/src/GoogleApi/contrib/apiAdsenseService.php +++ b/src/GoogleApi/Contrib/apiAdsenseService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "urlchannels" collection of methods. @@ -28,7 +29,7 @@ * $urlchannels = $adsenseService->urlchannels; * */ - class UrlchannelsServiceResource extends apiServiceResource { + class UrlchannelsServiceResource extends ServiceResource { /** @@ -61,7 +62,7 @@ public function listUrlchannels($adClientId, $optParams = array()) { * $adunits = $adsenseService->adunits; * */ - class AdunitsServiceResource extends apiServiceResource { + class AdunitsServiceResource extends ServiceResource { /** @@ -113,7 +114,7 @@ public function get($adClientId, $adUnitId, $optParams = array()) { * $customchannels = $adsenseService->customchannels; * */ - class AdunitsCustomchannelsServiceResource extends apiServiceResource { + class AdunitsCustomchannelsServiceResource extends ServiceResource { /** @@ -147,7 +148,7 @@ public function listAdunitsCustomchannels($adClientId, $adUnitId, $optParams = a * $adclients = $adsenseService->adclients; * */ - class AdclientsServiceResource extends apiServiceResource { + class AdclientsServiceResource extends ServiceResource { /** @@ -179,7 +180,7 @@ public function listAdclients($optParams = array()) { * $reports = $adsenseService->reports; * */ - class ReportsServiceResource extends apiServiceResource { + class ReportsServiceResource extends ServiceResource { /** @@ -222,7 +223,7 @@ public function generate($startDate, $endDate, $optParams = array()) { * $accounts = $adsenseService->accounts; * */ - class AccountsServiceResource extends apiServiceResource { + class AccountsServiceResource extends ServiceResource { /** @@ -274,7 +275,7 @@ public function get($accountId, $optParams = array()) { * $urlchannels = $adsenseService->urlchannels; * */ - class AccountsUrlchannelsServiceResource extends apiServiceResource { + class AccountsUrlchannelsServiceResource extends ServiceResource { /** @@ -307,7 +308,7 @@ public function listAccountsUrlchannels($accountId, $adClientId, $optParams = ar * $adunits = $adsenseService->adunits; * */ - class AccountsAdunitsServiceResource extends apiServiceResource { + class AccountsAdunitsServiceResource extends ServiceResource { /** @@ -361,7 +362,7 @@ public function get($accountId, $adClientId, $adUnitId, $optParams = array()) { * $customchannels = $adsenseService->customchannels; * */ - class AccountsAdunitsCustomchannelsServiceResource extends apiServiceResource { + class AccountsAdunitsCustomchannelsServiceResource extends ServiceResource { /** @@ -395,7 +396,7 @@ public function listAccountsAdunitsCustomchannels($accountId, $adClientId, $adUn * $adclients = $adsenseService->adclients; * */ - class AccountsAdclientsServiceResource extends apiServiceResource { + class AccountsAdclientsServiceResource extends ServiceResource { /** @@ -427,7 +428,7 @@ public function listAccountsAdclients($accountId, $optParams = array()) { * $reports = $adsenseService->reports; * */ - class AccountsReportsServiceResource extends apiServiceResource { + class AccountsReportsServiceResource extends ServiceResource { /** @@ -469,7 +470,7 @@ public function generate($startDate, $endDate, $optParams = array()) { * $customchannels = $adsenseService->customchannels; * */ - class AccountsCustomchannelsServiceResource extends apiServiceResource { + class AccountsCustomchannelsServiceResource extends ServiceResource { /** @@ -524,7 +525,7 @@ public function get($accountId, $adClientId, $customChannelId, $optParams = arra * $adunits = $adsenseService->adunits; * */ - class AccountsCustomchannelsAdunitsServiceResource extends apiServiceResource { + class AccountsCustomchannelsAdunitsServiceResource extends ServiceResource { /** @@ -560,7 +561,7 @@ public function listAccountsCustomchannelsAdunits($accountId, $adClientId, $cust * $customchannels = $adsenseService->customchannels; * */ - class CustomchannelsServiceResource extends apiServiceResource { + class CustomchannelsServiceResource extends ServiceResource { /** @@ -612,7 +613,7 @@ public function get($adClientId, $customChannelId, $optParams = array()) { * $adunits = $adsenseService->adunits; * */ - class CustomchannelsAdunitsServiceResource extends apiServiceResource { + class CustomchannelsAdunitsServiceResource extends ServiceResource { /** @@ -655,7 +656,7 @@ public function listCustomchannelsAdunits($adClientId, $customChannelId, $optPar * * @author Google, Inc. */ -class apiAdsenseService extends apiService { +class apiAdsenseService extends Service { public $urlchannels; public $adunits; public $adunits_customchannels; @@ -699,15 +700,15 @@ class apiAdsenseService extends apiService { /** * Constructs the internal representation of the Adsense service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/adsense/v1.1/'; $this->version = 'v1.1'; $this->serviceName = 'adsense'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->urlchannels = new UrlchannelsServiceResource($this, $this->serviceName, 'urlchannels', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "int32", "maximum": "10000", "minimum": "0", "location": "query", "type": "integer"}}, "id": "adsense.urlchannels.list", "httpMethod": "GET", "path": "adclients/{adClientId}/urlchannels", "response": {"$ref": "UrlChannels"}}}}', true)); $this->adunits = new AdunitsServiceResource($this, $this->serviceName, 'adunits', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"includeInactive": {"type": "boolean", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "int32", "maximum": "10000", "minimum": "0", "location": "query", "type": "integer"}}, "id": "adsense.adunits.list", "httpMethod": "GET", "path": "adclients/{adClientId}/adunits", "response": {"$ref": "AdUnits"}}, "get": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}, "adUnitId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.adunits.get", "httpMethod": "GET", "path": "adclients/{adClientId}/adunits/{adUnitId}", "response": {"$ref": "AdUnit"}}}}', true)); $this->adunits_customchannels = new AdunitsCustomchannelsServiceResource($this, $this->serviceName, 'customchannels', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "adUnitId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "int32", "maximum": "10000", "minimum": "0", "location": "query", "type": "integer"}}, "id": "adsense.adunits.customchannels.list", "httpMethod": "GET", "path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels", "response": {"$ref": "CustomChannels"}}}}', true)); @@ -726,7 +727,7 @@ public function __construct(apiClient $apiClient) { } } -class Account extends apiModel { +class Account extends Model { public $kind; public $id; protected $__subAccountsType = 'Account'; @@ -760,7 +761,7 @@ public function getName() { } } -class Accounts extends apiModel { +class Accounts extends Model { public $nextPageToken; protected $__itemsType = 'Account'; protected $__itemsDataType = 'array'; @@ -794,7 +795,7 @@ public function getEtag() { } } -class AdClient extends apiModel { +class AdClient extends Model { public $productCode; public $kind; public $id; @@ -825,7 +826,7 @@ public function getSupportsReporting() { } } -class AdClients extends apiModel { +class AdClients extends Model { public $nextPageToken; protected $__itemsType = 'AdClient'; protected $__itemsDataType = 'array'; @@ -859,7 +860,7 @@ public function getEtag() { } } -class AdUnit extends apiModel { +class AdUnit extends Model { public $status; public $kind; public $code; @@ -897,7 +898,7 @@ public function getName() { } } -class AdUnits extends apiModel { +class AdUnits extends Model { public $nextPageToken; protected $__itemsType = 'AdUnit'; protected $__itemsDataType = 'array'; @@ -931,7 +932,7 @@ public function getEtag() { } } -class AdsenseReportsGenerateResponse extends apiModel { +class AdsenseReportsGenerateResponse extends Model { public $kind; public $rows; public $warnings; @@ -990,7 +991,7 @@ public function getAverages() { } } -class AdsenseReportsGenerateResponseHeaders extends apiModel { +class AdsenseReportsGenerateResponseHeaders extends Model { public $currency; public $type; public $name; @@ -1014,7 +1015,7 @@ public function getName() { } } -class CustomChannel extends apiModel { +class CustomChannel extends Model { public $kind; public $code; protected $__targetingInfoType = 'CustomChannelTargetingInfo'; @@ -1054,7 +1055,7 @@ public function getName() { } } -class CustomChannelTargetingInfo extends apiModel { +class CustomChannelTargetingInfo extends Model { public $location; public $adsAppearOn; public $siteLanguage; @@ -1085,7 +1086,7 @@ public function getDescription() { } } -class CustomChannels extends apiModel { +class CustomChannels extends Model { public $nextPageToken; protected $__itemsType = 'CustomChannel'; protected $__itemsDataType = 'array'; @@ -1119,7 +1120,7 @@ public function getEtag() { } } -class UrlChannel extends apiModel { +class UrlChannel extends Model { public $kind; public $id; public $urlPattern; @@ -1143,7 +1144,7 @@ public function getUrlPattern() { } } -class UrlChannels extends apiModel { +class UrlChannels extends Model { public $nextPageToken; protected $__itemsType = 'UrlChannel'; protected $__itemsDataType = 'array'; diff --git a/src/GoogleApi/contrib/apiAdsensehostService.php b/src/GoogleApi/Contrib/apiAdsensehostService.php similarity index 94% rename from src/GoogleApi/contrib/apiAdsensehostService.php rename to src/GoogleApi/Contrib/apiAdsensehostService.php index 751030f..0bded03 100644 --- a/src/GoogleApi/contrib/apiAdsensehostService.php +++ b/src/GoogleApi/Contrib/apiAdsensehostService.php @@ -15,6 +15,11 @@ * the License. */ +namespace GoogleApi\Contrib; + +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "urlchannels" collection of methods. @@ -24,7 +29,7 @@ * $urlchannels = $adsensehostService->urlchannels; * */ - class UrlchannelsServiceResource extends apiServiceResource { + class UrlchannelsServiceResource extends ServiceResource { /** @@ -57,7 +62,7 @@ public function listUrlchannels($adClientId, $optParams = array()) { * $adclients = $adsensehostService->adclients; * */ - class AdclientsServiceResource extends apiServiceResource { + class AdclientsServiceResource extends ServiceResource { /** @@ -89,7 +94,7 @@ public function listAdclients($optParams = array()) { * $reports = $adsensehostService->reports; * */ - class ReportsServiceResource extends apiServiceResource { + class ReportsServiceResource extends ServiceResource { /** @@ -131,7 +136,7 @@ public function generate($startDate, $endDate, $optParams = array()) { * $customchannels = $adsensehostService->customchannels; * */ - class CustomchannelsServiceResource extends apiServiceResource { + class CustomchannelsServiceResource extends ServiceResource { /** @@ -170,7 +175,7 @@ public function listCustomchannels($adClientId, $optParams = array()) { * * @author Google, Inc. */ -class apiAdsensehostService extends apiService { +class apiAdsensehostService extends Service { public $urlchannels; public $adclients; public $reports; @@ -178,15 +183,15 @@ class apiAdsensehostService extends apiService { /** * Constructs the internal representation of the Adsensehost service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/adsensehost/v4/'; $this->version = 'v4'; $this->serviceName = 'adsensehost'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->urlchannels = new UrlchannelsServiceResource($this, $this->serviceName, 'urlchannels', json_decode('{"methods": {"list": {"parameters": {"pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "int32", "maximum": "10000", "minimum": "0", "location": "query", "type": "integer"}}, "id": "adsensehost.urlchannels.list", "httpMethod": "GET", "path": "adclients/{adClientId}/urlchannels", "response": {"$ref": "UrlChannels"}}}}', true)); $this->adclients = new AdclientsServiceResource($this, $this->serviceName, 'adclients', json_decode('{"methods": {"list": {"parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"format": "int32", "maximum": "10000", "minimum": "0", "location": "query", "type": "integer"}}, "id": "adsensehost.adclients.list", "httpMethod": "GET", "path": "adclients", "response": {"$ref": "AdClients"}}}}', true)); $this->reports = new ReportsServiceResource($this, $this->serviceName, 'reports', json_decode('{"methods": {"generate": {"parameters": {"sort": {"repeated": true, "type": "string", "location": "query"}, "startDate": {"required": true, "type": "string", "location": "query"}, "endDate": {"required": true, "type": "string", "location": "query"}, "locale": {"type": "string", "location": "query"}, "metric": {"repeated": true, "type": "string", "location": "query"}, "maxResults": {"format": "int32", "maximum": "50000", "minimum": "0", "location": "query", "type": "integer"}, "filter": {"repeated": true, "type": "string", "location": "query"}, "currency": {"type": "string", "location": "query"}, "startIndex": {"format": "int32", "maximum": "5000", "minimum": "0", "location": "query", "type": "integer"}, "dimension": {"repeated": true, "type": "string", "location": "query"}}, "id": "adsensehost.reports.generate", "httpMethod": "GET", "path": "reports", "response": {"$ref": "AdsensehostReportsGenerateResponse"}}}}', true)); @@ -195,7 +200,7 @@ public function __construct(apiClient $apiClient) { } } -class AdClient extends apiModel { +class AdClient extends Model { public $productCode; public $kind; public $id; @@ -226,7 +231,7 @@ public function getSupportsReporting() { } } -class AdClients extends apiModel { +class AdClients extends Model { public $nextPageToken; protected $__itemsType = 'AdClient'; protected $__itemsDataType = 'array'; @@ -260,7 +265,7 @@ public function getEtag() { } } -class AdsensehostReportsGenerateResponse extends apiModel { +class AdsensehostReportsGenerateResponse extends Model { public $rows; public $warnings; public $totals; @@ -312,7 +317,7 @@ public function getAverages() { } } -class AdsensehostReportsGenerateResponseHeaders extends apiModel { +class AdsensehostReportsGenerateResponseHeaders extends Model { public $currency; public $type; public $name; @@ -336,7 +341,7 @@ public function getName() { } } -class CustomChannel extends apiModel { +class CustomChannel extends Model { public $kind; public $code; public $id; @@ -367,7 +372,7 @@ public function getName() { } } -class CustomChannels extends apiModel { +class CustomChannels extends Model { public $nextPageToken; protected $__itemsType = 'CustomChannel'; protected $__itemsDataType = 'array'; @@ -401,7 +406,7 @@ public function getEtag() { } } -class UrlChannel extends apiModel { +class UrlChannel extends Model { public $kind; public $id; public $urlPattern; @@ -425,7 +430,7 @@ public function getUrlPattern() { } } -class UrlChannels extends apiModel { +class UrlChannels extends Model { public $nextPageToken; protected $__itemsType = 'UrlChannel'; protected $__itemsDataType = 'array'; diff --git a/src/GoogleApi/contrib/apiAnalyticsService.php b/src/GoogleApi/Contrib/apiAnalyticsService.php similarity index 96% rename from src/GoogleApi/contrib/apiAnalyticsService.php rename to src/GoogleApi/Contrib/apiAnalyticsService.php index 328695a..7a6436f 100644 --- a/src/GoogleApi/contrib/apiAnalyticsService.php +++ b/src/GoogleApi/Contrib/apiAnalyticsService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "management" collection of methods. @@ -28,7 +29,7 @@ * $management = $analyticsService->management; * */ - class ManagementServiceResource extends apiServiceResource { + class ManagementServiceResource extends ServiceResource { } @@ -42,7 +43,7 @@ class ManagementServiceResource extends apiServiceResource { * $webproperties = $analyticsService->webproperties; * */ - class ManagementWebpropertiesServiceResource extends apiServiceResource { + class ManagementWebpropertiesServiceResource extends ServiceResource { /** @@ -74,7 +75,7 @@ public function listManagementWebproperties($accountId, $optParams = array()) { * $segments = $analyticsService->segments; * */ - class ManagementSegmentsServiceResource extends apiServiceResource { + class ManagementSegmentsServiceResource extends ServiceResource { /** @@ -105,7 +106,7 @@ public function listManagementSegments($optParams = array()) { * $accounts = $analyticsService->accounts; * */ - class ManagementAccountsServiceResource extends apiServiceResource { + class ManagementAccountsServiceResource extends ServiceResource { /** @@ -136,7 +137,7 @@ public function listManagementAccounts($optParams = array()) { * $goals = $analyticsService->goals; * */ - class ManagementGoalsServiceResource extends apiServiceResource { + class ManagementGoalsServiceResource extends ServiceResource { /** @@ -170,7 +171,7 @@ public function listManagementGoals($accountId, $webPropertyId, $profileId, $opt * $profiles = $analyticsService->profiles; * */ - class ManagementProfilesServiceResource extends apiServiceResource { + class ManagementProfilesServiceResource extends ServiceResource { /** @@ -204,7 +205,7 @@ public function listManagementProfiles($accountId, $webPropertyId, $optParams = * $data = $analyticsService->data; * */ - class DataServiceResource extends apiServiceResource { + class DataServiceResource extends ServiceResource { } @@ -218,7 +219,7 @@ class DataServiceResource extends apiServiceResource { * $ga = $analyticsService->ga; * */ - class DataGaServiceResource extends apiServiceResource { + class DataGaServiceResource extends ServiceResource { /** @@ -266,7 +267,7 @@ public function get($ids, $start_date, $end_date, $metrics, $optParams = array() * * @author Google, Inc. */ -class apiAnalyticsService extends apiService { +class apiAnalyticsService extends Service { public $management_webproperties; public $management_segments; public $management_accounts; @@ -276,15 +277,15 @@ class apiAnalyticsService extends apiService { /** * Constructs the internal representation of the Analytics service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/analytics/v3/'; $this->version = 'v3'; $this->serviceName = 'analytics'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->management_webproperties = new ManagementWebpropertiesServiceResource($this, $this->serviceName, 'webproperties', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/analytics.readonly"], "parameters": {"max-results": {"format": "int32", "type": "integer", "location": "query"}, "start-index": {"format": "int32", "minimum": "1", "type": "integer", "location": "query"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "analytics.management.webproperties.list", "httpMethod": "GET", "path": "management/accounts/{accountId}/webproperties", "response": {"$ref": "Webproperties"}}}}', true)); $this->management_segments = new ManagementSegmentsServiceResource($this, $this->serviceName, 'segments', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/analytics.readonly"], "parameters": {"max-results": {"format": "int32", "type": "integer", "location": "query"}, "start-index": {"format": "int32", "minimum": "1", "type": "integer", "location": "query"}}, "response": {"$ref": "Segments"}, "httpMethod": "GET", "path": "management/segments", "id": "analytics.management.segments.list"}}}', true)); $this->management_accounts = new ManagementAccountsServiceResource($this, $this->serviceName, 'accounts', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/analytics.readonly"], "parameters": {"max-results": {"format": "int32", "type": "integer", "location": "query"}, "start-index": {"format": "int32", "minimum": "1", "type": "integer", "location": "query"}}, "response": {"$ref": "Accounts"}, "httpMethod": "GET", "path": "management/accounts", "id": "analytics.management.accounts.list"}}}', true)); @@ -294,7 +295,7 @@ public function __construct(apiClient $apiClient) { } } -class Account extends apiModel { +class Account extends Model { public $kind; public $name; public $created; @@ -348,7 +349,7 @@ public function getSelfLink() { } } -class AccountChildLink extends apiModel { +class AccountChildLink extends Model { public $href; public $type; public function setHref($href) { @@ -365,7 +366,7 @@ public function getType() { } } -class Accounts extends apiModel { +class Accounts extends Model { public $username; public $kind; protected $__itemsType = 'Account'; @@ -427,7 +428,7 @@ public function getTotalResults() { } } -class GaData extends apiModel { +class GaData extends Model { public $kind; public $rows; public $containsSampledData; @@ -529,7 +530,7 @@ public function getSelfLink() { } } -class GaDataColumnHeaders extends apiModel { +class GaDataColumnHeaders extends Model { public $dataType; public $columnType; public $name; @@ -553,7 +554,7 @@ public function getName() { } } -class GaDataProfileInfo extends apiModel { +class GaDataProfileInfo extends Model { public $webPropertyId; public $internalWebPropertyId; public $tableId; @@ -598,7 +599,7 @@ public function getAccountId() { } } -class GaDataQuery extends apiModel { +class GaDataQuery extends Model { public $max_results; public $sort; public $dimensions; @@ -673,7 +674,7 @@ public function getEnd_date() { } } -class Goal extends apiModel { +class Goal extends Model { public $kind; protected $__visitTimeOnSiteDetailsType = 'GoalVisitTimeOnSiteDetails'; protected $__visitTimeOnSiteDetailsDataType = ''; @@ -812,7 +813,7 @@ public function getAccountId() { } } -class GoalEventDetails extends apiModel { +class GoalEventDetails extends Model { protected $__eventConditionsType = 'GoalEventDetailsEventConditions'; protected $__eventConditionsDataType = 'array'; public $eventConditions; @@ -832,7 +833,7 @@ public function getUseEventValue() { } } -class GoalEventDetailsEventConditions extends apiModel { +class GoalEventDetailsEventConditions extends Model { public $type; public $matchType; public $expression; @@ -870,7 +871,7 @@ public function getComparisonValue() { } } -class GoalParentLink extends apiModel { +class GoalParentLink extends Model { public $href; public $type; public function setHref($href) { @@ -887,7 +888,7 @@ public function getType() { } } -class GoalUrlDestinationDetails extends apiModel { +class GoalUrlDestinationDetails extends Model { public $url; public $caseSensitive; public $matchType; @@ -928,7 +929,7 @@ public function getFirstStepRequired() { } } -class GoalUrlDestinationDetailsSteps extends apiModel { +class GoalUrlDestinationDetailsSteps extends Model { public $url; public $name; public $number; @@ -952,7 +953,7 @@ public function getNumber() { } } -class GoalVisitNumPagesDetails extends apiModel { +class GoalVisitNumPagesDetails extends Model { public $comparisonType; public $comparisonValue; public function setComparisonType($comparisonType) { @@ -969,7 +970,7 @@ public function getComparisonValue() { } } -class GoalVisitTimeOnSiteDetails extends apiModel { +class GoalVisitTimeOnSiteDetails extends Model { public $comparisonType; public $comparisonValue; public function setComparisonType($comparisonType) { @@ -986,7 +987,7 @@ public function getComparisonValue() { } } -class Goals extends apiModel { +class Goals extends Model { public $username; public $kind; protected $__itemsType = 'Goal'; @@ -1048,7 +1049,7 @@ public function getTotalResults() { } } -class Profile extends apiModel { +class Profile extends Model { public $defaultPage; public $kind; public $excludeQueryParameters; @@ -1174,7 +1175,7 @@ public function getAccountId() { } } -class ProfileChildLink extends apiModel { +class ProfileChildLink extends Model { public $href; public $type; public function setHref($href) { @@ -1191,7 +1192,7 @@ public function getType() { } } -class ProfileParentLink extends apiModel { +class ProfileParentLink extends Model { public $href; public $type; public function setHref($href) { @@ -1208,7 +1209,7 @@ public function getType() { } } -class Profiles extends apiModel { +class Profiles extends Model { public $username; public $kind; protected $__itemsType = 'Profile'; @@ -1270,7 +1271,7 @@ public function getTotalResults() { } } -class Segment extends apiModel { +class Segment extends Model { public $definition; public $kind; public $segmentId; @@ -1329,7 +1330,7 @@ public function getName() { } } -class Segments extends apiModel { +class Segments extends Model { public $username; public $kind; protected $__itemsType = 'Segment'; @@ -1391,7 +1392,7 @@ public function getTotalResults() { } } -class Webproperties extends apiModel { +class Webproperties extends Model { public $username; public $kind; protected $__itemsType = 'Webproperty'; @@ -1453,7 +1454,7 @@ public function getTotalResults() { } } -class Webproperty extends apiModel { +class Webproperty extends Model { public $kind; public $name; public $created; @@ -1537,7 +1538,7 @@ public function getAccountId() { } } -class WebpropertyChildLink extends apiModel { +class WebpropertyChildLink extends Model { public $href; public $type; public function setHref($href) { @@ -1554,7 +1555,7 @@ public function getType() { } } -class WebpropertyParentLink extends apiModel { +class WebpropertyParentLink extends Model { public $href; public $type; public function setHref($href) { diff --git a/src/GoogleApi/contrib/apiBigqueryService.php b/src/GoogleApi/Contrib/apiBigqueryService.php similarity index 97% rename from src/GoogleApi/contrib/apiBigqueryService.php rename to src/GoogleApi/Contrib/apiBigqueryService.php index 8c3b2b6..081023e 100644 --- a/src/GoogleApi/contrib/apiBigqueryService.php +++ b/src/GoogleApi/Contrib/apiBigqueryService.php @@ -15,6 +15,11 @@ * the License. */ +namespace GoogleApi\Contrib; + +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "tables" collection of methods. @@ -24,7 +29,7 @@ * $tables = $bigqueryService->tables; * */ - class TablesServiceResource extends apiServiceResource { + class TablesServiceResource extends ServiceResource { /** @@ -152,7 +157,7 @@ public function delete($projectId, $datasetId, $tableId, $optParams = array()) { * $datasets = $bigqueryService->datasets; * */ - class DatasetsServiceResource extends apiServiceResource { + class DatasetsServiceResource extends ServiceResource { /** @@ -283,7 +288,7 @@ public function delete($projectId, $datasetId, $optParams = array()) { * $jobs = $bigqueryService->jobs; * */ - class JobsServiceResource extends apiServiceResource { + class JobsServiceResource extends ServiceResource { /** @@ -407,7 +412,7 @@ public function delete($projectId, $jobId, $optParams = array()) { * $tabledata = $bigqueryService->tabledata; * */ - class TabledataServiceResource extends apiServiceResource { + class TabledataServiceResource extends ServiceResource { /** @@ -442,7 +447,7 @@ public function listTabledata($projectId, $datasetId, $tableId, $optParams = arr * $projects = $bigqueryService->projects; * */ - class ProjectsServiceResource extends apiServiceResource { + class ProjectsServiceResource extends ServiceResource { /** @@ -480,7 +485,7 @@ public function listProjects($optParams = array()) { * * @author Google, Inc. */ -class apiBigqueryService extends apiService { +class apiBigqueryService extends Service { public $tables; public $datasets; public $jobs; @@ -489,15 +494,15 @@ class apiBigqueryService extends apiService { /** * Constructs the internal representation of the Bigquery service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/bigquery/v2/'; $this->version = 'v2'; $this->serviceName = 'bigquery'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->tables = new TablesServiceResource($this, $this->serviceName, 'tables', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"type": "string", "location": "path"}, "datasetId": {"type": "string", "location": "path"}}, "request": {"$ref": "Table"}, "id": "bigquery.tables.insert", "httpMethod": "POST", "path": "projects/{projectId}/datasets/{datasetId}/tables", "response": {"$ref": "Table"}}, "get": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "tableId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.tables.get", "httpMethod": "GET", "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", "response": {"$ref": "Table"}}, "list": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "datasetId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "type": "integer", "location": "query"}, "projectId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.tables.list", "httpMethod": "GET", "path": "projects/{projectId}/datasets/{datasetId}/tables", "response": {"$ref": "TableList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"type": "string", "location": "path"}, "tableId": {"type": "string", "location": "path"}, "datasetId": {"type": "string", "location": "path"}}, "request": {"$ref": "Table"}, "id": "bigquery.tables.update", "httpMethod": "PUT", "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", "response": {"$ref": "Table"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "tableId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Table"}, "id": "bigquery.tables.patch", "httpMethod": "PATCH", "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", "response": {"$ref": "Table"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "tableId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", "id": "bigquery.tables.delete"}}}', true)); $this->datasets = new DatasetsServiceResource($this, $this->serviceName, 'datasets', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"type": "string", "location": "path"}}, "request": {"$ref": "Dataset"}, "id": "bigquery.datasets.insert", "httpMethod": "POST", "path": "projects/{projectId}/datasets", "response": {"$ref": "Dataset"}}, "get": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.datasets.get", "httpMethod": "GET", "path": "projects/{projectId}/datasets/{datasetId}", "response": {"$ref": "Dataset"}}, "list": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"format": "uint32", "type": "integer", "location": "query"}, "projectId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.datasets.list", "httpMethod": "GET", "path": "projects/{projectId}/datasets", "response": {"$ref": "DatasetList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"type": "string", "location": "path"}, "datasetId": {"type": "string", "location": "path"}}, "request": {"$ref": "Dataset"}, "id": "bigquery.datasets.update", "httpMethod": "PUT", "path": "projects/{projectId}/datasets/{datasetId}", "response": {"$ref": "Dataset"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Dataset"}, "id": "bigquery.datasets.patch", "httpMethod": "PATCH", "path": "projects/{projectId}/datasets/{datasetId}", "response": {"$ref": "Dataset"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"deleteContents": {"type": "boolean", "location": "query"}, "datasetId": {"required": true, "type": "string", "location": "path"}, "projectId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "projects/{projectId}/datasets/{datasetId}", "id": "bigquery.datasets.delete"}}}', true)); $this->jobs = new JobsServiceResource($this, $this->serviceName, 'jobs', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"type": "string", "location": "path"}}, "mediaUpload": {"accept": ["application/octet-stream"], "protocols": {"simple": {"path": "/upload/bigquery/v2/projects/{projectId}/jobs", "multipart": true}, "resumable": {"path": "/resumable/upload/bigquery/v2/projects/{projectId}/jobs", "multipart": true}}}, "request": {"$ref": "Job"}, "id": "bigquery.jobs.insert", "httpMethod": "POST", "path": "projects/{projectId}/jobs", "response": {"$ref": "Job"}}, "get": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "jobId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.jobs.get", "httpMethod": "GET", "path": "projects/{projectId}/jobs/{jobId}", "response": {"$ref": "Job"}}, "list": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projection": {"enum": ["full", "minimal"], "type": "string", "location": "query"}, "stateFilter": {"enum": ["done", "pending", "running"], "repeated": true, "location": "query", "type": "string"}, "projectId": {"required": true, "type": "string", "location": "path"}, "allUsers": {"type": "boolean", "location": "query"}, "maxResults": {"format": "uint32", "type": "integer", "location": "query"}, "pageToken": {"type": "string", "location": "query"}}, "id": "bigquery.jobs.list", "httpMethod": "GET", "path": "projects/{projectId}/jobs", "response": {"$ref": "JobList"}}, "query": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "QueryRequest"}, "id": "bigquery.jobs.query", "httpMethod": "POST", "path": "projects/{projectId}/queries", "response": {"$ref": "QueryResponse"}}, "getQueryResults": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"timeoutMs": {"format": "uint32", "type": "integer", "location": "query"}, "projectId": {"required": true, "type": "string", "location": "path"}, "startIndex": {"format": "uint64", "type": "string", "location": "query"}, "maxResults": {"format": "uint32", "type": "integer", "location": "query"}, "jobId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.jobs.getQueryResults", "httpMethod": "GET", "path": "projects/{projectId}/queries/{jobId}", "response": {"$ref": "GetQueryResultsResponse"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "jobId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "projects/{projectId}/jobs/{jobId}", "id": "bigquery.jobs.delete"}}}', true)); @@ -507,7 +512,7 @@ public function __construct(apiClient $apiClient) { } } -class Dataset extends apiModel { +class Dataset extends Model { public $kind; public $description; protected $__datasetReferenceType = 'DatasetReference'; @@ -585,7 +590,7 @@ public function getSelfLink() { } } -class DatasetAccess extends apiModel { +class DatasetAccess extends Model { public $specialGroup; public $domain; public $role; @@ -623,7 +628,7 @@ public function getUserByEmail() { } } -class DatasetList extends apiModel { +class DatasetList extends Model { public $nextPageToken; public $kind; protected $__datasetsType = 'DatasetListDatasets'; @@ -657,7 +662,7 @@ public function getEtag() { } } -class DatasetListDatasets extends apiModel { +class DatasetListDatasets extends Model { public $friendlyName; public $kind; public $id; @@ -690,7 +695,7 @@ public function getDatasetReference() { } } -class DatasetReference extends apiModel { +class DatasetReference extends Model { public $projectId; public $datasetId; public function setProjectId($projectId) { @@ -707,7 +712,7 @@ public function getDatasetId() { } } -class ErrorProto extends apiModel { +class ErrorProto extends Model { public $debugInfo; public $message; public $reason; @@ -738,7 +743,7 @@ public function getLocation() { } } -class GetQueryResultsResponse extends apiModel { +class GetQueryResultsResponse extends Model { public $kind; protected $__rowsType = 'TableRow'; protected $__rowsDataType = 'array'; @@ -797,7 +802,7 @@ public function getSchema() { } } -class Job extends apiModel { +class Job extends Model { protected $__statusType = 'JobStatus'; protected $__statusDataType = ''; public $status; @@ -864,7 +869,7 @@ public function getSelfLink() { } } -class JobConfiguration extends apiModel { +class JobConfiguration extends Model { protected $__loadType = 'JobConfigurationLoad'; protected $__loadDataType = ''; public $load; @@ -919,7 +924,7 @@ public function getProperties() { } } -class JobConfigurationExtract extends apiModel { +class JobConfigurationExtract extends Model { public $destinationUri; protected $__sourceTableType = 'TableReference'; protected $__sourceTableDataType = ''; @@ -938,7 +943,7 @@ public function getSourceTable() { } } -class JobConfigurationLink extends apiModel { +class JobConfigurationLink extends Model { public $createDisposition; protected $__destinationTableType = 'TableReference'; protected $__destinationTableDataType = ''; @@ -964,7 +969,7 @@ public function getSourceUri() { } } -class JobConfigurationLoad extends apiModel { +class JobConfigurationLoad extends Model { public $encoding; public $fieldDelimiter; protected $__destinationTableType = 'TableReference'; @@ -1035,7 +1040,7 @@ public function getSchema() { } } -class JobConfigurationQuery extends apiModel { +class JobConfigurationQuery extends Model { public $createDisposition; public $query; public $writeDisposition; @@ -1077,7 +1082,7 @@ public function getDefaultDataset() { } } -class JobConfigurationTableCopy extends apiModel { +class JobConfigurationTableCopy extends Model { public $createDisposition; public $writeDisposition; protected $__destinationTableType = 'TableReference'; @@ -1112,7 +1117,7 @@ public function getSourceTable() { } } -class JobList extends apiModel { +class JobList extends Model { public $nextPageToken; public $totalItems; public $kind; @@ -1153,7 +1158,7 @@ public function getJobs() { } } -class JobListJobs extends apiModel { +class JobListJobs extends Model { protected $__statusType = 'JobStatus'; protected $__statusDataType = ''; public $status; @@ -1215,7 +1220,7 @@ public function getErrorResult() { } } -class JobReference extends apiModel { +class JobReference extends Model { public $projectId; public $jobId; public function setProjectId($projectId) { @@ -1232,7 +1237,7 @@ public function getJobId() { } } -class JobStatistics extends apiModel { +class JobStatistics extends Model { public $endTime; public $totalBytesProcessed; public $startTime; @@ -1256,7 +1261,7 @@ public function getStartTime() { } } -class JobStatus extends apiModel { +class JobStatus extends Model { public $state; protected $__errorsType = 'ErrorProto'; protected $__errorsDataType = 'array'; @@ -1285,7 +1290,7 @@ public function getErrorResult() { } } -class ProjectList extends apiModel { +class ProjectList extends Model { public $nextPageToken; public $totalItems; public $kind; @@ -1326,7 +1331,7 @@ public function getProjects() { } } -class ProjectListProjects extends apiModel { +class ProjectListProjects extends Model { public $friendlyName; public $kind; public $id; @@ -1359,7 +1364,7 @@ public function getProjectReference() { } } -class ProjectReference extends apiModel { +class ProjectReference extends Model { public $projectId; public function setProjectId($projectId) { $this->projectId = $projectId; @@ -1369,7 +1374,7 @@ public function getProjectId() { } } -class QueryRequest extends apiModel { +class QueryRequest extends Model { public $timeoutMs; public $query; public $kind; @@ -1409,7 +1414,7 @@ public function getDefaultDataset() { } } -class QueryResponse extends apiModel { +class QueryResponse extends Model { public $kind; protected $__rowsType = 'TableRow'; protected $__rowsDataType = 'array'; @@ -1461,7 +1466,7 @@ public function getSchema() { } } -class Table extends apiModel { +class Table extends Model { public $kind; public $description; public $creationTime; @@ -1538,7 +1543,7 @@ public function getSchema() { } } -class TableDataList extends apiModel { +class TableDataList extends Model { protected $__rowsType = 'TableRow'; protected $__rowsDataType = 'array'; public $rows; @@ -1572,7 +1577,7 @@ public function getTotalRows() { } } -class TableFieldSchema extends apiModel { +class TableFieldSchema extends Model { protected $__fieldsType = 'TableFieldSchema'; protected $__fieldsDataType = 'array'; public $fields; @@ -1606,7 +1611,7 @@ public function getName() { } } -class TableList extends apiModel { +class TableList extends Model { public $nextPageToken; protected $__tablesType = 'TableListTables'; protected $__tablesDataType = 'array'; @@ -1647,7 +1652,7 @@ public function getTotalItems() { } } -class TableListTables extends apiModel { +class TableListTables extends Model { public $friendlyName; public $kind; public $id; @@ -1680,7 +1685,7 @@ public function getTableReference() { } } -class TableReference extends apiModel { +class TableReference extends Model { public $projectId; public $tableId; public $datasetId; @@ -1704,7 +1709,7 @@ public function getDatasetId() { } } -class TableRow extends apiModel { +class TableRow extends Model { protected $__fType = 'TableRowF'; protected $__fDataType = 'array'; public $f; @@ -1717,7 +1722,7 @@ public function getF() { } } -class TableRowF extends apiModel { +class TableRowF extends Model { public $v; public function setV($v) { $this->v = $v; @@ -1727,7 +1732,7 @@ public function getV() { } } -class TableSchema extends apiModel { +class TableSchema extends Model { protected $__fieldsType = 'TableFieldSchema'; protected $__fieldsDataType = 'array'; public $fields; diff --git a/src/GoogleApi/contrib/apiBloggerService.php b/src/GoogleApi/Contrib/apiBloggerService.php similarity index 94% rename from src/GoogleApi/contrib/apiBloggerService.php rename to src/GoogleApi/Contrib/apiBloggerService.php index 1c8b6fb..18e42e9 100644 --- a/src/GoogleApi/contrib/apiBloggerService.php +++ b/src/GoogleApi/Contrib/apiBloggerService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "blogs" collection of methods. @@ -28,7 +29,7 @@ * $blogs = $bloggerService->blogs; * */ - class BlogsServiceResource extends apiServiceResource { + class BlogsServiceResource extends ServiceResource { /** @@ -57,7 +58,7 @@ public function get($blogId, $optParams = array()) { * $posts = $bloggerService->posts; * */ - class PostsServiceResource extends apiServiceResource { + class PostsServiceResource extends ServiceResource { /** @@ -109,7 +110,7 @@ public function get($blogId, $postId, $optParams = array()) { * $pages = $bloggerService->pages; * */ - class PagesServiceResource extends apiServiceResource { + class PagesServiceResource extends ServiceResource { /** @@ -158,7 +159,7 @@ public function get($blogId, $pageId, $optParams = array()) { * $comments = $bloggerService->comments; * */ - class CommentsServiceResource extends apiServiceResource { + class CommentsServiceResource extends ServiceResource { /** @@ -212,7 +213,7 @@ public function get($blogId, $postId, $commentId, $optParams = array()) { * $users = $bloggerService->users; * */ - class UsersServiceResource extends apiServiceResource { + class UsersServiceResource extends ServiceResource { /** @@ -242,7 +243,7 @@ public function get($userId, $optParams = array()) { * $blogs = $bloggerService->blogs; * */ - class UsersBlogsServiceResource extends apiServiceResource { + class UsersBlogsServiceResource extends ServiceResource { /** @@ -279,7 +280,7 @@ public function listUsersBlogs($userId, $optParams = array()) { * * @author Google, Inc. */ -class apiBloggerService extends apiService { +class apiBloggerService extends Service { public $blogs; public $posts; public $pages; @@ -289,15 +290,15 @@ class apiBloggerService extends apiService { /** * Constructs the internal representation of the Blogger service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/blogger/v2/'; $this->version = 'v2'; $this->serviceName = 'blogger'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->blogs = new BlogsServiceResource($this, $this->serviceName, 'blogs', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/blogger"], "parameters": {"blogId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.blogs.get", "httpMethod": "GET", "path": "blogs/{blogId}", "response": {"$ref": "Blog"}}}}', true)); $this->posts = new PostsServiceResource($this, $this->serviceName, 'posts', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/blogger"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "fetchBodies": {"type": "boolean", "location": "query"}, "blogId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "type": "integer", "location": "query"}, "startDate": {"type": "string", "location": "query"}}, "id": "blogger.posts.list", "httpMethod": "GET", "path": "blogs/{blogId}/posts", "response": {"$ref": "PostList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/blogger"], "parameters": {"postId": {"required": true, "type": "string", "location": "path"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.posts.get", "httpMethod": "GET", "path": "blogs/{blogId}/posts/{postId}", "response": {"$ref": "Post"}}}}', true)); $this->pages = new PagesServiceResource($this, $this->serviceName, 'pages', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/blogger"], "parameters": {"fetchBodies": {"type": "boolean", "location": "query"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.pages.list", "httpMethod": "GET", "path": "blogs/{blogId}/pages", "response": {"$ref": "PageList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/blogger"], "parameters": {"pageId": {"required": true, "type": "string", "location": "path"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.pages.get", "httpMethod": "GET", "path": "blogs/{blogId}/pages/{pageId}", "response": {"$ref": "Page"}}}}', true)); @@ -307,7 +308,7 @@ public function __construct(apiClient $apiClient) { } } -class Blog extends apiModel { +class Blog extends Model { public $kind; public $description; protected $__localeType = 'BlogLocale'; @@ -393,7 +394,7 @@ public function getName() { } } -class BlogList extends apiModel { +class BlogList extends Model { protected $__itemsType = 'Blog'; protected $__itemsDataType = 'array'; public $items; @@ -413,7 +414,7 @@ public function getKind() { } } -class BlogLocale extends apiModel { +class BlogLocale extends Model { public $country; public $variant; public $language; @@ -437,7 +438,7 @@ public function getLanguage() { } } -class BlogPages extends apiModel { +class BlogPages extends Model { public $totalItems; public $selfLink; public function setTotalItems($totalItems) { @@ -454,7 +455,7 @@ public function getSelfLink() { } } -class BlogPosts extends apiModel { +class BlogPosts extends Model { public $totalItems; public $selfLink; public function setTotalItems($totalItems) { @@ -471,7 +472,7 @@ public function getSelfLink() { } } -class Comment extends apiModel { +class Comment extends Model { public $content; public $kind; protected $__authorType = 'CommentAuthor'; @@ -543,7 +544,7 @@ public function getSelfLink() { } } -class CommentAuthor extends apiModel { +class CommentAuthor extends Model { public $url; protected $__imageType = 'CommentAuthorImage'; protected $__imageDataType = ''; @@ -576,7 +577,7 @@ public function getId() { } } -class CommentAuthorImage extends apiModel { +class CommentAuthorImage extends Model { public $url; public function setUrl($url) { $this->url = $url; @@ -586,7 +587,7 @@ public function getUrl() { } } -class CommentBlog extends apiModel { +class CommentBlog extends Model { public $id; public function setId($id) { $this->id = $id; @@ -596,7 +597,7 @@ public function getId() { } } -class CommentList extends apiModel { +class CommentList extends Model { public $nextPageToken; protected $__itemsType = 'Comment'; protected $__itemsDataType = 'array'; @@ -630,7 +631,7 @@ public function getPrevPageToken() { } } -class CommentPost extends apiModel { +class CommentPost extends Model { public $id; public function setId($id) { $this->id = $id; @@ -640,7 +641,7 @@ public function getId() { } } -class Page extends apiModel { +class Page extends Model { public $content; public $kind; protected $__authorType = 'PageAuthor'; @@ -717,7 +718,7 @@ public function getSelfLink() { } } -class PageAuthor extends apiModel { +class PageAuthor extends Model { public $url; protected $__imageType = 'PageAuthorImage'; protected $__imageDataType = ''; @@ -750,7 +751,7 @@ public function getId() { } } -class PageAuthorImage extends apiModel { +class PageAuthorImage extends Model { public $url; public function setUrl($url) { $this->url = $url; @@ -760,7 +761,7 @@ public function getUrl() { } } -class PageBlog extends apiModel { +class PageBlog extends Model { public $id; public function setId($id) { $this->id = $id; @@ -770,7 +771,7 @@ public function getId() { } } -class PageList extends apiModel { +class PageList extends Model { protected $__itemsType = 'Page'; protected $__itemsDataType = 'array'; public $items; @@ -790,7 +791,7 @@ public function getKind() { } } -class Post extends apiModel { +class Post extends Model { public $content; public $kind; protected $__authorType = 'PostAuthor'; @@ -884,7 +885,7 @@ public function getSelfLink() { } } -class PostAuthor extends apiModel { +class PostAuthor extends Model { public $url; protected $__imageType = 'PostAuthorImage'; protected $__imageDataType = ''; @@ -917,7 +918,7 @@ public function getId() { } } -class PostAuthorImage extends apiModel { +class PostAuthorImage extends Model { public $url; public function setUrl($url) { $this->url = $url; @@ -927,7 +928,7 @@ public function getUrl() { } } -class PostBlog extends apiModel { +class PostBlog extends Model { public $id; public function setId($id) { $this->id = $id; @@ -937,7 +938,7 @@ public function getId() { } } -class PostList extends apiModel { +class PostList extends Model { public $nextPageToken; protected $__itemsType = 'Post'; protected $__itemsDataType = 'array'; @@ -971,7 +972,7 @@ public function getPrevPageToken() { } } -class PostReplies extends apiModel { +class PostReplies extends Model { public $totalItems; public $selfLink; public function setTotalItems($totalItems) { @@ -988,7 +989,7 @@ public function getSelfLink() { } } -class User extends apiModel { +class User extends Model { public $about; public $displayName; public $created; @@ -1058,7 +1059,7 @@ public function getSelfLink() { } } -class UserBlogs extends apiModel { +class UserBlogs extends Model { public $selfLink; public function setSelfLink($selfLink) { $this->selfLink = $selfLink; @@ -1068,7 +1069,7 @@ public function getSelfLink() { } } -class UserLocale extends apiModel { +class UserLocale extends Model { public $country; public $variant; public $language; diff --git a/src/GoogleApi/contrib/apiBooksService.php b/src/GoogleApi/Contrib/apiBooksService.php similarity index 96% rename from src/GoogleApi/contrib/apiBooksService.php rename to src/GoogleApi/Contrib/apiBooksService.php index 6be6eb1..1b5fc81 100644 --- a/src/GoogleApi/contrib/apiBooksService.php +++ b/src/GoogleApi/Contrib/apiBooksService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "bookshelves" collection of methods. @@ -28,7 +29,7 @@ * $bookshelves = $booksService->bookshelves; * */ - class BookshelvesServiceResource extends apiServiceResource { + class BookshelvesServiceResource extends ServiceResource { /** @@ -83,7 +84,7 @@ public function get($userId, $shelf, $optParams = array()) { * $volumes = $booksService->volumes; * */ - class BookshelvesVolumesServiceResource extends apiServiceResource { + class BookshelvesVolumesServiceResource extends ServiceResource { /** @@ -120,7 +121,7 @@ public function listBookshelvesVolumes($userId, $shelf, $optParams = array()) { * $myconfig = $booksService->myconfig; * */ - class MyconfigServiceResource extends apiServiceResource { + class MyconfigServiceResource extends ServiceResource { /** @@ -202,7 +203,7 @@ public function syncVolumeLicenses($source, $nonce, $cpksver, $optParams = array * $volumes = $booksService->volumes; * */ - class VolumesServiceResource extends apiServiceResource { + class VolumesServiceResource extends ServiceResource { /** @@ -268,7 +269,7 @@ public function get($volumeId, $optParams = array()) { * $mylibrary = $booksService->mylibrary; * */ - class MylibraryServiceResource extends apiServiceResource { + class MylibraryServiceResource extends ServiceResource { } @@ -282,7 +283,7 @@ class MylibraryServiceResource extends apiServiceResource { * $bookshelves = $booksService->bookshelves; * */ - class MylibraryBookshelvesServiceResource extends apiServiceResource { + class MylibraryBookshelvesServiceResource extends ServiceResource { /** @@ -382,7 +383,7 @@ public function get($shelf, $optParams = array()) { * $volumes = $booksService->volumes; * */ - class MylibraryBookshelvesVolumesServiceResource extends apiServiceResource { + class MylibraryBookshelvesVolumesServiceResource extends ServiceResource { /** @@ -419,7 +420,7 @@ public function listMylibraryBookshelvesVolumes($optParams = array()) { * $annotations = $booksService->annotations; * */ - class MylibraryAnnotationsServiceResource extends apiServiceResource { + class MylibraryAnnotationsServiceResource extends ServiceResource { /** @@ -541,7 +542,7 @@ public function delete($annotationId, $optParams = array()) { * * @author Google, Inc. */ -class apiBooksService extends apiService { +class apiBooksService extends Service { public $bookshelves; public $bookshelves_volumes; public $myconfig; @@ -552,15 +553,15 @@ class apiBooksService extends apiService { /** * Constructs the internal representation of the Books service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/books/v1/'; $this->version = 'v1'; $this->serviceName = 'books'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->bookshelves = new BookshelvesServiceResource($this, $this->serviceName, 'bookshelves', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"country": {"type": "string", "location": "query"}, "userId": {"required": true, "type": "string", "location": "path"}, "source": {"type": "string", "location": "query"}}, "id": "books.bookshelves.list", "httpMethod": "GET", "path": "users/{userId}/bookshelves", "response": {"$ref": "Bookshelves"}}, "get": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"country": {"type": "string", "location": "query"}, "userId": {"required": true, "type": "string", "location": "path"}, "shelf": {"required": true, "type": "string", "location": "path"}, "source": {"type": "string", "location": "query"}}, "id": "books.bookshelves.get", "httpMethod": "GET", "path": "users/{userId}/bookshelves/{shelf}", "response": {"$ref": "Bookshelf"}}}}', true)); $this->bookshelves_volumes = new BookshelvesVolumesServiceResource($this, $this->serviceName, 'volumes', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"country": {"type": "string", "location": "query"}, "showPreorders": {"type": "boolean", "location": "query"}, "maxResults": {"format": "uint32", "minimum": "0", "type": "integer", "location": "query"}, "source": {"type": "string", "location": "query"}, "startIndex": {"format": "uint32", "minimum": "0", "type": "integer", "location": "query"}, "shelf": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}}, "id": "books.bookshelves.volumes.list", "httpMethod": "GET", "path": "users/{userId}/bookshelves/{shelf}/volumes", "response": {"$ref": "Volumes"}}}}', true)); $this->myconfig = new MyconfigServiceResource($this, $this->serviceName, 'myconfig', json_decode('{"methods": {"releaseDownloadAccess": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"locale": {"type": "string", "location": "query"}, "country": {"type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "cpksver": {"required": true, "type": "string", "location": "query"}, "volumeIds": {"repeated": true, "required": true, "type": "string", "location": "query"}}, "id": "books.myconfig.releaseDownloadAccess", "httpMethod": "POST", "path": "myconfig/releaseDownloadAccess", "response": {"$ref": "DownloadAccesses"}}, "requestAccess": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"nonce": {"required": true, "type": "string", "location": "query"}, "locale": {"type": "string", "location": "query"}, "country": {"type": "string", "location": "query"}, "cpksver": {"required": true, "type": "string", "location": "query"}, "volumeId": {"required": true, "type": "string", "location": "query"}, "source": {"required": true, "type": "string", "location": "query"}}, "id": "books.myconfig.requestAccess", "httpMethod": "POST", "path": "myconfig/requestAccess", "response": {"$ref": "RequestAccess"}}, "syncVolumeLicenses": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"nonce": {"required": true, "type": "string", "location": "query"}, "locale": {"type": "string", "location": "query"}, "country": {"type": "string", "location": "query"}, "cpksver": {"required": true, "type": "string", "location": "query"}, "source": {"required": true, "type": "string", "location": "query"}, "volumeIds": {"repeated": true, "type": "string", "location": "query"}}, "id": "books.myconfig.syncVolumeLicenses", "httpMethod": "POST", "path": "myconfig/syncVolumeLicenses", "response": {"$ref": "Volumes"}}}}', true)); @@ -571,7 +572,7 @@ public function __construct(apiClient $apiClient) { } } -class Annotation extends apiModel { +class Annotation extends Model { public $kind; public $updated; public $created; @@ -684,7 +685,7 @@ public function getSelfLink() { } } -class AnnotationClientVersionRanges extends apiModel { +class AnnotationClientVersionRanges extends Model { public $contentVersion; protected $__gbTextRangeType = 'BooksAnnotationsRange'; protected $__gbTextRangeDataType = ''; @@ -721,7 +722,7 @@ public function getGbImageRange() { } } -class AnnotationCurrentVersionRanges extends apiModel { +class AnnotationCurrentVersionRanges extends Model { public $contentVersion; protected $__gbTextRangeType = 'BooksAnnotationsRange'; protected $__gbTextRangeDataType = ''; @@ -758,7 +759,7 @@ public function getGbImageRange() { } } -class Annotations extends apiModel { +class Annotations extends Model { public $nextPageToken; protected $__itemsType = 'Annotation'; protected $__itemsDataType = 'array'; @@ -792,7 +793,7 @@ public function getTotalItems() { } } -class BooksAnnotationsRange extends apiModel { +class BooksAnnotationsRange extends Model { public $startPosition; public $endPosition; public $startOffset; @@ -823,7 +824,7 @@ public function getEndOffset() { } } -class Bookshelf extends apiModel { +class Bookshelf extends Model { public $kind; public $description; public $created; @@ -896,7 +897,7 @@ public function getSelfLink() { } } -class Bookshelves extends apiModel { +class Bookshelves extends Model { protected $__itemsType = 'Bookshelf'; protected $__itemsDataType = 'array'; public $items; @@ -916,7 +917,7 @@ public function getKind() { } } -class ConcurrentAccessRestriction extends apiModel { +class ConcurrentAccessRestriction extends Model { public $nonce; public $kind; public $restricted; @@ -996,7 +997,7 @@ public function getMessage() { } } -class DownloadAccessRestriction extends apiModel { +class DownloadAccessRestriction extends Model { public $nonce; public $kind; public $justAcquired; @@ -1083,7 +1084,7 @@ public function getMessage() { } } -class DownloadAccesses extends apiModel { +class DownloadAccesses extends Model { protected $__downloadAccessListType = 'DownloadAccessRestriction'; protected $__downloadAccessListDataType = 'array'; public $downloadAccessList; @@ -1103,7 +1104,7 @@ public function getKind() { } } -class ReadingPosition extends apiModel { +class ReadingPosition extends Model { public $kind; public $gbImagePosition; public $epubCfiPosition; @@ -1155,7 +1156,7 @@ public function getGbTextPosition() { } } -class RequestAccess extends apiModel { +class RequestAccess extends Model { protected $__downloadAccessType = 'DownloadAccessRestriction'; protected $__downloadAccessDataType = ''; public $downloadAccess; @@ -1183,7 +1184,7 @@ public function getConcurrentAccess() { } } -class Review extends apiModel { +class Review extends Model { public $rating; public $kind; protected $__authorType = 'ReviewAuthor'; @@ -1260,7 +1261,7 @@ public function getFullTextUrl() { } } -class ReviewAuthor extends apiModel { +class ReviewAuthor extends Model { public $displayName; public function setDisplayName($displayName) { $this->displayName = $displayName; @@ -1270,7 +1271,7 @@ public function getDisplayName() { } } -class ReviewSource extends apiModel { +class ReviewSource extends Model { public $extraDescription; public $url; public $description; @@ -1294,7 +1295,7 @@ public function getDescription() { } } -class Volume extends apiModel { +class Volume extends Model { public $kind; protected $__accessInfoType = 'VolumeAccessInfo'; protected $__accessInfoDataType = ''; @@ -1361,7 +1362,7 @@ public function getSelfLink() { } } -class VolumeAccessInfo extends apiModel { +class VolumeAccessInfo extends Model { public $publicDomain; public $embeddable; protected $__downloadAccessType = 'DownloadAccessRestriction'; @@ -1433,7 +1434,7 @@ public function getAccessViewStatus() { } } -class VolumeAccessInfoEpub extends apiModel { +class VolumeAccessInfoEpub extends Model { public $downloadLink; public $acsTokenLink; public function setDownloadLink($downloadLink) { @@ -1450,7 +1451,7 @@ public function getAcsTokenLink() { } } -class VolumeAccessInfoPdf extends apiModel { +class VolumeAccessInfoPdf extends Model { public $downloadLink; public $acsTokenLink; public function setDownloadLink($downloadLink) { @@ -1467,7 +1468,7 @@ public function getAcsTokenLink() { } } -class VolumeSaleInfo extends apiModel { +class VolumeSaleInfo extends Model { public $country; protected $__retailPriceType = 'VolumeSaleInfoRetailPrice'; protected $__retailPriceDataType = ''; @@ -1523,7 +1524,7 @@ public function getListPrice() { } } -class VolumeSaleInfoListPrice extends apiModel { +class VolumeSaleInfoListPrice extends Model { public $amount; public $currencyCode; public function setAmount($amount) { @@ -1540,7 +1541,7 @@ public function getCurrencyCode() { } } -class VolumeSaleInfoRetailPrice extends apiModel { +class VolumeSaleInfoRetailPrice extends Model { public $amount; public $currencyCode; public function setAmount($amount) { @@ -1557,7 +1558,7 @@ public function getCurrencyCode() { } } -class VolumeUserInfo extends apiModel { +class VolumeUserInfo extends Model { public $updated; public $isPreordered; public $isPurchased; @@ -1599,7 +1600,7 @@ public function getReview() { } } -class VolumeVolumeInfo extends apiModel { +class VolumeVolumeInfo extends Model { public $publisher; public $subtitle; public $description; @@ -1751,7 +1752,7 @@ public function getAverageRating() { } } -class VolumeVolumeInfoDimensions extends apiModel { +class VolumeVolumeInfoDimensions extends Model { public $width; public $thickness; public $height; @@ -1775,7 +1776,7 @@ public function getHeight() { } } -class VolumeVolumeInfoImageLinks extends apiModel { +class VolumeVolumeInfoImageLinks extends Model { public $medium; public $smallThumbnail; public $large; @@ -1820,7 +1821,7 @@ public function getThumbnail() { } } -class VolumeVolumeInfoIndustryIdentifiers extends apiModel { +class VolumeVolumeInfoIndustryIdentifiers extends Model { public $identifier; public $type; public function setIdentifier($identifier) { @@ -1837,7 +1838,7 @@ public function getType() { } } -class Volumes extends apiModel { +class Volumes extends Model { public $totalItems; protected $__itemsType = 'Volume'; protected $__itemsDataType = 'array'; diff --git a/src/GoogleApi/contrib/apiCalendarService.php b/src/GoogleApi/Contrib/apiCalendarService.php similarity index 97% rename from src/GoogleApi/contrib/apiCalendarService.php rename to src/GoogleApi/Contrib/apiCalendarService.php index e2991f9..2ca87ab 100644 --- a/src/GoogleApi/contrib/apiCalendarService.php +++ b/src/GoogleApi/Contrib/apiCalendarService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "freebusy" collection of methods. @@ -28,7 +29,7 @@ * $freebusy = $calendarService->freebusy; * */ - class FreebusyServiceResource extends apiServiceResource { + class FreebusyServiceResource extends ServiceResource { /** @@ -57,7 +58,7 @@ public function query(FreeBusyRequest $postBody, $optParams = array()) { * $settings = $calendarService->settings; * */ - class SettingsServiceResource extends apiServiceResource { + class SettingsServiceResource extends ServiceResource { /** @@ -101,7 +102,7 @@ public function get($setting, $optParams = array()) { * $calendarList = $calendarService->calendarList; * */ - class CalendarListServiceResource extends apiServiceResource { + class CalendarListServiceResource extends ServiceResource { /** @@ -213,7 +214,7 @@ public function delete($calendarId, $optParams = array()) { * $calendars = $calendarService->calendars; * */ - class CalendarsServiceResource extends apiServiceResource { + class CalendarsServiceResource extends ServiceResource { /** @@ -315,7 +316,7 @@ public function delete($calendarId, $optParams = array()) { * $acl = $calendarService->acl; * */ - class AclServiceResource extends apiServiceResource { + class AclServiceResource extends ServiceResource { /** @@ -426,7 +427,7 @@ public function delete($calendarId, $ruleId, $optParams = array()) { * $colors = $calendarService->colors; * */ - class ColorsServiceResource extends apiServiceResource { + class ColorsServiceResource extends ServiceResource { /** @@ -454,7 +455,7 @@ public function get($optParams = array()) { * $events = $calendarService->events; * */ - class EventsServiceResource extends apiServiceResource { + class EventsServiceResource extends ServiceResource { /** @@ -707,7 +708,7 @@ public function delete($calendarId, $eventId, $optParams = array()) { * * @author Google, Inc. */ -class apiCalendarService extends apiService { +class apiCalendarService extends Service { public $freebusy; public $settings; public $calendarList; @@ -718,15 +719,15 @@ class apiCalendarService extends apiService { /** * Constructs the internal representation of the Calendar service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/calendar/v3/'; $this->version = 'v3'; $this->serviceName = 'calendar'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->freebusy = new FreebusyServiceResource($this, $this->serviceName, 'freebusy', json_decode('{"methods": {"query": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "request": {"$ref": "FreeBusyRequest"}, "response": {"$ref": "FreeBusyResponse"}, "httpMethod": "POST", "path": "freeBusy", "id": "calendar.freebusy.query"}}}', true)); $this->settings = new SettingsServiceResource($this, $this->serviceName, 'settings', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "id": "calendar.settings.list", "httpMethod": "GET", "path": "users/me/settings", "response": {"$ref": "Settings"}}, "get": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "parameters": {"setting": {"required": true, "type": "string", "location": "path"}}, "id": "calendar.settings.get", "httpMethod": "GET", "path": "users/me/settings/{setting}", "response": {"$ref": "Setting"}}}}', true)); $this->calendarList = new CalendarListServiceResource($this, $this->serviceName, 'calendarList', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/calendar"], "request": {"$ref": "CalendarListEntry"}, "response": {"$ref": "CalendarListEntry"}, "httpMethod": "POST", "path": "users/me/calendarList", "id": "calendar.calendarList.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "id": "calendar.calendarList.get", "httpMethod": "GET", "path": "users/me/calendarList/{calendarId}", "response": {"$ref": "CalendarListEntry"}}, "list": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "showHidden": {"type": "boolean", "location": "query"}, "maxResults": {"format": "int32", "minimum": "1", "type": "integer", "location": "query"}, "minAccessRole": {"enum": ["freeBusyReader", "owner", "reader", "writer"], "type": "string", "location": "query"}}, "response": {"$ref": "CalendarList"}, "httpMethod": "GET", "path": "users/me/calendarList", "id": "calendar.calendarList.list"}, "update": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "CalendarListEntry"}, "id": "calendar.calendarList.update", "httpMethod": "PUT", "path": "users/me/calendarList/{calendarId}", "response": {"$ref": "CalendarListEntry"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "CalendarListEntry"}, "id": "calendar.calendarList.patch", "httpMethod": "PATCH", "path": "users/me/calendarList/{calendarId}", "response": {"$ref": "CalendarListEntry"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "users/me/calendarList/{calendarId}", "id": "calendar.calendarList.delete"}}}', true)); @@ -737,7 +738,7 @@ public function __construct(apiClient $apiClient) { } } -class Acl extends apiModel { +class Acl extends Model { public $nextPageToken; protected $__itemsType = 'AclRule'; protected $__itemsDataType = 'array'; @@ -771,7 +772,7 @@ public function getEtag() { } } -class AclRule extends apiModel { +class AclRule extends Model { protected $__scopeType = 'AclRuleScope'; protected $__scopeDataType = ''; public $scope; @@ -811,7 +812,7 @@ public function getId() { } } -class AclRuleScope extends apiModel { +class AclRuleScope extends Model { public $type; public $value; public function setType($type) { @@ -828,7 +829,7 @@ public function getValue() { } } -class Calendar extends apiModel { +class Calendar extends Model { public $kind; public $description; public $summary; @@ -880,7 +881,7 @@ public function getId() { } } -class CalendarList extends apiModel { +class CalendarList extends Model { public $nextPageToken; protected $__itemsType = 'CalendarListEntry'; protected $__itemsDataType = 'array'; @@ -914,7 +915,7 @@ public function getEtag() { } } -class CalendarListEntry extends apiModel { +class CalendarListEntry extends Model { public $kind; protected $__defaultRemindersType = 'EventReminder'; protected $__defaultRemindersDataType = 'array'; @@ -1011,7 +1012,7 @@ public function getId() { } } -class ColorDefinition extends apiModel { +class ColorDefinition extends Model { public $foreground; public $background; public function setForeground($foreground) { @@ -1028,7 +1029,7 @@ public function getBackground() { } } -class Colors extends apiModel { +class Colors extends Model { protected $__calendarType = 'ColorDefinition'; protected $__calendarDataType = 'map'; public $calendar; @@ -1063,7 +1064,7 @@ public function getKind() { } } -class Error extends apiModel { +class Error extends Model { public $domain; public $reason; public function setDomain($domain) { @@ -1080,7 +1081,7 @@ public function getReason() { } } -class Event extends apiModel { +class Event extends Model { protected $__creatorType = 'EventCreator'; protected $__creatorDataType = ''; public $creator; @@ -1327,7 +1328,7 @@ public function getPrivateCopy() { } } -class EventAttendee extends apiModel { +class EventAttendee extends Model { public $comment; public $displayName; public $self; @@ -1393,7 +1394,7 @@ public function getEmail() { } } -class EventCreator extends apiModel { +class EventCreator extends Model { public $displayName; public $email; public function setDisplayName($displayName) { @@ -1410,7 +1411,7 @@ public function getEmail() { } } -class EventDateTime extends apiModel { +class EventDateTime extends Model { public $date; public $timeZone; public $dateTime; @@ -1434,7 +1435,7 @@ public function getDateTime() { } } -class EventExtendedProperties extends apiModel { +class EventExtendedProperties extends Model { public $shared; public $private; public function setShared($shared) { @@ -1451,7 +1452,7 @@ public function getPrivate() { } } -class EventGadget extends apiModel { +class EventGadget extends Model { public $preferences; public $title; public $height; @@ -1510,7 +1511,7 @@ public function getIconLink() { } } -class EventOrganizer extends apiModel { +class EventOrganizer extends Model { public $displayName; public $email; public function setDisplayName($displayName) { @@ -1527,7 +1528,7 @@ public function getEmail() { } } -class EventReminder extends apiModel { +class EventReminder extends Model { public $minutes; public $method; public function setMinutes($minutes) { @@ -1544,7 +1545,7 @@ public function getMethod() { } } -class EventReminders extends apiModel { +class EventReminders extends Model { protected $__overridesType = 'EventReminder'; protected $__overridesDataType = 'array'; public $overrides; @@ -1564,7 +1565,7 @@ public function getUseDefault() { } } -class Events extends apiModel { +class Events extends Model { public $nextPageToken; public $kind; protected $__defaultRemindersType = 'EventReminder'; @@ -1643,7 +1644,7 @@ public function getAccessRole() { } } -class FreeBusyCalendar extends apiModel { +class FreeBusyCalendar extends Model { protected $__busyType = 'TimePeriod'; protected $__busyDataType = 'array'; public $busy; @@ -1666,7 +1667,7 @@ public function getErrors() { } } -class FreeBusyGroup extends apiModel { +class FreeBusyGroup extends Model { protected $__errorsType = 'Error'; protected $__errorsDataType = 'array'; public $errors; @@ -1687,7 +1688,7 @@ public function getCalendars() { } } -class FreeBusyRequest extends apiModel { +class FreeBusyRequest extends Model { public $calendarExpansionMax; public $groupExpansionMax; public $timeMax; @@ -1735,7 +1736,7 @@ public function getTimeZone() { } } -class FreeBusyRequestItem extends apiModel { +class FreeBusyRequestItem extends Model { public $id; public function setId($id) { $this->id = $id; @@ -1745,7 +1746,7 @@ public function getId() { } } -class FreeBusyResponse extends apiModel { +class FreeBusyResponse extends Model { public $timeMax; public $kind; protected $__calendarsType = 'FreeBusyCalendar'; @@ -1787,7 +1788,7 @@ public function getGroups() { } } -class Setting extends apiModel { +class Setting extends Model { public $kind; public $etag; public $id; @@ -1818,7 +1819,7 @@ public function getValue() { } } -class Settings extends apiModel { +class Settings extends Model { protected $__itemsType = 'Setting'; protected $__itemsDataType = 'array'; public $items; @@ -1845,7 +1846,7 @@ public function getEtag() { } } -class TimePeriod extends apiModel { +class TimePeriod extends Model { public $start; public $end; public function setStart($start) { diff --git a/src/GoogleApi/contrib/apiCustomsearchService.php b/src/GoogleApi/Contrib/apiCustomsearchService.php similarity index 94% rename from src/GoogleApi/contrib/apiCustomsearchService.php rename to src/GoogleApi/Contrib/apiCustomsearchService.php index 0a64e8a..67da2b3 100644 --- a/src/GoogleApi/contrib/apiCustomsearchService.php +++ b/src/GoogleApi/Contrib/apiCustomsearchService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "cse" collection of methods. @@ -28,7 +29,7 @@ * $cse = $customsearchService->cse; * */ - class CseServiceResource extends apiServiceResource { + class CseServiceResource extends ServiceResource { /** @@ -79,25 +80,25 @@ public function listCse($q, $optParams = array()) { * * @author Google, Inc. */ -class apiCustomsearchService extends apiService { +class apiCustomsearchService extends Service { public $cse; /** * Constructs the internal representation of the Customsearch service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/customsearch/'; $this->version = 'v1'; $this->serviceName = 'customsearch'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->cse = new CseServiceResource($this, $this->serviceName, 'cse', json_decode('{"methods": {"list": {"parameters": {"sort": {"type": "string", "location": "query"}, "filter": {"enum": ["0", "1"], "type": "string", "location": "query"}, "cx": {"type": "string", "location": "query"}, "googlehost": {"type": "string", "location": "query"}, "safe": {"default": "off", "enum": ["high", "medium", "off"], "location": "query", "type": "string"}, "q": {"required": true, "type": "string", "location": "query"}, "start": {"type": "string", "location": "query"}, "num": {"default": "10", "type": "string", "location": "query"}, "lr": {"enum": ["lang_ar", "lang_bg", "lang_ca", "lang_cs", "lang_da", "lang_de", "lang_el", "lang_en", "lang_es", "lang_et", "lang_fi", "lang_fr", "lang_hr", "lang_hu", "lang_id", "lang_is", "lang_it", "lang_iw", "lang_ja", "lang_ko", "lang_lt", "lang_lv", "lang_nl", "lang_no", "lang_pl", "lang_pt", "lang_ro", "lang_ru", "lang_sk", "lang_sl", "lang_sr", "lang_sv", "lang_tr", "lang_zh-CN", "lang_zh-TW"], "type": "string", "location": "query"}, "cr": {"type": "string", "location": "query"}, "gl": {"type": "string", "location": "query"}, "cref": {"type": "string", "location": "query"}}, "id": "search.cse.list", "httpMethod": "GET", "path": "v1", "response": {"$ref": "Search"}}}}', true)); } } -class Context extends apiModel { +class Context extends Model { protected $__facetsType = 'ContextFacets'; protected $__facetsDataType = 'array'; public $facets; @@ -117,7 +118,7 @@ public function getTitle() { } } -class ContextFacets extends apiModel { +class ContextFacets extends Model { public $anchor; public $label; public function setAnchor($anchor) { @@ -134,7 +135,7 @@ public function getLabel() { } } -class Promotion extends apiModel { +class Promotion extends Model { public $link; public $displayLink; protected $__imageType = 'PromotionImage'; @@ -177,7 +178,7 @@ public function getTitle() { } } -class PromotionBodyLines extends apiModel { +class PromotionBodyLines extends Model { public $url; public $link; public $title; @@ -201,7 +202,7 @@ public function getTitle() { } } -class PromotionImage extends apiModel { +class PromotionImage extends Model { public $source; public $width; public $height; @@ -225,7 +226,7 @@ public function getHeight() { } } -class Query extends apiModel { +class Query extends Model { public $count; public $sort; public $outputEncoding; @@ -347,7 +348,7 @@ public function getCref() { } } -class Result extends apiModel { +class Result extends Model { public $kind; public $title; public $displayLink; @@ -413,7 +414,7 @@ public function getHtmlTitle() { } } -class Search extends apiModel { +class Search extends Model { protected $__promotionsType = 'Promotion'; protected $__promotionsDataType = 'array'; public $promotions; @@ -470,7 +471,7 @@ public function getQueries() { } } -class SearchUrl extends apiModel { +class SearchUrl extends Model { public $type; public $template; public function setType($type) { diff --git a/src/GoogleApi/contrib/apiDriveService.php b/src/GoogleApi/Contrib/apiDriveService.php similarity index 94% rename from src/GoogleApi/contrib/apiDriveService.php rename to src/GoogleApi/Contrib/apiDriveService.php index 5efcbf6..b365fd5 100644 --- a/src/GoogleApi/contrib/apiDriveService.php +++ b/src/GoogleApi/Contrib/apiDriveService.php @@ -15,6 +15,11 @@ * the License. */ +namespace GoogleApi\Contrib; + +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "files" collection of methods. @@ -24,7 +29,7 @@ * $files = $driveService->files; * */ - class FilesServiceResource extends apiServiceResource { + class FilesServiceResource extends ServiceResource { /** @@ -33,7 +38,7 @@ class FilesServiceResource extends apiServiceResource { * @param DriveFile $postBody * @return DriveFile */ - public function insert(com.google.drive.model.DriveFile $postBody, $optParams = array()) { + public function insert(DriveFile $postBody, $optParams = array()) { $params = array('postBody' => $postBody); $params = array_merge($params, $optParams); $data = $this->__call('insert', array($params)); @@ -55,7 +60,7 @@ public function insert(com.google.drive.model.DriveFile $postBody, $optParams = * @opt_param bool newRevision Whether a blob upload should create a new revision. If not set or false, the blob data in the current head revision will be replaced. * @return DriveFile */ - public function patch($id, com.google.drive.model.DriveFile $postBody, $optParams = array()) { + public function patch($id, DriveFile $postBody, $optParams = array()) { $params = array('id' => $id, 'postBody' => $postBody); $params = array_merge($params, $optParams); $data = $this->__call('patch', array($params)); @@ -77,7 +82,7 @@ public function patch($id, com.google.drive.model.DriveFile $postBody, $optParam * @opt_param bool newRevision Whether a blob upload should create a new revision. If not set or false, the blob data in the current head revision will be replaced. * @return DriveFile */ - public function update($id, com.google.drive.model.DriveFile $postBody, $optParams = array()) { + public function update($id, DriveFile $postBody, $optParams = array()) { $params = array('id' => $id, 'postBody' => $postBody); $params = array_merge($params, $optParams); $data = $this->__call('update', array($params)); @@ -123,26 +128,26 @@ public function get($id, $optParams = array()) { * * @author Google, Inc. */ -class apiDriveService extends apiService { +class apiDriveService extends Service { public $files; /** * Constructs the internal representation of the Drive service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/drive/v1/'; $this->version = 'v1'; $this->serviceName = 'drive'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->files = new FilesServiceResource($this, $this->serviceName, 'files', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/drive.file"], "mediaUpload": {"maxSize": "10GB", "accept": ["*/*"], "protocols": {"simple": {"path": "/upload/drive/v1/files", "multipart": true}, "resumable": {"path": "/resumable/upload/drive/v1/files", "multipart": true}}}, "request": {"$ref": "File"}, "response": {"$ref": "File"}, "httpMethod": "POST", "path": "files", "id": "drive.files.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/drive.file"], "parameters": {"updateViewedDate": {"default": "true", "type": "boolean", "location": "query"}, "id": {"required": true, "type": "string", "location": "path"}, "projection": {"enum": ["BASIC", "FULL"], "type": "string", "location": "query"}}, "id": "drive.files.get", "httpMethod": "GET", "path": "files/{id}", "response": {"$ref": "File"}}, "update": {"scopes": ["https://www.googleapis.com/auth/drive.file"], "parameters": {"updateViewedDate": {"default": "true", "type": "boolean", "location": "query"}, "updateModifiedDate": {"default": "false", "type": "boolean", "location": "query"}, "id": {"required": true, "type": "string", "location": "path"}, "newRevision": {"default": "true", "type": "boolean", "location": "query"}}, "mediaUpload": {"maxSize": "10GB", "accept": ["*/*"], "protocols": {"simple": {"path": "/upload/drive/v1/files/{id}", "multipart": true}, "resumable": {"path": "/resumable/upload/drive/v1/files/{id}", "multipart": true}}}, "request": {"$ref": "File"}, "id": "drive.files.update", "httpMethod": "PUT", "path": "files/{id}", "response": {"$ref": "File"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/drive.file"], "parameters": {"updateViewedDate": {"default": "true", "type": "boolean", "location": "query"}, "updateModifiedDate": {"default": "false", "type": "boolean", "location": "query"}, "id": {"required": true, "type": "string", "location": "path"}, "newRevision": {"default": "true", "type": "boolean", "location": "query"}}, "request": {"$ref": "File"}, "id": "drive.files.patch", "httpMethod": "PATCH", "path": "files/{id}", "response": {"$ref": "File"}}}}', true)); } } -class DriveFile extends apiModel { +class DriveFile extends Model { public $mimeType; public $selfLink; public $kind; @@ -287,7 +292,7 @@ public function getModifiedDate() { } } -class DriveFileIndexableText extends apiModel { +class DriveFileIndexableText extends Model { public $text; public function setText($text) { $this->text = $text; @@ -297,7 +302,7 @@ public function getText() { } } -class DriveFileLabels extends apiModel { +class DriveFileLabels extends Model { public $hidden; public $starred; public $trashed; @@ -321,7 +326,7 @@ public function getTrashed() { } } -class DriveFileParentsCollection extends apiModel { +class DriveFileParentsCollection extends Model { public $parentLink; public $id; public function setParentLink($parentLink) { @@ -338,7 +343,7 @@ public function getId() { } } -class Permission extends apiModel { +class Permission extends Model { public $type; public $kind; public $etag; diff --git a/src/GoogleApi/contrib/apiFreebaseService.php b/src/GoogleApi/Contrib/apiFreebaseService.php similarity index 92% rename from src/GoogleApi/contrib/apiFreebaseService.php rename to src/GoogleApi/Contrib/apiFreebaseService.php index e786440..0689523 100644 --- a/src/GoogleApi/contrib/apiFreebaseService.php +++ b/src/GoogleApi/Contrib/apiFreebaseService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "text" collection of methods. @@ -28,7 +29,7 @@ * $text = $freebaseService->text; * */ - class TextServiceResource extends apiServiceResource { + class TextServiceResource extends ServiceResource { /** @@ -62,7 +63,7 @@ public function get($id, $optParams = array()) { * $mqlread = $freebaseService->mqlread; * */ - class MqlreadServiceResource extends apiServiceResource { + class MqlreadServiceResource extends ServiceResource { /** * Performs MQL Queries. (mqlread.mqlread) * @@ -96,7 +97,7 @@ public function mqlread($query, $optParams = array()) { * $image = $freebaseService->image; * */ - class ImageServiceResource extends apiServiceResource { + class ImageServiceResource extends ServiceResource { /** * Returns the scaled/cropped image attached to a freebase node. (image.image) * @@ -133,29 +134,29 @@ public function image($id, $optParams = array()) { * * @author Google, Inc. */ -class apiFreebaseService extends apiService { +class apiFreebaseService extends Service { public $mqlread; public $image; public $text; /** * Constructs the internal representation of the Freebase service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/freebase/v1/'; $this->version = 'v1'; $this->serviceName = 'freebase'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->text = new TextServiceResource($this, $this->serviceName, 'text', json_decode('{"methods": {"get": {"parameters": {"format": {"default": "plain", "enum": ["html", "plain", "raw"], "location": "query", "type": "string"}, "id": {"repeated": true, "required": true, "type": "string", "location": "path"}, "maxlength": {"format": "uint32", "type": "integer", "location": "query"}}, "id": "freebase.text.get", "httpMethod": "GET", "path": "text{/id*}", "response": {"$ref": "ContentserviceGet"}}}}', true)); $this->mqlread = new MqlreadServiceResource($this, $this->serviceName, 'mqlread', json_decode('{"httpMethod": "GET", "parameters": {"lang": {"default": "/lang/en", "type": "string", "location": "query"}, "cursor": {"type": "string", "location": "query"}, "indent": {"format": "uint32", "default": "0", "maximum": "10", "location": "query", "type": "integer"}, "uniqueness_failure": {"default": "hard", "enum": ["hard", "soft"], "location": "query", "type": "string"}, "dateline": {"type": "string", "location": "query"}, "html_escape": {"default": "true", "type": "boolean", "location": "query"}, "callback": {"type": "string", "location": "query"}, "cost": {"default": "false", "type": "boolean", "location": "query"}, "query": {"required": true, "type": "string", "location": "query"}, "as_of_time": {"type": "string", "location": "query"}}, "path": "mqlread", "id": "freebase.mqlread"}', true)); $this->image = new ImageServiceResource($this, $this->serviceName, 'image', json_decode('{"httpMethod": "GET", "parameters": {"maxwidth": {"format": "uint32", "type": "integer", "location": "query", "maximum": "4096"}, "maxheight": {"format": "uint32", "type": "integer", "location": "query", "maximum": "4096"}, "fallbackid": {"default": "/freebase/no_image_png", "type": "string", "location": "query"}, "pad": {"default": "false", "type": "boolean", "location": "query"}, "mode": {"default": "fit", "enum": ["fill", "fillcrop", "fillcropmid", "fit"], "location": "query", "type": "string"}, "id": {"repeated": true, "required": true, "type": "string", "location": "path"}}, "path": "image{/id*}", "id": "freebase.image"}', true)); } } -class ContentserviceGet extends apiModel { +class ContentserviceGet extends Model { public $result; public function setResult($result) { $this->result = $result; diff --git a/src/GoogleApi/contrib/apiGanService.php b/src/GoogleApi/Contrib/apiGanService.php similarity index 98% rename from src/GoogleApi/contrib/apiGanService.php rename to src/GoogleApi/Contrib/apiGanService.php index 13e2125..e9f40fc 100644 --- a/src/GoogleApi/contrib/apiGanService.php +++ b/src/GoogleApi/Contrib/apiGanService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "advertisers" collection of methods. @@ -28,7 +29,7 @@ * $advertisers = $ganService->advertisers; * */ - class AdvertisersServiceResource extends apiServiceResource { + class AdvertisersServiceResource extends ServiceResource { /** @@ -90,7 +91,7 @@ public function get($role, $roleId, $optParams = array()) { * $ccOffers = $ganService->ccOffers; * */ - class CcOffersServiceResource extends apiServiceResource { + class CcOffersServiceResource extends ServiceResource { /** @@ -123,7 +124,7 @@ public function listCcOffers($publisher, $optParams = array()) { * $events = $ganService->events; * */ - class EventsServiceResource extends apiServiceResource { + class EventsServiceResource extends ServiceResource { /** @@ -169,7 +170,7 @@ public function listEvents($role, $roleId, $optParams = array()) { * $publishers = $ganService->publishers; * */ - class PublishersServiceResource extends apiServiceResource { + class PublishersServiceResource extends ServiceResource { /** @@ -239,7 +240,7 @@ public function get($role, $roleId, $optParams = array()) { * * @author Google, Inc. */ -class apiGanService extends apiService { +class apiGanService extends Service { public $advertisers; public $ccOffers; public $events; @@ -247,15 +248,15 @@ class apiGanService extends apiService { /** * Constructs the internal representation of the Gan service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/gan/v1beta1/'; $this->version = 'v1beta1'; $this->serviceName = 'gan'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->advertisers = new AdvertisersServiceResource($this, $this->serviceName, 'advertisers', json_decode('{"methods": {"list": {"parameters": {"relationshipStatus": {"enum": ["approved", "available", "deactivated", "declined", "pending"], "type": "string", "location": "query"}, "minSevenDayEpc": {"format": "double", "type": "number", "location": "query"}, "advertiserCategory": {"type": "string", "location": "query"}, "minNinetyDayEpc": {"format": "double", "type": "number", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "role": {"required": true, "enum": ["advertisers", "publishers"], "location": "path", "type": "string"}, "maxResults": {"format": "uint32", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}, "roleId": {"required": true, "type": "string", "location": "path"}, "minPayoutRank": {"format": "int32", "maximum": "4", "minimum": "1", "location": "query", "type": "integer"}}, "id": "gan.advertisers.list", "httpMethod": "GET", "path": "{role}/{roleId}/advertisers", "response": {"$ref": "Advertisers"}}, "get": {"parameters": {"advertiserId": {"type": "string", "location": "query"}, "roleId": {"required": true, "type": "string", "location": "path"}, "role": {"required": true, "enum": ["advertisers", "publishers"], "location": "path", "type": "string"}}, "id": "gan.advertisers.get", "httpMethod": "GET", "path": "{role}/{roleId}/advertiser", "response": {"$ref": "Advertiser"}}}}', true)); $this->ccOffers = new CcOffersServiceResource($this, $this->serviceName, 'ccOffers', json_decode('{"methods": {"list": {"parameters": {"advertiser": {"repeated": true, "type": "string", "location": "query"}, "projection": {"enum": ["full", "summary"], "type": "string", "location": "query"}, "publisher": {"required": true, "type": "string", "location": "path"}}, "id": "gan.ccOffers.list", "httpMethod": "GET", "path": "publishers/{publisher}/ccOffers", "response": {"$ref": "CcOffers"}}}}', true)); $this->events = new EventsServiceResource($this, $this->serviceName, 'events', json_decode('{"methods": {"list": {"parameters": {"orderId": {"type": "string", "location": "query"}, "sku": {"type": "string", "location": "query"}, "eventDateMax": {"type": "string", "location": "query"}, "linkId": {"type": "string", "location": "query"}, "eventDateMin": {"type": "string", "location": "query"}, "memberId": {"type": "string", "location": "query"}, "maxResults": {"format": "uint32", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}, "advertiserId": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "publisherId": {"type": "string", "location": "query"}, "status": {"enum": ["active", "canceled"], "type": "string", "location": "query"}, "productCategory": {"type": "string", "location": "query"}, "chargeType": {"enum": ["credit", "debit", "monthly_minimum", "other", "slotting_fee", "tier_bonus"], "type": "string", "location": "query"}, "roleId": {"required": true, "type": "string", "location": "path"}, "role": {"required": true, "enum": ["advertisers", "publishers"], "location": "path", "type": "string"}, "type": {"enum": ["action", "charge", "transaction"], "type": "string", "location": "query"}}, "id": "gan.events.list", "httpMethod": "GET", "path": "{role}/{roleId}/events", "response": {"$ref": "Events"}}}}', true)); @@ -263,7 +264,7 @@ public function __construct(apiClient $apiClient) { } } -class Advertiser extends apiModel { +class Advertiser extends Model { public $category; public $productFeedsEnabled; public $kind; @@ -391,7 +392,7 @@ public function getName() { } } -class Advertisers extends apiModel { +class Advertisers extends Model { public $nextPageToken; protected $__itemsType = 'Advertiser'; protected $__itemsDataType = 'array'; @@ -418,7 +419,7 @@ public function getKind() { } } -class CcOffer extends apiModel { +class CcOffer extends Model { public $rewardsHaveBlackoutDates; public $introPurchasePeriodLength; public $introBalanceTransferRate; @@ -1043,7 +1044,7 @@ public function getIntroBalanceTransferPeriodEndDate() { } } -class CcOfferBonusRewards extends apiModel { +class CcOfferBonusRewards extends Model { public $amount; public $details; public function setAmount($amount) { @@ -1060,7 +1061,7 @@ public function getDetails() { } } -class CcOfferDefaultFees extends apiModel { +class CcOfferDefaultFees extends Model { public $category; public $maxRate; public $minRate; @@ -1091,7 +1092,7 @@ public function getRateType() { } } -class CcOfferRewards extends apiModel { +class CcOfferRewards extends Model { public $category; public $minRewardTier; public $maxRewardTier; @@ -1136,7 +1137,7 @@ public function getAdditionalDetails() { } } -class CcOffers extends apiModel { +class CcOffers extends Model { protected $__itemsType = 'CcOffer'; protected $__itemsDataType = 'array'; public $items; @@ -1156,7 +1157,7 @@ public function getKind() { } } -class Event extends apiModel { +class Event extends Model { protected $__networkFeeType = 'Money'; protected $__networkFeeDataType = ''; public $networkFee; @@ -1296,7 +1297,7 @@ public function getEventDate() { } } -class EventProducts extends apiModel { +class EventProducts extends Model { protected $__networkFeeType = 'Money'; protected $__networkFeeDataType = ''; public $networkFee; @@ -1370,7 +1371,7 @@ public function getQuantity() { } } -class Events extends apiModel { +class Events extends Model { public $nextPageToken; protected $__itemsType = 'Event'; protected $__itemsDataType = 'array'; @@ -1397,7 +1398,7 @@ public function getKind() { } } -class Money extends apiModel { +class Money extends Model { public $amount; public $currencyCode; public function setAmount($amount) { @@ -1414,7 +1415,7 @@ public function getCurrencyCode() { } } -class Publisher extends apiModel { +class Publisher extends Model { public $status; public $kind; public $name; @@ -1501,7 +1502,7 @@ public function getId() { } } -class Publishers extends apiModel { +class Publishers extends Model { public $nextPageToken; protected $__itemsType = 'Publisher'; protected $__itemsDataType = 'array'; diff --git a/src/GoogleApi/contrib/apiGroupssettingsService.php b/src/GoogleApi/Contrib/apiGroupssettingsService.php similarity index 95% rename from src/GoogleApi/contrib/apiGroupssettingsService.php rename to src/GoogleApi/Contrib/apiGroupssettingsService.php index 5c2d9c8..57ebdd6 100644 --- a/src/GoogleApi/contrib/apiGroupssettingsService.php +++ b/src/GoogleApi/Contrib/apiGroupssettingsService.php @@ -15,6 +15,11 @@ * the License. */ +namespace GoogleApi\Contrib; + +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "groups" collection of methods. @@ -24,7 +29,7 @@ * $groups = $groupssettingsService->groups; * */ - class GroupsServiceResource extends apiServiceResource { + class GroupsServiceResource extends ServiceResource { /** @@ -93,26 +98,26 @@ public function get($groupUniqueId, $optParams = array()) { * * @author Google, Inc. */ -class apiGroupssettingsService extends apiService { +class apiGroupssettingsService extends Service { public $groups; /** * Constructs the internal representation of the Groupssettings service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/groups/v1/groups/'; $this->version = 'v1'; $this->serviceName = 'groupssettings'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->groups = new GroupsServiceResource($this, $this->serviceName, 'groups', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/apps.groups.settings"], "parameters": {"groupUniqueId": {"required": true, "type": "string", "location": "path"}}, "id": "groupsSettings.groups.get", "httpMethod": "GET", "path": "{groupUniqueId}", "response": {"$ref": "Groups"}}, "update": {"scopes": ["https://www.googleapis.com/auth/apps.groups.settings"], "parameters": {"groupUniqueId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Groups"}, "id": "groupsSettings.groups.update", "httpMethod": "PUT", "path": "{groupUniqueId}", "response": {"$ref": "Groups"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/apps.groups.settings"], "parameters": {"groupUniqueId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Groups"}, "id": "groupsSettings.groups.patch", "httpMethod": "PATCH", "path": "{groupUniqueId}", "response": {"$ref": "Groups"}}}}', true)); } } -class Groups extends apiModel { +class Groups extends Model { public $allowExternalMembers; public $whoCanJoin; public $primaryLanguage; diff --git a/src/GoogleApi/contrib/apiLatitudeService.php b/src/GoogleApi/Contrib/apiLatitudeService.php similarity index 95% rename from src/GoogleApi/contrib/apiLatitudeService.php rename to src/GoogleApi/Contrib/apiLatitudeService.php index 8fa9192..0fd7be6 100644 --- a/src/GoogleApi/contrib/apiLatitudeService.php +++ b/src/GoogleApi/Contrib/apiLatitudeService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "currentLocation" collection of methods. @@ -28,7 +29,7 @@ * $currentLocation = $latitudeService->currentLocation; * */ - class CurrentLocationServiceResource extends apiServiceResource { + class CurrentLocationServiceResource extends ServiceResource { /** @@ -85,7 +86,7 @@ public function delete($optParams = array()) { * $location = $latitudeService->location; * */ - class LocationServiceResource extends apiServiceResource { + class LocationServiceResource extends ServiceResource { /** @@ -173,27 +174,27 @@ public function delete($locationId, $optParams = array()) { * * @author Google, Inc. */ -class apiLatitudeService extends apiService { +class apiLatitudeService extends Service { public $currentLocation; public $location; /** * Constructs the internal representation of the Latitude service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/latitude/v1/'; $this->version = 'v1'; $this->serviceName = 'latitude'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->currentLocation = new CurrentLocationServiceResource($this, $this->serviceName, 'currentLocation', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city", "https://www.googleapis.com/auth/latitude.current.best", "https://www.googleapis.com/auth/latitude.current.city"], "request": {"$ref": "LatitudeCurrentlocationResourceJson"}, "response": {"$ref": "LatitudeCurrentlocationResourceJson"}, "httpMethod": "POST", "path": "currentLocation", "id": "latitude.currentLocation.insert"}, "delete": {"id": "latitude.currentLocation.delete", "path": "currentLocation", "httpMethod": "DELETE", "scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city", "https://www.googleapis.com/auth/latitude.current.best", "https://www.googleapis.com/auth/latitude.current.city"]}, "get": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city", "https://www.googleapis.com/auth/latitude.current.best", "https://www.googleapis.com/auth/latitude.current.city"], "parameters": {"granularity": {"type": "string", "location": "query"}}, "response": {"$ref": "LatitudeCurrentlocationResourceJson"}, "httpMethod": "GET", "path": "currentLocation", "id": "latitude.currentLocation.get"}}}', true)); $this->location = new LocationServiceResource($this, $this->serviceName, 'location', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "request": {"$ref": "Location"}, "response": {"$ref": "Location"}, "httpMethod": "POST", "path": "location", "id": "latitude.location.insert"}, "delete": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "parameters": {"locationId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "location/{locationId}", "id": "latitude.location.delete"}, "list": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "parameters": {"max-results": {"type": "string", "location": "query"}, "max-time": {"type": "string", "location": "query"}, "min-time": {"type": "string", "location": "query"}, "granularity": {"type": "string", "location": "query"}}, "response": {"$ref": "LocationFeed"}, "httpMethod": "GET", "path": "location", "id": "latitude.location.list"}, "get": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "parameters": {"locationId": {"required": true, "type": "string", "location": "path"}, "granularity": {"type": "string", "location": "query"}}, "id": "latitude.location.get", "httpMethod": "GET", "path": "location/{locationId}", "response": {"$ref": "Location"}}}}', true)); } } -class Location extends apiModel { +class Location extends Model { public $kind; public $altitude; public $longitude; @@ -266,7 +267,7 @@ public function getAccuracy() { } } -class LocationFeed extends apiModel { +class LocationFeed extends Model { protected $__itemsType = 'Location'; protected $__itemsDataType = 'array'; public $items; diff --git a/src/GoogleApi/contrib/apiModeratorService.php b/src/GoogleApi/Contrib/apiModeratorService.php similarity index 95% rename from src/GoogleApi/contrib/apiModeratorService.php rename to src/GoogleApi/Contrib/apiModeratorService.php index 33afc3d..2601a4b 100644 --- a/src/GoogleApi/contrib/apiModeratorService.php +++ b/src/GoogleApi/Contrib/apiModeratorService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "votes" collection of methods. @@ -28,7 +29,7 @@ * $votes = $moderatorService->votes; * */ - class VotesServiceResource extends apiServiceResource { + class VotesServiceResource extends ServiceResource { /** @@ -151,7 +152,7 @@ public function get($seriesId, $submissionId, $optParams = array()) { * $responses = $moderatorService->responses; * */ - class ResponsesServiceResource extends apiServiceResource { + class ResponsesServiceResource extends ServiceResource { /** @@ -214,7 +215,7 @@ public function listResponses($seriesId, $submissionId, $optParams = array()) { * $tags = $moderatorService->tags; * */ - class TagsServiceResource extends apiServiceResource { + class TagsServiceResource extends ServiceResource { /** @@ -276,7 +277,7 @@ public function delete($seriesId, $submissionId, $tagId, $optParams = array()) { * $series = $moderatorService->series; * */ - class SeriesServiceResource extends apiServiceResource { + class SeriesServiceResource extends ServiceResource { /** @@ -376,7 +377,7 @@ public function get($seriesId, $optParams = array()) { * $submissions = $moderatorService->submissions; * */ - class SeriesSubmissionsServiceResource extends apiServiceResource { + class SeriesSubmissionsServiceResource extends ServiceResource { /** @@ -415,7 +416,7 @@ public function listSeriesSubmissions($seriesId, $optParams = array()) { * $responses = $moderatorService->responses; * */ - class SeriesResponsesServiceResource extends apiServiceResource { + class SeriesResponsesServiceResource extends ServiceResource { /** @@ -452,7 +453,7 @@ public function listSeriesResponses($seriesId, $optParams = array()) { * $topics = $moderatorService->topics; * */ - class TopicsServiceResource extends apiServiceResource { + class TopicsServiceResource extends ServiceResource { /** @@ -540,7 +541,7 @@ public function get($seriesId, $topicId, $optParams = array()) { * $submissions = $moderatorService->submissions; * */ - class TopicsSubmissionsServiceResource extends apiServiceResource { + class TopicsSubmissionsServiceResource extends ServiceResource { /** @@ -580,7 +581,7 @@ public function listTopicsSubmissions($seriesId, $topicId, $optParams = array()) * $global = $moderatorService->global; * */ - class ModeratorGlobalServiceResource extends apiServiceResource { + class ModeratorGlobalServiceResource extends ServiceResource { } @@ -594,7 +595,7 @@ class ModeratorGlobalServiceResource extends apiServiceResource { * $series = $moderatorService->series; * */ - class ModeratorGlobalSeriesServiceResource extends apiServiceResource { + class ModeratorGlobalSeriesServiceResource extends ServiceResource { /** @@ -627,7 +628,7 @@ public function listModeratorGlobalSeries($optParams = array()) { * $profiles = $moderatorService->profiles; * */ - class ProfilesServiceResource extends apiServiceResource { + class ProfilesServiceResource extends ServiceResource { /** @@ -688,7 +689,7 @@ public function get($optParams = array()) { * $featured = $moderatorService->featured; * */ - class FeaturedServiceResource extends apiServiceResource { + class FeaturedServiceResource extends ServiceResource { } @@ -702,7 +703,7 @@ class FeaturedServiceResource extends apiServiceResource { * $series = $moderatorService->series; * */ - class FeaturedSeriesServiceResource extends apiServiceResource { + class FeaturedSeriesServiceResource extends ServiceResource { /** @@ -730,7 +731,7 @@ public function listFeaturedSeries($optParams = array()) { * $myrecent = $moderatorService->myrecent; * */ - class MyrecentServiceResource extends apiServiceResource { + class MyrecentServiceResource extends ServiceResource { } @@ -744,7 +745,7 @@ class MyrecentServiceResource extends apiServiceResource { * $series = $moderatorService->series; * */ - class MyrecentSeriesServiceResource extends apiServiceResource { + class MyrecentSeriesServiceResource extends ServiceResource { /** @@ -772,7 +773,7 @@ public function listMyrecentSeries($optParams = array()) { * $my = $moderatorService->my; * */ - class MyServiceResource extends apiServiceResource { + class MyServiceResource extends ServiceResource { } @@ -786,7 +787,7 @@ class MyServiceResource extends apiServiceResource { * $series = $moderatorService->series; * */ - class MySeriesServiceResource extends apiServiceResource { + class MySeriesServiceResource extends ServiceResource { /** @@ -814,7 +815,7 @@ public function listMySeries($optParams = array()) { * $submissions = $moderatorService->submissions; * */ - class SubmissionsServiceResource extends apiServiceResource { + class SubmissionsServiceResource extends ServiceResource { /** @@ -878,7 +879,7 @@ public function get($seriesId, $submissionId, $optParams = array()) { * * @author Google, Inc. */ -class apiModeratorService extends apiService { +class apiModeratorService extends Service { public $votes; public $responses; public $tags; @@ -909,15 +910,15 @@ class apiModeratorService extends apiService { /** * Constructs the internal representation of the Moderator service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/moderator/v1/'; $this->version = 'v1'; $this->serviceName = 'moderator'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->votes = new VotesServiceResource($this, $this->serviceName, 'votes', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "unauthToken": {"type": "string", "location": "query"}, "submissionId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}}, "request": {"$ref": "Vote"}, "id": "moderator.votes.insert", "httpMethod": "POST", "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", "response": {"$ref": "Vote"}}, "get": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "userId": {"type": "string", "location": "query"}, "unauthToken": {"type": "string", "location": "query"}, "submissionId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}}, "id": "moderator.votes.get", "httpMethod": "GET", "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", "response": {"$ref": "Vote"}}, "list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"max-results": {"format": "uint32", "type": "integer", "location": "query"}, "seriesId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "start-index": {"format": "uint32", "type": "integer", "location": "query"}}, "id": "moderator.votes.list", "httpMethod": "GET", "path": "series/{seriesId}/votes/@me", "response": {"$ref": "VoteList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "userId": {"type": "string", "location": "query"}, "unauthToken": {"type": "string", "location": "query"}, "submissionId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}}, "request": {"$ref": "Vote"}, "id": "moderator.votes.update", "httpMethod": "PUT", "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", "response": {"$ref": "Vote"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "userId": {"type": "string", "location": "query"}, "unauthToken": {"type": "string", "location": "query"}, "submissionId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}}, "request": {"$ref": "Vote"}, "id": "moderator.votes.patch", "httpMethod": "PATCH", "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", "response": {"$ref": "Vote"}}}}', true)); $this->responses = new ResponsesServiceResource($this, $this->serviceName, 'responses', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "parentSubmissionId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "unauthToken": {"type": "string", "location": "query"}, "anonymous": {"type": "boolean", "location": "query"}, "topicId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}}, "request": {"$ref": "Submission"}, "id": "moderator.responses.insert", "httpMethod": "POST", "path": "series/{seriesId}/topics/{topicId}/submissions/{parentSubmissionId}/responses", "response": {"$ref": "Submission"}}, "list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"max-results": {"format": "uint32", "type": "integer", "location": "query"}, "sort": {"type": "string", "location": "query"}, "seriesId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "author": {"type": "string", "location": "query"}, "start-index": {"format": "uint32", "type": "integer", "location": "query"}, "submissionId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "q": {"type": "string", "location": "query"}, "hasAttachedVideo": {"type": "boolean", "location": "query"}}, "id": "moderator.responses.list", "httpMethod": "GET", "path": "series/{seriesId}/submissions/{submissionId}/responses", "response": {"$ref": "SubmissionList"}}}}', true)); $this->tags = new TagsServiceResource($this, $this->serviceName, 'tags', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "submissionId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}}, "request": {"$ref": "Tag"}, "id": "moderator.tags.insert", "httpMethod": "POST", "path": "series/{seriesId}/submissions/{submissionId}/tags", "response": {"$ref": "Tag"}}, "list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "submissionId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}}, "id": "moderator.tags.list", "httpMethod": "GET", "path": "series/{seriesId}/submissions/{submissionId}/tags", "response": {"$ref": "TagList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "tagId": {"required": true, "type": "string", "location": "path"}, "submissionId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}}, "httpMethod": "DELETE", "path": "series/{seriesId}/submissions/{submissionId}/tags/{tagId}", "id": "moderator.tags.delete"}}}', true)); @@ -939,7 +940,7 @@ public function __construct(apiClient $apiClient) { } } -class ModeratorTopicsResourcePartial extends apiModel { +class ModeratorTopicsResourcePartial extends Model { protected $__idType = 'ModeratorTopicsResourcePartialId'; protected $__idDataType = ''; public $id; @@ -951,7 +952,7 @@ public function getId() { } } -class ModeratorTopicsResourcePartialId extends apiModel { +class ModeratorTopicsResourcePartialId extends Model { public $seriesId; public $topicId; public function setSeriesId($seriesId) { @@ -968,7 +969,7 @@ public function getTopicId() { } } -class ModeratorVotesResourcePartial extends apiModel { +class ModeratorVotesResourcePartial extends Model { public $vote; public $flag; public function setVote($vote) { @@ -985,7 +986,7 @@ public function getFlag() { } } -class Profile extends apiModel { +class Profile extends Model { public $kind; protected $__attributionType = 'ProfileAttribution'; protected $__attributionDataType = ''; @@ -1013,7 +1014,7 @@ public function getId() { } } -class ProfileAttribution extends apiModel { +class ProfileAttribution extends Model { protected $__geoType = 'ProfileAttributionGeo'; protected $__geoDataType = ''; public $geo; @@ -1046,7 +1047,7 @@ public function getAvatarUrl() { } } -class ProfileAttributionGeo extends apiModel { +class ProfileAttributionGeo extends Model { public $latitude; public $location; public $longitude; @@ -1070,7 +1071,7 @@ public function getLongitude() { } } -class ProfileId extends apiModel { +class ProfileId extends Model { public $user; public function setUser($user) { $this->user = $user; @@ -1080,7 +1081,7 @@ public function getUser() { } } -class Series extends apiModel { +class Series extends Model { public $kind; public $description; protected $__rulesType = 'SeriesRules'; @@ -1166,7 +1167,7 @@ public function getCounters() { } } -class SeriesCounters extends apiModel { +class SeriesCounters extends Model { public $users; public $noneVotes; public $videoSubmissions; @@ -1218,7 +1219,7 @@ public function getPlusVotes() { } } -class SeriesId extends apiModel { +class SeriesId extends Model { public $seriesId; public function setSeriesId($seriesId) { $this->seriesId = $seriesId; @@ -1228,7 +1229,7 @@ public function getSeriesId() { } } -class SeriesList extends apiModel { +class SeriesList extends Model { protected $__itemsType = 'Series'; protected $__itemsDataType = 'array'; public $items; @@ -1248,7 +1249,7 @@ public function getKind() { } } -class SeriesRules extends apiModel { +class SeriesRules extends Model { protected $__votesType = 'SeriesRulesVotes'; protected $__votesDataType = ''; public $votes; @@ -1269,7 +1270,7 @@ public function getSubmissions() { } } -class SeriesRulesSubmissions extends apiModel { +class SeriesRulesSubmissions extends Model { public $close; public $open; public function setClose($close) { @@ -1286,7 +1287,7 @@ public function getOpen() { } } -class SeriesRulesVotes extends apiModel { +class SeriesRulesVotes extends Model { public $close; public $open; public function setClose($close) { @@ -1303,7 +1304,7 @@ public function getOpen() { } } -class Submission extends apiModel { +class Submission extends Model { public $kind; protected $__attributionType = 'SubmissionAttribution'; protected $__attributionDataType = ''; @@ -1415,7 +1416,7 @@ public function getCounters() { } } -class SubmissionAttribution extends apiModel { +class SubmissionAttribution extends Model { public $displayName; public $location; public $avatarUrl; @@ -1439,7 +1440,7 @@ public function getAvatarUrl() { } } -class SubmissionCounters extends apiModel { +class SubmissionCounters extends Model { public $noneVotes; public $minusVotes; public $plusVotes; @@ -1463,7 +1464,7 @@ public function getPlusVotes() { } } -class SubmissionGeo extends apiModel { +class SubmissionGeo extends Model { public $latitude; public $location; public $longitude; @@ -1487,7 +1488,7 @@ public function getLongitude() { } } -class SubmissionId extends apiModel { +class SubmissionId extends Model { public $seriesId; public $submissionId; public function setSeriesId($seriesId) { @@ -1504,7 +1505,7 @@ public function getSubmissionId() { } } -class SubmissionList extends apiModel { +class SubmissionList extends Model { protected $__itemsType = 'Submission'; protected $__itemsDataType = 'array'; public $items; @@ -1524,7 +1525,7 @@ public function getKind() { } } -class SubmissionParentSubmissionId extends apiModel { +class SubmissionParentSubmissionId extends Model { public $seriesId; public $submissionId; public function setSeriesId($seriesId) { @@ -1541,7 +1542,7 @@ public function getSubmissionId() { } } -class SubmissionTranslations extends apiModel { +class SubmissionTranslations extends Model { public $lang; public $text; public function setLang($lang) { @@ -1558,7 +1559,7 @@ public function getText() { } } -class Tag extends apiModel { +class Tag extends Model { public $text; public $kind; protected $__idType = 'TagId'; @@ -1584,7 +1585,7 @@ public function getId() { } } -class TagId extends apiModel { +class TagId extends Model { public $seriesId; public $tagId; public $submissionId; @@ -1608,7 +1609,7 @@ public function getSubmissionId() { } } -class TagList extends apiModel { +class TagList extends Model { protected $__itemsType = 'Tag'; protected $__itemsDataType = 'array'; public $items; @@ -1628,7 +1629,7 @@ public function getKind() { } } -class Topic extends apiModel { +class Topic extends Model { public $kind; public $description; protected $__rulesType = 'TopicRules'; @@ -1695,7 +1696,7 @@ public function getName() { } } -class TopicCounters extends apiModel { +class TopicCounters extends Model { public $users; public $noneVotes; public $videoSubmissions; @@ -1740,7 +1741,7 @@ public function getPlusVotes() { } } -class TopicId extends apiModel { +class TopicId extends Model { public $seriesId; public $topicId; public function setSeriesId($seriesId) { @@ -1757,7 +1758,7 @@ public function getTopicId() { } } -class TopicList extends apiModel { +class TopicList extends Model { protected $__itemsType = 'Topic'; protected $__itemsDataType = 'array'; public $items; @@ -1777,7 +1778,7 @@ public function getKind() { } } -class TopicRules extends apiModel { +class TopicRules extends Model { protected $__votesType = 'TopicRulesVotes'; protected $__votesDataType = ''; public $votes; @@ -1798,7 +1799,7 @@ public function getSubmissions() { } } -class TopicRulesSubmissions extends apiModel { +class TopicRulesSubmissions extends Model { public $close; public $open; public function setClose($close) { @@ -1815,7 +1816,7 @@ public function getOpen() { } } -class TopicRulesVotes extends apiModel { +class TopicRulesVotes extends Model { public $close; public $open; public function setClose($close) { @@ -1832,7 +1833,7 @@ public function getOpen() { } } -class Vote extends apiModel { +class Vote extends Model { public $vote; public $flag; protected $__idType = 'VoteId'; @@ -1865,7 +1866,7 @@ public function getKind() { } } -class VoteId extends apiModel { +class VoteId extends Model { public $seriesId; public $submissionId; public function setSeriesId($seriesId) { @@ -1882,7 +1883,7 @@ public function getSubmissionId() { } } -class VoteList extends apiModel { +class VoteList extends Model { protected $__itemsType = 'Vote'; protected $__itemsDataType = 'array'; public $items; diff --git a/src/GoogleApi/contrib/apiOauth2Service.php b/src/GoogleApi/Contrib/apiOauth2Service.php similarity index 91% rename from src/GoogleApi/contrib/apiOauth2Service.php rename to src/GoogleApi/Contrib/apiOauth2Service.php index 2a9a15b..d4acb59 100644 --- a/src/GoogleApi/contrib/apiOauth2Service.php +++ b/src/GoogleApi/Contrib/apiOauth2Service.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "userinfo" collection of methods. @@ -28,7 +29,7 @@ * $userinfo = $oauth2Service->userinfo; * */ - class UserinfoServiceResource extends apiServiceResource { + class UserinfoServiceResource extends ServiceResource { /** @@ -57,7 +58,7 @@ public function get($optParams = array()) { * $v2 = $oauth2Service->v2; * */ - class UserinfoV2ServiceResource extends apiServiceResource { + class UserinfoV2ServiceResource extends ServiceResource { } @@ -71,7 +72,7 @@ class UserinfoV2ServiceResource extends apiServiceResource { * $me = $oauth2Service->me; * */ - class UserinfoV2MeServiceResource extends apiServiceResource { + class UserinfoV2MeServiceResource extends ServiceResource { /** @@ -100,7 +101,7 @@ public function get($optParams = array()) { * $tokeninfo = $oauth2Service->tokeninfo; * */ - class TokeninfoServiceResource extends apiServiceResource { + class TokeninfoServiceResource extends ServiceResource { /** * (tokeninfo.tokeninfo) * @@ -138,29 +139,29 @@ public function tokeninfo($optParams = array()) { * * @author Google, Inc. */ -class apiOauth2Service extends apiService { +class apiOauth2Service extends Service { public $tokeninfo; public $userinfo; public $userinfo_v2; /** * Constructs the internal representation of the Oauth2 service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/'; $this->version = 'v2'; $this->serviceName = 'oauth2'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->userinfo = new UserinfoServiceResource($this, $this->serviceName, 'userinfo', json_decode('{"methods": {"get": {"path": "oauth2/v2/userinfo", "response": {"$ref": "Userinfo"}, "httpMethod": "GET", "id": "oauth2.userinfo.get"}}}', true)); $this->userinfo_v2 = new UserinfoV2ServiceResource($this, $this->serviceName, 'v2', json_decode('{}', true)); $this->tokeninfo = new TokeninfoServiceResource($this, $this->serviceName, 'tokeninfo', json_decode('{"id": "oauth2.tokeninfo", "path": "oauth2/v2/tokeninfo", "response": {"$ref": "Tokeninfo"}, "parameters": {"access_token": {"type": "string", "location": "query"}, "id_token": {"type": "string", "location": "query"}}, "httpMethod": "GET"}', true)); } } -class Tokeninfo extends apiModel { +class Tokeninfo extends Model { public $issued_to; public $user_id; public $expires_in; @@ -219,7 +220,7 @@ public function getVerified_email() { } } -class Userinfo extends apiModel { +class Userinfo extends Model { public $family_name; public $name; public $picture; diff --git a/src/GoogleApi/contrib/apiOrkutService.php b/src/GoogleApi/Contrib/apiOrkutService.php similarity index 96% rename from src/GoogleApi/contrib/apiOrkutService.php rename to src/GoogleApi/Contrib/apiOrkutService.php index c5e5460..c87d07e 100644 --- a/src/GoogleApi/contrib/apiOrkutService.php +++ b/src/GoogleApi/Contrib/apiOrkutService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "communityMembers" collection of methods. @@ -28,7 +29,7 @@ * $communityMembers = $orkutService->communityMembers; * */ - class CommunityMembersServiceResource extends apiServiceResource { + class CommunityMembersServiceResource extends ServiceResource { /** @@ -112,7 +113,7 @@ public function delete($communityId, $userId, $optParams = array()) { * $activities = $orkutService->activities; * */ - class ActivitiesServiceResource extends apiServiceResource { + class ActivitiesServiceResource extends ServiceResource { /** @@ -158,7 +159,7 @@ public function delete($activityId, $optParams = array()) { * $communityPollComments = $orkutService->communityPollComments; * */ - class CommunityPollCommentsServiceResource extends apiServiceResource { + class CommunityPollCommentsServiceResource extends ServiceResource { /** @@ -211,7 +212,7 @@ public function listCommunityPollComments($communityId, $pollId, $optParams = ar * $communityPolls = $orkutService->communityPolls; * */ - class CommunityPollsServiceResource extends apiServiceResource { + class CommunityPollsServiceResource extends ServiceResource { /** @@ -265,7 +266,7 @@ public function get($communityId, $pollId, $optParams = array()) { * $communityMessages = $orkutService->communityMessages; * */ - class CommunityMessagesServiceResource extends apiServiceResource { + class CommunityMessagesServiceResource extends ServiceResource { /** @@ -331,7 +332,7 @@ public function delete($communityId, $topicId, $messageId, $optParams = array()) * $communityTopics = $orkutService->communityTopics; * */ - class CommunityTopicsServiceResource extends apiServiceResource { + class CommunityTopicsServiceResource extends ServiceResource { /** @@ -417,7 +418,7 @@ public function delete($communityId, $topicId, $optParams = array()) { * $comments = $orkutService->comments; * */ - class CommentsServiceResource extends apiServiceResource { + class CommentsServiceResource extends ServiceResource { /** @@ -499,7 +500,7 @@ public function delete($commentId, $optParams = array()) { * $acl = $orkutService->acl; * */ - class AclServiceResource extends apiServiceResource { + class AclServiceResource extends ServiceResource { /** @@ -524,7 +525,7 @@ public function delete($activityId, $userId, $optParams = array()) { * $communityRelated = $orkutService->communityRelated; * */ - class CommunityRelatedServiceResource extends apiServiceResource { + class CommunityRelatedServiceResource extends ServiceResource { /** @@ -556,7 +557,7 @@ public function listCommunityRelated($communityId, $optParams = array()) { * $scraps = $orkutService->scraps; * */ - class ScrapsServiceResource extends apiServiceResource { + class ScrapsServiceResource extends ServiceResource { /** @@ -585,7 +586,7 @@ public function insert(Activity $postBody, $optParams = array()) { * $communityPollVotes = $orkutService->communityPollVotes; * */ - class CommunityPollVotesServiceResource extends apiServiceResource { + class CommunityPollVotesServiceResource extends ServiceResource { /** @@ -616,7 +617,7 @@ public function insert($communityId, $pollId, CommunityPollVote $postBody, $optP * $communities = $orkutService->communities; * */ - class CommunitiesServiceResource extends apiServiceResource { + class CommunitiesServiceResource extends ServiceResource { /** @@ -669,7 +670,7 @@ public function get($communityId, $optParams = array()) { * $communityFollow = $orkutService->communityFollow; * */ - class CommunityFollowServiceResource extends apiServiceResource { + class CommunityFollowServiceResource extends ServiceResource { /** @@ -711,7 +712,7 @@ public function delete($communityId, $userId, $optParams = array()) { * $activityVisibility = $orkutService->activityVisibility; * */ - class ActivityVisibilityServiceResource extends apiServiceResource { + class ActivityVisibilityServiceResource extends ServiceResource { /** @@ -775,7 +776,7 @@ public function get($activityId, $optParams = array()) { * $badges = $orkutService->badges; * */ - class BadgesServiceResource extends apiServiceResource { + class BadgesServiceResource extends ServiceResource { /** @@ -821,7 +822,7 @@ public function get($userId, $badgeId, $optParams = array()) { * $counters = $orkutService->counters; * */ - class CountersServiceResource extends apiServiceResource { + class CountersServiceResource extends ServiceResource { /** @@ -858,7 +859,7 @@ public function listCounters($userId, $optParams = array()) { * * @author Google, Inc. */ -class apiOrkutService extends apiService { +class apiOrkutService extends Service { public $communityMembers; public $activities; public $communityPollComments; @@ -878,15 +879,15 @@ class apiOrkutService extends apiService { /** * Constructs the internal representation of the Orkut service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/orkut/v2/'; $this->version = 'v2'; $this->serviceName = 'orkut'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->communityMembers = new CommunityMembersServiceResource($this, $this->serviceName, 'communityMembers', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"communityId": {"format": "int32", "required": true, "type": "integer", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}}, "id": "orkut.communityMembers.insert", "httpMethod": "POST", "path": "communities/{communityId}/members/{userId}", "response": {"$ref": "CommunityMembers"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"communityId": {"format": "int32", "required": true, "type": "integer", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "communities/{communityId}/members/{userId}", "id": "orkut.communityMembers.delete"}, "list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "friendsOnly": {"type": "boolean", "location": "query"}, "communityId": {"format": "int32", "required": true, "type": "integer", "location": "path"}, "hl": {"type": "string", "location": "query"}, "maxResults": {"format": "uint32", "minimum": "1", "type": "integer", "location": "query"}}, "id": "orkut.communityMembers.list", "httpMethod": "GET", "path": "communities/{communityId}/members", "response": {"$ref": "CommunityMembersList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"communityId": {"format": "int32", "required": true, "type": "integer", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.communityMembers.get", "httpMethod": "GET", "path": "communities/{communityId}/members/{userId}", "response": {"$ref": "CommunityMembers"}}}}', true)); $this->activities = new ActivitiesServiceResource($this, $this->serviceName, 'activities', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"collection": {"required": true, "enum": ["all", "scraps", "stream"], "location": "path", "type": "string"}, "pageToken": {"type": "string", "location": "query"}, "userId": {"required": true, "type": "string", "location": "path"}, "hl": {"type": "string", "location": "query"}, "maxResults": {"format": "uint32", "maximum": "100", "minimum": "1", "location": "query", "type": "integer"}}, "id": "orkut.activities.list", "httpMethod": "GET", "path": "people/{userId}/activities/{collection}", "response": {"$ref": "ActivityList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"activityId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "activities/{activityId}", "id": "orkut.activities.delete"}}}', true)); $this->communityPollComments = new CommunityPollCommentsServiceResource($this, $this->serviceName, 'communityPollComments', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"communityId": {"format": "int32", "required": true, "type": "integer", "location": "path"}, "pollId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "CommunityPollComment"}, "id": "orkut.communityPollComments.insert", "httpMethod": "POST", "path": "communities/{communityId}/polls/{pollId}/comments", "response": {"$ref": "CommunityPollComment"}}, "list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "communityId": {"format": "int32", "required": true, "type": "integer", "location": "path"}, "hl": {"type": "string", "location": "query"}, "maxResults": {"format": "uint32", "minimum": "1", "type": "integer", "location": "query"}, "pollId": {"required": true, "type": "string", "location": "path"}}, "id": "orkut.communityPollComments.list", "httpMethod": "GET", "path": "communities/{communityId}/polls/{pollId}/comments", "response": {"$ref": "CommunityPollCommentList"}}}}', true)); @@ -906,7 +907,7 @@ public function __construct(apiClient $apiClient) { } } -class Acl extends apiModel { +class Acl extends Model { protected $__itemsType = 'AclItems'; protected $__itemsDataType = 'array'; public $items; @@ -940,7 +941,7 @@ public function getTotalParticipants() { } } -class AclItems extends apiModel { +class AclItems extends Model { public $type; public $id; public function setType($type) { @@ -957,7 +958,7 @@ public function getId() { } } -class Activity extends apiModel { +class Activity extends Model { public $kind; protected $__linksType = 'OrkutLinkResource'; protected $__linksDataType = 'array'; @@ -1039,7 +1040,7 @@ public function getId() { } } -class ActivityList extends apiModel { +class ActivityList extends Model { public $nextPageToken; protected $__itemsType = 'Activity'; protected $__itemsDataType = 'array'; @@ -1066,7 +1067,7 @@ public function getKind() { } } -class ActivityObject extends apiModel { +class ActivityObject extends Model { public $content; protected $__itemsType = 'OrkutActivityobjectsResource'; protected $__itemsDataType = 'array'; @@ -1102,7 +1103,7 @@ public function getObjectType() { } } -class ActivityObjectReplies extends apiModel { +class ActivityObjectReplies extends Model { public $totalItems; protected $__itemsType = 'Comment'; protected $__itemsDataType = 'array'; @@ -1129,7 +1130,7 @@ public function getUrl() { } } -class Badge extends apiModel { +class Badge extends Model { public $badgeSmallLogo; public $kind; public $description; @@ -1195,7 +1196,7 @@ public function getId() { } } -class BadgeList extends apiModel { +class BadgeList extends Model { protected $__itemsType = 'Badge'; protected $__itemsDataType = 'array'; public $items; @@ -1215,7 +1216,7 @@ public function getKind() { } } -class Comment extends apiModel { +class Comment extends Model { protected $__inReplyToType = 'CommentInReplyTo'; protected $__inReplyToDataType = ''; public $inReplyTo; @@ -1274,7 +1275,7 @@ public function getId() { } } -class CommentInReplyTo extends apiModel { +class CommentInReplyTo extends Model { public $type; public $href; public $ref; @@ -1305,7 +1306,7 @@ public function getRel() { } } -class CommentList extends apiModel { +class CommentList extends Model { public $nextPageToken; protected $__itemsType = 'Comment'; protected $__itemsDataType = 'array'; @@ -1339,7 +1340,7 @@ public function getPreviousPageToken() { } } -class Community extends apiModel { +class Community extends Model { public $category; public $kind; public $member_count; @@ -1451,7 +1452,7 @@ public function getName() { } } -class CommunityList extends apiModel { +class CommunityList extends Model { protected $__itemsType = 'Community'; protected $__itemsDataType = 'array'; public $items; @@ -1471,7 +1472,7 @@ public function getKind() { } } -class CommunityMembers extends apiModel { +class CommunityMembers extends Model { protected $__communityMembershipStatusType = 'CommunityMembershipStatus'; protected $__communityMembershipStatusDataType = ''; public $communityMembershipStatus; @@ -1499,7 +1500,7 @@ public function getKind() { } } -class CommunityMembersList extends apiModel { +class CommunityMembersList extends Model { public $nextPageToken; public $kind; protected $__itemsType = 'CommunityMembers'; @@ -1547,7 +1548,7 @@ public function getFirstPageToken() { } } -class CommunityMembershipStatus extends apiModel { +class CommunityMembershipStatus extends Model { public $status; public $isFollowing; public $isRestoreAvailable; @@ -1627,7 +1628,7 @@ public function getIsTakebackAvailable() { } } -class CommunityMessage extends apiModel { +class CommunityMessage extends Model { public $body; public $kind; protected $__linksType = 'OrkutLinkResource'; @@ -1691,7 +1692,7 @@ public function getSubject() { } } -class CommunityMessageList extends apiModel { +class CommunityMessageList extends Model { public $nextPageToken; public $kind; protected $__itemsType = 'CommunityMessage'; @@ -1739,7 +1740,7 @@ public function getFirstPageToken() { } } -class CommunityPoll extends apiModel { +class CommunityPoll extends Model { protected $__linksType = 'OrkutLinkResource'; protected $__linksDataType = 'array'; public $links; @@ -1907,7 +1908,7 @@ public function getOptions() { } } -class CommunityPollComment extends apiModel { +class CommunityPollComment extends Model { public $body; public $kind; public $addedDate; @@ -1947,7 +1948,7 @@ public function getAuthor() { } } -class CommunityPollCommentList extends apiModel { +class CommunityPollCommentList extends Model { public $nextPageToken; public $kind; protected $__itemsType = 'CommunityPollComment'; @@ -1995,7 +1996,7 @@ public function getFirstPageToken() { } } -class CommunityPollImage extends apiModel { +class CommunityPollImage extends Model { public $url; public function setUrl($url) { $this->url = $url; @@ -2005,7 +2006,7 @@ public function getUrl() { } } -class CommunityPollList extends apiModel { +class CommunityPollList extends Model { public $nextPageToken; public $kind; protected $__itemsType = 'CommunityPoll'; @@ -2053,7 +2054,7 @@ public function getFirstPageToken() { } } -class CommunityPollVote extends apiModel { +class CommunityPollVote extends Model { public $kind; public $optionIds; public $isVotevisible; @@ -2078,7 +2079,7 @@ public function getIsVotevisible() { } } -class CommunityTopic extends apiModel { +class CommunityTopic extends Model { public $body; public $lastUpdate; public $kind; @@ -2166,7 +2167,7 @@ public function getId() { } } -class CommunityTopicList extends apiModel { +class CommunityTopicList extends Model { public $nextPageToken; public $kind; protected $__itemsType = 'CommunityTopic'; @@ -2214,7 +2215,7 @@ public function getFirstPageToken() { } } -class Counters extends apiModel { +class Counters extends Model { protected $__itemsType = 'OrkutCounterResource'; protected $__itemsDataType = 'array'; public $items; @@ -2234,7 +2235,7 @@ public function getKind() { } } -class OrkutActivityobjectsResource extends apiModel { +class OrkutActivityobjectsResource extends Model { public $displayName; protected $__linksType = 'OrkutLinkResource'; protected $__linksDataType = 'array'; @@ -2284,7 +2285,7 @@ public function getObjectType() { } } -class OrkutActivitypersonResource extends apiModel { +class OrkutActivitypersonResource extends Model { protected $__nameType = 'OrkutActivitypersonResourceName'; protected $__nameDataType = ''; public $name; @@ -2333,7 +2334,7 @@ public function getId() { } } -class OrkutActivitypersonResourceImage extends apiModel { +class OrkutActivitypersonResourceImage extends Model { public $url; public function setUrl($url) { $this->url = $url; @@ -2343,7 +2344,7 @@ public function getUrl() { } } -class OrkutActivitypersonResourceName extends apiModel { +class OrkutActivitypersonResourceName extends Model { public $givenName; public $familyName; public function setGivenName($givenName) { @@ -2360,7 +2361,7 @@ public function getFamilyName() { } } -class OrkutAuthorResource extends apiModel { +class OrkutAuthorResource extends Model { public $url; protected $__imageType = 'OrkutAuthorResourceImage'; protected $__imageDataType = ''; @@ -2393,7 +2394,7 @@ public function getId() { } } -class OrkutAuthorResourceImage extends apiModel { +class OrkutAuthorResourceImage extends Model { public $url; public function setUrl($url) { $this->url = $url; @@ -2403,7 +2404,7 @@ public function getUrl() { } } -class OrkutCommunitypolloptionResource extends apiModel { +class OrkutCommunitypolloptionResource extends Model { protected $__imageType = 'OrkutCommunitypolloptionResourceImage'; protected $__imageDataType = ''; public $image; @@ -2436,7 +2437,7 @@ public function getNumberOfVotes() { } } -class OrkutCommunitypolloptionResourceImage extends apiModel { +class OrkutCommunitypolloptionResourceImage extends Model { public $url; public function setUrl($url) { $this->url = $url; @@ -2446,7 +2447,7 @@ public function getUrl() { } } -class OrkutCounterResource extends apiModel { +class OrkutCounterResource extends Model { public $total; protected $__linkType = 'OrkutLinkResource'; protected $__linkDataType = ''; @@ -2472,7 +2473,7 @@ public function getName() { } } -class OrkutLinkResource extends apiModel { +class OrkutLinkResource extends Model { public $href; public $type; public $rel; @@ -2503,7 +2504,7 @@ public function getTitle() { } } -class Visibility extends apiModel { +class Visibility extends Model { public $kind; public $visibility; protected $__linksType = 'OrkutLinkResource'; diff --git a/src/GoogleApi/contrib/apiPagespeedonlineService.php b/src/GoogleApi/Contrib/apiPagespeedonlineService.php similarity index 90% rename from src/GoogleApi/contrib/apiPagespeedonlineService.php rename to src/GoogleApi/Contrib/apiPagespeedonlineService.php index e1cb0ac..3ef2776 100644 --- a/src/GoogleApi/contrib/apiPagespeedonlineService.php +++ b/src/GoogleApi/Contrib/apiPagespeedonlineService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "pagespeedapi" collection of methods. @@ -28,7 +29,7 @@ * $pagespeedapi = $pagespeedonlineService->pagespeedapi; * */ - class PagespeedapiServiceResource extends apiServiceResource { + class PagespeedServiceResource extends ServiceResource { /** @@ -71,25 +72,25 @@ public function runpagespeed($url, $optParams = array()) { * * @author Google, Inc. */ -class apiPagespeedonlineService extends apiService { +class apiPagespeedonlineService extends Service { public $pagespeedapi; /** * Constructs the internal representation of the Pagespeedonline service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/pagespeedonline/v1/'; $this->version = 'v1'; $this->serviceName = 'pagespeedonline'; - $apiClient->addService($this->serviceName, $this->version); - $this->pagespeedapi = new PagespeedapiServiceResource($this, $this->serviceName, 'pagespeedapi', json_decode('{"methods": {"runpagespeed": {"parameters": {"locale": {"type": "string", "location": "query"}, "url": {"required": true, "type": "string", "location": "query"}, "rule": {"repeated": true, "type": "string", "location": "query"}, "strategy": {"enum": ["desktop", "mobile"], "type": "string", "location": "query"}}, "id": "pagespeedonline.pagespeedapi.runpagespeed", "httpMethod": "GET", "path": "runPagespeed", "response": {"$ref": "Result"}}}}', true)); + $Client->addService($this->serviceName, $this->version); + $this->pagespeedapi = new PagespeedServiceResource($this, $this->serviceName, 'pagespeedapi', json_decode('{"methods": {"runpagespeed": {"parameters": {"locale": {"type": "string", "location": "query"}, "url": {"required": true, "type": "string", "location": "query"}, "rule": {"repeated": true, "type": "string", "location": "query"}, "strategy": {"enum": ["desktop", "mobile"], "type": "string", "location": "query"}}, "id": "pagespeedonline.pagespeedapi.runpagespeed", "httpMethod": "GET", "path": "runPagespeed", "response": {"$ref": "Result"}}}}', true)); } } -class Result extends apiModel { +class Result extends Model { public $kind; protected $__formattedResultsType = 'ResultFormattedResults'; protected $__formattedResultsDataType = ''; @@ -162,7 +163,7 @@ public function getId() { } } -class ResultFormattedResults extends apiModel { +class ResultFormattedResults extends Model { public $locale; protected $__ruleResultsType = 'ResultFormattedResultsRuleResults'; protected $__ruleResultsDataType = 'map'; @@ -181,7 +182,7 @@ public function getRuleResults() { } } -class ResultFormattedResultsRuleResults extends apiModel { +class ResultFormattedResultsRuleResults extends Model { public $localizedRuleName; protected $__urlBlocksType = 'ResultFormattedResultsRuleResultsUrlBlocks'; protected $__urlBlocksDataType = 'array'; @@ -215,7 +216,7 @@ public function getRuleImpact() { } } -class ResultFormattedResultsRuleResultsUrlBlocks extends apiModel { +class ResultFormattedResultsRuleResultsUrlBlocks extends Model { protected $__headerType = 'ResultFormattedResultsRuleResultsUrlBlocksHeader'; protected $__headerDataType = ''; public $header; @@ -237,7 +238,7 @@ public function getUrls() { } } -class ResultFormattedResultsRuleResultsUrlBlocksHeader extends apiModel { +class ResultFormattedResultsRuleResultsUrlBlocksHeader extends Model { protected $__argsType = 'ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs'; protected $__argsDataType = 'array'; public $args; @@ -257,7 +258,7 @@ public function getFormat() { } } -class ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs extends apiModel { +class ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs extends Model { public $type; public $value; public function setType($type) { @@ -274,7 +275,7 @@ public function getValue() { } } -class ResultFormattedResultsRuleResultsUrlBlocksUrls extends apiModel { +class ResultFormattedResultsRuleResultsUrlBlocksUrls extends Model { protected $__detailsType = 'ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails'; protected $__detailsDataType = 'array'; public $details; @@ -296,7 +297,7 @@ public function getResult() { } } -class ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails extends apiModel { +class ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails extends Model { protected $__argsType = 'ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs'; protected $__argsDataType = 'array'; public $args; @@ -316,7 +317,7 @@ public function getFormat() { } } -class ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs extends apiModel { +class ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs extends Model { public $type; public $value; public function setType($type) { @@ -333,7 +334,7 @@ public function getValue() { } } -class ResultFormattedResultsRuleResultsUrlBlocksUrlsResult extends apiModel { +class ResultFormattedResultsRuleResultsUrlBlocksUrlsResult extends Model { protected $__argsType = 'ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs'; protected $__argsDataType = 'array'; public $args; @@ -353,7 +354,7 @@ public function getFormat() { } } -class ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs extends apiModel { +class ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs extends Model { public $type; public $value; public function setType($type) { @@ -370,7 +371,7 @@ public function getValue() { } } -class ResultPageStats extends apiModel { +class ResultPageStats extends Model { public $otherResponseBytes; public $flashResponseBytes; public $totalRequestBytes; @@ -464,7 +465,7 @@ public function getTextResponseBytes() { } } -class ResultVersion extends apiModel { +class ResultVersion extends Model { public $major; public $minor; public function setMajor($major) { diff --git a/src/GoogleApi/contrib/apiPlusService.php b/src/GoogleApi/Contrib/apiPlusService.php similarity index 95% rename from src/GoogleApi/contrib/apiPlusService.php rename to src/GoogleApi/Contrib/apiPlusService.php index adda9e1..d38009c 100644 --- a/src/GoogleApi/contrib/apiPlusService.php +++ b/src/GoogleApi/Contrib/apiPlusService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "activities" collection of methods. @@ -28,7 +29,7 @@ * $activities = $plusService->activities; * */ - class ActivitiesServiceResource extends apiServiceResource { + class ActivitiesServiceResource extends ServiceResource { /** @@ -100,7 +101,7 @@ public function get($activityId, $optParams = array()) { * $comments = $plusService->comments; * */ - class CommentsServiceResource extends apiServiceResource { + class CommentsServiceResource extends ServiceResource { /** @@ -149,7 +150,7 @@ public function get($commentId, $optParams = array()) { * $people = $plusService->people; * */ - class PeopleServiceResource extends apiServiceResource { + class PeopleServiceResource extends ServiceResource { /** @@ -229,29 +230,29 @@ public function get($userId, $optParams = array()) { * * @author Google, Inc. */ -class apiPlusService extends apiService { +class apiPlusService extends Service { public $activities; public $comments; public $people; /** * Constructs the internal representation of the Plus service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/plus/v1/'; $this->version = 'v1'; $this->serviceName = 'plus'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->activities = new ActivitiesServiceResource($this, $this->serviceName, 'activities', json_decode('{"methods": {"search": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"orderBy": {"default": "recent", "enum": ["best", "recent"], "location": "query", "type": "string"}, "pageToken": {"type": "string", "location": "query"}, "language": {"default": "", "type": "string", "location": "query"}, "maxResults": {"format": "uint32", "default": "10", "maximum": "20", "minimum": "1", "location": "query", "type": "integer"}, "query": {"required": true, "type": "string", "location": "query"}}, "id": "plus.activities.search", "httpMethod": "GET", "path": "activities", "response": {"$ref": "ActivityFeed"}}, "list": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "alt": {"default": "json", "enum": ["json"], "location": "query", "type": "string"}, "userId": {"required": true, "type": "string", "location": "path"}, "collection": {"required": true, "enum": ["public"], "location": "path", "type": "string"}, "maxResults": {"format": "uint32", "default": "20", "maximum": "100", "minimum": "1", "location": "query", "type": "integer"}}, "id": "plus.activities.list", "httpMethod": "GET", "path": "people/{userId}/activities/{collection}", "response": {"$ref": "ActivityFeed"}}, "get": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"activityId": {"required": true, "type": "string", "location": "path"}, "alt": {"default": "json", "enum": ["json"], "location": "query", "type": "string"}}, "id": "plus.activities.get", "httpMethod": "GET", "path": "activities/{activityId}", "response": {"$ref": "Activity"}}}}', true)); $this->comments = new CommentsServiceResource($this, $this->serviceName, 'comments', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "activityId": {"required": true, "type": "string", "location": "path"}, "alt": {"default": "json", "enum": ["json"], "location": "query", "type": "string"}, "maxResults": {"format": "uint32", "default": "20", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}}, "id": "plus.comments.list", "httpMethod": "GET", "path": "activities/{activityId}/comments", "response": {"$ref": "CommentFeed"}}, "get": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"commentId": {"required": true, "type": "string", "location": "path"}}, "id": "plus.comments.get", "httpMethod": "GET", "path": "comments/{commentId}", "response": {"$ref": "Comment"}}}}', true)); $this->people = new PeopleServiceResource($this, $this->serviceName, 'people', json_decode('{"methods": {"listByActivity": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "activityId": {"required": true, "type": "string", "location": "path"}, "collection": {"required": true, "enum": ["plusoners", "resharers"], "location": "path", "type": "string"}, "maxResults": {"format": "uint32", "default": "20", "maximum": "100", "minimum": "1", "location": "query", "type": "integer"}}, "id": "plus.people.listByActivity", "httpMethod": "GET", "path": "activities/{activityId}/people/{collection}", "response": {"$ref": "PeopleFeed"}}, "search": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "language": {"default": "", "type": "string", "location": "query"}, "maxResults": {"format": "uint32", "default": "10", "maximum": "20", "minimum": "1", "location": "query", "type": "integer"}, "query": {"required": true, "type": "string", "location": "query"}}, "id": "plus.people.search", "httpMethod": "GET", "path": "people", "response": {"$ref": "PeopleFeed"}}, "get": {"scopes": ["https://www.googleapis.com/auth/plus.me", "https://www.googleapis.com/auth/userinfo.email"], "parameters": {"userId": {"required": true, "type": "string", "location": "path"}}, "id": "plus.people.get", "httpMethod": "GET", "path": "people/{userId}", "response": {"$ref": "Person"}}}}', true)); } } -class Acl extends apiModel { +class Acl extends Model { protected $__itemsType = 'PlusAclentryResource'; protected $__itemsDataType = 'array'; public $items; @@ -278,7 +279,7 @@ public function getDescription() { } } -class Activity extends apiModel { +class Activity extends Model { public $placeName; public $kind; public $updated; @@ -429,7 +430,7 @@ public function getPublished() { } } -class ActivityActor extends apiModel { +class ActivityActor extends Model { public $displayName; public $url; protected $__imageType = 'ActivityActorImage'; @@ -476,7 +477,7 @@ public function getId() { } } -class ActivityActorImage extends apiModel { +class ActivityActorImage extends Model { public $url; public function setUrl($url) { $this->url = $url; @@ -486,7 +487,7 @@ public function getUrl() { } } -class ActivityFeed extends apiModel { +class ActivityFeed extends Model { public $nextPageToken; public $kind; public $title; @@ -555,7 +556,7 @@ public function getSelfLink() { } } -class ActivityObject extends apiModel { +class ActivityObject extends Model { protected $__resharersType = 'ActivityObjectResharers'; protected $__resharersDataType = ''; public $resharers; @@ -639,7 +640,7 @@ public function getObjectType() { } } -class ActivityObjectActor extends apiModel { +class ActivityObjectActor extends Model { public $url; protected $__imageType = 'ActivityObjectActorImage'; protected $__imageDataType = ''; @@ -672,7 +673,7 @@ public function getId() { } } -class ActivityObjectActorImage extends apiModel { +class ActivityObjectActorImage extends Model { public $url; public function setUrl($url) { $this->url = $url; @@ -682,7 +683,7 @@ public function getUrl() { } } -class ActivityObjectAttachments extends apiModel { +class ActivityObjectAttachments extends Model { public $displayName; protected $__fullImageType = 'ActivityObjectAttachmentsFullImage'; protected $__fullImageDataType = ''; @@ -747,7 +748,7 @@ public function getObjectType() { } } -class ActivityObjectAttachmentsEmbed extends apiModel { +class ActivityObjectAttachmentsEmbed extends Model { public $url; public $type; public function setUrl($url) { @@ -764,7 +765,7 @@ public function getType() { } } -class ActivityObjectAttachmentsFullImage extends apiModel { +class ActivityObjectAttachmentsFullImage extends Model { public $url; public $width; public $type; @@ -795,7 +796,7 @@ public function getHeight() { } } -class ActivityObjectAttachmentsImage extends apiModel { +class ActivityObjectAttachmentsImage extends Model { public $url; public $width; public $type; @@ -826,7 +827,7 @@ public function getHeight() { } } -class ActivityObjectPlusoners extends apiModel { +class ActivityObjectPlusoners extends Model { public $totalItems; public $selfLink; public function setTotalItems($totalItems) { @@ -843,7 +844,7 @@ public function getSelfLink() { } } -class ActivityObjectReplies extends apiModel { +class ActivityObjectReplies extends Model { public $totalItems; public $selfLink; public function setTotalItems($totalItems) { @@ -860,7 +861,7 @@ public function getSelfLink() { } } -class ActivityObjectResharers extends apiModel { +class ActivityObjectResharers extends Model { public $totalItems; public $selfLink; public function setTotalItems($totalItems) { @@ -877,7 +878,7 @@ public function getSelfLink() { } } -class ActivityProvider extends apiModel { +class ActivityProvider extends Model { public $title; public function setTitle($title) { $this->title = $title; @@ -887,7 +888,7 @@ public function getTitle() { } } -class Comment extends apiModel { +class Comment extends Model { protected $__inReplyToType = 'CommentInReplyTo'; protected $__inReplyToDataType = 'array'; public $inReplyTo; @@ -967,7 +968,7 @@ public function getSelfLink() { } } -class CommentActor extends apiModel { +class CommentActor extends Model { public $url; protected $__imageType = 'CommentActorImage'; protected $__imageDataType = ''; @@ -1000,7 +1001,7 @@ public function getId() { } } -class CommentActorImage extends apiModel { +class CommentActorImage extends Model { public $url; public function setUrl($url) { $this->url = $url; @@ -1010,7 +1011,7 @@ public function getUrl() { } } -class CommentFeed extends apiModel { +class CommentFeed extends Model { public $nextPageToken; public $kind; public $title; @@ -1072,7 +1073,7 @@ public function getId() { } } -class CommentInReplyTo extends apiModel { +class CommentInReplyTo extends Model { public $url; public $id; public function setUrl($url) { @@ -1089,7 +1090,7 @@ public function getId() { } } -class CommentObject extends apiModel { +class CommentObject extends Model { public $content; public $objectType; public function setContent($content) { @@ -1106,7 +1107,7 @@ public function getObjectType() { } } -class PeopleFeed extends apiModel { +class PeopleFeed extends Model { public $nextPageToken; public $kind; public $title; @@ -1154,7 +1155,7 @@ public function getSelfLink() { } } -class Person extends apiModel { +class Person extends Model { public $relationshipStatus; protected $__organizationsType = 'PersonOrganizations'; protected $__organizationsDataType = 'array'; @@ -1321,7 +1322,7 @@ public function getObjectType() { } } -class PersonEmails extends apiModel { +class PersonEmails extends Model { public $type; public $primary; public $value; @@ -1345,7 +1346,7 @@ public function getValue() { } } -class PersonImage extends apiModel { +class PersonImage extends Model { public $url; public function setUrl($url) { $this->url = $url; @@ -1355,7 +1356,7 @@ public function getUrl() { } } -class PersonName extends apiModel { +class PersonName extends Model { public $honorificPrefix; public $middleName; public $familyName; @@ -1400,7 +1401,7 @@ public function getHonorificSuffix() { } } -class PersonOrganizations extends apiModel { +class PersonOrganizations extends Model { public $startDate; public $endDate; public $description; @@ -1466,7 +1467,7 @@ public function getName() { } } -class PersonPlacesLived extends apiModel { +class PersonPlacesLived extends Model { public $primary; public $value; public function setPrimary($primary) { @@ -1483,7 +1484,7 @@ public function getValue() { } } -class PersonUrls extends apiModel { +class PersonUrls extends Model { public $type; public $primary; public $value; @@ -1507,7 +1508,7 @@ public function getValue() { } } -class PlusAclentryResource extends apiModel { +class PlusAclentryResource extends Model { public $type; public $id; public function setType($type) { diff --git a/src/GoogleApi/contrib/apiPredictionService.php b/src/GoogleApi/Contrib/apiPredictionService.php similarity index 77% rename from src/GoogleApi/contrib/apiPredictionService.php rename to src/GoogleApi/Contrib/apiPredictionService.php index 600c21b..98c77d1 100644 --- a/src/GoogleApi/contrib/apiPredictionService.php +++ b/src/GoogleApi/Contrib/apiPredictionService.php @@ -15,10 +15,12 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; +use GoogleApi\Client; /** * The "trainedmodels" collection of methods. @@ -28,7 +30,7 @@ * $trainedmodels = $predictionService->trainedmodels; * */ - class TrainedmodelsServiceResource extends apiServiceResource { + class TrainedmodelsServiceResource extends ServiceResource { /** @@ -108,6 +110,21 @@ public function delete($id, $optParams = array()) { $data = $this->__call('delete', array($params)); return $data; } + + /** + * Executes "list" api method. list is a php saved keyword and therefore it can't be used as method name + * + * @param array $optParams + */ + public function listModels($optParams = array()) { + $data = $this->__call('list', array($optParams)); + + if ($this->useObjects()) { + return new ListModel($data); + } else { + return $data; + } + } } /** @@ -118,7 +135,7 @@ public function delete($id, $optParams = array()) { * $hostedmodels = $predictionService->hostedmodels; * */ - class HostedmodelsServiceResource extends apiServiceResource { + class HostedmodelsServiceResource extends ServiceResource { /** @@ -156,28 +173,28 @@ public function predict($hostedModelName, Input $postBody, $optParams = array()) * * @author Google, Inc. */ -class apiPredictionService extends apiService { +class apiPredictionService extends Service { public $trainedmodels; public $hostedmodels; /** * Constructs the internal representation of the Prediction service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/prediction/v1.5/'; $this->version = 'v1.5'; $this->serviceName = 'prediction'; - $apiClient->addService($this->serviceName, $this->version); - $this->trainedmodels = new TrainedmodelsServiceResource($this, $this->serviceName, 'trainedmodels', json_decode('{"methods": {"predict": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Input"}, "id": "prediction.trainedmodels.predict", "httpMethod": "POST", "path": "trainedmodels/{id}/predict", "response": {"$ref": "Output"}}, "insert": {"scopes": ["https://www.googleapis.com/auth/prediction"], "request": {"$ref": "Training"}, "response": {"$ref": "Training"}, "httpMethod": "POST", "path": "trainedmodels", "id": "prediction.trainedmodels.insert"}, "delete": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "trainedmodels/{id}", "id": "prediction.trainedmodels.delete"}, "update": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Update"}, "id": "prediction.trainedmodels.update", "httpMethod": "PUT", "path": "trainedmodels/{id}", "response": {"$ref": "Training"}}, "get": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "id": "prediction.trainedmodels.get", "httpMethod": "GET", "path": "trainedmodels/{id}", "response": {"$ref": "Training"}}}}', true)); + $Client->addService($this->serviceName, $this->version); + $this->trainedmodels = new TrainedmodelsServiceResource($this, $this->serviceName, 'trainedmodels', json_decode('{"methods":{"predict":{"scopes":["https://www.googleapis.com/auth/prediction"],"parameters":{"id":{"required":true,"type":"string","location":"path"}},"request":{"$ref":"Input"},"id":"prediction.trainedmodels.predict","httpMethod":"POST","path":"trainedmodels/{id}/predict","response":{"$ref":"Output"}},"insert":{"scopes":["https://www.googleapis.com/auth/prediction"],"request":{"$ref":"Training"},"response":{"$ref":"Training"},"httpMethod":"POST","path":"trainedmodels","id":"prediction.trainedmodels.insert"},"delete":{"scopes":["https://www.googleapis.com/auth/prediction"],"parameters":{"id":{"required":true,"type":"string","location":"path"}},"httpMethod":"DELETE","path":"trainedmodels/{id}","id":"prediction.trainedmodels.delete"},"update":{"scopes":["https://www.googleapis.com/auth/prediction"],"parameters":{"id":{"required":true,"type":"string","location":"path"}},"request":{"$ref":"Update"},"id":"prediction.trainedmodels.update","httpMethod":"PUT","path":"trainedmodels/{id}","response":{"$ref":"Training"}},"get":{"scopes":["https://www.googleapis.com/auth/prediction"],"parameters":{"id":{"required":true,"type":"string","location":"path"}},"id":"prediction.trainedmodels.get","httpMethod":"GET","path":"trainedmodels/{id}","response":{"$ref":"Training"}},"list":{"scopes":["https://www.googleapis.com/auth/prediction"],"parameters":{},"id":"prediction.trainedmodels.list","httpMethod":"GET","path":"trainedmodels/list","response":{"$ref":"ListModel"}}}}', true)); $this->hostedmodels = new HostedmodelsServiceResource($this, $this->serviceName, 'hostedmodels', json_decode('{"methods": {"predict": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"hostedModelName": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Input"}, "id": "prediction.hostedmodels.predict", "httpMethod": "POST", "path": "hostedmodels/{hostedModelName}/predict", "response": {"$ref": "Output"}}}}', true)); } } -class Input extends apiModel { - protected $__inputType = 'InputInput'; +class Input extends Model { + protected $__inputType = 'GoogleApi\Contrib\InputInput'; protected $__inputDataType = ''; public $input; public function setInput(InputInput $input) { @@ -188,7 +205,7 @@ public function getInput() { } } -class InputInput extends apiModel { +class InputInput extends Model { public $csvInstance; public function setCsvInstance(/* array(object) */ $csvInstance) { $this->assertIsArray($csvInstance, 'object', __METHOD__); @@ -199,11 +216,11 @@ public function getCsvInstance() { } } -class Output extends apiModel { +class Output extends Model { public $kind; public $outputLabel; public $id; - protected $__outputMultiType = 'OutputOutputMulti'; + protected $__outputMultiType = 'GoogleApi\Contrib\OutputOutputMulti'; protected $__outputMultiDataType = 'array'; public $outputMulti; public $outputValue; @@ -247,7 +264,7 @@ public function getSelfLink() { } } -class OutputOutputMulti extends apiModel { +class OutputOutputMulti extends Model { public $score; public $label; public function setScore($score) { @@ -264,15 +281,15 @@ public function getLabel() { } } -class Training extends apiModel { +class Training extends Model { public $kind; public $storageDataLocation; public $storagePMMLModelLocation; - protected $__dataAnalysisType = 'TrainingDataAnalysis'; + protected $__dataAnalysisType = 'GoogleApi\Contrib\TrainingDataAnalysis'; protected $__dataAnalysisDataType = ''; public $dataAnalysis; public $trainingStatus; - protected $__modelInfoType = 'TrainingModelInfo'; + protected $__modelInfoType = 'GoogleApi\Contrib\TrainingModelInfo'; protected $__modelInfoDataType = ''; public $modelInfo; public $storagePMMLLocation; @@ -342,7 +359,7 @@ public function getUtility() { } } -class TrainingDataAnalysis extends apiModel { +class TrainingDataAnalysis extends Model { public $warnings; public function setWarnings(/* array(string) */ $warnings) { $this->assertIsArray($warnings, 'string', __METHOD__); @@ -353,7 +370,7 @@ public function getWarnings() { } } -class TrainingModelInfo extends apiModel { +class TrainingModelInfo extends Model { public $confusionMatrixRowTotals; public $numberLabels; public $confusionMatrix; @@ -412,7 +429,7 @@ public function getClassificationAccuracy() { } } -class Update extends apiModel { +class Update extends Model { public $csvInstance; public $label; public function setCsvInstance(/* array(object) */ $csvInstance) { @@ -430,3 +447,30 @@ public function getLabel() { } } +class ListModel extends Model { + public $kind; + public $selfLink; + public $items; + protected $__itemsType = 'GoogleApi\Contrib\Training'; + protected $__itemsDataType = 'array'; + + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } + public function setItems(/* array(Webproperty) */ $items) { + $this->assertIsArray($items, 'GoogleApi\Contrib\Training', __METHOD__); + $this->items = $items; + } + public function getItems() { + return $this->items; + } +} diff --git a/src/GoogleApi/contrib/apiShoppingService.php b/src/GoogleApi/Contrib/apiShoppingService.php similarity index 96% rename from src/GoogleApi/contrib/apiShoppingService.php rename to src/GoogleApi/Contrib/apiShoppingService.php index ac635fd..11a4449 100644 --- a/src/GoogleApi/contrib/apiShoppingService.php +++ b/src/GoogleApi/Contrib/apiShoppingService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "products" collection of methods. @@ -28,7 +29,7 @@ * $products = $shoppingService->products; * */ - class ProductsServiceResource extends apiServiceResource { + class ProductsServiceResource extends ServiceResource { /** @@ -150,25 +151,25 @@ public function get($source, $accountId, $productIdType, $productId, $optParams * * @author Google, Inc. */ -class apiShoppingService extends apiService { +class apiShoppingService extends Service { public $products; /** * Constructs the internal representation of the Shopping service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/shopping/search/v1/'; $this->version = 'v1'; $this->serviceName = 'shopping'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->products = new ProductsServiceResource($this, $this->serviceName, 'products', json_decode('{"methods": {"list": {"parameters": {"sayt.useGcsConfig": {"type": "boolean", "location": "query"}, "debug.geocodeResponse": {"type": "boolean", "location": "query"}, "debug.enableLogging": {"type": "boolean", "location": "query"}, "facets.enabled": {"type": "boolean", "location": "query"}, "relatedQueries.useGcsConfig": {"type": "boolean", "location": "query"}, "promotions.enabled": {"type": "boolean", "location": "query"}, "debug.enabled": {"type": "boolean", "location": "query"}, "facets.include": {"type": "string", "location": "query"}, "productFields": {"type": "string", "location": "query"}, "channels": {"type": "string", "location": "query"}, "currency": {"type": "string", "location": "query"}, "startIndex": {"format": "uint32", "type": "integer", "location": "query"}, "facets.discover": {"type": "string", "location": "query"}, "debug.searchResponse": {"type": "boolean", "location": "query"}, "crowdBy": {"type": "string", "location": "query"}, "spelling.enabled": {"type": "boolean", "location": "query"}, "debug.geocodeRequest": {"type": "boolean", "location": "query"}, "source": {"required": true, "type": "string", "location": "path"}, "spelling.useGcsConfig": {"type": "boolean", "location": "query"}, "useCase": {"type": "string", "location": "query"}, "location": {"type": "string", "location": "query"}, "taxonomy": {"type": "string", "location": "query"}, "debug.rdcRequest": {"type": "boolean", "location": "query"}, "categories.include": {"type": "string", "location": "query"}, "debug.searchRequest": {"type": "boolean", "location": "query"}, "safe": {"type": "boolean", "location": "query"}, "boostBy": {"type": "string", "location": "query"}, "maxVariants": {"format": "uint32", "type": "integer", "location": "query"}, "categories.useGcsConfig": {"type": "boolean", "location": "query"}, "maxResults": {"format": "uint32", "type": "integer", "location": "query"}, "facets.useGcsConfig": {"type": "boolean", "location": "query"}, "categories.enabled": {"type": "boolean", "location": "query"}, "attributeFilter": {"type": "string", "location": "query"}, "sayt.enabled": {"type": "boolean", "location": "query"}, "plusOne": {"type": "string", "location": "query"}, "thumbnails": {"type": "string", "location": "query"}, "language": {"type": "string", "location": "query"}, "redirects.useGcsConfig": {"type": "boolean", "location": "query"}, "rankBy": {"type": "string", "location": "query"}, "restrictBy": {"type": "string", "location": "query"}, "debug.rdcResponse": {"type": "boolean", "location": "query"}, "q": {"type": "string", "location": "query"}, "redirects.enabled": {"type": "boolean", "location": "query"}, "country": {"type": "string", "location": "query"}, "relatedQueries.enabled": {"type": "boolean", "location": "query"}, "minAvailability": {"enum": ["inStock", "limited", "outOfStock", "unknown"], "type": "string", "location": "query"}, "promotions.useGcsConfig": {"type": "boolean", "location": "query"}}, "id": "shopping.products.list", "httpMethod": "GET", "path": "{source}/products", "response": {"$ref": "Products"}}, "get": {"parameters": {"categories.include": {"type": "string", "location": "query"}, "recommendations.enabled": {"type": "boolean", "location": "query"}, "plusOne": {"type": "string", "location": "query"}, "debug.enableLogging": {"type": "boolean", "location": "query"}, "thumbnails": {"type": "string", "location": "query"}, "recommendations.include": {"type": "string", "location": "query"}, "taxonomy": {"type": "string", "location": "query"}, "productIdType": {"required": true, "type": "string", "location": "path"}, "categories.useGcsConfig": {"type": "boolean", "location": "query"}, "attributeFilter": {"type": "string", "location": "query"}, "debug.enabled": {"type": "boolean", "location": "query"}, "source": {"required": true, "type": "string", "location": "path"}, "categories.enabled": {"type": "boolean", "location": "query"}, "location": {"type": "string", "location": "query"}, "debug.searchRequest": {"type": "boolean", "location": "query"}, "debug.searchResponse": {"type": "boolean", "location": "query"}, "recommendations.useGcsConfig": {"type": "boolean", "location": "query"}, "productFields": {"type": "string", "location": "query"}, "accountId": {"format": "uint32", "required": true, "type": "integer", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "id": "shopping.products.get", "httpMethod": "GET", "path": "{source}/products/{accountId}/{productIdType}/{productId}", "response": {"$ref": "Product"}}}}', true)); } } -class Product extends apiModel { +class Product extends Model { public $selfLink; public $kind; protected $__productType = 'ShoppingModelProductJsonV1'; @@ -237,7 +238,7 @@ public function getCategories() { } } -class ProductRecommendations extends apiModel { +class ProductRecommendations extends Model { protected $__recommendationListType = 'ProductRecommendationsRecommendationList'; protected $__recommendationListDataType = 'array'; public $recommendationList; @@ -257,7 +258,7 @@ public function getType() { } } -class ProductRecommendationsRecommendationList extends apiModel { +class ProductRecommendationsRecommendationList extends Model { protected $__productType = 'ShoppingModelProductJsonV1'; protected $__productDataType = ''; public $product; @@ -269,7 +270,7 @@ public function getProduct() { } } -class Products extends apiModel { +class Products extends Model { protected $__promotionsType = 'ProductsPromotions'; protected $__promotionsDataType = 'array'; public $promotions; @@ -443,7 +444,7 @@ public function getCategories() { } } -class ProductsFacets extends apiModel { +class ProductsFacets extends Model { public $count; public $displayName; public $name; @@ -498,7 +499,7 @@ public function getUnit() { } } -class ProductsFacetsBuckets extends apiModel { +class ProductsFacetsBuckets extends Model { public $count; public $minExclusive; public $min; @@ -543,7 +544,7 @@ public function getMaxExclusive() { } } -class ProductsPromotions extends apiModel { +class ProductsPromotions extends Model { protected $__productType = 'ShoppingModelProductJsonV1'; protected $__productDataType = ''; public $product; @@ -614,7 +615,7 @@ public function getName() { } } -class ProductsPromotionsCustomFields extends apiModel { +class ProductsPromotionsCustomFields extends Model { public $name; public $value; public function setName($name) { @@ -631,7 +632,7 @@ public function getValue() { } } -class ProductsShelfSpaceAds extends apiModel { +class ProductsShelfSpaceAds extends Model { protected $__productType = 'ShoppingModelProductJsonV1'; protected $__productDataType = ''; public $product; @@ -643,7 +644,7 @@ public function getProduct() { } } -class ProductsSpelling extends apiModel { +class ProductsSpelling extends Model { public $suggestion; public function setSuggestion($suggestion) { $this->suggestion = $suggestion; @@ -653,7 +654,7 @@ public function getSuggestion() { } } -class ProductsStores extends apiModel { +class ProductsStores extends Model { public $storeCode; public $name; public $storeId; @@ -698,7 +699,7 @@ public function getAddress() { } } -class ShoppingModelCategoryJsonV1 extends apiModel { +class ShoppingModelCategoryJsonV1 extends Model { public $url; public $shortName; public $parents; @@ -730,7 +731,7 @@ public function getId() { } } -class ShoppingModelDebugJsonV1 extends apiModel { +class ShoppingModelDebugJsonV1 extends Model { public $searchResponse; public $searchRequest; public $rdcResponse; @@ -771,7 +772,7 @@ public function getElapsedMillis() { } } -class ShoppingModelDebugJsonV1BackendTimes extends apiModel { +class ShoppingModelDebugJsonV1BackendTimes extends Model { public $serverMillis; public $hostName; public $name; @@ -802,7 +803,7 @@ public function getElapsedMillis() { } } -class ShoppingModelProductJsonV1 extends apiModel { +class ShoppingModelProductJsonV1 extends Model { public $queryMatched; public $gtin; protected $__imagesType = 'ShoppingModelProductJsonV1Images'; @@ -1058,7 +1059,7 @@ public function getInternal15() { } } -class ShoppingModelProductJsonV1Attributes extends apiModel { +class ShoppingModelProductJsonV1Attributes extends Model { public $type; public $value; public $displayName; @@ -1096,7 +1097,7 @@ public function getUnit() { } } -class ShoppingModelProductJsonV1Author extends apiModel { +class ShoppingModelProductJsonV1Author extends Model { public $name; public $accountId; public function setName($name) { @@ -1113,7 +1114,7 @@ public function getAccountId() { } } -class ShoppingModelProductJsonV1Images extends apiModel { +class ShoppingModelProductJsonV1Images extends Model { public $link; protected $__thumbnailsType = 'ShoppingModelProductJsonV1ImagesThumbnails'; protected $__thumbnailsDataType = 'array'; @@ -1133,7 +1134,7 @@ public function getThumbnails() { } } -class ShoppingModelProductJsonV1ImagesThumbnails extends apiModel { +class ShoppingModelProductJsonV1ImagesThumbnails extends Model { public $content; public $width; public $link; @@ -1164,7 +1165,7 @@ public function getHeight() { } } -class ShoppingModelProductJsonV1Internal4 extends apiModel { +class ShoppingModelProductJsonV1Internal4 extends Model { public $node; public $confidence; public function setNode($node) { @@ -1181,7 +1182,7 @@ public function getConfidence() { } } -class ShoppingModelProductJsonV1Inventories extends apiModel { +class ShoppingModelProductJsonV1Inventories extends Model { public $distance; public $price; public $storeId; @@ -1247,7 +1248,7 @@ public function getChannel() { } } -class ShoppingModelProductJsonV1Variants extends apiModel { +class ShoppingModelProductJsonV1Variants extends Model { protected $__variantType = 'ShoppingModelProductJsonV1'; protected $__variantDataType = ''; public $variant; diff --git a/src/GoogleApi/contrib/apiSiteVerificationService.php b/src/GoogleApi/Contrib/apiSiteVerificationService.php similarity index 93% rename from src/GoogleApi/contrib/apiSiteVerificationService.php rename to src/GoogleApi/Contrib/apiSiteVerificationService.php index 0c4bdf7..a3deabc 100644 --- a/src/GoogleApi/contrib/apiSiteVerificationService.php +++ b/src/GoogleApi/Contrib/apiSiteVerificationService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "webResource" collection of methods. @@ -28,7 +29,7 @@ * $webResource = $siteVerificationService->webResource; * */ - class WebResourceServiceResource extends apiServiceResource { + class WebResourceServiceResource extends ServiceResource { /** @@ -163,25 +164,25 @@ public function delete($id, $optParams = array()) { * * @author Google, Inc. */ -class apiSiteVerificationService extends apiService { +class apiSiteVerificationService extends Service { public $webResource; /** * Constructs the internal representation of the SiteVerification service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/siteVerification/v1/'; $this->version = 'v1'; $this->serviceName = 'siteVerification'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->webResource = new WebResourceServiceResource($this, $this->serviceName, 'webResource', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"verificationMethod": {"required": true, "type": "string", "location": "query"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "id": "siteVerification.webResource.insert", "httpMethod": "POST", "path": "webResource", "response": {"$ref": "SiteVerificationWebResourceResource"}}, "get": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "id": "siteVerification.webResource.get", "httpMethod": "GET", "path": "webResource/{id}", "response": {"$ref": "SiteVerificationWebResourceResource"}}, "list": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "id": "siteVerification.webResource.list", "httpMethod": "GET", "path": "webResource", "response": {"$ref": "SiteVerificationWebResourceListResponse"}}, "update": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "id": "siteVerification.webResource.update", "httpMethod": "PUT", "path": "webResource/{id}", "response": {"$ref": "SiteVerificationWebResourceResource"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "id": "siteVerification.webResource.patch", "httpMethod": "PATCH", "path": "webResource/{id}", "response": {"$ref": "SiteVerificationWebResourceResource"}}, "getToken": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"type": {"type": "string", "location": "query"}, "identifier": {"type": "string", "location": "query"}, "verificationMethod": {"type": "string", "location": "query"}}, "response": {"$ref": "SiteVerificationWebResourceGettokenResponse"}, "httpMethod": "GET", "path": "token", "id": "siteVerification.webResource.getToken"}, "delete": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "webResource/{id}", "id": "siteVerification.webResource.delete"}}}', true)); } } -class SiteVerificationWebResourceGettokenRequest extends apiModel { +class SiteVerificationWebResourceGettokenRequest extends Model { public $verificationMethod; protected $__siteType = 'SiteVerificationWebResourceGettokenRequestSite'; protected $__siteDataType = ''; @@ -200,7 +201,7 @@ public function getSite() { } } -class SiteVerificationWebResourceGettokenRequestSite extends apiModel { +class SiteVerificationWebResourceGettokenRequestSite extends Model { public $identifier; public $type; public function setIdentifier($identifier) { @@ -217,7 +218,7 @@ public function getType() { } } -class SiteVerificationWebResourceGettokenResponse extends apiModel { +class SiteVerificationWebResourceGettokenResponse extends Model { public $token; public $method; public function setToken($token) { @@ -234,7 +235,7 @@ public function getMethod() { } } -class SiteVerificationWebResourceListResponse extends apiModel { +class SiteVerificationWebResourceListResponse extends Model { protected $__itemsType = 'SiteVerificationWebResourceResource'; protected $__itemsDataType = 'array'; public $items; @@ -247,7 +248,7 @@ public function getItems() { } } -class SiteVerificationWebResourceResource extends apiModel { +class SiteVerificationWebResourceResource extends Model { public $owners; public $id; protected $__siteType = 'SiteVerificationWebResourceResourceSite'; @@ -274,7 +275,7 @@ public function getSite() { } } -class SiteVerificationWebResourceResourceSite extends apiModel { +class SiteVerificationWebResourceResourceSite extends Model { public $identifier; public $type; public function setIdentifier($identifier) { diff --git a/src/GoogleApi/contrib/apiTasksService.php b/src/GoogleApi/Contrib/apiTasksService.php similarity index 97% rename from src/GoogleApi/contrib/apiTasksService.php rename to src/GoogleApi/Contrib/apiTasksService.php index c6b7a42..3c8c39f 100644 --- a/src/GoogleApi/contrib/apiTasksService.php +++ b/src/GoogleApi/Contrib/apiTasksService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "tasks" collection of methods. @@ -28,7 +29,7 @@ * $tasks = $tasksService->tasks; * */ - class TasksServiceResource extends apiServiceResource { + class TasksServiceResource extends ServiceResource { /** @@ -191,7 +192,7 @@ public function delete($tasklist, $task, $optParams = array()) { * $tasklists = $tasksService->tasklists; * */ - class TasklistsServiceResource extends apiServiceResource { + class TasklistsServiceResource extends ServiceResource { /** @@ -309,27 +310,27 @@ public function delete($tasklist, $optParams = array()) { * * @author Google, Inc. */ -class apiTasksService extends apiService { +class apiTasksService extends Service { public $tasks; public $tasklists; /** * Constructs the internal representation of the Tasks service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/tasks/v1/'; $this->version = 'v1'; $this->serviceName = 'tasks'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->tasks = new TasksServiceResource($this, $this->serviceName, 'tasks', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "parent": {"type": "string", "location": "query"}, "previous": {"type": "string", "location": "query"}}, "request": {"$ref": "Task"}, "id": "tasks.tasks.insert", "httpMethod": "POST", "path": "lists/{tasklist}/tasks", "response": {"$ref": "Task"}}, "get": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "id": "tasks.tasks.get", "httpMethod": "GET", "path": "lists/{tasklist}/tasks/{task}", "response": {"$ref": "Task"}}, "clear": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "POST", "path": "lists/{tasklist}/clear", "id": "tasks.tasks.clear"}, "move": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"previous": {"type": "string", "location": "query"}, "tasklist": {"required": true, "type": "string", "location": "path"}, "parent": {"type": "string", "location": "query"}, "task": {"required": true, "type": "string", "location": "path"}}, "id": "tasks.tasks.move", "httpMethod": "POST", "path": "lists/{tasklist}/tasks/{task}/move", "response": {"$ref": "Task"}}, "list": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"dueMax": {"type": "string", "location": "query"}, "tasklist": {"required": true, "type": "string", "location": "path"}, "pageToken": {"type": "string", "location": "query"}, "updatedMin": {"type": "string", "location": "query"}, "completedMin": {"type": "string", "location": "query"}, "maxResults": {"format": "int64", "type": "string", "location": "query"}, "showCompleted": {"type": "boolean", "location": "query"}, "showDeleted": {"type": "boolean", "location": "query"}, "completedMax": {"type": "string", "location": "query"}, "showHidden": {"type": "boolean", "location": "query"}, "dueMin": {"type": "string", "location": "query"}}, "id": "tasks.tasks.list", "httpMethod": "GET", "path": "lists/{tasklist}/tasks", "response": {"$ref": "Tasks"}}, "update": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Task"}, "id": "tasks.tasks.update", "httpMethod": "PUT", "path": "lists/{tasklist}/tasks/{task}", "response": {"$ref": "Task"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Task"}, "id": "tasks.tasks.patch", "httpMethod": "PATCH", "path": "lists/{tasklist}/tasks/{task}", "response": {"$ref": "Task"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "lists/{tasklist}/tasks/{task}", "id": "tasks.tasks.delete"}}}', true)); $this->tasklists = new TasklistsServiceResource($this, $this->serviceName, 'tasklists', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/tasks"], "request": {"$ref": "TaskList"}, "response": {"$ref": "TaskList"}, "httpMethod": "POST", "path": "users/@me/lists", "id": "tasks.tasklists.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "id": "tasks.tasklists.get", "httpMethod": "GET", "path": "users/@me/lists/{tasklist}", "response": {"$ref": "TaskList"}}, "list": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"format": "int64", "type": "string", "location": "query"}}, "response": {"$ref": "TaskLists"}, "httpMethod": "GET", "path": "users/@me/lists", "id": "tasks.tasklists.list"}, "update": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "TaskList"}, "id": "tasks.tasklists.update", "httpMethod": "PUT", "path": "users/@me/lists/{tasklist}", "response": {"$ref": "TaskList"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "TaskList"}, "id": "tasks.tasklists.patch", "httpMethod": "PATCH", "path": "users/@me/lists/{tasklist}", "response": {"$ref": "TaskList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE", "path": "users/@me/lists/{tasklist}", "id": "tasks.tasklists.delete"}}}', true)); } } -class Task extends apiModel { +class Task extends Model { public $status; public $kind; public $updated; @@ -440,7 +441,7 @@ public function getSelfLink() { } } -class TaskLinks extends apiModel { +class TaskLinks extends Model { public $type; public $link; public $description; @@ -464,7 +465,7 @@ public function getDescription() { } } -class TaskList extends apiModel { +class TaskList extends Model { public $kind; public $etag; public $id; @@ -502,7 +503,7 @@ public function getTitle() { } } -class TaskLists extends apiModel { +class TaskLists extends Model { public $nextPageToken; protected $__itemsType = 'TaskList'; protected $__itemsDataType = 'array'; @@ -536,7 +537,7 @@ public function getEtag() { } } -class Tasks extends apiModel { +class Tasks extends Model { public $nextPageToken; protected $__itemsType = 'Task'; protected $__itemsDataType = 'array'; diff --git a/src/GoogleApi/contrib/apiTranslateService.php b/src/GoogleApi/Contrib/apiTranslateService.php similarity index 90% rename from src/GoogleApi/contrib/apiTranslateService.php rename to src/GoogleApi/Contrib/apiTranslateService.php index 9a41af2..43dfa00 100644 --- a/src/GoogleApi/contrib/apiTranslateService.php +++ b/src/GoogleApi/Contrib/apiTranslateService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "languages" collection of methods. @@ -28,7 +29,7 @@ * $languages = $translateService->languages; * */ - class LanguagesServiceResource extends apiServiceResource { + class LanguagesServiceResource extends ServiceResource { /** @@ -59,7 +60,7 @@ public function listLanguages($optParams = array()) { * $detections = $translateService->detections; * */ - class DetectionsServiceResource extends apiServiceResource { + class DetectionsServiceResource extends ServiceResource { /** @@ -88,7 +89,7 @@ public function listDetections($q, $optParams = array()) { * $translations = $translateService->translations; * */ - class TranslationsServiceResource extends apiServiceResource { + class TranslationsServiceResource extends ServiceResource { /** @@ -131,29 +132,29 @@ public function listTranslations($q, $target, $optParams = array()) { * * @author Google, Inc. */ -class apiTranslateService extends apiService { +class apiTranslateService extends Service { public $languages; public $detections; public $translations; /** * Constructs the internal representation of the Translate service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/language/translate/'; $this->version = 'v2'; $this->serviceName = 'translate'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->languages = new LanguagesServiceResource($this, $this->serviceName, 'languages', json_decode('{"methods": {"list": {"parameters": {"target": {"type": "string", "location": "query"}}, "id": "language.languages.list", "httpMethod": "GET", "path": "v2/languages", "response": {"$ref": "LanguagesListResponse"}}}}', true)); $this->detections = new DetectionsServiceResource($this, $this->serviceName, 'detections', json_decode('{"methods": {"list": {"parameters": {"q": {"repeated": true, "required": true, "type": "string", "location": "query"}}, "id": "language.detections.list", "httpMethod": "GET", "path": "v2/detect", "response": {"$ref": "DetectionsListResponse"}}}}', true)); $this->translations = new TranslationsServiceResource($this, $this->serviceName, 'translations', json_decode('{"methods": {"list": {"parameters": {"q": {"repeated": true, "required": true, "type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "cid": {"repeated": true, "type": "string", "location": "query"}, "target": {"required": true, "type": "string", "location": "query"}, "format": {"enum": ["html", "text"], "type": "string", "location": "query"}}, "id": "language.translations.list", "httpMethod": "GET", "path": "v2", "response": {"$ref": "TranslationsListResponse"}}}}', true)); } } -class DetectionsListResponse extends apiModel { +class DetectionsListResponse extends Model { protected $__detectionsType = 'DetectionsResourceItems'; protected $__detectionsDataType = 'array'; public $detections; @@ -166,10 +167,10 @@ public function getDetections() { } } -class DetectionsResource extends apiModel { +class DetectionsResource extends Model { } -class DetectionsResourceItems extends apiModel { +class DetectionsResourceItems extends Model { public $isReliable; public $confidence; public $language; @@ -193,7 +194,7 @@ public function getLanguage() { } } -class LanguagesListResponse extends apiModel { +class LanguagesListResponse extends Model { protected $__languagesType = 'LanguagesResource'; protected $__languagesDataType = 'array'; public $languages; @@ -206,7 +207,7 @@ public function getLanguages() { } } -class LanguagesResource extends apiModel { +class LanguagesResource extends Model { public $name; public $language; public function setName($name) { @@ -223,7 +224,7 @@ public function getLanguage() { } } -class TranslationsListResponse extends apiModel { +class TranslationsListResponse extends Model { protected $__translationsType = 'TranslationsResource'; protected $__translationsDataType = 'array'; public $translations; @@ -236,7 +237,7 @@ public function getTranslations() { } } -class TranslationsResource extends apiModel { +class TranslationsResource extends Model { public $detectedSourceLanguage; public $translatedText; public function setDetectedSourceLanguage($detectedSourceLanguage) { diff --git a/src/GoogleApi/contrib/apiUrlshortenerService.php b/src/GoogleApi/Contrib/apiUrlshortenerService.php similarity index 94% rename from src/GoogleApi/contrib/apiUrlshortenerService.php rename to src/GoogleApi/Contrib/apiUrlshortenerService.php index a45211b..e5194ac 100644 --- a/src/GoogleApi/contrib/apiUrlshortenerService.php +++ b/src/GoogleApi/Contrib/apiUrlshortenerService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "url" collection of methods. @@ -28,7 +29,7 @@ * $url = $urlshortenerService->url; * */ - class UrlServiceResource extends apiServiceResource { + class UrlServiceResource extends ServiceResource { /** @@ -103,25 +104,25 @@ public function get($shortUrl, $optParams = array()) { * * @author Google, Inc. */ -class apiUrlshortenerService extends apiService { +class apiUrlshortenerService extends Service { public $url; /** * Constructs the internal representation of the Urlshortener service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/urlshortener/v1/'; $this->version = 'v1'; $this->serviceName = 'urlshortener'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->url = new UrlServiceResource($this, $this->serviceName, 'url', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/urlshortener"], "request": {"$ref": "Url"}, "response": {"$ref": "Url"}, "httpMethod": "POST", "path": "url", "id": "urlshortener.url.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/urlshortener"], "parameters": {"start-token": {"type": "string", "location": "query"}, "projection": {"enum": ["ANALYTICS_CLICKS", "FULL"], "type": "string", "location": "query"}}, "response": {"$ref": "UrlHistory"}, "httpMethod": "GET", "path": "url/history", "id": "urlshortener.url.list"}, "get": {"parameters": {"shortUrl": {"required": true, "type": "string", "location": "query"}, "projection": {"enum": ["ANALYTICS_CLICKS", "ANALYTICS_TOP_STRINGS", "FULL"], "type": "string", "location": "query"}}, "id": "urlshortener.url.get", "httpMethod": "GET", "path": "url", "response": {"$ref": "Url"}}}}', true)); } } -class AnalyticsSnapshot extends apiModel { +class AnalyticsSnapshot extends Model { public $shortUrlClicks; protected $__countriesType = 'StringCount'; protected $__countriesDataType = 'array'; @@ -178,7 +179,7 @@ public function getLongUrlClicks() { } } -class AnalyticsSummary extends apiModel { +class AnalyticsSummary extends Model { protected $__weekType = 'AnalyticsSnapshot'; protected $__weekDataType = ''; public $week; @@ -226,7 +227,7 @@ public function getMonth() { } } -class StringCount extends apiModel { +class StringCount extends Model { public $count; public $id; public function setCount($count) { @@ -243,7 +244,7 @@ public function getId() { } } -class Url extends apiModel { +class Url extends Model { public $status; public $kind; public $created; @@ -290,7 +291,7 @@ public function getId() { } } -class UrlHistory extends apiModel { +class UrlHistory extends Model { public $nextPageToken; protected $__itemsType = 'Url'; protected $__itemsDataType = 'array'; diff --git a/src/GoogleApi/contrib/apiWebfontsService.php b/src/GoogleApi/Contrib/apiWebfontsService.php similarity index 88% rename from src/GoogleApi/contrib/apiWebfontsService.php rename to src/GoogleApi/Contrib/apiWebfontsService.php index ff26ca5..c67deab 100644 --- a/src/GoogleApi/contrib/apiWebfontsService.php +++ b/src/GoogleApi/Contrib/apiWebfontsService.php @@ -15,10 +15,11 @@ * the License. */ -require_once 'service/apiModel.php'; -require_once 'service/apiService.php'; -require_once 'service/apiServiceRequest.php'; +namespace GoogleApi\Contrib; +use GoogleApi\Service\Model; +use GoogleApi\Service\Service; +use GoogleApi\Service\ServiceResource; /** * The "webfonts" collection of methods. @@ -28,7 +29,7 @@ * $webfonts = $webfontsService->webfonts; * */ - class WebfontsServiceResource extends apiServiceResource { + class WebfontsServiceResource extends ServiceResource { /** @@ -68,25 +69,25 @@ public function listWebfonts($optParams = array()) { * * @author Google, Inc. */ -class apiWebfontsService extends apiService { +class apiWebfontsService extends Service { public $webfonts; /** * Constructs the internal representation of the Webfonts service. * - * @param apiClient apiClient + * @param Client Client */ - public function __construct(apiClient $apiClient) { + public function __construct(Client $Client) { $this->rpcPath = '/rpc'; $this->restBasePath = '/webfonts/v1/'; $this->version = 'v1'; $this->serviceName = 'webfonts'; - $apiClient->addService($this->serviceName, $this->version); + $Client->addService($this->serviceName, $this->version); $this->webfonts = new WebfontsServiceResource($this, $this->serviceName, 'webfonts', json_decode('{"methods": {"list": {"parameters": {"sort": {"enum": ["alpha", "date", "popularity", "style", "trending"], "type": "string", "location": "query"}}, "id": "webfonts.webfonts.list", "httpMethod": "GET", "path": "webfonts", "response": {"$ref": "WebfontList"}}}}', true)); } } -class Webfont extends apiModel { +class Webfont extends Model { public $kind; public $variants; public $subsets; @@ -117,7 +118,7 @@ public function getFamily() { } } -class WebfontList extends apiModel { +class WebfontList extends Model { protected $__itemsType = 'Webfont'; protected $__itemsDataType = 'array'; public $items; diff --git a/src/GoogleApi/External/URITemplateParser.php b/src/GoogleApi/External/URITemplateParser.php new file mode 100644 index 0000000..909da1d --- /dev/null +++ b/src/GoogleApi/External/URITemplateParser.php @@ -0,0 +1,212 @@ +template = $template; + } + + public function expand($data) { + // Modification to make this a bit more performant (since gettype is very slow) + if (! is_array($data)) { + $data = (array)$data; + } + /* + // Original code, which uses a slow gettype() statement, kept in place for if the assumption that is_array always works here is incorrect + switch (gettype($data)) { + case "boolean": + case "integer": + case "double": + case "string": + case "object": + $data = (array)$data; + break; + } +*/ + + // Resolve template vars + preg_match_all('/\{([^\}]*)\}/', $this->template, $em); + + foreach ($em[1] as $i => $bare_expression) { + preg_match('/^([\+\;\?\/\.]{1})?(.*)$/', $bare_expression, $lm); + $exp = new \StdClass(); + $exp->expression = $em[0][$i]; + $exp->operator = $lm[1]; + $exp->variable_list = $lm[2]; + $exp->varspecs = explode(',', $exp->variable_list); + $exp->vars = array(); + foreach ($exp->varspecs as $varspec) { + preg_match('/^([a-zA-Z0-9_]+)([\*\+]{1})?([\:\^][0-9-]+)?(\=[^,]+)?$/', $varspec, $vm); + $var = new \StdClass(); + $var->name = $vm[1]; + $var->modifier = isset($vm[2]) && $vm[2] ? $vm[2] : null; + $var->modifier = isset($vm[3]) && $vm[3] ? $vm[3] : $var->modifier; + $var->default = isset($vm[4]) ? substr($vm[4], 1) : null; + $exp->vars[] = $var; + } + + // Add processing flags + $exp->reserved = false; + $exp->prefix = ''; + $exp->delimiter = ','; + switch ($exp->operator) { + case '+': + $exp->reserved = 'true'; + break; + case ';': + $exp->prefix = ';'; + $exp->delimiter = ';'; + break; + case '?': + $exp->prefix = '?'; + $exp->delimiter = '&'; + break; + case '/': + $exp->prefix = '/'; + $exp->delimiter = '/'; + break; + case '.': + $exp->prefix = '.'; + $exp->delimiter = '.'; + break; + } + $expressions[] = $exp; + } + + // Expansion + $this->expansion = $this->template; + + foreach ($expressions as $exp) { + $part = $exp->prefix; + $exp->one_var_defined = false; + foreach ($exp->vars as $var) { + $val = ''; + if ($exp->one_var_defined && isset($data[$var->name])) { + $part .= $exp->delimiter; + } + // Variable present + if (isset($data[$var->name])) { + $exp->one_var_defined = true; + $var->data = $data[$var->name]; + + $val = self::val_from_var($var, $exp); + + // Variable missing + } else { + if ($var->default) { + $exp->one_var_defined = true; + $val = $var->default; + } + } + $part .= $val; + } + if (! $exp->one_var_defined) $part = ''; + $this->expansion = str_replace($exp->expression, $part, $this->expansion); + } + + return $this->expansion; + } + + private function val_from_var($var, $exp) { + $val = ''; + if (is_array($var->data)) { + $i = 0; + if ($exp->operator == '?' && ! $var->modifier) { + $val .= $var->name . '='; + } + foreach ($var->data as $k => $v) { + $del = $var->modifier ? $exp->delimiter : ','; + $ek = rawurlencode($k); + $ev = rawurlencode($v); + + // Array + if ($k !== $i) { + if ($var->modifier == '+') { + $val .= $var->name . '.'; + } + if ($exp->operator == '?' && $var->modifier || $exp->operator == ';' && $var->modifier == '*' || $exp->operator == ';' && $var->modifier == '+') { + $val .= $ek . '='; + } else { + $val .= $ek . $del; + } + + // List + } else { + if ($var->modifier == '+') { + if ($exp->operator == ';' && $var->modifier == '*' || $exp->operator == ';' && $var->modifier == '+' || $exp->operator == '?' && $var->modifier == '+') { + $val .= $var->name . '='; + } else { + $val .= $var->name . '.'; + } + } + } + $val .= $ev . $del; + $i ++; + } + $val = trim($val, $del); + + // Strings, numbers, etc. + } else { + if ($exp->operator == '?') { + $val = $var->name . (isset($var->data) ? '=' : ''); + } else if ($exp->operator == ';') { + $val = $var->name . ($var->data ? '=' : ''); + } + $val .= rawurlencode($var->data); + if ($exp->operator == '+') { + $val = str_replace(self::$reserved_pct, self::$reserved, $val); + } + } + return $val; + } + + public function match($uri) {} + + public function __toString() { + return $this->template; + } +} diff --git a/src/GoogleApi/Io/HttpRequest.php b/src/GoogleApi/Io/HttpRequest.php index 6c20a60..1b2aeb5 100644 --- a/src/GoogleApi/Io/HttpRequest.php +++ b/src/GoogleApi/Io/HttpRequest.php @@ -17,6 +17,7 @@ namespace GoogleApi\Io; use GoogleApi\Service\Utils; +use GoogleApi\Config; /** * HTTP Request to be executed by IO classes. Upon execution, the @@ -53,11 +54,10 @@ public function __construct($url, $method = 'GET', $headers = array(), $postBody $this->setRequestHeaders($headers); $this->setPostBody($postBody); - global $apiConfig; - if (empty($apiConfig['application_name'])) { + if (!Config::has('application_name')) { $this->userAgent = self::USER_AGENT_SUFFIX; } else { - $this->userAgent = $apiConfig['application_name'] . " " . self::USER_AGENT_SUFFIX; + $this->userAgent = Config::get('application_name') . " " . self::USER_AGENT_SUFFIX; } } @@ -195,8 +195,7 @@ public function setUrl($url) { if (substr($url, 0, 4) == 'http') { $this->url = $url; } else { - global $apiConfig; - $this->url = $apiConfig['basePath'] . $url; + $this->url = Config::get('basePath') . $url; } } diff --git a/src/GoogleApi/Io/REST.php b/src/GoogleApi/Io/REST.php index 3ac1793..0d02102 100644 --- a/src/GoogleApi/Io/REST.php +++ b/src/GoogleApi/Io/REST.php @@ -18,6 +18,7 @@ use GoogleApi\Client; use GoogleApi\Service; +use GoogleApi\External\URITemplateParser; /** * This class implements the RESTful transport of Service\ServiceRequest()'s @@ -116,7 +117,7 @@ static function createRequestUri($basePath, $restPath, $params) { } if (count($uriTemplateVars)) { - $uriTemplateParser = new URI_Template_Parser($requestUrl); + $uriTemplateParser = new URITemplateParser($requestUrl); $requestUrl = $uriTemplateParser->expand($uriTemplateVars); } //FIXME work around for the the uri template lib which url encodes diff --git a/src/GoogleApi/Service/BatchRequest.php b/src/GoogleApi/Service/BatchRequest.php index 536184f..87729c5 100644 --- a/src/GoogleApi/Service/BatchRequest.php +++ b/src/GoogleApi/Service/BatchRequest.php @@ -20,6 +20,7 @@ use GoogleApi\Client; use GoogleApi\Io\CurlIO; use GoogleApi\Io\REST; +use GoogleApi\Config; /** * @author Chirag Shah @@ -56,8 +57,7 @@ public function execute() { $body = rtrim($body); $body .= "\n--{$this->boundary}--"; - global $apiConfig; - $url = $apiConfig['basePath'] . '/batch'; + $url = Config::get('basePath') . '/batch'; $httpRequest = new HttpRequest($url, 'POST'); $httpRequest->setRequestHeaders(array( 'Content-Type' => 'multipart/mixed; boundary=' . $this->boundary)); diff --git a/src/GoogleApi/Service/Model.php b/src/GoogleApi/Service/Model.php index edf568c..f8ffca4 100644 --- a/src/GoogleApi/Service/Model.php +++ b/src/GoogleApi/Service/Model.php @@ -16,6 +16,8 @@ */ namespace GoogleApi\Service; +use GoogleApi\Config; + /** * This class defines attributes, valid values, and usage which is generated from * a given json schema. http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5 @@ -96,8 +98,7 @@ private function createObjectFromName($name, $item) { } protected function useObjects() { - global $apiConfig; - return (isset($apiConfig['use_objects']) && $apiConfig['use_objects']); + return Config::get('use_objects', false); } /** diff --git a/src/GoogleApi/Service/ServiceResource.php b/src/GoogleApi/Service/ServiceResource.php index e01fc1c..934eb96 100644 --- a/src/GoogleApi/Service/ServiceResource.php +++ b/src/GoogleApi/Service/ServiceResource.php @@ -19,6 +19,7 @@ use GoogleApi\Io\HttpRequest; use GoogleApi\Io\REST; use GoogleApi\Client; +use GoogleApi\Config; /** * Implements the actual methods/resources of the discovered Google API using magic function @@ -184,8 +185,7 @@ public function __call($name, $arguments) { } protected function useObjects() { - global $apiConfig; - return (isset($apiConfig['use_objects']) && $apiConfig['use_objects']); + return Config::get('use_objects', false); } protected function stripNull(&$o) { diff --git a/src/GoogleApi/config.php b/src/GoogleApi/config.php deleted file mode 100644 index 22ee535..0000000 --- a/src/GoogleApi/config.php +++ /dev/null @@ -1,92 +0,0 @@ - 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' => '', - - // OAuth1 Settings. - // If you're using the apiOAuth auth class, it will use these values for the oauth consumer key and secret. - // See http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.html for info on how to obtain those - 'oauth_consumer_key' => 'anonymous', - 'oauth_consumer_secret' => 'anonymous', - - // 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' => 'apiOAuth2', - 'ioClass' => 'apiCurlIO', - 'cacheClass' => 'apiFileCache', - - // If you want to run the test suite (by running # phpunit AllTests.php in the tests/ directory), fill in the settings below - 'oauth_test_token' => '', // the oauth access token to use (which you can get by runing authenticate() as the test user and copying the token value), ie '{"key":"foo","secret":"bar","callback_url":null}' - 'oauth_test_user' => '', // and the user ID to use, this can either be a vanity name 'testuser' or a numberic ID '123456' - - // 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() . '/apiClient' : - '/tmp/apiClient'), - 'ioMemCacheStorage_host' => '127.0.0.1', - 'ioMemcacheStorage_port' => '11211', - - // 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') - ) -); \ No newline at end of file