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\Dataform\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Dataform\CommitWorkspaceChangesRequest;
|
---|
21 | use Google\Service\Dataform\DataformEmpty;
|
---|
22 | use Google\Service\Dataform\FetchFileDiffResponse;
|
---|
23 | use Google\Service\Dataform\FetchFileGitStatusesResponse;
|
---|
24 | use Google\Service\Dataform\FetchGitAheadBehindResponse;
|
---|
25 | use Google\Service\Dataform\InstallNpmPackagesRequest;
|
---|
26 | use Google\Service\Dataform\InstallNpmPackagesResponse;
|
---|
27 | use Google\Service\Dataform\ListWorkspacesResponse;
|
---|
28 | use Google\Service\Dataform\MakeDirectoryRequest;
|
---|
29 | use Google\Service\Dataform\MakeDirectoryResponse;
|
---|
30 | use Google\Service\Dataform\MoveDirectoryRequest;
|
---|
31 | use Google\Service\Dataform\MoveDirectoryResponse;
|
---|
32 | use Google\Service\Dataform\MoveFileRequest;
|
---|
33 | use Google\Service\Dataform\MoveFileResponse;
|
---|
34 | use Google\Service\Dataform\Policy;
|
---|
35 | use Google\Service\Dataform\PullGitCommitsRequest;
|
---|
36 | use Google\Service\Dataform\PushGitCommitsRequest;
|
---|
37 | use Google\Service\Dataform\QueryDirectoryContentsResponse;
|
---|
38 | use Google\Service\Dataform\ReadFileResponse;
|
---|
39 | use Google\Service\Dataform\RemoveDirectoryRequest;
|
---|
40 | use Google\Service\Dataform\RemoveFileRequest;
|
---|
41 | use Google\Service\Dataform\ResetWorkspaceChangesRequest;
|
---|
42 | use Google\Service\Dataform\SearchFilesResponse;
|
---|
43 | use Google\Service\Dataform\SetIamPolicyRequest;
|
---|
44 | use Google\Service\Dataform\TestIamPermissionsRequest;
|
---|
45 | use Google\Service\Dataform\TestIamPermissionsResponse;
|
---|
46 | use Google\Service\Dataform\Workspace;
|
---|
47 | use Google\Service\Dataform\WriteFileRequest;
|
---|
48 | use Google\Service\Dataform\WriteFileResponse;
|
---|
49 |
|
---|
50 | /**
|
---|
51 | * The "workspaces" collection of methods.
|
---|
52 | * Typical usage is:
|
---|
53 | * <code>
|
---|
54 | * $dataformService = new Google\Service\Dataform(...);
|
---|
55 | * $workspaces = $dataformService->projects_locations_repositories_workspaces;
|
---|
56 | * </code>
|
---|
57 | */
|
---|
58 | class ProjectsLocationsRepositoriesWorkspaces extends \Google\Service\Resource
|
---|
59 | {
|
---|
60 | /**
|
---|
61 | * Applies a Git commit for uncommitted files in a Workspace.
|
---|
62 | * (workspaces.commit)
|
---|
63 | *
|
---|
64 | * @param string $name Required. The workspace's name.
|
---|
65 | * @param CommitWorkspaceChangesRequest $postBody
|
---|
66 | * @param array $optParams Optional parameters.
|
---|
67 | * @return DataformEmpty
|
---|
68 | * @throws \Google\Service\Exception
|
---|
69 | */
|
---|
70 | public function commit($name, CommitWorkspaceChangesRequest $postBody, $optParams = [])
|
---|
71 | {
|
---|
72 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
73 | $params = array_merge($params, $optParams);
|
---|
74 | return $this->call('commit', [$params], DataformEmpty::class);
|
---|
75 | }
|
---|
76 | /**
|
---|
77 | * Creates a new Workspace in a given Repository. (workspaces.create)
|
---|
78 | *
|
---|
79 | * @param string $parent Required. The repository in which to create the
|
---|
80 | * workspace. Must be in the format `projects/locations/repositories`.
|
---|
81 | * @param Workspace $postBody
|
---|
82 | * @param array $optParams Optional parameters.
|
---|
83 | *
|
---|
84 | * @opt_param string workspaceId Required. The ID to use for the workspace,
|
---|
85 | * which will become the final component of the workspace's resource name.
|
---|
86 | * @return Workspace
|
---|
87 | * @throws \Google\Service\Exception
|
---|
88 | */
|
---|
89 | public function create($parent, Workspace $postBody, $optParams = [])
|
---|
90 | {
|
---|
91 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
92 | $params = array_merge($params, $optParams);
|
---|
93 | return $this->call('create', [$params], Workspace::class);
|
---|
94 | }
|
---|
95 | /**
|
---|
96 | * Deletes a single Workspace. (workspaces.delete)
|
---|
97 | *
|
---|
98 | * @param string $name Required. The workspace resource's name.
|
---|
99 | * @param array $optParams Optional parameters.
|
---|
100 | * @return DataformEmpty
|
---|
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], DataformEmpty::class);
|
---|
108 | }
|
---|
109 | /**
|
---|
110 | * Fetches Git diff for an uncommitted file in a Workspace.
|
---|
111 | * (workspaces.fetchFileDiff)
|
---|
112 | *
|
---|
113 | * @param string $workspace Required. The workspace's name.
|
---|
114 | * @param array $optParams Optional parameters.
|
---|
115 | *
|
---|
116 | * @opt_param string path Required. The file's full path including filename,
|
---|
117 | * relative to the workspace root.
|
---|
118 | * @return FetchFileDiffResponse
|
---|
119 | * @throws \Google\Service\Exception
|
---|
120 | */
|
---|
121 | public function fetchFileDiff($workspace, $optParams = [])
|
---|
122 | {
|
---|
123 | $params = ['workspace' => $workspace];
|
---|
124 | $params = array_merge($params, $optParams);
|
---|
125 | return $this->call('fetchFileDiff', [$params], FetchFileDiffResponse::class);
|
---|
126 | }
|
---|
127 | /**
|
---|
128 | * Fetches Git statuses for the files in a Workspace.
|
---|
129 | * (workspaces.fetchFileGitStatuses)
|
---|
130 | *
|
---|
131 | * @param string $name Required. The workspace's name.
|
---|
132 | * @param array $optParams Optional parameters.
|
---|
133 | * @return FetchFileGitStatusesResponse
|
---|
134 | * @throws \Google\Service\Exception
|
---|
135 | */
|
---|
136 | public function fetchFileGitStatuses($name, $optParams = [])
|
---|
137 | {
|
---|
138 | $params = ['name' => $name];
|
---|
139 | $params = array_merge($params, $optParams);
|
---|
140 | return $this->call('fetchFileGitStatuses', [$params], FetchFileGitStatusesResponse::class);
|
---|
141 | }
|
---|
142 | /**
|
---|
143 | * Fetches Git ahead/behind against a remote branch.
|
---|
144 | * (workspaces.fetchGitAheadBehind)
|
---|
145 | *
|
---|
146 | * @param string $name Required. The workspace's name.
|
---|
147 | * @param array $optParams Optional parameters.
|
---|
148 | *
|
---|
149 | * @opt_param string remoteBranch Optional. The name of the branch in the Git
|
---|
150 | * remote against which this workspace should be compared. If left unset, the
|
---|
151 | * repository's default branch name will be used.
|
---|
152 | * @return FetchGitAheadBehindResponse
|
---|
153 | * @throws \Google\Service\Exception
|
---|
154 | */
|
---|
155 | public function fetchGitAheadBehind($name, $optParams = [])
|
---|
156 | {
|
---|
157 | $params = ['name' => $name];
|
---|
158 | $params = array_merge($params, $optParams);
|
---|
159 | return $this->call('fetchGitAheadBehind', [$params], FetchGitAheadBehindResponse::class);
|
---|
160 | }
|
---|
161 | /**
|
---|
162 | * Fetches a single Workspace. (workspaces.get)
|
---|
163 | *
|
---|
164 | * @param string $name Required. The workspace's name.
|
---|
165 | * @param array $optParams Optional parameters.
|
---|
166 | * @return Workspace
|
---|
167 | * @throws \Google\Service\Exception
|
---|
168 | */
|
---|
169 | public function get($name, $optParams = [])
|
---|
170 | {
|
---|
171 | $params = ['name' => $name];
|
---|
172 | $params = array_merge($params, $optParams);
|
---|
173 | return $this->call('get', [$params], Workspace::class);
|
---|
174 | }
|
---|
175 | /**
|
---|
176 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
177 | * resource exists and does not have a policy set. (workspaces.getIamPolicy)
|
---|
178 | *
|
---|
179 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
180 | * requested. See [Resource
|
---|
181 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
182 | * appropriate value for this field.
|
---|
183 | * @param array $optParams Optional parameters.
|
---|
184 | *
|
---|
185 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
186 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
187 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
188 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
189 | * conditional role bindings may specify any valid value or leave the field
|
---|
190 | * unset. The policy in the response might use the policy version that you
|
---|
191 | * specified, or it might use a lower policy version. For example, if you
|
---|
192 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
193 | * response uses version 1. To learn which resources support conditions in their
|
---|
194 | * IAM policies, see the [IAM
|
---|
195 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
196 | * policies).
|
---|
197 | * @return Policy
|
---|
198 | * @throws \Google\Service\Exception
|
---|
199 | */
|
---|
200 | public function getIamPolicy($resource, $optParams = [])
|
---|
201 | {
|
---|
202 | $params = ['resource' => $resource];
|
---|
203 | $params = array_merge($params, $optParams);
|
---|
204 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
205 | }
|
---|
206 | /**
|
---|
207 | * Installs dependency NPM packages (inside a Workspace).
|
---|
208 | * (workspaces.installNpmPackages)
|
---|
209 | *
|
---|
210 | * @param string $workspace Required. The workspace's name.
|
---|
211 | * @param InstallNpmPackagesRequest $postBody
|
---|
212 | * @param array $optParams Optional parameters.
|
---|
213 | * @return InstallNpmPackagesResponse
|
---|
214 | * @throws \Google\Service\Exception
|
---|
215 | */
|
---|
216 | public function installNpmPackages($workspace, InstallNpmPackagesRequest $postBody, $optParams = [])
|
---|
217 | {
|
---|
218 | $params = ['workspace' => $workspace, 'postBody' => $postBody];
|
---|
219 | $params = array_merge($params, $optParams);
|
---|
220 | return $this->call('installNpmPackages', [$params], InstallNpmPackagesResponse::class);
|
---|
221 | }
|
---|
222 | /**
|
---|
223 | * Lists Workspaces in a given Repository.
|
---|
224 | * (workspaces.listProjectsLocationsRepositoriesWorkspaces)
|
---|
225 | *
|
---|
226 | * @param string $parent Required. The repository in which to list workspaces.
|
---|
227 | * Must be in the format `projects/locations/repositories`.
|
---|
228 | * @param array $optParams Optional parameters.
|
---|
229 | *
|
---|
230 | * @opt_param string filter Optional. Filter for the returned list.
|
---|
231 | * @opt_param string orderBy Optional. This field only supports ordering by
|
---|
232 | * `name`. If unspecified, the server will choose the ordering. If specified,
|
---|
233 | * the default order is ascending for the `name` field.
|
---|
234 | * @opt_param int pageSize Optional. Maximum number of workspaces to return. The
|
---|
235 | * server may return fewer items than requested. If unspecified, the server will
|
---|
236 | * pick an appropriate default.
|
---|
237 | * @opt_param string pageToken Optional. Page token received from a previous
|
---|
238 | * `ListWorkspaces` call. Provide this to retrieve the subsequent page. When
|
---|
239 | * paginating, all other parameters provided to `ListWorkspaces`, with the
|
---|
240 | * exception of `page_size`, must match the call that provided the page token.
|
---|
241 | * @return ListWorkspacesResponse
|
---|
242 | * @throws \Google\Service\Exception
|
---|
243 | */
|
---|
244 | public function listProjectsLocationsRepositoriesWorkspaces($parent, $optParams = [])
|
---|
245 | {
|
---|
246 | $params = ['parent' => $parent];
|
---|
247 | $params = array_merge($params, $optParams);
|
---|
248 | return $this->call('list', [$params], ListWorkspacesResponse::class);
|
---|
249 | }
|
---|
250 | /**
|
---|
251 | * Creates a directory inside a Workspace. (workspaces.makeDirectory)
|
---|
252 | *
|
---|
253 | * @param string $workspace Required. The workspace's name.
|
---|
254 | * @param MakeDirectoryRequest $postBody
|
---|
255 | * @param array $optParams Optional parameters.
|
---|
256 | * @return MakeDirectoryResponse
|
---|
257 | * @throws \Google\Service\Exception
|
---|
258 | */
|
---|
259 | public function makeDirectory($workspace, MakeDirectoryRequest $postBody, $optParams = [])
|
---|
260 | {
|
---|
261 | $params = ['workspace' => $workspace, 'postBody' => $postBody];
|
---|
262 | $params = array_merge($params, $optParams);
|
---|
263 | return $this->call('makeDirectory', [$params], MakeDirectoryResponse::class);
|
---|
264 | }
|
---|
265 | /**
|
---|
266 | * Moves a directory (inside a Workspace), and all of its contents, to a new
|
---|
267 | * location. (workspaces.moveDirectory)
|
---|
268 | *
|
---|
269 | * @param string $workspace Required. The workspace's name.
|
---|
270 | * @param MoveDirectoryRequest $postBody
|
---|
271 | * @param array $optParams Optional parameters.
|
---|
272 | * @return MoveDirectoryResponse
|
---|
273 | * @throws \Google\Service\Exception
|
---|
274 | */
|
---|
275 | public function moveDirectory($workspace, MoveDirectoryRequest $postBody, $optParams = [])
|
---|
276 | {
|
---|
277 | $params = ['workspace' => $workspace, 'postBody' => $postBody];
|
---|
278 | $params = array_merge($params, $optParams);
|
---|
279 | return $this->call('moveDirectory', [$params], MoveDirectoryResponse::class);
|
---|
280 | }
|
---|
281 | /**
|
---|
282 | * Moves a file (inside a Workspace) to a new location. (workspaces.moveFile)
|
---|
283 | *
|
---|
284 | * @param string $workspace Required. The workspace's name.
|
---|
285 | * @param MoveFileRequest $postBody
|
---|
286 | * @param array $optParams Optional parameters.
|
---|
287 | * @return MoveFileResponse
|
---|
288 | * @throws \Google\Service\Exception
|
---|
289 | */
|
---|
290 | public function moveFile($workspace, MoveFileRequest $postBody, $optParams = [])
|
---|
291 | {
|
---|
292 | $params = ['workspace' => $workspace, 'postBody' => $postBody];
|
---|
293 | $params = array_merge($params, $optParams);
|
---|
294 | return $this->call('moveFile', [$params], MoveFileResponse::class);
|
---|
295 | }
|
---|
296 | /**
|
---|
297 | * Pulls Git commits from the Repository's remote into a Workspace.
|
---|
298 | * (workspaces.pull)
|
---|
299 | *
|
---|
300 | * @param string $name Required. The workspace's name.
|
---|
301 | * @param PullGitCommitsRequest $postBody
|
---|
302 | * @param array $optParams Optional parameters.
|
---|
303 | * @return DataformEmpty
|
---|
304 | * @throws \Google\Service\Exception
|
---|
305 | */
|
---|
306 | public function pull($name, PullGitCommitsRequest $postBody, $optParams = [])
|
---|
307 | {
|
---|
308 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
309 | $params = array_merge($params, $optParams);
|
---|
310 | return $this->call('pull', [$params], DataformEmpty::class);
|
---|
311 | }
|
---|
312 | /**
|
---|
313 | * Pushes Git commits from a Workspace to the Repository's remote.
|
---|
314 | * (workspaces.push)
|
---|
315 | *
|
---|
316 | * @param string $name Required. The workspace's name.
|
---|
317 | * @param PushGitCommitsRequest $postBody
|
---|
318 | * @param array $optParams Optional parameters.
|
---|
319 | * @return DataformEmpty
|
---|
320 | * @throws \Google\Service\Exception
|
---|
321 | */
|
---|
322 | public function push($name, PushGitCommitsRequest $postBody, $optParams = [])
|
---|
323 | {
|
---|
324 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
325 | $params = array_merge($params, $optParams);
|
---|
326 | return $this->call('push', [$params], DataformEmpty::class);
|
---|
327 | }
|
---|
328 | /**
|
---|
329 | * Returns the contents of a given Workspace directory.
|
---|
330 | * (workspaces.queryDirectoryContents)
|
---|
331 | *
|
---|
332 | * @param string $workspace Required. The workspace's name.
|
---|
333 | * @param array $optParams Optional parameters.
|
---|
334 | *
|
---|
335 | * @opt_param int pageSize Optional. Maximum number of paths to return. The
|
---|
336 | * server may return fewer items than requested. If unspecified, the server will
|
---|
337 | * pick an appropriate default.
|
---|
338 | * @opt_param string pageToken Optional. Page token received from a previous
|
---|
339 | * `QueryDirectoryContents` call. Provide this to retrieve the subsequent page.
|
---|
340 | * When paginating, all other parameters provided to `QueryDirectoryContents`,
|
---|
341 | * with the exception of `page_size`, must match the call that provided the page
|
---|
342 | * token.
|
---|
343 | * @opt_param string path Optional. The directory's full path including
|
---|
344 | * directory name, relative to the workspace root. If left unset, the workspace
|
---|
345 | * root is used.
|
---|
346 | * @return QueryDirectoryContentsResponse
|
---|
347 | * @throws \Google\Service\Exception
|
---|
348 | */
|
---|
349 | public function queryDirectoryContents($workspace, $optParams = [])
|
---|
350 | {
|
---|
351 | $params = ['workspace' => $workspace];
|
---|
352 | $params = array_merge($params, $optParams);
|
---|
353 | return $this->call('queryDirectoryContents', [$params], QueryDirectoryContentsResponse::class);
|
---|
354 | }
|
---|
355 | /**
|
---|
356 | * Returns the contents of a file (inside a Workspace). (workspaces.readFile)
|
---|
357 | *
|
---|
358 | * @param string $workspace Required. The workspace's name.
|
---|
359 | * @param array $optParams Optional parameters.
|
---|
360 | *
|
---|
361 | * @opt_param string path Required. The file's full path including filename,
|
---|
362 | * relative to the workspace root.
|
---|
363 | * @opt_param string revision Optional. The Git revision of the file to return.
|
---|
364 | * If left empty, the current contents of `path` will be returned.
|
---|
365 | * @return ReadFileResponse
|
---|
366 | * @throws \Google\Service\Exception
|
---|
367 | */
|
---|
368 | public function readFile($workspace, $optParams = [])
|
---|
369 | {
|
---|
370 | $params = ['workspace' => $workspace];
|
---|
371 | $params = array_merge($params, $optParams);
|
---|
372 | return $this->call('readFile', [$params], ReadFileResponse::class);
|
---|
373 | }
|
---|
374 | /**
|
---|
375 | * Deletes a directory (inside a Workspace) and all of its contents.
|
---|
376 | * (workspaces.removeDirectory)
|
---|
377 | *
|
---|
378 | * @param string $workspace Required. The workspace's name.
|
---|
379 | * @param RemoveDirectoryRequest $postBody
|
---|
380 | * @param array $optParams Optional parameters.
|
---|
381 | * @return DataformEmpty
|
---|
382 | * @throws \Google\Service\Exception
|
---|
383 | */
|
---|
384 | public function removeDirectory($workspace, RemoveDirectoryRequest $postBody, $optParams = [])
|
---|
385 | {
|
---|
386 | $params = ['workspace' => $workspace, 'postBody' => $postBody];
|
---|
387 | $params = array_merge($params, $optParams);
|
---|
388 | return $this->call('removeDirectory', [$params], DataformEmpty::class);
|
---|
389 | }
|
---|
390 | /**
|
---|
391 | * Deletes a file (inside a Workspace). (workspaces.removeFile)
|
---|
392 | *
|
---|
393 | * @param string $workspace Required. The workspace's name.
|
---|
394 | * @param RemoveFileRequest $postBody
|
---|
395 | * @param array $optParams Optional parameters.
|
---|
396 | * @return DataformEmpty
|
---|
397 | * @throws \Google\Service\Exception
|
---|
398 | */
|
---|
399 | public function removeFile($workspace, RemoveFileRequest $postBody, $optParams = [])
|
---|
400 | {
|
---|
401 | $params = ['workspace' => $workspace, 'postBody' => $postBody];
|
---|
402 | $params = array_merge($params, $optParams);
|
---|
403 | return $this->call('removeFile', [$params], DataformEmpty::class);
|
---|
404 | }
|
---|
405 | /**
|
---|
406 | * Performs a Git reset for uncommitted files in a Workspace. (workspaces.reset)
|
---|
407 | *
|
---|
408 | * @param string $name Required. The workspace's name.
|
---|
409 | * @param ResetWorkspaceChangesRequest $postBody
|
---|
410 | * @param array $optParams Optional parameters.
|
---|
411 | * @return DataformEmpty
|
---|
412 | * @throws \Google\Service\Exception
|
---|
413 | */
|
---|
414 | public function reset($name, ResetWorkspaceChangesRequest $postBody, $optParams = [])
|
---|
415 | {
|
---|
416 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
417 | $params = array_merge($params, $optParams);
|
---|
418 | return $this->call('reset', [$params], DataformEmpty::class);
|
---|
419 | }
|
---|
420 | /**
|
---|
421 | * Finds the contents of a given Workspace directory by filter.
|
---|
422 | * (workspaces.searchFiles)
|
---|
423 | *
|
---|
424 | * @param string $workspace Required. The workspace's name.
|
---|
425 | * @param array $optParams Optional parameters.
|
---|
426 | *
|
---|
427 | * @opt_param string filter Optional. Optional filter for the returned list in
|
---|
428 | * filtering format. Filtering is only currently supported on the `path` field.
|
---|
429 | * See https://google.aip.dev/160 for details.
|
---|
430 | * @opt_param int pageSize Optional. Maximum number of search results to return.
|
---|
431 | * The server may return fewer items than requested. If unspecified, the server
|
---|
432 | * will pick an appropriate default.
|
---|
433 | * @opt_param string pageToken Optional. Page token received from a previous
|
---|
434 | * `SearchFilesRequest` call. Provide this to retrieve the subsequent page. When
|
---|
435 | * paginating, all other parameters provided to `SearchFilesRequest`, with the
|
---|
436 | * exception of `page_size`, must match the call that provided the page token.
|
---|
437 | * @return SearchFilesResponse
|
---|
438 | * @throws \Google\Service\Exception
|
---|
439 | */
|
---|
440 | public function searchFiles($workspace, $optParams = [])
|
---|
441 | {
|
---|
442 | $params = ['workspace' => $workspace];
|
---|
443 | $params = array_merge($params, $optParams);
|
---|
444 | return $this->call('searchFiles', [$params], SearchFilesResponse::class);
|
---|
445 | }
|
---|
446 | /**
|
---|
447 | * Sets the access control policy on the specified resource. Replaces any
|
---|
448 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
449 | * `PERMISSION_DENIED` errors. (workspaces.setIamPolicy)
|
---|
450 | *
|
---|
451 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
452 | * specified. See [Resource
|
---|
453 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
454 | * appropriate value for this field.
|
---|
455 | * @param SetIamPolicyRequest $postBody
|
---|
456 | * @param array $optParams Optional parameters.
|
---|
457 | * @return Policy
|
---|
458 | * @throws \Google\Service\Exception
|
---|
459 | */
|
---|
460 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
461 | {
|
---|
462 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
463 | $params = array_merge($params, $optParams);
|
---|
464 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
465 | }
|
---|
466 | /**
|
---|
467 | * Returns permissions that a caller has on the specified resource. If the
|
---|
468 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
469 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
470 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
471 | * This operation may "fail open" without warning.
|
---|
472 | * (workspaces.testIamPermissions)
|
---|
473 | *
|
---|
474 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
475 | * being requested. See [Resource
|
---|
476 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
477 | * appropriate value for this field.
|
---|
478 | * @param TestIamPermissionsRequest $postBody
|
---|
479 | * @param array $optParams Optional parameters.
|
---|
480 | * @return TestIamPermissionsResponse
|
---|
481 | * @throws \Google\Service\Exception
|
---|
482 | */
|
---|
483 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
484 | {
|
---|
485 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
486 | $params = array_merge($params, $optParams);
|
---|
487 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
488 | }
|
---|
489 | /**
|
---|
490 | * Writes to a file (inside a Workspace). (workspaces.writeFile)
|
---|
491 | *
|
---|
492 | * @param string $workspace Required. The workspace's name.
|
---|
493 | * @param WriteFileRequest $postBody
|
---|
494 | * @param array $optParams Optional parameters.
|
---|
495 | * @return WriteFileResponse
|
---|
496 | * @throws \Google\Service\Exception
|
---|
497 | */
|
---|
498 | public function writeFile($workspace, WriteFileRequest $postBody, $optParams = [])
|
---|
499 | {
|
---|
500 | $params = ['workspace' => $workspace, 'postBody' => $postBody];
|
---|
501 | $params = array_merge($params, $optParams);
|
---|
502 | return $this->call('writeFile', [$params], WriteFileResponse::class);
|
---|
503 | }
|
---|
504 | }
|
---|
505 |
|
---|
506 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
507 | class_alias(ProjectsLocationsRepositoriesWorkspaces::class, 'Google_Service_Dataform_Resource_ProjectsLocationsRepositoriesWorkspaces');
|
---|