PageRenderTime 51ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/src/Google/Service/Pagespeedonline.php

https://github.com/leogaggl/pluspress
PHP | 811 lines | 611 code | 135 blank | 65 comment | 0 complexity | 9ae264e1245d3e264a9b868da32e5489 MD5 | raw file
  1. <?php
  2. /*
  3. * Copyright 2010 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. /**
  18. * Service definition for Pagespeedonline (v1).
  19. *
  20. * <p>
  21. * Lets you analyze the performance of a web page and get tailored suggestions to make that page faster.
  22. * </p>
  23. *
  24. * <p>
  25. * For more information about this service, see the API
  26. * <a href="https://developers.google.com/speed/docs/insights/v1/getting_started" target="_blank">Documentation</a>
  27. * </p>
  28. *
  29. * @author Google, Inc.
  30. */
  31. class Google_Service_Pagespeedonline extends Google_Service
  32. {
  33. public $pagespeedapi;
  34. /**
  35. * Constructs the internal representation of the Pagespeedonline service.
  36. *
  37. * @param Google_Client $client
  38. */
  39. public function __construct(Google_Client $client)
  40. {
  41. parent::__construct($client);
  42. $this->servicePath = 'pagespeedonline/v1/';
  43. $this->version = 'v1';
  44. $this->serviceName = 'pagespeedonline';
  45. $this->pagespeedapi = new Google_Service_Pagespeedonline_Pagespeedapi_Resource(
  46. $this,
  47. $this->serviceName,
  48. 'pagespeedapi',
  49. array(
  50. 'methods' => array(
  51. 'runpagespeed' => array(
  52. 'path' => 'runPagespeed',
  53. 'httpMethod' => 'GET',
  54. 'parameters' => array(
  55. 'url' => array(
  56. 'location' => 'query',
  57. 'type' => 'string',
  58. 'required' => true,
  59. ),
  60. 'screenshot' => array(
  61. 'location' => 'query',
  62. 'type' => 'boolean',
  63. ),
  64. 'locale' => array(
  65. 'location' => 'query',
  66. 'type' => 'string',
  67. ),
  68. 'snapshots' => array(
  69. 'location' => 'query',
  70. 'type' => 'boolean',
  71. ),
  72. 'strategy' => array(
  73. 'location' => 'query',
  74. 'type' => 'string',
  75. ),
  76. 'rule' => array(
  77. 'location' => 'query',
  78. 'type' => 'string',
  79. 'repeated' => true,
  80. ),
  81. 'filter_third_party_resources' => array(
  82. 'location' => 'query',
  83. 'type' => 'boolean',
  84. ),
  85. ),
  86. ),
  87. )
  88. )
  89. );
  90. }
  91. }
  92. /**
  93. * The "pagespeedapi" collection of methods.
  94. * Typical usage is:
  95. * <code>
  96. * $pagespeedonlineService = new Google_Service_Pagespeedonline(...);
  97. * $pagespeedapi = $pagespeedonlineService->pagespeedapi;
  98. * </code>
  99. */
  100. class Google_Service_Pagespeedonline_Pagespeedapi_Resource extends Google_Service_Resource
  101. {
  102. /**
  103. * Runs Page Speed analysis on the page at the specified URL, and returns a Page
  104. * Speed score, a list of suggestions to make that page faster, and other
  105. * information. (pagespeedapi.runpagespeed)
  106. *
  107. * @param string $url
  108. * The URL to fetch and analyze
  109. * @param array $optParams Optional parameters.
  110. *
  111. * @opt_param bool screenshot
  112. * Indicates if binary data containing a screenshot should be included
  113. * @opt_param string locale
  114. * The locale used to localize formatted results
  115. * @opt_param bool snapshots
  116. * Indicates if binary data containing snapshot images should be included
  117. * @opt_param string strategy
  118. * The analysis strategy to use
  119. * @opt_param string rule
  120. * A Page Speed rule to run; if none are given, all rules are run
  121. * @opt_param bool filterThirdPartyResources
  122. * Indicates if third party resources should be filtered out before PageSpeed analysis.
  123. * @return Google_Service_Pagespeedonline_Result
  124. */
  125. public function runpagespeed($url, $optParams = array())
  126. {
  127. $params = array('url' => $url);
  128. $params = array_merge($params, $optParams);
  129. return $this->call('runpagespeed', array($params), "Google_Service_Pagespeedonline_Result");
  130. }
  131. }
  132. class Google_Service_Pagespeedonline_Result extends Google_Collection
  133. {
  134. protected $formattedResultsType = 'Google_Service_Pagespeedonline_ResultFormattedResults';
  135. protected $formattedResultsDataType = '';
  136. public $id;
  137. public $invalidRules;
  138. public $kind;
  139. protected $pageStatsType = 'Google_Service_Pagespeedonline_ResultPageStats';
  140. protected $pageStatsDataType = '';
  141. protected $requestType = 'Google_Service_Pagespeedonline_ResultRequest';
  142. protected $requestDataType = '';
  143. public $responseCode;
  144. public $score;
  145. protected $screenshotType = 'Google_Service_Pagespeedonline_ResultScreenshot';
  146. protected $screenshotDataType = '';
  147. public $title;
  148. protected $versionType = 'Google_Service_Pagespeedonline_ResultVersion';
  149. protected $versionDataType = '';
  150. public function setFormattedResults(Google_Service_Pagespeedonline_ResultFormattedResults $formattedResults)
  151. {
  152. $this->formattedResults = $formattedResults;
  153. }
  154. public function getFormattedResults()
  155. {
  156. return $this->formattedResults;
  157. }
  158. public function setId($id)
  159. {
  160. $this->id = $id;
  161. }
  162. public function getId()
  163. {
  164. return $this->id;
  165. }
  166. public function setInvalidRules($invalidRules)
  167. {
  168. $this->invalidRules = $invalidRules;
  169. }
  170. public function getInvalidRules()
  171. {
  172. return $this->invalidRules;
  173. }
  174. public function setKind($kind)
  175. {
  176. $this->kind = $kind;
  177. }
  178. public function getKind()
  179. {
  180. return $this->kind;
  181. }
  182. public function setPageStats(Google_Service_Pagespeedonline_ResultPageStats $pageStats)
  183. {
  184. $this->pageStats = $pageStats;
  185. }
  186. public function getPageStats()
  187. {
  188. return $this->pageStats;
  189. }
  190. public function setRequest(Google_Service_Pagespeedonline_ResultRequest $request)
  191. {
  192. $this->request = $request;
  193. }
  194. public function getRequest()
  195. {
  196. return $this->request;
  197. }
  198. public function setResponseCode($responseCode)
  199. {
  200. $this->responseCode = $responseCode;
  201. }
  202. public function getResponseCode()
  203. {
  204. return $this->responseCode;
  205. }
  206. public function setScore($score)
  207. {
  208. $this->score = $score;
  209. }
  210. public function getScore()
  211. {
  212. return $this->score;
  213. }
  214. public function setScreenshot(Google_Service_Pagespeedonline_ResultScreenshot $screenshot)
  215. {
  216. $this->screenshot = $screenshot;
  217. }
  218. public function getScreenshot()
  219. {
  220. return $this->screenshot;
  221. }
  222. public function setTitle($title)
  223. {
  224. $this->title = $title;
  225. }
  226. public function getTitle()
  227. {
  228. return $this->title;
  229. }
  230. public function setVersion(Google_Service_Pagespeedonline_ResultVersion $version)
  231. {
  232. $this->version = $version;
  233. }
  234. public function getVersion()
  235. {
  236. return $this->version;
  237. }
  238. }
  239. class Google_Service_Pagespeedonline_ResultFormattedResults extends Google_Model
  240. {
  241. public $locale;
  242. protected $ruleResultsType = 'Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElement';
  243. protected $ruleResultsDataType = 'map';
  244. public function setLocale($locale)
  245. {
  246. $this->locale = $locale;
  247. }
  248. public function getLocale()
  249. {
  250. return $this->locale;
  251. }
  252. public function setRuleResults($ruleResults)
  253. {
  254. $this->ruleResults = $ruleResults;
  255. }
  256. public function getRuleResults()
  257. {
  258. return $this->ruleResults;
  259. }
  260. }
  261. class Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElement extends Google_Collection
  262. {
  263. public $localizedRuleName;
  264. public $ruleImpact;
  265. protected $urlBlocksType = 'Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocks';
  266. protected $urlBlocksDataType = 'array';
  267. public function setLocalizedRuleName($localizedRuleName)
  268. {
  269. $this->localizedRuleName = $localizedRuleName;
  270. }
  271. public function getLocalizedRuleName()
  272. {
  273. return $this->localizedRuleName;
  274. }
  275. public function setRuleImpact($ruleImpact)
  276. {
  277. $this->ruleImpact = $ruleImpact;
  278. }
  279. public function getRuleImpact()
  280. {
  281. return $this->ruleImpact;
  282. }
  283. public function setUrlBlocks($urlBlocks)
  284. {
  285. $this->urlBlocks = $urlBlocks;
  286. }
  287. public function getUrlBlocks()
  288. {
  289. return $this->urlBlocks;
  290. }
  291. }
  292. class Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocks extends Google_Collection
  293. {
  294. protected $headerType = 'Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksHeader';
  295. protected $headerDataType = '';
  296. protected $urlsType = 'Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksUrls';
  297. protected $urlsDataType = 'array';
  298. public function setHeader(Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksHeader $header)
  299. {
  300. $this->header = $header;
  301. }
  302. public function getHeader()
  303. {
  304. return $this->header;
  305. }
  306. public function setUrls($urls)
  307. {
  308. $this->urls = $urls;
  309. }
  310. public function getUrls()
  311. {
  312. return $this->urls;
  313. }
  314. }
  315. class Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksHeader extends Google_Collection
  316. {
  317. protected $argsType = 'Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksHeaderArgs';
  318. protected $argsDataType = 'array';
  319. public $format;
  320. public function setArgs($args)
  321. {
  322. $this->args = $args;
  323. }
  324. public function getArgs()
  325. {
  326. return $this->args;
  327. }
  328. public function setFormat($format)
  329. {
  330. $this->format = $format;
  331. }
  332. public function getFormat()
  333. {
  334. return $this->format;
  335. }
  336. }
  337. class Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksHeaderArgs extends Google_Model
  338. {
  339. public $type;
  340. public $value;
  341. public function setType($type)
  342. {
  343. $this->type = $type;
  344. }
  345. public function getType()
  346. {
  347. return $this->type;
  348. }
  349. public function setValue($value)
  350. {
  351. $this->value = $value;
  352. }
  353. public function getValue()
  354. {
  355. return $this->value;
  356. }
  357. }
  358. class Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksUrls extends Google_Collection
  359. {
  360. protected $detailsType = 'Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksUrlsDetails';
  361. protected $detailsDataType = 'array';
  362. protected $resultType = 'Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksUrlsResult';
  363. protected $resultDataType = '';
  364. public function setDetails($details)
  365. {
  366. $this->details = $details;
  367. }
  368. public function getDetails()
  369. {
  370. return $this->details;
  371. }
  372. public function setResult(Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksUrlsResult $result)
  373. {
  374. $this->result = $result;
  375. }
  376. public function getResult()
  377. {
  378. return $this->result;
  379. }
  380. }
  381. class Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksUrlsDetails extends Google_Collection
  382. {
  383. protected $argsType = 'Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksUrlsDetailsArgs';
  384. protected $argsDataType = 'array';
  385. public $format;
  386. public function setArgs($args)
  387. {
  388. $this->args = $args;
  389. }
  390. public function getArgs()
  391. {
  392. return $this->args;
  393. }
  394. public function setFormat($format)
  395. {
  396. $this->format = $format;
  397. }
  398. public function getFormat()
  399. {
  400. return $this->format;
  401. }
  402. }
  403. class Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksUrlsDetailsArgs extends Google_Model
  404. {
  405. public $type;
  406. public $value;
  407. public function setType($type)
  408. {
  409. $this->type = $type;
  410. }
  411. public function getType()
  412. {
  413. return $this->type;
  414. }
  415. public function setValue($value)
  416. {
  417. $this->value = $value;
  418. }
  419. public function getValue()
  420. {
  421. return $this->value;
  422. }
  423. }
  424. class Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksUrlsResult extends Google_Collection
  425. {
  426. protected $argsType = 'Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksUrlsResultArgs';
  427. protected $argsDataType = 'array';
  428. public $format;
  429. public function setArgs($args)
  430. {
  431. $this->args = $args;
  432. }
  433. public function getArgs()
  434. {
  435. return $this->args;
  436. }
  437. public function setFormat($format)
  438. {
  439. $this->format = $format;
  440. }
  441. public function getFormat()
  442. {
  443. return $this->format;
  444. }
  445. }
  446. class Google_Service_Pagespeedonline_ResultFormattedResultsRuleResultsElementUrlBlocksUrlsResultArgs extends Google_Model
  447. {
  448. public $type;
  449. public $value;
  450. public function setType($type)
  451. {
  452. $this->type = $type;
  453. }
  454. public function getType()
  455. {
  456. return $this->type;
  457. }
  458. public function setValue($value)
  459. {
  460. $this->value = $value;
  461. }
  462. public function getValue()
  463. {
  464. return $this->value;
  465. }
  466. }
  467. class Google_Service_Pagespeedonline_ResultPageStats extends Google_Model
  468. {
  469. public $cssResponseBytes;
  470. public $flashResponseBytes;
  471. public $htmlResponseBytes;
  472. public $imageResponseBytes;
  473. public $javascriptResponseBytes;
  474. public $numberCssResources;
  475. public $numberHosts;
  476. public $numberJsResources;
  477. public $numberResources;
  478. public $numberStaticResources;
  479. public $otherResponseBytes;
  480. public $textResponseBytes;
  481. public $totalRequestBytes;
  482. public function setCssResponseBytes($cssResponseBytes)
  483. {
  484. $this->cssResponseBytes = $cssResponseBytes;
  485. }
  486. public function getCssResponseBytes()
  487. {
  488. return $this->cssResponseBytes;
  489. }
  490. public function setFlashResponseBytes($flashResponseBytes)
  491. {
  492. $this->flashResponseBytes = $flashResponseBytes;
  493. }
  494. public function getFlashResponseBytes()
  495. {
  496. return $this->flashResponseBytes;
  497. }
  498. public function setHtmlResponseBytes($htmlResponseBytes)
  499. {
  500. $this->htmlResponseBytes = $htmlResponseBytes;
  501. }
  502. public function getHtmlResponseBytes()
  503. {
  504. return $this->htmlResponseBytes;
  505. }
  506. public function setImageResponseBytes($imageResponseBytes)
  507. {
  508. $this->imageResponseBytes = $imageResponseBytes;
  509. }
  510. public function getImageResponseBytes()
  511. {
  512. return $this->imageResponseBytes;
  513. }
  514. public function setJavascriptResponseBytes($javascriptResponseBytes)
  515. {
  516. $this->javascriptResponseBytes = $javascriptResponseBytes;
  517. }
  518. public function getJavascriptResponseBytes()
  519. {
  520. return $this->javascriptResponseBytes;
  521. }
  522. public function setNumberCssResources($numberCssResources)
  523. {
  524. $this->numberCssResources = $numberCssResources;
  525. }
  526. public function getNumberCssResources()
  527. {
  528. return $this->numberCssResources;
  529. }
  530. public function setNumberHosts($numberHosts)
  531. {
  532. $this->numberHosts = $numberHosts;
  533. }
  534. public function getNumberHosts()
  535. {
  536. return $this->numberHosts;
  537. }
  538. public function setNumberJsResources($numberJsResources)
  539. {
  540. $this->numberJsResources = $numberJsResources;
  541. }
  542. public function getNumberJsResources()
  543. {
  544. return $this->numberJsResources;
  545. }
  546. public function setNumberResources($numberResources)
  547. {
  548. $this->numberResources = $numberResources;
  549. }
  550. public function getNumberResources()
  551. {
  552. return $this->numberResources;
  553. }
  554. public function setNumberStaticResources($numberStaticResources)
  555. {
  556. $this->numberStaticResources = $numberStaticResources;
  557. }
  558. public function getNumberStaticResources()
  559. {
  560. return $this->numberStaticResources;
  561. }
  562. public function setOtherResponseBytes($otherResponseBytes)
  563. {
  564. $this->otherResponseBytes = $otherResponseBytes;
  565. }
  566. public function getOtherResponseBytes()
  567. {
  568. return $this->otherResponseBytes;
  569. }
  570. public function setTextResponseBytes($textResponseBytes)
  571. {
  572. $this->textResponseBytes = $textResponseBytes;
  573. }
  574. public function getTextResponseBytes()
  575. {
  576. return $this->textResponseBytes;
  577. }
  578. public function setTotalRequestBytes($totalRequestBytes)
  579. {
  580. $this->totalRequestBytes = $totalRequestBytes;
  581. }
  582. public function getTotalRequestBytes()
  583. {
  584. return $this->totalRequestBytes;
  585. }
  586. }
  587. class Google_Service_Pagespeedonline_ResultRequest extends Google_Model
  588. {
  589. public $filterThirdPartyResources;
  590. public $strategy;
  591. public $url;
  592. public function setFilterThirdPartyResources($filterThirdPartyResources)
  593. {
  594. $this->filterThirdPartyResources = $filterThirdPartyResources;
  595. }
  596. public function getFilterThirdPartyResources()
  597. {
  598. return $this->filterThirdPartyResources;
  599. }
  600. public function setStrategy($strategy)
  601. {
  602. $this->strategy = $strategy;
  603. }
  604. public function getStrategy()
  605. {
  606. return $this->strategy;
  607. }
  608. public function setUrl($url)
  609. {
  610. $this->url = $url;
  611. }
  612. public function getUrl()
  613. {
  614. return $this->url;
  615. }
  616. }
  617. class Google_Service_Pagespeedonline_ResultScreenshot extends Google_Model
  618. {
  619. public $data;
  620. public $height;
  621. public $mimeType;
  622. public $width;
  623. public function setData($data)
  624. {
  625. $this->data = $data;
  626. }
  627. public function getData()
  628. {
  629. return $this->data;
  630. }
  631. public function setHeight($height)
  632. {
  633. $this->height = $height;
  634. }
  635. public function getHeight()
  636. {
  637. return $this->height;
  638. }
  639. public function setMimeType($mimeType)
  640. {
  641. $this->mimeType = $mimeType;
  642. }
  643. public function getMimeType()
  644. {
  645. return $this->mimeType;
  646. }
  647. public function setWidth($width)
  648. {
  649. $this->width = $width;
  650. }
  651. public function getWidth()
  652. {
  653. return $this->width;
  654. }
  655. }
  656. class Google_Service_Pagespeedonline_ResultVersion extends Google_Model
  657. {
  658. public $major;
  659. public $minor;
  660. public function setMajor($major)
  661. {
  662. $this->major = $major;
  663. }
  664. public function getMajor()
  665. {
  666. return $this->major;
  667. }
  668. public function setMinor($minor)
  669. {
  670. $this->minor = $minor;
  671. }
  672. public function getMinor()
  673. {
  674. return $this->minor;
  675. }
  676. }