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
18namespace Google\Service;
19
20use Google\Client;
21
22/**
23 * Service definition for AnalyticsData (v1beta).
24 *
25 * <p>
26 * Accesses report data in Google Analytics.</p>
27 *
28 * <p>
29 * For more information about this service, see the API
30 * <a href="https://developers.google.com/analytics/devguides/reporting/data/v1/" target="_blank">Documentation</a>
31 * </p>
32 *
33 * @author Google, Inc.
34 */
35class AnalyticsData extends \Google\Service
36{
37  /** View and manage your Google Analytics data. */
38  const ANALYTICS =
39      "https://www.googleapis.com/auth/analytics";
40  /** See and download your Google Analytics data. */
41  const ANALYTICS_READONLY =
42      "https://www.googleapis.com/auth/analytics.readonly";
43
44  public $properties;
45
46  /**
47   * Constructs the internal representation of the AnalyticsData service.
48   *
49   * @param Client|array $clientOrConfig The client used to deliver requests, or a
50   *                                     config array to pass to a new Client instance.
51   * @param string $rootUrl The root URL used for requests to the service.
52   */
53  public function __construct($clientOrConfig = [], $rootUrl = null)
54  {
55    parent::__construct($clientOrConfig);
56    $this->rootUrl = $rootUrl ?: 'https://analyticsdata.googleapis.com/';
57    $this->servicePath = '';
58    $this->batchPath = 'batch';
59    $this->version = 'v1beta';
60    $this->serviceName = 'analyticsdata';
61
62    $this->properties = new AnalyticsData\Resource\Properties(
63        $this,
64        $this->serviceName,
65        'properties',
66        [
67          'methods' => [
68            'batchRunPivotReports' => [
69              'path' => 'v1beta/{+property}:batchRunPivotReports',
70              'httpMethod' => 'POST',
71              'parameters' => [
72                'property' => [
73                  'location' => 'path',
74                  'type' => 'string',
75                  'required' => true,
76                ],
77              ],
78            ],'batchRunReports' => [
79              'path' => 'v1beta/{+property}:batchRunReports',
80              'httpMethod' => 'POST',
81              'parameters' => [
82                'property' => [
83                  'location' => 'path',
84                  'type' => 'string',
85                  'required' => true,
86                ],
87              ],
88            ],'checkCompatibility' => [
89              'path' => 'v1beta/{+property}:checkCompatibility',
90              'httpMethod' => 'POST',
91              'parameters' => [
92                'property' => [
93                  'location' => 'path',
94                  'type' => 'string',
95                  'required' => true,
96                ],
97              ],
98            ],'getMetadata' => [
99              'path' => 'v1beta/{+name}',
100              'httpMethod' => 'GET',
101              'parameters' => [
102                'name' => [
103                  'location' => 'path',
104                  'type' => 'string',
105                  'required' => true,
106                ],
107              ],
108            ],'runPivotReport' => [
109              'path' => 'v1beta/{+property}:runPivotReport',
110              'httpMethod' => 'POST',
111              'parameters' => [
112                'property' => [
113                  'location' => 'path',
114                  'type' => 'string',
115                  'required' => true,
116                ],
117              ],
118            ],'runRealtimeReport' => [
119              'path' => 'v1beta/{+property}:runRealtimeReport',
120              'httpMethod' => 'POST',
121              'parameters' => [
122                'property' => [
123                  'location' => 'path',
124                  'type' => 'string',
125                  'required' => true,
126                ],
127              ],
128            ],'runReport' => [
129              'path' => 'v1beta/{+property}:runReport',
130              'httpMethod' => 'POST',
131              'parameters' => [
132                'property' => [
133                  'location' => 'path',
134                  'type' => 'string',
135                  'required' => true,
136                ],
137              ],
138            ],
139          ]
140        ]
141    );
142  }
143}
144
145// Adding a class alias for backwards compatibility with the previous class name.
146class_alias(AnalyticsData::class, 'Google_Service_AnalyticsData');
147