AdSenseHost.php 20 KB

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