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\RecommendationsAI\Resource;
19
20use Google\Service\RecommendationsAI\GoogleCloudRecommendationengineV1beta1CatalogItem;
21use Google\Service\RecommendationsAI\GoogleCloudRecommendationengineV1beta1ImportCatalogItemsRequest;
22use Google\Service\RecommendationsAI\GoogleCloudRecommendationengineV1beta1ListCatalogItemsResponse;
23use Google\Service\RecommendationsAI\GoogleLongrunningOperation;
24use Google\Service\RecommendationsAI\GoogleProtobufEmpty;
25
26/**
27 * The "catalogItems" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $recommendationengineService = new Google\Service\RecommendationsAI(...);
31 *   $catalogItems = $recommendationengineService->catalogItems;
32 *  </code>
33 */
34class ProjectsLocationsCatalogsCatalogItems extends \Google\Service\Resource
35{
36  /**
37   * Creates a catalog item. (catalogItems.create)
38   *
39   * @param string $parent Required. The parent catalog resource name, such as
40   * `projects/locations/global/catalogs/default_catalog`.
41   * @param GoogleCloudRecommendationengineV1beta1CatalogItem $postBody
42   * @param array $optParams Optional parameters.
43   * @return GoogleCloudRecommendationengineV1beta1CatalogItem
44   */
45  public function create($parent, GoogleCloudRecommendationengineV1beta1CatalogItem $postBody, $optParams = [])
46  {
47    $params = ['parent' => $parent, 'postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('create', [$params], GoogleCloudRecommendationengineV1beta1CatalogItem::class);
50  }
51  /**
52   * Deletes a catalog item. (catalogItems.delete)
53   *
54   * @param string $name Required. Full resource name of catalog item, such as `pr
55   * ojects/locations/global/catalogs/default_catalog/catalogItems/some_catalog_it
56   * em_id`.
57   * @param array $optParams Optional parameters.
58   * @return GoogleProtobufEmpty
59   */
60  public function delete($name, $optParams = [])
61  {
62    $params = ['name' => $name];
63    $params = array_merge($params, $optParams);
64    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
65  }
66  /**
67   * Gets a specific catalog item. (catalogItems.get)
68   *
69   * @param string $name Required. Full resource name of catalog item, such as `pr
70   * ojects/locations/global/catalogs/default_catalog/catalogitems/some_catalog_it
71   * em_id`.
72   * @param array $optParams Optional parameters.
73   * @return GoogleCloudRecommendationengineV1beta1CatalogItem
74   */
75  public function get($name, $optParams = [])
76  {
77    $params = ['name' => $name];
78    $params = array_merge($params, $optParams);
79    return $this->call('get', [$params], GoogleCloudRecommendationengineV1beta1CatalogItem::class);
80  }
81  /**
82   * Bulk import of multiple catalog items. Request processing may be synchronous.
83   * No partial updating supported. Non-existing items will be created.
84   * Operation.response is of type ImportResponse. Note that it is possible for a
85   * subset of the items to be successfully updated. (catalogItems.import)
86   *
87   * @param string $parent Required.
88   * `projects/1234/locations/global/catalogs/default_catalog` If no updateMask is
89   * specified, requires catalogItems.create permission. If updateMask is
90   * specified, requires catalogItems.update permission.
91   * @param GoogleCloudRecommendationengineV1beta1ImportCatalogItemsRequest $postBody
92   * @param array $optParams Optional parameters.
93   * @return GoogleLongrunningOperation
94   */
95  public function import($parent, GoogleCloudRecommendationengineV1beta1ImportCatalogItemsRequest $postBody, $optParams = [])
96  {
97    $params = ['parent' => $parent, 'postBody' => $postBody];
98    $params = array_merge($params, $optParams);
99    return $this->call('import', [$params], GoogleLongrunningOperation::class);
100  }
101  /**
102   * Gets a list of catalog items.
103   * (catalogItems.listProjectsLocationsCatalogsCatalogItems)
104   *
105   * @param string $parent Required. The parent catalog resource name, such as
106   * `projects/locations/global/catalogs/default_catalog`.
107   * @param array $optParams Optional parameters.
108   *
109   * @opt_param string filter Optional. Use of this field is not supported by
110   * version v1beta1.
111   * @opt_param int pageSize Optional. Maximum number of results to return per
112   * page. If zero, the service will choose a reasonable default.
113   * @opt_param string pageToken Optional. The previous
114   * ListCatalogItemsResponse.next_page_token.
115   * @return GoogleCloudRecommendationengineV1beta1ListCatalogItemsResponse
116   */
117  public function listProjectsLocationsCatalogsCatalogItems($parent, $optParams = [])
118  {
119    $params = ['parent' => $parent];
120    $params = array_merge($params, $optParams);
121    return $this->call('list', [$params], GoogleCloudRecommendationengineV1beta1ListCatalogItemsResponse::class);
122  }
123  /**
124   * Updates a catalog item. Partial updating is supported. Non-existing items
125   * will be created. (catalogItems.patch)
126   *
127   * @param string $name Required. Full resource name of catalog item, such as `pr
128   * ojects/locations/global/catalogs/default_catalog/catalogItems/some_catalog_it
129   * em_id`.
130   * @param GoogleCloudRecommendationengineV1beta1CatalogItem $postBody
131   * @param array $optParams Optional parameters.
132   *
133   * @opt_param string updateMask Optional. Indicates which fields in the provided
134   * 'item' to update. If not set, will by default update all fields.
135   * @return GoogleCloudRecommendationengineV1beta1CatalogItem
136   */
137  public function patch($name, GoogleCloudRecommendationengineV1beta1CatalogItem $postBody, $optParams = [])
138  {
139    $params = ['name' => $name, 'postBody' => $postBody];
140    $params = array_merge($params, $optParams);
141    return $this->call('patch', [$params], GoogleCloudRecommendationengineV1beta1CatalogItem::class);
142  }
143}
144
145// Adding a class alias for backwards compatibility with the previous class name.
146class_alias(ProjectsLocationsCatalogsCatalogItems::class, 'Google_Service_RecommendationsAI_Resource_ProjectsLocationsCatalogsCatalogItems');
147