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\MigrationCenterAPI\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\MigrationCenterAPI\AddAssetsToGroupRequest;
|
---|
21 | use Google\Service\MigrationCenterAPI\Group;
|
---|
22 | use Google\Service\MigrationCenterAPI\ListGroupsResponse;
|
---|
23 | use Google\Service\MigrationCenterAPI\Operation;
|
---|
24 | use Google\Service\MigrationCenterAPI\RemoveAssetsFromGroupRequest;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "groups" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $migrationcenterService = new Google\Service\MigrationCenterAPI(...);
|
---|
31 | * $groups = $migrationcenterService->projects_locations_groups;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class ProjectsLocationsGroups extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Adds assets to a group. (groups.addAssets)
|
---|
38 | *
|
---|
39 | * @param string $group Required. Group reference.
|
---|
40 | * @param AddAssetsToGroupRequest $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | * @return Operation
|
---|
43 | * @throws \Google\Service\Exception
|
---|
44 | */
|
---|
45 | public function addAssets($group, AddAssetsToGroupRequest $postBody, $optParams = [])
|
---|
46 | {
|
---|
47 | $params = ['group' => $group, 'postBody' => $postBody];
|
---|
48 | $params = array_merge($params, $optParams);
|
---|
49 | return $this->call('addAssets', [$params], Operation::class);
|
---|
50 | }
|
---|
51 | /**
|
---|
52 | * Creates a new group in a given project and location. (groups.create)
|
---|
53 | *
|
---|
54 | * @param string $parent Required. Value for parent.
|
---|
55 | * @param Group $postBody
|
---|
56 | * @param array $optParams Optional parameters.
|
---|
57 | *
|
---|
58 | * @opt_param string groupId Required. User specified ID for the group. It will
|
---|
59 | * become the last component of the group name. The ID must be unique within the
|
---|
60 | * project, must conform with RFC-1034, is restricted to lower-cased letters,
|
---|
61 | * and has a maximum length of 63 characters. The ID must match the regular
|
---|
62 | * expression: `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
|
---|
63 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
64 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
65 | * the server will know to ignore the request if it has already been completed.
|
---|
66 | * The server will guarantee that for at least 60 minutes since the first
|
---|
67 | * request. For example, consider a situation where you make an initial request
|
---|
68 | * and the request times out. If you make the request again with the same
|
---|
69 | * request ID, the server can check if original operation with the same request
|
---|
70 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
71 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
72 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
73 | * (00000000-0000-0000-0000-000000000000).
|
---|
74 | * @return Operation
|
---|
75 | * @throws \Google\Service\Exception
|
---|
76 | */
|
---|
77 | public function create($parent, Group $postBody, $optParams = [])
|
---|
78 | {
|
---|
79 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
80 | $params = array_merge($params, $optParams);
|
---|
81 | return $this->call('create', [$params], Operation::class);
|
---|
82 | }
|
---|
83 | /**
|
---|
84 | * Deletes a group. (groups.delete)
|
---|
85 | *
|
---|
86 | * @param string $name Required. Name of the group resource.
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | *
|
---|
89 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
90 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
91 | * the server will know to ignore the request if it has already been completed.
|
---|
92 | * The server will guarantee that for at least 60 minutes after the first
|
---|
93 | * request. For example, consider a situation where you make an initial request
|
---|
94 | * and the request times out. If you make the request again with the same
|
---|
95 | * request ID, the server can check if original operation with the same request
|
---|
96 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
97 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
98 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
99 | * (00000000-0000-0000-0000-000000000000).
|
---|
100 | * @return Operation
|
---|
101 | * @throws \Google\Service\Exception
|
---|
102 | */
|
---|
103 | public function delete($name, $optParams = [])
|
---|
104 | {
|
---|
105 | $params = ['name' => $name];
|
---|
106 | $params = array_merge($params, $optParams);
|
---|
107 | return $this->call('delete', [$params], Operation::class);
|
---|
108 | }
|
---|
109 | /**
|
---|
110 | * Gets the details of a group. (groups.get)
|
---|
111 | *
|
---|
112 | * @param string $name Required. Name of the resource.
|
---|
113 | * @param array $optParams Optional parameters.
|
---|
114 | * @return Group
|
---|
115 | * @throws \Google\Service\Exception
|
---|
116 | */
|
---|
117 | public function get($name, $optParams = [])
|
---|
118 | {
|
---|
119 | $params = ['name' => $name];
|
---|
120 | $params = array_merge($params, $optParams);
|
---|
121 | return $this->call('get', [$params], Group::class);
|
---|
122 | }
|
---|
123 | /**
|
---|
124 | * Lists all groups in a given project and location.
|
---|
125 | * (groups.listProjectsLocationsGroups)
|
---|
126 | *
|
---|
127 | * @param string $parent Required. Parent value for `ListGroupsRequest`.
|
---|
128 | * @param array $optParams Optional parameters.
|
---|
129 | *
|
---|
130 | * @opt_param string filter Filtering results.
|
---|
131 | * @opt_param string orderBy Field to sort by. See
|
---|
132 | * https://google.aip.dev/132#ordering for more details.
|
---|
133 | * @opt_param int pageSize Requested page size. Server may return fewer items
|
---|
134 | * than requested. If unspecified, server will pick an appropriate default.
|
---|
135 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
136 | * should return.
|
---|
137 | * @return ListGroupsResponse
|
---|
138 | * @throws \Google\Service\Exception
|
---|
139 | */
|
---|
140 | public function listProjectsLocationsGroups($parent, $optParams = [])
|
---|
141 | {
|
---|
142 | $params = ['parent' => $parent];
|
---|
143 | $params = array_merge($params, $optParams);
|
---|
144 | return $this->call('list', [$params], ListGroupsResponse::class);
|
---|
145 | }
|
---|
146 | /**
|
---|
147 | * Updates the parameters of a group. (groups.patch)
|
---|
148 | *
|
---|
149 | * @param string $name Output only. The name of the group.
|
---|
150 | * @param Group $postBody
|
---|
151 | * @param array $optParams Optional parameters.
|
---|
152 | *
|
---|
153 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
154 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
155 | * the server will know to ignore the request if it has already been completed.
|
---|
156 | * The server will guarantee that for at least 60 minutes since the first
|
---|
157 | * request. For example, consider a situation where you make an initial request
|
---|
158 | * and the request times out. If you make the request again with the same
|
---|
159 | * request ID, the server can check if original operation with the same request
|
---|
160 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
161 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
162 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
163 | * (00000000-0000-0000-0000-000000000000).
|
---|
164 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
165 | * fields to be overwritten in the `Group` resource by the update. The values
|
---|
166 | * specified in the `update_mask` are relative to the resource, not the full
|
---|
167 | * request. A field will be overwritten if it is in the mask. A single * value
|
---|
168 | * in the mask lets you to overwrite all fields.
|
---|
169 | * @return Operation
|
---|
170 | * @throws \Google\Service\Exception
|
---|
171 | */
|
---|
172 | public function patch($name, Group $postBody, $optParams = [])
|
---|
173 | {
|
---|
174 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
175 | $params = array_merge($params, $optParams);
|
---|
176 | return $this->call('patch', [$params], Operation::class);
|
---|
177 | }
|
---|
178 | /**
|
---|
179 | * Removes assets from a group. (groups.removeAssets)
|
---|
180 | *
|
---|
181 | * @param string $group Required. Group reference.
|
---|
182 | * @param RemoveAssetsFromGroupRequest $postBody
|
---|
183 | * @param array $optParams Optional parameters.
|
---|
184 | * @return Operation
|
---|
185 | * @throws \Google\Service\Exception
|
---|
186 | */
|
---|
187 | public function removeAssets($group, RemoveAssetsFromGroupRequest $postBody, $optParams = [])
|
---|
188 | {
|
---|
189 | $params = ['group' => $group, 'postBody' => $postBody];
|
---|
190 | $params = array_merge($params, $optParams);
|
---|
191 | return $this->call('removeAssets', [$params], Operation::class);
|
---|
192 | }
|
---|
193 | }
|
---|
194 |
|
---|
195 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
196 | class_alias(ProjectsLocationsGroups::class, 'Google_Service_MigrationCenterAPI_Resource_ProjectsLocationsGroups');
|
---|