| 1 |
<?php |
| 2 |
/* |
| 3 |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 |
* use this file except in compliance with the License. You may obtain a copy of |
| 5 |
* the License at |
| 6 |
* |
| 7 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
* |
| 9 |
* Unless required by applicable law or agreed to in writing, software |
| 10 |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 |
* License for the specific language governing permissions and limitations under |
| 13 |
* the License. |
| 14 |
*/ |
| 15 |
|
| 16 |
|
| 17 |
/** |
| 18 |
* The "pagespeedapi" collection of methods. |
| 19 |
* Typical usage is: |
| 20 |
* <code> |
| 21 |
* $pagespeedonlineService = new Google_PagespeedonlineService(...); |
| 22 |
* $pagespeedapi = $pagespeedonlineService->pagespeedapi; |
| 23 |
* </code> |
| 24 |
*/ |
| 25 |
class Google_PagespeedapiServiceResource extends Google_ServiceResource { |
| 26 |
|
| 27 |
|
| 28 |
/** |
| 29 |
* Runs Page Speed analysis on the page at the specified URL, and returns a Page Speed score, a list |
| 30 |
* of suggestions to make that page faster, and other information. (pagespeedapi.runpagespeed) |
| 31 |
* |
| 32 |
* @param string $url The URL to fetch and analyze |
| 33 |
* @param array $optParams Optional parameters. |
| 34 |
* |
| 35 |
* @opt_param string locale The locale used to localize formatted results |
| 36 |
* @opt_param string rule A Page Speed rule to run; if none are given, all rules are run |
| 37 |
* @opt_param string strategy The analysis strategy to use |
| 38 |
* @return Google_Result |
| 39 |
*/ |
| 40 |
public function runpagespeed($url, $optParams = array()) { |
| 41 |
$params = array('url' => $url); |
| 42 |
$params = array_merge($params, $optParams); |
| 43 |
$data = $this->__call('runpagespeed', array($params)); |
| 44 |
if ($this->useObjects()) { |
| 45 |
return new Google_Result($data); |
| 46 |
} else { |
| 47 |
return $data; |
| 48 |
} |
| 49 |
} |
| 50 |
} |
| 51 |
|
| 52 |
/** |
| 53 |
* Service definition for Google_Pagespeedonline (v1). |
| 54 |
* |
| 55 |
* <p> |
| 56 |
* Lets you analyze the performance of a web page and get tailored suggestions to make that page faster. |
| 57 |
* </p> |
| 58 |
* |
| 59 |
* <p> |
| 60 |
* For more information about this service, see the |
| 61 |
* <a href="https://code.google.com/apis/pagespeedonline/v1/getting_started.html" target="_blank">API Documentation</a> |
| 62 |
* </p> |
| 63 |
* |
| 64 |
* @author Google, Inc. |
| 65 |
*/ |
| 66 |
class Google_PagespeedonlineService extends Google_Service { |
| 67 |
public $pagespeedapi; |
| 68 |
/** |
| 69 |
* Constructs the internal representation of the Pagespeedonline service. |
| 70 |
* |
| 71 |
* @param Google_Client $client |
| 72 |
*/ |
| 73 |
public function __construct(Google_Client $client) { |
| 74 |
$this->servicePath = 'pagespeedonline/v1/'; |
| 75 |
$this->version = 'v1'; |
| 76 |
$this->serviceName = 'pagespeedonline'; |
| 77 |
|
| 78 |
$client->addService($this->serviceName, $this->version); |
| 79 |
$this->pagespeedapi = new Google_PagespeedapiServiceResource($this, $this->serviceName, 'pagespeedapi', json_decode('{"methods": {"runpagespeed": {"httpMethod": "GET", "response": {"$ref": "Result"}, "id": "pagespeedonline.pagespeedapi.runpagespeed", "parameters": {"locale": {"type": "string", "location": "query"}, "url": {"required": true, "type": "string", "location": "query"}, "rule": {"repeated": true, "type": "string", "location": "query"}, "strategy": {"enum": ["desktop", "mobile"], "type": "string", "location": "query"}}, "path": "runPagespeed"}}}', true)); |
| 80 |
|
| 81 |
} |
| 82 |
} |
| 83 |
|
| 84 |
class Google_Result extends Google_Model { |
| 85 |
public $kind; |
| 86 |
protected $__formattedResultsType = 'Google_ResultFormattedResults'; |
| 87 |
protected $__formattedResultsDataType = ''; |
| 88 |
public $formattedResults; |
| 89 |
public $title; |
| 90 |
protected $__versionType = 'Google_ResultVersion'; |
| 91 |
protected $__versionDataType = ''; |
| 92 |
public $version; |
| 93 |
public $score; |
| 94 |
public $responseCode; |
| 95 |
public $invalidRules; |
| 96 |
protected $__pageStatsType = 'Google_ResultPageStats'; |
| 97 |
protected $__pageStatsDataType = ''; |
| 98 |
public $pageStats; |
| 99 |
public $id; |
| 100 |
public function setKind($kind) { |
| 101 |
$this->kind = $kind; |
| 102 |
} |
| 103 |
public function getKind() { |
| 104 |
return $this->kind; |
| 105 |
} |
| 106 |
public function setFormattedResults(Google_ResultFormattedResults $formattedResults) { |
| 107 |
$this->formattedResults = $formattedResults; |
| 108 |
} |
| 109 |
public function getFormattedResults() { |
| 110 |
return $this->formattedResults; |
| 111 |
} |
| 112 |
public function setTitle($title) { |
| 113 |
$this->title = $title; |
| 114 |
} |
| 115 |
public function getTitle() { |
| 116 |
return $this->title; |
| 117 |
} |
| 118 |
public function setVersion(Google_ResultVersion $version) { |
| 119 |
$this->version = $version; |
| 120 |
} |
| 121 |
public function getVersion() { |
| 122 |
return $this->version; |
| 123 |
} |
| 124 |
public function setScore($score) { |
| 125 |
$this->score = $score; |
| 126 |
} |
| 127 |
public function getScore() { |
| 128 |
return $this->score; |
| 129 |
} |
| 130 |
public function setResponseCode($responseCode) { |
| 131 |
$this->responseCode = $responseCode; |
| 132 |
} |
| 133 |
public function getResponseCode() { |
| 134 |
return $this->responseCode; |
| 135 |
} |
| 136 |
public function setInvalidRules(/* array(Google_string) */ $invalidRules) { |
| 137 |
$this->assertIsArray($invalidRules, 'Google_string', __METHOD__); |
| 138 |
$this->invalidRules = $invalidRules; |
| 139 |
} |
| 140 |
public function getInvalidRules() { |
| 141 |
return $this->invalidRules; |
| 142 |
} |
| 143 |
public function setPageStats(Google_ResultPageStats $pageStats) { |
| 144 |
$this->pageStats = $pageStats; |
| 145 |
} |
| 146 |
public function getPageStats() { |
| 147 |
return $this->pageStats; |
| 148 |
} |
| 149 |
public function setId($id) { |
| 150 |
$this->id = $id; |
| 151 |
} |
| 152 |
public function getId() { |
| 153 |
return $this->id; |
| 154 |
} |
| 155 |
} |
| 156 |
|
| 157 |
class Google_ResultFormattedResults extends Google_Model { |
| 158 |
public $locale; |
| 159 |
protected $__ruleResultsType = 'Google_ResultFormattedResultsRuleResults'; |
| 160 |
protected $__ruleResultsDataType = 'map'; |
| 161 |
public $ruleResults; |
| 162 |
public function setLocale($locale) { |
| 163 |
$this->locale = $locale; |
| 164 |
} |
| 165 |
public function getLocale() { |
| 166 |
return $this->locale; |
| 167 |
} |
| 168 |
public function setRuleResults(Google_ResultFormattedResultsRuleResults $ruleResults) { |
| 169 |
$this->ruleResults = $ruleResults; |
| 170 |
} |
| 171 |
public function getRuleResults() { |
| 172 |
return $this->ruleResults; |
| 173 |
} |
| 174 |
} |
| 175 |
|
| 176 |
class Google_ResultFormattedResultsRuleResults extends Google_Model { |
| 177 |
public $localizedRuleName; |
| 178 |
protected $__urlBlocksType = 'Google_ResultFormattedResultsRuleResultsUrlBlocks'; |
| 179 |
protected $__urlBlocksDataType = 'array'; |
| 180 |
public $urlBlocks; |
| 181 |
public $ruleScore; |
| 182 |
public $ruleImpact; |
| 183 |
public function setLocalizedRuleName($localizedRuleName) { |
| 184 |
$this->localizedRuleName = $localizedRuleName; |
| 185 |
} |
| 186 |
public function getLocalizedRuleName() { |
| 187 |
return $this->localizedRuleName; |
| 188 |
} |
| 189 |
public function setUrlBlocks(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocks) */ $urlBlocks) { |
| 190 |
$this->assertIsArray($urlBlocks, 'Google_ResultFormattedResultsRuleResultsUrlBlocks', __METHOD__); |
| 191 |
$this->urlBlocks = $urlBlocks; |
| 192 |
} |
| 193 |
public function getUrlBlocks() { |
| 194 |
return $this->urlBlocks; |
| 195 |
} |
| 196 |
public function setRuleScore($ruleScore) { |
| 197 |
$this->ruleScore = $ruleScore; |
| 198 |
} |
| 199 |
public function getRuleScore() { |
| 200 |
return $this->ruleScore; |
| 201 |
} |
| 202 |
public function setRuleImpact($ruleImpact) { |
| 203 |
$this->ruleImpact = $ruleImpact; |
| 204 |
} |
| 205 |
public function getRuleImpact() { |
| 206 |
return $this->ruleImpact; |
| 207 |
} |
| 208 |
} |
| 209 |
|
| 210 |
class Google_ResultFormattedResultsRuleResultsUrlBlocks extends Google_Model { |
| 211 |
protected $__headerType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksHeader'; |
| 212 |
protected $__headerDataType = ''; |
| 213 |
public $header; |
| 214 |
protected $__urlsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrls'; |
| 215 |
protected $__urlsDataType = 'array'; |
| 216 |
public $urls; |
| 217 |
public function setHeader(Google_ResultFormattedResultsRuleResultsUrlBlocksHeader $header) { |
| 218 |
$this->header = $header; |
| 219 |
} |
| 220 |
public function getHeader() { |
| 221 |
return $this->header; |
| 222 |
} |
| 223 |
public function setUrls(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrls) */ $urls) { |
| 224 |
$this->assertIsArray($urls, 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrls', __METHOD__); |
| 225 |
$this->urls = $urls; |
| 226 |
} |
| 227 |
public function getUrls() { |
| 228 |
return $this->urls; |
| 229 |
} |
| 230 |
} |
| 231 |
|
| 232 |
class Google_ResultFormattedResultsRuleResultsUrlBlocksHeader extends Google_Model { |
| 233 |
protected $__argsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs'; |
| 234 |
protected $__argsDataType = 'array'; |
| 235 |
public $args; |
| 236 |
public $format; |
| 237 |
public function setArgs(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs) */ $args) { |
| 238 |
$this->assertIsArray($args, 'Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs', __METHOD__); |
| 239 |
$this->args = $args; |
| 240 |
} |
| 241 |
public function getArgs() { |
| 242 |
return $this->args; |
| 243 |
} |
| 244 |
public function setFormat($format) { |
| 245 |
$this->format = $format; |
| 246 |
} |
| 247 |
public function getFormat() { |
| 248 |
return $this->format; |
| 249 |
} |
| 250 |
} |
| 251 |
|
| 252 |
class Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs extends Google_Model { |
| 253 |
public $type; |
| 254 |
public $value; |
| 255 |
public function setType($type) { |
| 256 |
$this->type = $type; |
| 257 |
} |
| 258 |
public function getType() { |
| 259 |
return $this->type; |
| 260 |
} |
| 261 |
public function setValue($value) { |
| 262 |
$this->value = $value; |
| 263 |
} |
| 264 |
public function getValue() { |
| 265 |
return $this->value; |
| 266 |
} |
| 267 |
} |
| 268 |
|
| 269 |
class Google_ResultFormattedResultsRuleResultsUrlBlocksUrls extends Google_Model { |
| 270 |
protected $__detailsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails'; |
| 271 |
protected $__detailsDataType = 'array'; |
| 272 |
public $details; |
| 273 |
protected $__resultType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResult'; |
| 274 |
protected $__resultDataType = ''; |
| 275 |
public $result; |
| 276 |
public function setDetails(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails) */ $details) { |
| 277 |
$this->assertIsArray($details, 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails', __METHOD__); |
| 278 |
$this->details = $details; |
| 279 |
} |
| 280 |
public function getDetails() { |
| 281 |
return $this->details; |
| 282 |
} |
| 283 |
public function setResult(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResult $result) { |
| 284 |
$this->result = $result; |
| 285 |
} |
| 286 |
public function getResult() { |
| 287 |
return $this->result; |
| 288 |
} |
| 289 |
} |
| 290 |
|
| 291 |
class Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails extends Google_Model { |
| 292 |
protected $__argsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs'; |
| 293 |
protected $__argsDataType = 'array'; |
| 294 |
public $args; |
| 295 |
public $format; |
| 296 |
public function setArgs(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs) */ $args) { |
| 297 |
$this->assertIsArray($args, 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs', __METHOD__); |
| 298 |
$this->args = $args; |
| 299 |
} |
| 300 |
public function getArgs() { |
| 301 |
return $this->args; |
| 302 |
} |
| 303 |
public function setFormat($format) { |
| 304 |
$this->format = $format; |
| 305 |
} |
| 306 |
public function getFormat() { |
| 307 |
return $this->format; |
| 308 |
} |
| 309 |
} |
| 310 |
|
| 311 |
class Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs extends Google_Model { |
| 312 |
public $type; |
| 313 |
public $value; |
| 314 |
public function setType($type) { |
| 315 |
$this->type = $type; |
| 316 |
} |
| 317 |
public function getType() { |
| 318 |
return $this->type; |
| 319 |
} |
| 320 |
public function setValue($value) { |
| 321 |
$this->value = $value; |
| 322 |
} |
| 323 |
public function getValue() { |
| 324 |
return $this->value; |
| 325 |
} |
| 326 |
} |
| 327 |
|
| 328 |
class Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResult extends Google_Model { |
| 329 |
protected $__argsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs'; |
| 330 |
protected $__argsDataType = 'array'; |
| 331 |
public $args; |
| 332 |
public $format; |
| 333 |
public function setArgs(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs) */ $args) { |
| 334 |
$this->assertIsArray($args, 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs', __METHOD__); |
| 335 |
$this->args = $args; |
| 336 |
} |
| 337 |
public function getArgs() { |
| 338 |
return $this->args; |
| 339 |
} |
| 340 |
public function setFormat($format) { |
| 341 |
$this->format = $format; |
| 342 |
} |
| 343 |
public function getFormat() { |
| 344 |
return $this->format; |
| 345 |
} |
| 346 |
} |
| 347 |
|
| 348 |
class Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs extends Google_Model { |
| 349 |
public $type; |
| 350 |
public $value; |
| 351 |
public function setType($type) { |
| 352 |
$this->type = $type; |
| 353 |
} |
| 354 |
public function getType() { |
| 355 |
return $this->type; |
| 356 |
} |
| 357 |
public function setValue($value) { |
| 358 |
$this->value = $value; |
| 359 |
} |
| 360 |
public function getValue() { |
| 361 |
return $this->value; |
| 362 |
} |
| 363 |
} |
| 364 |
|
| 365 |
class Google_ResultPageStats extends Google_Model { |
| 366 |
public $otherResponseBytes; |
| 367 |
public $flashResponseBytes; |
| 368 |
public $totalRequestBytes; |
| 369 |
public $numberCssResources; |
| 370 |
public $numberResources; |
| 371 |
public $cssResponseBytes; |
| 372 |
public $javascriptResponseBytes; |
| 373 |
public $imageResponseBytes; |
| 374 |
public $numberHosts; |
| 375 |
public $numberStaticResources; |
| 376 |
public $htmlResponseBytes; |
| 377 |
public $numberJsResources; |
| 378 |
public $textResponseBytes; |
| 379 |
public function setOtherResponseBytes($otherResponseBytes) { |
| 380 |
$this->otherResponseBytes = $otherResponseBytes; |
| 381 |
} |
| 382 |
public function getOtherResponseBytes() { |
| 383 |
return $this->otherResponseBytes; |
| 384 |
} |
| 385 |
public function setFlashResponseBytes($flashResponseBytes) { |
| 386 |
$this->flashResponseBytes = $flashResponseBytes; |
| 387 |
} |
| 388 |
public function getFlashResponseBytes() { |
| 389 |
return $this->flashResponseBytes; |
| 390 |
} |
| 391 |
public function setTotalRequestBytes($totalRequestBytes) { |
| 392 |
$this->totalRequestBytes = $totalRequestBytes; |
| 393 |
} |
| 394 |
public function getTotalRequestBytes() { |
| 395 |
return $this->totalRequestBytes; |
| 396 |
} |
| 397 |
public function setNumberCssResources($numberCssResources) { |
| 398 |
$this->numberCssResources = $numberCssResources; |
| 399 |
} |
| 400 |
public function getNumberCssResources() { |
| 401 |
return $this->numberCssResources; |
| 402 |
} |
| 403 |
public function setNumberResources($numberResources) { |
| 404 |
$this->numberResources = $numberResources; |
| 405 |
} |
| 406 |
public function getNumberResources() { |
| 407 |
return $this->numberResources; |
| 408 |
} |
| 409 |
public function setCssResponseBytes($cssResponseBytes) { |
| 410 |
$this->cssResponseBytes = $cssResponseBytes; |
| 411 |
} |
| 412 |
public function getCssResponseBytes() { |
| 413 |
return $this->cssResponseBytes; |
| 414 |
} |
| 415 |
public function setJavascriptResponseBytes($javascriptResponseBytes) { |
| 416 |
$this->javascriptResponseBytes = $javascriptResponseBytes; |
| 417 |
} |
| 418 |
public function getJavascriptResponseBytes() { |
| 419 |
return $this->javascriptResponseBytes; |
| 420 |
} |
| 421 |
public function setImageResponseBytes($imageResponseBytes) { |
| 422 |
$this->imageResponseBytes = $imageResponseBytes; |
| 423 |
} |
| 424 |
public function getImageResponseBytes() { |
| 425 |
return $this->imageResponseBytes; |
| 426 |
} |
| 427 |
public function setNumberHosts($numberHosts) { |
| 428 |
$this->numberHosts = $numberHosts; |
| 429 |
} |
| 430 |
public function getNumberHosts() { |
| 431 |
return $this->numberHosts; |
| 432 |
} |
| 433 |
public function setNumberStaticResources($numberStaticResources) { |
| 434 |
$this->numberStaticResources = $numberStaticResources; |
| 435 |
} |
| 436 |
public function getNumberStaticResources() { |
| 437 |
return $this->numberStaticResources; |
| 438 |
} |
| 439 |
public function setHtmlResponseBytes($htmlResponseBytes) { |
| 440 |
$this->htmlResponseBytes = $htmlResponseBytes; |
| 441 |
} |
| 442 |
public function getHtmlResponseBytes() { |
| 443 |
return $this->htmlResponseBytes; |
| 444 |
} |
| 445 |
public function setNumberJsResources($numberJsResources) { |
| 446 |
$this->numberJsResources = $numberJsResources; |
| 447 |
} |
| 448 |
public function getNumberJsResources() { |
| 449 |
return $this->numberJsResources; |
| 450 |
} |
| 451 |
public function setTextResponseBytes($textResponseBytes) { |
| 452 |
$this->textResponseBytes = $textResponseBytes; |
| 453 |
} |
| 454 |
public function getTextResponseBytes() { |
| 455 |
return $this->textResponseBytes; |
| 456 |
} |
| 457 |
} |
| 458 |
|
| 459 |
class Google_ResultVersion extends Google_Model { |
| 460 |
public $major; |
| 461 |
public $minor; |
| 462 |
public function setMajor($major) { |
| 463 |
$this->major = $major; |
| 464 |
} |
| 465 |
public function getMajor() { |
| 466 |
return $this->major; |
| 467 |
} |
| 468 |
public function setMinor($minor) { |
| 469 |
$this->minor = $minor; |
| 470 |
} |
| 471 |
public function getMinor() { |
| 472 |
return $this->minor; |
| 473 |
} |
| 474 |
} |
| 475 |
|