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\CloudWorkstations\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudWorkstations\ListUsableWorkstationConfigsResponse;
|
---|
21 | use Google\Service\CloudWorkstations\ListWorkstationConfigsResponse;
|
---|
22 | use Google\Service\CloudWorkstations\Operation;
|
---|
23 | use Google\Service\CloudWorkstations\Policy;
|
---|
24 | use Google\Service\CloudWorkstations\SetIamPolicyRequest;
|
---|
25 | use Google\Service\CloudWorkstations\TestIamPermissionsRequest;
|
---|
26 | use Google\Service\CloudWorkstations\TestIamPermissionsResponse;
|
---|
27 | use Google\Service\CloudWorkstations\WorkstationConfig;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * The "workstationConfigs" collection of methods.
|
---|
31 | * Typical usage is:
|
---|
32 | * <code>
|
---|
33 | * $workstationsService = new Google\Service\CloudWorkstations(...);
|
---|
34 | * $workstationConfigs = $workstationsService->projects_locations_workstationClusters_workstationConfigs;
|
---|
35 | * </code>
|
---|
36 | */
|
---|
37 | class ProjectsLocationsWorkstationClustersWorkstationConfigs extends \Google\Service\Resource
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * Creates a new workstation configuration. (workstationConfigs.create)
|
---|
41 | *
|
---|
42 | * @param string $parent Required. Parent resource name.
|
---|
43 | * @param WorkstationConfig $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | *
|
---|
46 | * @opt_param bool validateOnly Optional. If set, validate the request and
|
---|
47 | * preview the review, but do not actually apply it.
|
---|
48 | * @opt_param string workstationConfigId Required. ID to use for the workstation
|
---|
49 | * configuration.
|
---|
50 | * @return Operation
|
---|
51 | * @throws \Google\Service\Exception
|
---|
52 | */
|
---|
53 | public function create($parent, WorkstationConfig $postBody, $optParams = [])
|
---|
54 | {
|
---|
55 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
56 | $params = array_merge($params, $optParams);
|
---|
57 | return $this->call('create', [$params], Operation::class);
|
---|
58 | }
|
---|
59 | /**
|
---|
60 | * Deletes the specified workstation configuration. (workstationConfigs.delete)
|
---|
61 | *
|
---|
62 | * @param string $name Required. Name of the workstation configuration to
|
---|
63 | * delete.
|
---|
64 | * @param array $optParams Optional parameters.
|
---|
65 | *
|
---|
66 | * @opt_param string etag Optional. If set, the request is rejected if the
|
---|
67 | * latest version of the workstation configuration on the server does not have
|
---|
68 | * this ETag.
|
---|
69 | * @opt_param bool force Optional. If set, any workstations in the workstation
|
---|
70 | * configuration are also deleted. Otherwise, the request works only if the
|
---|
71 | * workstation configuration has no workstations.
|
---|
72 | * @opt_param bool validateOnly Optional. If set, validate the request and
|
---|
73 | * preview the review, but do not actually apply it.
|
---|
74 | * @return Operation
|
---|
75 | * @throws \Google\Service\Exception
|
---|
76 | */
|
---|
77 | public function delete($name, $optParams = [])
|
---|
78 | {
|
---|
79 | $params = ['name' => $name];
|
---|
80 | $params = array_merge($params, $optParams);
|
---|
81 | return $this->call('delete', [$params], Operation::class);
|
---|
82 | }
|
---|
83 | /**
|
---|
84 | * Returns the requested workstation configuration. (workstationConfigs.get)
|
---|
85 | *
|
---|
86 | * @param string $name Required. Name of the requested resource.
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | * @return WorkstationConfig
|
---|
89 | * @throws \Google\Service\Exception
|
---|
90 | */
|
---|
91 | public function get($name, $optParams = [])
|
---|
92 | {
|
---|
93 | $params = ['name' => $name];
|
---|
94 | $params = array_merge($params, $optParams);
|
---|
95 | return $this->call('get', [$params], WorkstationConfig::class);
|
---|
96 | }
|
---|
97 | /**
|
---|
98 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
99 | * resource exists and does not have a policy set.
|
---|
100 | * (workstationConfigs.getIamPolicy)
|
---|
101 | *
|
---|
102 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
103 | * requested. See [Resource
|
---|
104 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
105 | * appropriate value for this field.
|
---|
106 | * @param array $optParams Optional parameters.
|
---|
107 | *
|
---|
108 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
109 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
110 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
111 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
112 | * conditional role bindings may specify any valid value or leave the field
|
---|
113 | * unset. The policy in the response might use the policy version that you
|
---|
114 | * specified, or it might use a lower policy version. For example, if you
|
---|
115 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
116 | * response uses version 1. To learn which resources support conditions in their
|
---|
117 | * IAM policies, see the [IAM
|
---|
118 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
119 | * policies).
|
---|
120 | * @return Policy
|
---|
121 | * @throws \Google\Service\Exception
|
---|
122 | */
|
---|
123 | public function getIamPolicy($resource, $optParams = [])
|
---|
124 | {
|
---|
125 | $params = ['resource' => $resource];
|
---|
126 | $params = array_merge($params, $optParams);
|
---|
127 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
128 | }
|
---|
129 | /**
|
---|
130 | * Returns all workstation configurations in the specified cluster. (workstation
|
---|
131 | * Configs.listProjectsLocationsWorkstationClustersWorkstationConfigs)
|
---|
132 | *
|
---|
133 | * @param string $parent Required. Parent resource name.
|
---|
134 | * @param array $optParams Optional parameters.
|
---|
135 | *
|
---|
136 | * @opt_param int pageSize Optional. Maximum number of items to return.
|
---|
137 | * @opt_param string pageToken Optional. next_page_token value returned from a
|
---|
138 | * previous List request, if any.
|
---|
139 | * @return ListWorkstationConfigsResponse
|
---|
140 | * @throws \Google\Service\Exception
|
---|
141 | */
|
---|
142 | public function listProjectsLocationsWorkstationClustersWorkstationConfigs($parent, $optParams = [])
|
---|
143 | {
|
---|
144 | $params = ['parent' => $parent];
|
---|
145 | $params = array_merge($params, $optParams);
|
---|
146 | return $this->call('list', [$params], ListWorkstationConfigsResponse::class);
|
---|
147 | }
|
---|
148 | /**
|
---|
149 | * Returns all workstation configurations in the specified cluster on which the
|
---|
150 | * caller has the "workstations.workstation.create" permission.
|
---|
151 | * (workstationConfigs.listUsable)
|
---|
152 | *
|
---|
153 | * @param string $parent Required. Parent resource name.
|
---|
154 | * @param array $optParams Optional parameters.
|
---|
155 | *
|
---|
156 | * @opt_param int pageSize Optional. Maximum number of items to return.
|
---|
157 | * @opt_param string pageToken Optional. next_page_token value returned from a
|
---|
158 | * previous List request, if any.
|
---|
159 | * @return ListUsableWorkstationConfigsResponse
|
---|
160 | * @throws \Google\Service\Exception
|
---|
161 | */
|
---|
162 | public function listUsable($parent, $optParams = [])
|
---|
163 | {
|
---|
164 | $params = ['parent' => $parent];
|
---|
165 | $params = array_merge($params, $optParams);
|
---|
166 | return $this->call('listUsable', [$params], ListUsableWorkstationConfigsResponse::class);
|
---|
167 | }
|
---|
168 | /**
|
---|
169 | * Updates an existing workstation configuration. (workstationConfigs.patch)
|
---|
170 | *
|
---|
171 | * @param string $name Identifier. Full name of this workstation configuration.
|
---|
172 | * @param WorkstationConfig $postBody
|
---|
173 | * @param array $optParams Optional parameters.
|
---|
174 | *
|
---|
175 | * @opt_param bool allowMissing Optional. If set and the workstation
|
---|
176 | * configuration is not found, a new workstation configuration will be created.
|
---|
177 | * In this situation, update_mask is ignored.
|
---|
178 | * @opt_param string updateMask Required. Mask specifying which fields in the
|
---|
179 | * workstation configuration should be updated.
|
---|
180 | * @opt_param bool validateOnly Optional. If set, validate the request and
|
---|
181 | * preview the review, but do not actually apply it.
|
---|
182 | * @return Operation
|
---|
183 | * @throws \Google\Service\Exception
|
---|
184 | */
|
---|
185 | public function patch($name, WorkstationConfig $postBody, $optParams = [])
|
---|
186 | {
|
---|
187 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
188 | $params = array_merge($params, $optParams);
|
---|
189 | return $this->call('patch', [$params], Operation::class);
|
---|
190 | }
|
---|
191 | /**
|
---|
192 | * Sets the access control policy on the specified resource. Replaces any
|
---|
193 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
194 | * `PERMISSION_DENIED` errors. (workstationConfigs.setIamPolicy)
|
---|
195 | *
|
---|
196 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
197 | * specified. See [Resource
|
---|
198 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
199 | * appropriate value for this field.
|
---|
200 | * @param SetIamPolicyRequest $postBody
|
---|
201 | * @param array $optParams Optional parameters.
|
---|
202 | * @return Policy
|
---|
203 | * @throws \Google\Service\Exception
|
---|
204 | */
|
---|
205 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
206 | {
|
---|
207 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
208 | $params = array_merge($params, $optParams);
|
---|
209 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
210 | }
|
---|
211 | /**
|
---|
212 | * Returns permissions that a caller has on the specified resource. If the
|
---|
213 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
214 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
215 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
216 | * This operation may "fail open" without warning.
|
---|
217 | * (workstationConfigs.testIamPermissions)
|
---|
218 | *
|
---|
219 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
220 | * being requested. See [Resource
|
---|
221 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
222 | * appropriate value for this field.
|
---|
223 | * @param TestIamPermissionsRequest $postBody
|
---|
224 | * @param array $optParams Optional parameters.
|
---|
225 | * @return TestIamPermissionsResponse
|
---|
226 | * @throws \Google\Service\Exception
|
---|
227 | */
|
---|
228 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
229 | {
|
---|
230 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
231 | $params = array_merge($params, $optParams);
|
---|
232 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
233 | }
|
---|
234 | }
|
---|
235 |
|
---|
236 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
237 | class_alias(ProjectsLocationsWorkstationClustersWorkstationConfigs::class, 'Google_Service_CloudWorkstations_Resource_ProjectsLocationsWorkstationClustersWorkstationConfigs');
|
---|