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 |
|
---|
18 | namespace Google\Service\CloudRetail\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudRetail\GoogleCloudRetailV2AddCatalogAttributeRequest;
|
---|
21 | use Google\Service\CloudRetail\GoogleCloudRetailV2AttributesConfig;
|
---|
22 | use Google\Service\CloudRetail\GoogleCloudRetailV2RemoveCatalogAttributeRequest;
|
---|
23 | use Google\Service\CloudRetail\GoogleCloudRetailV2ReplaceCatalogAttributeRequest;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "attributesConfig" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $retailService = new Google\Service\CloudRetail(...);
|
---|
30 | * $attributesConfig = $retailService->projects_locations_catalogs_attributesConfig;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class ProjectsLocationsCatalogsAttributesConfig extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Adds the specified CatalogAttribute to the AttributesConfig. If the
|
---|
37 | * CatalogAttribute to add already exists, an ALREADY_EXISTS error is returned.
|
---|
38 | * (attributesConfig.addCatalogAttribute)
|
---|
39 | *
|
---|
40 | * @param string $attributesConfig Required. Full AttributesConfig resource
|
---|
41 | * name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{ca
|
---|
42 | * talog_id}/attributesConfig`
|
---|
43 | * @param GoogleCloudRetailV2AddCatalogAttributeRequest $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | * @return GoogleCloudRetailV2AttributesConfig
|
---|
46 | * @throws \Google\Service\Exception
|
---|
47 | */
|
---|
48 | public function addCatalogAttribute($attributesConfig, GoogleCloudRetailV2AddCatalogAttributeRequest $postBody, $optParams = [])
|
---|
49 | {
|
---|
50 | $params = ['attributesConfig' => $attributesConfig, 'postBody' => $postBody];
|
---|
51 | $params = array_merge($params, $optParams);
|
---|
52 | return $this->call('addCatalogAttribute', [$params], GoogleCloudRetailV2AttributesConfig::class);
|
---|
53 | }
|
---|
54 | /**
|
---|
55 | * Removes the specified CatalogAttribute from the AttributesConfig. If the
|
---|
56 | * CatalogAttribute to remove does not exist, a NOT_FOUND error is returned.
|
---|
57 | * (attributesConfig.removeCatalogAttribute)
|
---|
58 | *
|
---|
59 | * @param string $attributesConfig Required. Full AttributesConfig resource
|
---|
60 | * name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{ca
|
---|
61 | * talog_id}/attributesConfig`
|
---|
62 | * @param GoogleCloudRetailV2RemoveCatalogAttributeRequest $postBody
|
---|
63 | * @param array $optParams Optional parameters.
|
---|
64 | * @return GoogleCloudRetailV2AttributesConfig
|
---|
65 | * @throws \Google\Service\Exception
|
---|
66 | */
|
---|
67 | public function removeCatalogAttribute($attributesConfig, GoogleCloudRetailV2RemoveCatalogAttributeRequest $postBody, $optParams = [])
|
---|
68 | {
|
---|
69 | $params = ['attributesConfig' => $attributesConfig, 'postBody' => $postBody];
|
---|
70 | $params = array_merge($params, $optParams);
|
---|
71 | return $this->call('removeCatalogAttribute', [$params], GoogleCloudRetailV2AttributesConfig::class);
|
---|
72 | }
|
---|
73 | /**
|
---|
74 | * Replaces the specified CatalogAttribute in the AttributesConfig by updating
|
---|
75 | * the catalog attribute with the same CatalogAttribute.key. If the
|
---|
76 | * CatalogAttribute to replace does not exist, a NOT_FOUND error is returned.
|
---|
77 | * (attributesConfig.replaceCatalogAttribute)
|
---|
78 | *
|
---|
79 | * @param string $attributesConfig Required. Full AttributesConfig resource
|
---|
80 | * name. Format: `projects/{project_number}/locations/{location_id}/catalogs/{ca
|
---|
81 | * talog_id}/attributesConfig`
|
---|
82 | * @param GoogleCloudRetailV2ReplaceCatalogAttributeRequest $postBody
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | * @return GoogleCloudRetailV2AttributesConfig
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function replaceCatalogAttribute($attributesConfig, GoogleCloudRetailV2ReplaceCatalogAttributeRequest $postBody, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['attributesConfig' => $attributesConfig, 'postBody' => $postBody];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('replaceCatalogAttribute', [$params], GoogleCloudRetailV2AttributesConfig::class);
|
---|
92 | }
|
---|
93 | }
|
---|
94 |
|
---|
95 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
96 | class_alias(ProjectsLocationsCatalogsAttributesConfig::class, 'Google_Service_CloudRetail_Resource_ProjectsLocationsCatalogsAttributesConfig');
|
---|