source: vendor/google/apiclient-services/src/CloudRetail/Resource/ProjectsLocationsCatalogsControls.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload project files

  • Property mode set to 100644
File size: 5.7 KB
Line 
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\CloudRetail\Resource;
19
20use Google\Service\CloudRetail\GoogleCloudRetailV2Control;
21use Google\Service\CloudRetail\GoogleCloudRetailV2ListControlsResponse;
22use Google\Service\CloudRetail\GoogleProtobufEmpty;
23
24/**
25 * The "controls" collection of methods.
26 * Typical usage is:
27 * <code>
28 * $retailService = new Google\Service\CloudRetail(...);
29 * $controls = $retailService->projects_locations_catalogs_controls;
30 * </code>
31 */
32class ProjectsLocationsCatalogsControls extends \Google\Service\Resource
33{
34 /**
35 * Creates a Control. If the Control to create already exists, an ALREADY_EXISTS
36 * error is returned. (controls.create)
37 *
38 * @param string $parent Required. Full resource name of parent catalog. Format:
39 * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
40 * @param GoogleCloudRetailV2Control $postBody
41 * @param array $optParams Optional parameters.
42 *
43 * @opt_param string controlId Required. The ID to use for the Control, which
44 * will become the final component of the Control's resource name. This value
45 * should be 4-63 characters, and valid characters are /a-z-_/.
46 * @return GoogleCloudRetailV2Control
47 * @throws \Google\Service\Exception
48 */
49 public function create($parent, GoogleCloudRetailV2Control $postBody, $optParams = [])
50 {
51 $params = ['parent' => $parent, 'postBody' => $postBody];
52 $params = array_merge($params, $optParams);
53 return $this->call('create', [$params], GoogleCloudRetailV2Control::class);
54 }
55 /**
56 * Deletes a Control. If the Control to delete does not exist, a NOT_FOUND error
57 * is returned. (controls.delete)
58 *
59 * @param string $name Required. The resource name of the Control to delete.
60 * Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_
61 * id}/controls/{control_id}`
62 * @param array $optParams Optional parameters.
63 * @return GoogleProtobufEmpty
64 * @throws \Google\Service\Exception
65 */
66 public function delete($name, $optParams = [])
67 {
68 $params = ['name' => $name];
69 $params = array_merge($params, $optParams);
70 return $this->call('delete', [$params], GoogleProtobufEmpty::class);
71 }
72 /**
73 * Gets a Control. (controls.get)
74 *
75 * @param string $name Required. The resource name of the Control to get.
76 * Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_
77 * id}/controls/{control_id}`
78 * @param array $optParams Optional parameters.
79 * @return GoogleCloudRetailV2Control
80 * @throws \Google\Service\Exception
81 */
82 public function get($name, $optParams = [])
83 {
84 $params = ['name' => $name];
85 $params = array_merge($params, $optParams);
86 return $this->call('get', [$params], GoogleCloudRetailV2Control::class);
87 }
88 /**
89 * Lists all Controls by their parent Catalog.
90 * (controls.listProjectsLocationsCatalogsControls)
91 *
92 * @param string $parent Required. The catalog resource name. Format:
93 * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
94 * @param array $optParams Optional parameters.
95 *
96 * @opt_param string filter Optional. A filter to apply on the list results.
97 * Supported features: * List all the products under the parent branch if filter
98 * is unset. * List controls that are used in a single ServingConfig:
99 * 'serving_config = "boosted_home_page_cvr"'
100 * @opt_param int pageSize Optional. Maximum number of results to return. If
101 * unspecified, defaults to 50. Max allowed value is 1000.
102 * @opt_param string pageToken Optional. A page token, received from a previous
103 * `ListControls` call. Provide this to retrieve the subsequent page.
104 * @return GoogleCloudRetailV2ListControlsResponse
105 * @throws \Google\Service\Exception
106 */
107 public function listProjectsLocationsCatalogsControls($parent, $optParams = [])
108 {
109 $params = ['parent' => $parent];
110 $params = array_merge($params, $optParams);
111 return $this->call('list', [$params], GoogleCloudRetailV2ListControlsResponse::class);
112 }
113 /**
114 * Updates a Control. Control cannot be set to a different oneof field, if so an
115 * INVALID_ARGUMENT is returned. If the Control to update does not exist, a
116 * NOT_FOUND error is returned. (controls.patch)
117 *
118 * @param string $name Immutable. Fully qualified name
119 * `projects/locations/global/catalogs/controls`
120 * @param GoogleCloudRetailV2Control $postBody
121 * @param array $optParams Optional parameters.
122 *
123 * @opt_param string updateMask Indicates which fields in the provided Control
124 * to update. The following are NOT supported: * Control.name If not set or
125 * empty, all supported fields are updated.
126 * @return GoogleCloudRetailV2Control
127 * @throws \Google\Service\Exception
128 */
129 public function patch($name, GoogleCloudRetailV2Control $postBody, $optParams = [])
130 {
131 $params = ['name' => $name, 'postBody' => $postBody];
132 $params = array_merge($params, $optParams);
133 return $this->call('patch', [$params], GoogleCloudRetailV2Control::class);
134 }
135}
136
137// Adding a class alias for backwards compatibility with the previous class name.
138class_alias(ProjectsLocationsCatalogsControls::class, 'Google_Service_CloudRetail_Resource_ProjectsLocationsCatalogsControls');
Note: See TracBrowser for help on using the repository browser.