AdSenseHost.php 20 KB

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