[f9c482b] | 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 YouTubeAnalytics (v2).
|
---|
| 24 | *
|
---|
| 25 | * <p>
|
---|
| 26 | * Retrieves your YouTube Analytics data.</p>
|
---|
| 27 | *
|
---|
| 28 | * <p>
|
---|
| 29 | * For more information about this service, see the API
|
---|
| 30 | * <a href="https://developers.google.com/youtube/analytics" target="_blank">Documentation</a>
|
---|
| 31 | * </p>
|
---|
| 32 | *
|
---|
| 33 | * @author Google, Inc.
|
---|
| 34 | */
|
---|
| 35 | class YouTubeAnalytics extends \Google\Service
|
---|
| 36 | {
|
---|
| 37 | /** Manage your YouTube account. */
|
---|
| 38 | const YOUTUBE =
|
---|
| 39 | "https://www.googleapis.com/auth/youtube";
|
---|
| 40 | /** View your YouTube account. */
|
---|
| 41 | const YOUTUBE_READONLY =
|
---|
| 42 | "https://www.googleapis.com/auth/youtube.readonly";
|
---|
| 43 | /** View and manage your assets and associated content on YouTube. */
|
---|
| 44 | const YOUTUBEPARTNER =
|
---|
| 45 | "https://www.googleapis.com/auth/youtubepartner";
|
---|
| 46 | /** View monetary and non-monetary YouTube Analytics reports for your YouTube content. */
|
---|
| 47 | const YT_ANALYTICS_MONETARY_READONLY =
|
---|
| 48 | "https://www.googleapis.com/auth/yt-analytics-monetary.readonly";
|
---|
| 49 | /** View YouTube Analytics reports for your YouTube content. */
|
---|
| 50 | const YT_ANALYTICS_READONLY =
|
---|
| 51 | "https://www.googleapis.com/auth/yt-analytics.readonly";
|
---|
| 52 |
|
---|
| 53 | public $groupItems;
|
---|
| 54 | public $groups;
|
---|
| 55 | public $reports;
|
---|
| 56 | public $rootUrlTemplate;
|
---|
| 57 |
|
---|
| 58 | /**
|
---|
| 59 | * Constructs the internal representation of the YouTubeAnalytics service.
|
---|
| 60 | *
|
---|
| 61 | * @param Client|array $clientOrConfig The client used to deliver requests, or a
|
---|
| 62 | * config array to pass to a new Client instance.
|
---|
| 63 | * @param string $rootUrl The root URL used for requests to the service.
|
---|
| 64 | */
|
---|
| 65 | public function __construct($clientOrConfig = [], $rootUrl = null)
|
---|
| 66 | {
|
---|
| 67 | parent::__construct($clientOrConfig);
|
---|
| 68 | $this->rootUrl = $rootUrl ?: 'https://youtubeanalytics.googleapis.com/';
|
---|
| 69 | $this->rootUrlTemplate = $rootUrl ?: 'https://youtubeanalytics.UNIVERSE_DOMAIN/';
|
---|
| 70 | $this->servicePath = '';
|
---|
| 71 | $this->batchPath = 'batch';
|
---|
| 72 | $this->version = 'v2';
|
---|
| 73 | $this->serviceName = 'youtubeAnalytics';
|
---|
| 74 |
|
---|
| 75 | $this->groupItems = new YouTubeAnalytics\Resource\GroupItems(
|
---|
| 76 | $this,
|
---|
| 77 | $this->serviceName,
|
---|
| 78 | 'groupItems',
|
---|
| 79 | [
|
---|
| 80 | 'methods' => [
|
---|
| 81 | 'delete' => [
|
---|
| 82 | 'path' => 'v2/groupItems',
|
---|
| 83 | 'httpMethod' => 'DELETE',
|
---|
| 84 | 'parameters' => [
|
---|
| 85 | 'id' => [
|
---|
| 86 | 'location' => 'query',
|
---|
| 87 | 'type' => 'string',
|
---|
| 88 | ],
|
---|
| 89 | 'onBehalfOfContentOwner' => [
|
---|
| 90 | 'location' => 'query',
|
---|
| 91 | 'type' => 'string',
|
---|
| 92 | ],
|
---|
| 93 | ],
|
---|
| 94 | ],'insert' => [
|
---|
| 95 | 'path' => 'v2/groupItems',
|
---|
| 96 | 'httpMethod' => 'POST',
|
---|
| 97 | 'parameters' => [
|
---|
| 98 | 'onBehalfOfContentOwner' => [
|
---|
| 99 | 'location' => 'query',
|
---|
| 100 | 'type' => 'string',
|
---|
| 101 | ],
|
---|
| 102 | ],
|
---|
| 103 | ],'list' => [
|
---|
| 104 | 'path' => 'v2/groupItems',
|
---|
| 105 | 'httpMethod' => 'GET',
|
---|
| 106 | 'parameters' => [
|
---|
| 107 | 'groupId' => [
|
---|
| 108 | 'location' => 'query',
|
---|
| 109 | 'type' => 'string',
|
---|
| 110 | ],
|
---|
| 111 | 'onBehalfOfContentOwner' => [
|
---|
| 112 | 'location' => 'query',
|
---|
| 113 | 'type' => 'string',
|
---|
| 114 | ],
|
---|
| 115 | ],
|
---|
| 116 | ],
|
---|
| 117 | ]
|
---|
| 118 | ]
|
---|
| 119 | );
|
---|
| 120 | $this->groups = new YouTubeAnalytics\Resource\Groups(
|
---|
| 121 | $this,
|
---|
| 122 | $this->serviceName,
|
---|
| 123 | 'groups',
|
---|
| 124 | [
|
---|
| 125 | 'methods' => [
|
---|
| 126 | 'delete' => [
|
---|
| 127 | 'path' => 'v2/groups',
|
---|
| 128 | 'httpMethod' => 'DELETE',
|
---|
| 129 | 'parameters' => [
|
---|
| 130 | 'id' => [
|
---|
| 131 | 'location' => 'query',
|
---|
| 132 | 'type' => 'string',
|
---|
| 133 | ],
|
---|
| 134 | 'onBehalfOfContentOwner' => [
|
---|
| 135 | 'location' => 'query',
|
---|
| 136 | 'type' => 'string',
|
---|
| 137 | ],
|
---|
| 138 | ],
|
---|
| 139 | ],'insert' => [
|
---|
| 140 | 'path' => 'v2/groups',
|
---|
| 141 | 'httpMethod' => 'POST',
|
---|
| 142 | 'parameters' => [
|
---|
| 143 | 'onBehalfOfContentOwner' => [
|
---|
| 144 | 'location' => 'query',
|
---|
| 145 | 'type' => 'string',
|
---|
| 146 | ],
|
---|
| 147 | ],
|
---|
| 148 | ],'list' => [
|
---|
| 149 | 'path' => 'v2/groups',
|
---|
| 150 | 'httpMethod' => 'GET',
|
---|
| 151 | 'parameters' => [
|
---|
| 152 | 'id' => [
|
---|
| 153 | 'location' => 'query',
|
---|
| 154 | 'type' => 'string',
|
---|
| 155 | ],
|
---|
| 156 | 'mine' => [
|
---|
| 157 | 'location' => 'query',
|
---|
| 158 | 'type' => 'boolean',
|
---|
| 159 | ],
|
---|
| 160 | 'onBehalfOfContentOwner' => [
|
---|
| 161 | 'location' => 'query',
|
---|
| 162 | 'type' => 'string',
|
---|
| 163 | ],
|
---|
| 164 | 'pageToken' => [
|
---|
| 165 | 'location' => 'query',
|
---|
| 166 | 'type' => 'string',
|
---|
| 167 | ],
|
---|
| 168 | ],
|
---|
| 169 | ],'update' => [
|
---|
| 170 | 'path' => 'v2/groups',
|
---|
| 171 | 'httpMethod' => 'PUT',
|
---|
| 172 | 'parameters' => [
|
---|
| 173 | 'onBehalfOfContentOwner' => [
|
---|
| 174 | 'location' => 'query',
|
---|
| 175 | 'type' => 'string',
|
---|
| 176 | ],
|
---|
| 177 | ],
|
---|
| 178 | ],
|
---|
| 179 | ]
|
---|
| 180 | ]
|
---|
| 181 | );
|
---|
| 182 | $this->reports = new YouTubeAnalytics\Resource\Reports(
|
---|
| 183 | $this,
|
---|
| 184 | $this->serviceName,
|
---|
| 185 | 'reports',
|
---|
| 186 | [
|
---|
| 187 | 'methods' => [
|
---|
| 188 | 'query' => [
|
---|
| 189 | 'path' => 'v2/reports',
|
---|
| 190 | 'httpMethod' => 'GET',
|
---|
| 191 | 'parameters' => [
|
---|
| 192 | 'currency' => [
|
---|
| 193 | 'location' => 'query',
|
---|
| 194 | 'type' => 'string',
|
---|
| 195 | ],
|
---|
| 196 | 'dimensions' => [
|
---|
| 197 | 'location' => 'query',
|
---|
| 198 | 'type' => 'string',
|
---|
| 199 | ],
|
---|
| 200 | 'endDate' => [
|
---|
| 201 | 'location' => 'query',
|
---|
| 202 | 'type' => 'string',
|
---|
| 203 | ],
|
---|
| 204 | 'filters' => [
|
---|
| 205 | 'location' => 'query',
|
---|
| 206 | 'type' => 'string',
|
---|
| 207 | ],
|
---|
| 208 | 'ids' => [
|
---|
| 209 | 'location' => 'query',
|
---|
| 210 | 'type' => 'string',
|
---|
| 211 | ],
|
---|
| 212 | 'includeHistoricalChannelData' => [
|
---|
| 213 | 'location' => 'query',
|
---|
| 214 | 'type' => 'boolean',
|
---|
| 215 | ],
|
---|
| 216 | 'maxResults' => [
|
---|
| 217 | 'location' => 'query',
|
---|
| 218 | 'type' => 'integer',
|
---|
| 219 | ],
|
---|
| 220 | 'metrics' => [
|
---|
| 221 | 'location' => 'query',
|
---|
| 222 | 'type' => 'string',
|
---|
| 223 | ],
|
---|
| 224 | 'sort' => [
|
---|
| 225 | 'location' => 'query',
|
---|
| 226 | 'type' => 'string',
|
---|
| 227 | ],
|
---|
| 228 | 'startDate' => [
|
---|
| 229 | 'location' => 'query',
|
---|
| 230 | 'type' => 'string',
|
---|
| 231 | ],
|
---|
| 232 | 'startIndex' => [
|
---|
| 233 | 'location' => 'query',
|
---|
| 234 | 'type' => 'integer',
|
---|
| 235 | ],
|
---|
| 236 | ],
|
---|
| 237 | ],
|
---|
| 238 | ]
|
---|
| 239 | ]
|
---|
| 240 | );
|
---|
| 241 | }
|
---|
| 242 | }
|
---|
| 243 |
|
---|
| 244 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 245 | class_alias(YouTubeAnalytics::class, 'Google_Service_YouTubeAnalytics');
|
---|