AdMob.php 5.7 KB

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