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