CloudRetail.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  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 CloudRetail (v2).
  21. *
  22. * <p>
  23. * Cloud Retail service enables customers to build end-to-end personalized
  24. * recommendation systems without requiring a high level of expertise in machine
  25. * learning, recommendation system, or Google Cloud.</p>
  26. *
  27. * <p>
  28. * For more information about this service, see the API
  29. * <a href="https://cloud.google.com/recommendations" target="_blank">Documentation</a>
  30. * </p>
  31. *
  32. * @author Google, Inc.
  33. */
  34. class CloudRetail extends \Google\Service
  35. {
  36. /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
  37. const CLOUD_PLATFORM =
  38. "https://www.googleapis.com/auth/cloud-platform";
  39. public $projects_locations_catalogs;
  40. public $projects_locations_catalogs_branches_operations;
  41. public $projects_locations_catalogs_branches_products;
  42. public $projects_locations_catalogs_completionData;
  43. public $projects_locations_catalogs_operations;
  44. public $projects_locations_catalogs_placements;
  45. public $projects_locations_catalogs_servingConfigs;
  46. public $projects_locations_catalogs_userEvents;
  47. public $projects_locations_operations;
  48. public $projects_operations;
  49. /**
  50. * Constructs the internal representation of the CloudRetail service.
  51. *
  52. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  53. * config array to pass to a new Client instance.
  54. * @param string $rootUrl The root URL used for requests to the service.
  55. */
  56. public function __construct($clientOrConfig = [], $rootUrl = null)
  57. {
  58. parent::__construct($clientOrConfig);
  59. $this->rootUrl = $rootUrl ?: 'https://retail.googleapis.com/';
  60. $this->servicePath = '';
  61. $this->batchPath = 'batch';
  62. $this->version = 'v2';
  63. $this->serviceName = 'retail';
  64. $this->projects_locations_catalogs = new CloudRetail\Resource\ProjectsLocationsCatalogs(
  65. $this,
  66. $this->serviceName,
  67. 'catalogs',
  68. [
  69. 'methods' => [
  70. 'completeQuery' => [
  71. 'path' => 'v2/{+catalog}:completeQuery',
  72. 'httpMethod' => 'GET',
  73. 'parameters' => [
  74. 'catalog' => [
  75. 'location' => 'path',
  76. 'type' => 'string',
  77. 'required' => true,
  78. ],
  79. 'dataset' => [
  80. 'location' => 'query',
  81. 'type' => 'string',
  82. ],
  83. 'deviceType' => [
  84. 'location' => 'query',
  85. 'type' => 'string',
  86. ],
  87. 'languageCodes' => [
  88. 'location' => 'query',
  89. 'type' => 'string',
  90. 'repeated' => true,
  91. ],
  92. 'maxSuggestions' => [
  93. 'location' => 'query',
  94. 'type' => 'integer',
  95. ],
  96. 'query' => [
  97. 'location' => 'query',
  98. 'type' => 'string',
  99. ],
  100. 'visitorId' => [
  101. 'location' => 'query',
  102. 'type' => 'string',
  103. ],
  104. ],
  105. ],'getDefaultBranch' => [
  106. 'path' => 'v2/{+catalog}:getDefaultBranch',
  107. 'httpMethod' => 'GET',
  108. 'parameters' => [
  109. 'catalog' => [
  110. 'location' => 'path',
  111. 'type' => 'string',
  112. 'required' => true,
  113. ],
  114. ],
  115. ],'list' => [
  116. 'path' => 'v2/{+parent}/catalogs',
  117. 'httpMethod' => 'GET',
  118. 'parameters' => [
  119. 'parent' => [
  120. 'location' => 'path',
  121. 'type' => 'string',
  122. 'required' => true,
  123. ],
  124. 'pageSize' => [
  125. 'location' => 'query',
  126. 'type' => 'integer',
  127. ],
  128. 'pageToken' => [
  129. 'location' => 'query',
  130. 'type' => 'string',
  131. ],
  132. ],
  133. ],'patch' => [
  134. 'path' => 'v2/{+name}',
  135. 'httpMethod' => 'PATCH',
  136. 'parameters' => [
  137. 'name' => [
  138. 'location' => 'path',
  139. 'type' => 'string',
  140. 'required' => true,
  141. ],
  142. 'updateMask' => [
  143. 'location' => 'query',
  144. 'type' => 'string',
  145. ],
  146. ],
  147. ],'setDefaultBranch' => [
  148. 'path' => 'v2/{+catalog}:setDefaultBranch',
  149. 'httpMethod' => 'POST',
  150. 'parameters' => [
  151. 'catalog' => [
  152. 'location' => 'path',
  153. 'type' => 'string',
  154. 'required' => true,
  155. ],
  156. ],
  157. ],
  158. ]
  159. ]
  160. );
  161. $this->projects_locations_catalogs_branches_operations = new CloudRetail\Resource\ProjectsLocationsCatalogsBranchesOperations(
  162. $this,
  163. $this->serviceName,
  164. 'operations',
  165. [
  166. 'methods' => [
  167. 'get' => [
  168. 'path' => 'v2/{+name}',
  169. 'httpMethod' => 'GET',
  170. 'parameters' => [
  171. 'name' => [
  172. 'location' => 'path',
  173. 'type' => 'string',
  174. 'required' => true,
  175. ],
  176. ],
  177. ],
  178. ]
  179. ]
  180. );
  181. $this->projects_locations_catalogs_branches_products = new CloudRetail\Resource\ProjectsLocationsCatalogsBranchesProducts(
  182. $this,
  183. $this->serviceName,
  184. 'products',
  185. [
  186. 'methods' => [
  187. 'addFulfillmentPlaces' => [
  188. 'path' => 'v2/{+product}:addFulfillmentPlaces',
  189. 'httpMethod' => 'POST',
  190. 'parameters' => [
  191. 'product' => [
  192. 'location' => 'path',
  193. 'type' => 'string',
  194. 'required' => true,
  195. ],
  196. ],
  197. ],'addLocalInventories' => [
  198. 'path' => 'v2/{+product}:addLocalInventories',
  199. 'httpMethod' => 'POST',
  200. 'parameters' => [
  201. 'product' => [
  202. 'location' => 'path',
  203. 'type' => 'string',
  204. 'required' => true,
  205. ],
  206. ],
  207. ],'create' => [
  208. 'path' => 'v2/{+parent}/products',
  209. 'httpMethod' => 'POST',
  210. 'parameters' => [
  211. 'parent' => [
  212. 'location' => 'path',
  213. 'type' => 'string',
  214. 'required' => true,
  215. ],
  216. 'productId' => [
  217. 'location' => 'query',
  218. 'type' => 'string',
  219. ],
  220. ],
  221. ],'delete' => [
  222. 'path' => 'v2/{+name}',
  223. 'httpMethod' => 'DELETE',
  224. 'parameters' => [
  225. 'name' => [
  226. 'location' => 'path',
  227. 'type' => 'string',
  228. 'required' => true,
  229. ],
  230. ],
  231. ],'get' => [
  232. 'path' => 'v2/{+name}',
  233. 'httpMethod' => 'GET',
  234. 'parameters' => [
  235. 'name' => [
  236. 'location' => 'path',
  237. 'type' => 'string',
  238. 'required' => true,
  239. ],
  240. ],
  241. ],'import' => [
  242. 'path' => 'v2/{+parent}/products:import',
  243. 'httpMethod' => 'POST',
  244. 'parameters' => [
  245. 'parent' => [
  246. 'location' => 'path',
  247. 'type' => 'string',
  248. 'required' => true,
  249. ],
  250. ],
  251. ],'list' => [
  252. 'path' => 'v2/{+parent}/products',
  253. 'httpMethod' => 'GET',
  254. 'parameters' => [
  255. 'parent' => [
  256. 'location' => 'path',
  257. 'type' => 'string',
  258. 'required' => true,
  259. ],
  260. 'filter' => [
  261. 'location' => 'query',
  262. 'type' => 'string',
  263. ],
  264. 'pageSize' => [
  265. 'location' => 'query',
  266. 'type' => 'integer',
  267. ],
  268. 'pageToken' => [
  269. 'location' => 'query',
  270. 'type' => 'string',
  271. ],
  272. 'readMask' => [
  273. 'location' => 'query',
  274. 'type' => 'string',
  275. ],
  276. ],
  277. ],'patch' => [
  278. 'path' => 'v2/{+name}',
  279. 'httpMethod' => 'PATCH',
  280. 'parameters' => [
  281. 'name' => [
  282. 'location' => 'path',
  283. 'type' => 'string',
  284. 'required' => true,
  285. ],
  286. 'allowMissing' => [
  287. 'location' => 'query',
  288. 'type' => 'boolean',
  289. ],
  290. 'updateMask' => [
  291. 'location' => 'query',
  292. 'type' => 'string',
  293. ],
  294. ],
  295. ],'removeFulfillmentPlaces' => [
  296. 'path' => 'v2/{+product}:removeFulfillmentPlaces',
  297. 'httpMethod' => 'POST',
  298. 'parameters' => [
  299. 'product' => [
  300. 'location' => 'path',
  301. 'type' => 'string',
  302. 'required' => true,
  303. ],
  304. ],
  305. ],'removeLocalInventories' => [
  306. 'path' => 'v2/{+product}:removeLocalInventories',
  307. 'httpMethod' => 'POST',
  308. 'parameters' => [
  309. 'product' => [
  310. 'location' => 'path',
  311. 'type' => 'string',
  312. 'required' => true,
  313. ],
  314. ],
  315. ],'setInventory' => [
  316. 'path' => 'v2/{+name}:setInventory',
  317. 'httpMethod' => 'POST',
  318. 'parameters' => [
  319. 'name' => [
  320. 'location' => 'path',
  321. 'type' => 'string',
  322. 'required' => true,
  323. ],
  324. ],
  325. ],
  326. ]
  327. ]
  328. );
  329. $this->projects_locations_catalogs_completionData = new CloudRetail\Resource\ProjectsLocationsCatalogsCompletionData(
  330. $this,
  331. $this->serviceName,
  332. 'completionData',
  333. [
  334. 'methods' => [
  335. 'import' => [
  336. 'path' => 'v2/{+parent}/completionData:import',
  337. 'httpMethod' => 'POST',
  338. 'parameters' => [
  339. 'parent' => [
  340. 'location' => 'path',
  341. 'type' => 'string',
  342. 'required' => true,
  343. ],
  344. ],
  345. ],
  346. ]
  347. ]
  348. );
  349. $this->projects_locations_catalogs_operations = new CloudRetail\Resource\ProjectsLocationsCatalogsOperations(
  350. $this,
  351. $this->serviceName,
  352. 'operations',
  353. [
  354. 'methods' => [
  355. 'get' => [
  356. 'path' => 'v2/{+name}',
  357. 'httpMethod' => 'GET',
  358. 'parameters' => [
  359. 'name' => [
  360. 'location' => 'path',
  361. 'type' => 'string',
  362. 'required' => true,
  363. ],
  364. ],
  365. ],'list' => [
  366. 'path' => 'v2/{+name}/operations',
  367. 'httpMethod' => 'GET',
  368. 'parameters' => [
  369. 'name' => [
  370. 'location' => 'path',
  371. 'type' => 'string',
  372. 'required' => true,
  373. ],
  374. 'filter' => [
  375. 'location' => 'query',
  376. 'type' => 'string',
  377. ],
  378. 'pageSize' => [
  379. 'location' => 'query',
  380. 'type' => 'integer',
  381. ],
  382. 'pageToken' => [
  383. 'location' => 'query',
  384. 'type' => 'string',
  385. ],
  386. ],
  387. ],
  388. ]
  389. ]
  390. );
  391. $this->projects_locations_catalogs_placements = new CloudRetail\Resource\ProjectsLocationsCatalogsPlacements(
  392. $this,
  393. $this->serviceName,
  394. 'placements',
  395. [
  396. 'methods' => [
  397. 'predict' => [
  398. 'path' => 'v2/{+placement}:predict',
  399. 'httpMethod' => 'POST',
  400. 'parameters' => [
  401. 'placement' => [
  402. 'location' => 'path',
  403. 'type' => 'string',
  404. 'required' => true,
  405. ],
  406. ],
  407. ],'search' => [
  408. 'path' => 'v2/{+placement}:search',
  409. 'httpMethod' => 'POST',
  410. 'parameters' => [
  411. 'placement' => [
  412. 'location' => 'path',
  413. 'type' => 'string',
  414. 'required' => true,
  415. ],
  416. ],
  417. ],
  418. ]
  419. ]
  420. );
  421. $this->projects_locations_catalogs_servingConfigs = new CloudRetail\Resource\ProjectsLocationsCatalogsServingConfigs(
  422. $this,
  423. $this->serviceName,
  424. 'servingConfigs',
  425. [
  426. 'methods' => [
  427. 'predict' => [
  428. 'path' => 'v2/{+placement}:predict',
  429. 'httpMethod' => 'POST',
  430. 'parameters' => [
  431. 'placement' => [
  432. 'location' => 'path',
  433. 'type' => 'string',
  434. 'required' => true,
  435. ],
  436. ],
  437. ],'search' => [
  438. 'path' => 'v2/{+placement}:search',
  439. 'httpMethod' => 'POST',
  440. 'parameters' => [
  441. 'placement' => [
  442. 'location' => 'path',
  443. 'type' => 'string',
  444. 'required' => true,
  445. ],
  446. ],
  447. ],
  448. ]
  449. ]
  450. );
  451. $this->projects_locations_catalogs_userEvents = new CloudRetail\Resource\ProjectsLocationsCatalogsUserEvents(
  452. $this,
  453. $this->serviceName,
  454. 'userEvents',
  455. [
  456. 'methods' => [
  457. 'collect' => [
  458. 'path' => 'v2/{+parent}/userEvents:collect',
  459. 'httpMethod' => 'GET',
  460. 'parameters' => [
  461. 'parent' => [
  462. 'location' => 'path',
  463. 'type' => 'string',
  464. 'required' => true,
  465. ],
  466. 'ets' => [
  467. 'location' => 'query',
  468. 'type' => 'string',
  469. ],
  470. 'uri' => [
  471. 'location' => 'query',
  472. 'type' => 'string',
  473. ],
  474. 'userEvent' => [
  475. 'location' => 'query',
  476. 'type' => 'string',
  477. ],
  478. ],
  479. ],'import' => [
  480. 'path' => 'v2/{+parent}/userEvents:import',
  481. 'httpMethod' => 'POST',
  482. 'parameters' => [
  483. 'parent' => [
  484. 'location' => 'path',
  485. 'type' => 'string',
  486. 'required' => true,
  487. ],
  488. ],
  489. ],'purge' => [
  490. 'path' => 'v2/{+parent}/userEvents:purge',
  491. 'httpMethod' => 'POST',
  492. 'parameters' => [
  493. 'parent' => [
  494. 'location' => 'path',
  495. 'type' => 'string',
  496. 'required' => true,
  497. ],
  498. ],
  499. ],'rejoin' => [
  500. 'path' => 'v2/{+parent}/userEvents:rejoin',
  501. 'httpMethod' => 'POST',
  502. 'parameters' => [
  503. 'parent' => [
  504. 'location' => 'path',
  505. 'type' => 'string',
  506. 'required' => true,
  507. ],
  508. ],
  509. ],'write' => [
  510. 'path' => 'v2/{+parent}/userEvents:write',
  511. 'httpMethod' => 'POST',
  512. 'parameters' => [
  513. 'parent' => [
  514. 'location' => 'path',
  515. 'type' => 'string',
  516. 'required' => true,
  517. ],
  518. ],
  519. ],
  520. ]
  521. ]
  522. );
  523. $this->projects_locations_operations = new CloudRetail\Resource\ProjectsLocationsOperations(
  524. $this,
  525. $this->serviceName,
  526. 'operations',
  527. [
  528. 'methods' => [
  529. 'get' => [
  530. 'path' => 'v2/{+name}',
  531. 'httpMethod' => 'GET',
  532. 'parameters' => [
  533. 'name' => [
  534. 'location' => 'path',
  535. 'type' => 'string',
  536. 'required' => true,
  537. ],
  538. ],
  539. ],'list' => [
  540. 'path' => 'v2/{+name}/operations',
  541. 'httpMethod' => 'GET',
  542. 'parameters' => [
  543. 'name' => [
  544. 'location' => 'path',
  545. 'type' => 'string',
  546. 'required' => true,
  547. ],
  548. 'filter' => [
  549. 'location' => 'query',
  550. 'type' => 'string',
  551. ],
  552. 'pageSize' => [
  553. 'location' => 'query',
  554. 'type' => 'integer',
  555. ],
  556. 'pageToken' => [
  557. 'location' => 'query',
  558. 'type' => 'string',
  559. ],
  560. ],
  561. ],
  562. ]
  563. ]
  564. );
  565. $this->projects_operations = new CloudRetail\Resource\ProjectsOperations(
  566. $this,
  567. $this->serviceName,
  568. 'operations',
  569. [
  570. 'methods' => [
  571. 'get' => [
  572. 'path' => 'v2/{+name}',
  573. 'httpMethod' => 'GET',
  574. 'parameters' => [
  575. 'name' => [
  576. 'location' => 'path',
  577. 'type' => 'string',
  578. 'required' => true,
  579. ],
  580. ],
  581. ],'list' => [
  582. 'path' => 'v2/{+name}/operations',
  583. 'httpMethod' => 'GET',
  584. 'parameters' => [
  585. 'name' => [
  586. 'location' => 'path',
  587. 'type' => 'string',
  588. 'required' => true,
  589. ],
  590. 'filter' => [
  591. 'location' => 'query',
  592. 'type' => 'string',
  593. ],
  594. 'pageSize' => [
  595. 'location' => 'query',
  596. 'type' => 'integer',
  597. ],
  598. 'pageToken' => [
  599. 'location' => 'query',
  600. 'type' => 'string',
  601. ],
  602. ],
  603. ],
  604. ]
  605. ]
  606. );
  607. }
  608. }
  609. // Adding a class alias for backwards compatibility with the previous class name.
  610. class_alias(CloudRetail::class, 'Google_Service_CloudRetail');