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 AdMob (v1).
24 *
25 * <p>
26 * The AdMob API allows publishers to programmatically get information about
27 * their AdMob account.</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://developers.google.com/admob/api/" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class AdMob extends \Google\Service
37{
38  /** See your AdMob data. */
39  const ADMOB_READONLY =
40      "https://www.googleapis.com/auth/admob.readonly";
41  /** See your AdMob data. */
42  const ADMOB_REPORT =
43      "https://www.googleapis.com/auth/admob.report";
44
45  public $accounts;
46  public $accounts_adUnits;
47  public $accounts_apps;
48  public $accounts_mediationReport;
49  public $accounts_networkReport;
50
51  /**
52   * Constructs the internal representation of the AdMob service.
53   *
54   * @param Client|array $clientOrConfig The client used to deliver requests, or a
55   *                                     config array to pass to a new Client instance.
56   * @param string $rootUrl The root URL used for requests to the service.
57   */
58  public function __construct($clientOrConfig = [], $rootUrl = null)
59  {
60    parent::__construct($clientOrConfig);
61    $this->rootUrl = $rootUrl ?: 'https://admob.googleapis.com/';
62    $this->servicePath = '';
63    $this->batchPath = 'batch';
64    $this->version = 'v1';
65    $this->serviceName = 'admob';
66
67    $this->accounts = new AdMob\Resource\Accounts(
68        $this,
69        $this->serviceName,
70        'accounts',
71        [
72          'methods' => [
73            'get' => [
74              'path' => 'v1/{+name}',
75              'httpMethod' => 'GET',
76              'parameters' => [
77                'name' => [
78                  'location' => 'path',
79                  'type' => 'string',
80                  'required' => true,
81                ],
82              ],
83            ],'list' => [
84              'path' => 'v1/accounts',
85              'httpMethod' => 'GET',
86              'parameters' => [
87                'pageSize' => [
88                  'location' => 'query',
89                  'type' => 'integer',
90                ],
91                'pageToken' => [
92                  'location' => 'query',
93                  'type' => 'string',
94                ],
95              ],
96            ],
97          ]
98        ]
99    );
100    $this->accounts_adUnits = new AdMob\Resource\AccountsAdUnits(
101        $this,
102        $this->serviceName,
103        'adUnits',
104        [
105          'methods' => [
106            'list' => [
107              'path' => 'v1/{+parent}/adUnits',
108              'httpMethod' => 'GET',
109              'parameters' => [
110                'parent' => [
111                  'location' => 'path',
112                  'type' => 'string',
113                  'required' => true,
114                ],
115                'pageSize' => [
116                  'location' => 'query',
117                  'type' => 'integer',
118                ],
119                'pageToken' => [
120                  'location' => 'query',
121                  'type' => 'string',
122                ],
123              ],
124            ],
125          ]
126        ]
127    );
128    $this->accounts_apps = new AdMob\Resource\AccountsApps(
129        $this,
130        $this->serviceName,
131        'apps',
132        [
133          'methods' => [
134            'list' => [
135              'path' => 'v1/{+parent}/apps',
136              'httpMethod' => 'GET',
137              'parameters' => [
138                'parent' => [
139                  'location' => 'path',
140                  'type' => 'string',
141                  'required' => true,
142                ],
143                'pageSize' => [
144                  'location' => 'query',
145                  'type' => 'integer',
146                ],
147                'pageToken' => [
148                  'location' => 'query',
149                  'type' => 'string',
150                ],
151              ],
152            ],
153          ]
154        ]
155    );
156    $this->accounts_mediationReport = new AdMob\Resource\AccountsMediationReport(
157        $this,
158        $this->serviceName,
159        'mediationReport',
160        [
161          'methods' => [
162            'generate' => [
163              'path' => 'v1/{+parent}/mediationReport:generate',
164              'httpMethod' => 'POST',
165              'parameters' => [
166                'parent' => [
167                  'location' => 'path',
168                  'type' => 'string',
169                  'required' => true,
170                ],
171              ],
172            ],
173          ]
174        ]
175    );
176    $this->accounts_networkReport = new AdMob\Resource\AccountsNetworkReport(
177        $this,
178        $this->serviceName,
179        'networkReport',
180        [
181          'methods' => [
182            'generate' => [
183              'path' => 'v1/{+parent}/networkReport:generate',
184              'httpMethod' => 'POST',
185              'parameters' => [
186                'parent' => [
187                  'location' => 'path',
188                  'type' => 'string',
189                  'required' => true,
190                ],
191              ],
192            ],
193          ]
194        ]
195    );
196  }
197}
198
199// Adding a class alias for backwards compatibility with the previous class name.
200class_alias(AdMob::class, 'Google_Service_AdMob');
201