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