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 AdSenseHost (v4.1).
24 *
25 * <p>
26 * Generates performance reports, generates ad codes, and provides publisher
27 * management capabilities for AdSense Hosts.</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://developers.google.com/adsense/host/" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class AdSenseHost extends \Google\Service
37{
38  /** View and manage your AdSense host data and associated accounts. */
39  const ADSENSEHOST =
40      "https://www.googleapis.com/auth/adsensehost";
41
42  public $accounts;
43  public $accounts_adclients;
44  public $accounts_adunits;
45  public $accounts_reports;
46  public $adclients;
47  public $associationsessions;
48  public $customchannels;
49  public $reports;
50  public $urlchannels;
51
52  /**
53   * Constructs the internal representation of the AdSenseHost service.
54   *
55   * @param Client|array $clientOrConfig The client used to deliver requests, or a
56   *                                     config array to pass to a new Client instance.
57   * @param string $rootUrl The root URL used for requests to the service.
58   */
59  public function __construct($clientOrConfig = [], $rootUrl = null)
60  {
61    parent::__construct($clientOrConfig);
62    $this->rootUrl = $rootUrl ?: 'https://www.googleapis.com/';
63    $this->servicePath = 'adsensehost/v4.1/';
64    $this->batchPath = 'batch/adsensehost/v4.1';
65    $this->version = 'v4.1';
66    $this->serviceName = 'adsensehost';
67
68    $this->accounts = new AdSenseHost\Resource\Accounts(
69        $this,
70        $this->serviceName,
71        'accounts',
72        [
73          'methods' => [
74            'get' => [
75              'path' => 'accounts/{accountId}',
76              'httpMethod' => 'GET',
77              'parameters' => [
78                'accountId' => [
79                  'location' => 'path',
80                  'type' => 'string',
81                  'required' => true,
82                ],
83              ],
84            ],'list' => [
85              'path' => 'accounts',
86              'httpMethod' => 'GET',
87              'parameters' => [
88                'filterAdClientId' => [
89                  'location' => 'query',
90                  'type' => 'string',
91                  'repeated' => true,
92                  'required' => true,
93                ],
94              ],
95            ],
96          ]
97        ]
98    );
99    $this->accounts_adclients = new AdSenseHost\Resource\AccountsAdclients(
100        $this,
101        $this->serviceName,
102        'adclients',
103        [
104          'methods' => [
105            'get' => [
106              'path' => 'accounts/{accountId}/adclients/{adClientId}',
107              'httpMethod' => 'GET',
108              'parameters' => [
109                'accountId' => [
110                  'location' => 'path',
111                  'type' => 'string',
112                  'required' => true,
113                ],
114                'adClientId' => [
115                  'location' => 'path',
116                  'type' => 'string',
117                  'required' => true,
118                ],
119              ],
120            ],'list' => [
121              'path' => 'accounts/{accountId}/adclients',
122              'httpMethod' => 'GET',
123              'parameters' => [
124                'accountId' => [
125                  'location' => 'path',
126                  'type' => 'string',
127                  'required' => true,
128                ],
129                'maxResults' => [
130                  'location' => 'query',
131                  'type' => 'integer',
132                ],
133                'pageToken' => [
134                  'location' => 'query',
135                  'type' => 'string',
136                ],
137              ],
138            ],
139          ]
140        ]
141    );
142    $this->accounts_adunits = new AdSenseHost\Resource\AccountsAdunits(
143        $this,
144        $this->serviceName,
145        'adunits',
146        [
147          'methods' => [
148            'delete' => [
149              'path' => 'accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}',
150              'httpMethod' => 'DELETE',
151              'parameters' => [
152                'accountId' => [
153                  'location' => 'path',
154                  'type' => 'string',
155                  'required' => true,
156                ],
157                'adClientId' => [
158                  'location' => 'path',
159                  'type' => 'string',
160                  'required' => true,
161                ],
162                'adUnitId' => [
163                  'location' => 'path',
164                  'type' => 'string',
165                  'required' => true,
166                ],
167              ],
168            ],'get' => [
169              'path' => 'accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}',
170              'httpMethod' => 'GET',
171              'parameters' => [
172                'accountId' => [
173                  'location' => 'path',
174                  'type' => 'string',
175                  'required' => true,
176                ],
177                'adClientId' => [
178                  'location' => 'path',
179                  'type' => 'string',
180                  'required' => true,
181                ],
182                'adUnitId' => [
183                  'location' => 'path',
184                  'type' => 'string',
185                  'required' => true,
186                ],
187              ],
188            ],'getAdCode' => [
189              'path' => 'accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode',
190              'httpMethod' => 'GET',
191              'parameters' => [
192                'accountId' => [
193                  'location' => 'path',
194                  'type' => 'string',
195                  'required' => true,
196                ],
197                'adClientId' => [
198                  'location' => 'path',
199                  'type' => 'string',
200                  'required' => true,
201                ],
202                'adUnitId' => [
203                  'location' => 'path',
204                  'type' => 'string',
205                  'required' => true,
206                ],
207                'hostCustomChannelId' => [
208                  'location' => 'query',
209                  'type' => 'string',
210                  'repeated' => true,
211                ],
212              ],
213            ],'insert' => [
214              'path' => 'accounts/{accountId}/adclients/{adClientId}/adunits',
215              'httpMethod' => 'POST',
216              'parameters' => [
217                'accountId' => [
218                  'location' => 'path',
219                  'type' => 'string',
220                  'required' => true,
221                ],
222                'adClientId' => [
223                  'location' => 'path',
224                  'type' => 'string',
225                  'required' => true,
226                ],
227              ],
228            ],'list' => [
229              'path' => 'accounts/{accountId}/adclients/{adClientId}/adunits',
230              'httpMethod' => 'GET',
231              'parameters' => [
232                'accountId' => [
233                  'location' => 'path',
234                  'type' => 'string',
235                  'required' => true,
236                ],
237                'adClientId' => [
238                  'location' => 'path',
239                  'type' => 'string',
240                  'required' => true,
241                ],
242                'includeInactive' => [
243                  'location' => 'query',
244                  'type' => 'boolean',
245                ],
246                'maxResults' => [
247                  'location' => 'query',
248                  'type' => 'integer',
249                ],
250                'pageToken' => [
251                  'location' => 'query',
252                  'type' => 'string',
253                ],
254              ],
255            ],'patch' => [
256              'path' => 'accounts/{accountId}/adclients/{adClientId}/adunits',
257              'httpMethod' => 'PATCH',
258              'parameters' => [
259                'accountId' => [
260                  'location' => 'path',
261                  'type' => 'string',
262                  'required' => true,
263                ],
264                'adClientId' => [
265                  'location' => 'path',
266                  'type' => 'string',
267                  'required' => true,
268                ],
269                'adUnitId' => [
270                  'location' => 'query',
271                  'type' => 'string',
272                  'required' => true,
273                ],
274              ],
275            ],'update' => [
276              'path' => 'accounts/{accountId}/adclients/{adClientId}/adunits',
277              'httpMethod' => 'PUT',
278              'parameters' => [
279                'accountId' => [
280                  'location' => 'path',
281                  'type' => 'string',
282                  'required' => true,
283                ],
284                'adClientId' => [
285                  'location' => 'path',
286                  'type' => 'string',
287                  'required' => true,
288                ],
289              ],
290            ],
291          ]
292        ]
293    );
294    $this->accounts_reports = new AdSenseHost\Resource\AccountsReports(
295        $this,
296        $this->serviceName,
297        'reports',
298        [
299          'methods' => [
300            'generate' => [
301              'path' => 'accounts/{accountId}/reports',
302              'httpMethod' => 'GET',
303              'parameters' => [
304                'accountId' => [
305                  'location' => 'path',
306                  'type' => 'string',
307                  'required' => true,
308                ],
309                'startDate' => [
310                  'location' => 'query',
311                  'type' => 'string',
312                  'required' => true,
313                ],
314                'endDate' => [
315                  'location' => 'query',
316                  'type' => 'string',
317                  'required' => true,
318                ],
319                'dimension' => [
320                  'location' => 'query',
321                  'type' => 'string',
322                  'repeated' => true,
323                ],
324                'filter' => [
325                  'location' => 'query',
326                  'type' => 'string',
327                  'repeated' => true,
328                ],
329                'locale' => [
330                  'location' => 'query',
331                  'type' => 'string',
332                ],
333                'maxResults' => [
334                  'location' => 'query',
335                  'type' => 'integer',
336                ],
337                'metric' => [
338                  'location' => 'query',
339                  'type' => 'string',
340                  'repeated' => true,
341                ],
342                'sort' => [
343                  'location' => 'query',
344                  'type' => 'string',
345                  'repeated' => true,
346                ],
347                'startIndex' => [
348                  'location' => 'query',
349                  'type' => 'integer',
350                ],
351              ],
352            ],
353          ]
354        ]
355    );
356    $this->adclients = new AdSenseHost\Resource\Adclients(
357        $this,
358        $this->serviceName,
359        'adclients',
360        [
361          'methods' => [
362            'get' => [
363              'path' => 'adclients/{adClientId}',
364              'httpMethod' => 'GET',
365              'parameters' => [
366                'adClientId' => [
367                  'location' => 'path',
368                  'type' => 'string',
369                  'required' => true,
370                ],
371              ],
372            ],'list' => [
373              'path' => 'adclients',
374              'httpMethod' => 'GET',
375              'parameters' => [
376                'maxResults' => [
377                  'location' => 'query',
378                  'type' => 'integer',
379                ],
380                'pageToken' => [
381                  'location' => 'query',
382                  'type' => 'string',
383                ],
384              ],
385            ],
386          ]
387        ]
388    );
389    $this->associationsessions = new AdSenseHost\Resource\Associationsessions(
390        $this,
391        $this->serviceName,
392        'associationsessions',
393        [
394          'methods' => [
395            'start' => [
396              'path' => 'associationsessions/start',
397              'httpMethod' => 'GET',
398              'parameters' => [
399                'productCode' => [
400                  'location' => 'query',
401                  'type' => 'string',
402                  'repeated' => true,
403                  'required' => true,
404                ],
405                'websiteUrl' => [
406                  'location' => 'query',
407                  'type' => 'string',
408                  'required' => true,
409                ],
410                'callbackUrl' => [
411                  'location' => 'query',
412                  'type' => 'string',
413                ],
414                'userLocale' => [
415                  'location' => 'query',
416                  'type' => 'string',
417                ],
418                'websiteLocale' => [
419                  'location' => 'query',
420                  'type' => 'string',
421                ],
422              ],
423            ],'verify' => [
424              'path' => 'associationsessions/verify',
425              'httpMethod' => 'GET',
426              'parameters' => [
427                'token' => [
428                  'location' => 'query',
429                  'type' => 'string',
430                  'required' => true,
431                ],
432              ],
433            ],
434          ]
435        ]
436    );
437    $this->customchannels = new AdSenseHost\Resource\Customchannels(
438        $this,
439        $this->serviceName,
440        'customchannels',
441        [
442          'methods' => [
443            'delete' => [
444              'path' => 'adclients/{adClientId}/customchannels/{customChannelId}',
445              'httpMethod' => 'DELETE',
446              'parameters' => [
447                'adClientId' => [
448                  'location' => 'path',
449                  'type' => 'string',
450                  'required' => true,
451                ],
452                'customChannelId' => [
453                  'location' => 'path',
454                  'type' => 'string',
455                  'required' => true,
456                ],
457              ],
458            ],'get' => [
459              'path' => 'adclients/{adClientId}/customchannels/{customChannelId}',
460              'httpMethod' => 'GET',
461              'parameters' => [
462                'adClientId' => [
463                  'location' => 'path',
464                  'type' => 'string',
465                  'required' => true,
466                ],
467                'customChannelId' => [
468                  'location' => 'path',
469                  'type' => 'string',
470                  'required' => true,
471                ],
472              ],
473            ],'insert' => [
474              'path' => 'adclients/{adClientId}/customchannels',
475              'httpMethod' => 'POST',
476              'parameters' => [
477                'adClientId' => [
478                  'location' => 'path',
479                  'type' => 'string',
480                  'required' => true,
481                ],
482              ],
483            ],'list' => [
484              'path' => 'adclients/{adClientId}/customchannels',
485              'httpMethod' => 'GET',
486              'parameters' => [
487                'adClientId' => [
488                  'location' => 'path',
489                  'type' => 'string',
490                  'required' => true,
491                ],
492                'maxResults' => [
493                  'location' => 'query',
494                  'type' => 'integer',
495                ],
496                'pageToken' => [
497                  'location' => 'query',
498                  'type' => 'string',
499                ],
500              ],
501            ],'patch' => [
502              'path' => 'adclients/{adClientId}/customchannels',
503              'httpMethod' => 'PATCH',
504              'parameters' => [
505                'adClientId' => [
506                  'location' => 'path',
507                  'type' => 'string',
508                  'required' => true,
509                ],
510                'customChannelId' => [
511                  'location' => 'query',
512                  'type' => 'string',
513                  'required' => true,
514                ],
515              ],
516            ],'update' => [
517              'path' => 'adclients/{adClientId}/customchannels',
518              'httpMethod' => 'PUT',
519              'parameters' => [
520                'adClientId' => [
521                  'location' => 'path',
522                  'type' => 'string',
523                  'required' => true,
524                ],
525              ],
526            ],
527          ]
528        ]
529    );
530    $this->reports = new AdSenseHost\Resource\Reports(
531        $this,
532        $this->serviceName,
533        'reports',
534        [
535          'methods' => [
536            'generate' => [
537              'path' => 'reports',
538              'httpMethod' => 'GET',
539              'parameters' => [
540                'startDate' => [
541                  'location' => 'query',
542                  'type' => 'string',
543                  'required' => true,
544                ],
545                'endDate' => [
546                  'location' => 'query',
547                  'type' => 'string',
548                  'required' => true,
549                ],
550                'dimension' => [
551                  'location' => 'query',
552                  'type' => 'string',
553                  'repeated' => true,
554                ],
555                'filter' => [
556                  'location' => 'query',
557                  'type' => 'string',
558                  'repeated' => true,
559                ],
560                'locale' => [
561                  'location' => 'query',
562                  'type' => 'string',
563                ],
564                'maxResults' => [
565                  'location' => 'query',
566                  'type' => 'integer',
567                ],
568                'metric' => [
569                  'location' => 'query',
570                  'type' => 'string',
571                  'repeated' => true,
572                ],
573                'sort' => [
574                  'location' => 'query',
575                  'type' => 'string',
576                  'repeated' => true,
577                ],
578                'startIndex' => [
579                  'location' => 'query',
580                  'type' => 'integer',
581                ],
582              ],
583            ],
584          ]
585        ]
586    );
587    $this->urlchannels = new AdSenseHost\Resource\Urlchannels(
588        $this,
589        $this->serviceName,
590        'urlchannels',
591        [
592          'methods' => [
593            'delete' => [
594              'path' => 'adclients/{adClientId}/urlchannels/{urlChannelId}',
595              'httpMethod' => 'DELETE',
596              'parameters' => [
597                'adClientId' => [
598                  'location' => 'path',
599                  'type' => 'string',
600                  'required' => true,
601                ],
602                'urlChannelId' => [
603                  'location' => 'path',
604                  'type' => 'string',
605                  'required' => true,
606                ],
607              ],
608            ],'insert' => [
609              'path' => 'adclients/{adClientId}/urlchannels',
610              'httpMethod' => 'POST',
611              'parameters' => [
612                'adClientId' => [
613                  'location' => 'path',
614                  'type' => 'string',
615                  'required' => true,
616                ],
617              ],
618            ],'list' => [
619              'path' => 'adclients/{adClientId}/urlchannels',
620              'httpMethod' => 'GET',
621              'parameters' => [
622                'adClientId' => [
623                  'location' => 'path',
624                  'type' => 'string',
625                  'required' => true,
626                ],
627                'maxResults' => [
628                  'location' => 'query',
629                  'type' => 'integer',
630                ],
631                'pageToken' => [
632                  'location' => 'query',
633                  'type' => 'string',
634                ],
635              ],
636            ],
637          ]
638        ]
639    );
640  }
641}
642
643// Adding a class alias for backwards compatibility with the previous class name.
644class_alias(AdSenseHost::class, 'Google_Service_AdSenseHost');
645