1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright 2014 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 | namespace Google\Service;
|
---|
19 |
|
---|
20 | use Google\Client;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Service definition for PagespeedInsights (v5).
|
---|
24 | *
|
---|
25 | * <p>
|
---|
26 | * The PageSpeed Insights API lets you analyze the performance of your website
|
---|
27 | * with a simple API. It offers tailored suggestions for how you can optimize
|
---|
28 | * your site, and lets you easily integrate PageSpeed Insights analysis into
|
---|
29 | * your development tools and workflow.</p>
|
---|
30 | *
|
---|
31 | * <p>
|
---|
32 | * For more information about this service, see the API
|
---|
33 | * <a href="https://developers.google.com/speed/docs/insights/v5/about" target="_blank">Documentation</a>
|
---|
34 | * </p>
|
---|
35 | *
|
---|
36 | * @author Google, Inc.
|
---|
37 | */
|
---|
38 | class PagespeedInsights extends \Google\Service
|
---|
39 | {
|
---|
40 | /** Associate you with your personal info on Google. */
|
---|
41 | const OPENID =
|
---|
42 | "openid";
|
---|
43 |
|
---|
44 | public $pagespeedapi;
|
---|
45 | public $rootUrlTemplate;
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * Constructs the internal representation of the PagespeedInsights service.
|
---|
49 | *
|
---|
50 | * @param Client|array $clientOrConfig The client used to deliver requests, or a
|
---|
51 | * config array to pass to a new Client instance.
|
---|
52 | * @param string $rootUrl The root URL used for requests to the service.
|
---|
53 | */
|
---|
54 | public function __construct($clientOrConfig = [], $rootUrl = null)
|
---|
55 | {
|
---|
56 | parent::__construct($clientOrConfig);
|
---|
57 | $this->rootUrl = $rootUrl ?: 'https://pagespeedonline.googleapis.com/';
|
---|
58 | $this->rootUrlTemplate = $rootUrl ?: 'https://pagespeedonline.UNIVERSE_DOMAIN/';
|
---|
59 | $this->servicePath = '';
|
---|
60 | $this->batchPath = 'batch';
|
---|
61 | $this->version = 'v5';
|
---|
62 | $this->serviceName = 'pagespeedonline';
|
---|
63 |
|
---|
64 | $this->pagespeedapi = new PagespeedInsights\Resource\Pagespeedapi(
|
---|
65 | $this,
|
---|
66 | $this->serviceName,
|
---|
67 | 'pagespeedapi',
|
---|
68 | [
|
---|
69 | 'methods' => [
|
---|
70 | 'runpagespeed' => [
|
---|
71 | 'path' => 'pagespeedonline/v5/runPagespeed',
|
---|
72 | 'httpMethod' => 'GET',
|
---|
73 | 'parameters' => [
|
---|
74 | 'url' => [
|
---|
75 | 'location' => 'query',
|
---|
76 | 'type' => 'string',
|
---|
77 | 'required' => true,
|
---|
78 | ],
|
---|
79 | 'captchaToken' => [
|
---|
80 | 'location' => 'query',
|
---|
81 | 'type' => 'string',
|
---|
82 | ],
|
---|
83 | 'category' => [
|
---|
84 | 'location' => 'query',
|
---|
85 | 'type' => 'string',
|
---|
86 | 'repeated' => true,
|
---|
87 | ],
|
---|
88 | 'locale' => [
|
---|
89 | 'location' => 'query',
|
---|
90 | 'type' => 'string',
|
---|
91 | ],
|
---|
92 | 'strategy' => [
|
---|
93 | 'location' => 'query',
|
---|
94 | 'type' => 'string',
|
---|
95 | ],
|
---|
96 | 'utm_campaign' => [
|
---|
97 | 'location' => 'query',
|
---|
98 | 'type' => 'string',
|
---|
99 | ],
|
---|
100 | 'utm_source' => [
|
---|
101 | 'location' => 'query',
|
---|
102 | 'type' => 'string',
|
---|
103 | ],
|
---|
104 | ],
|
---|
105 | ],
|
---|
106 | ]
|
---|
107 | ]
|
---|
108 | );
|
---|
109 | }
|
---|
110 | }
|
---|
111 |
|
---|
112 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
113 | class_alias(PagespeedInsights::class, 'Google_Service_PagespeedInsights');
|
---|