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\Config\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Config\ExportRevisionStatefileRequest;
|
---|
21 | use Google\Service\Config\ListRevisionsResponse;
|
---|
22 | use Google\Service\Config\Revision;
|
---|
23 | use Google\Service\Config\Statefile;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "revisions" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $configService = new Google\Service\Config(...);
|
---|
30 | * $revisions = $configService->projects_locations_deployments_revisions;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class ProjectsLocationsDeploymentsRevisions extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Exports Terraform state file from a given revision. (revisions.exportState)
|
---|
37 | *
|
---|
38 | * @param string $parent Required. The parent in whose context the statefile is
|
---|
39 | * listed. The parent value is in the format: 'projects/{project_id}/locations/{
|
---|
40 | * location}/deployments/{deployment}/revisions/{revision}'.
|
---|
41 | * @param ExportRevisionStatefileRequest $postBody
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | * @return Statefile
|
---|
44 | * @throws \Google\Service\Exception
|
---|
45 | */
|
---|
46 | public function exportState($parent, ExportRevisionStatefileRequest $postBody, $optParams = [])
|
---|
47 | {
|
---|
48 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
49 | $params = array_merge($params, $optParams);
|
---|
50 | return $this->call('exportState', [$params], Statefile::class);
|
---|
51 | }
|
---|
52 | /**
|
---|
53 | * Gets details about a Revision. (revisions.get)
|
---|
54 | *
|
---|
55 | * @param string $name Required. The name of the Revision in the format: 'projec
|
---|
56 | * ts/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revi
|
---|
57 | * sion}'.
|
---|
58 | * @param array $optParams Optional parameters.
|
---|
59 | * @return Revision
|
---|
60 | * @throws \Google\Service\Exception
|
---|
61 | */
|
---|
62 | public function get($name, $optParams = [])
|
---|
63 | {
|
---|
64 | $params = ['name' => $name];
|
---|
65 | $params = array_merge($params, $optParams);
|
---|
66 | return $this->call('get', [$params], Revision::class);
|
---|
67 | }
|
---|
68 | /**
|
---|
69 | * Lists Revisions of a deployment.
|
---|
70 | * (revisions.listProjectsLocationsDeploymentsRevisions)
|
---|
71 | *
|
---|
72 | * @param string $parent Required. The parent in whose context the Revisions are
|
---|
73 | * listed. The parent value is in the format:
|
---|
74 | * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
|
---|
75 | * @param array $optParams Optional parameters.
|
---|
76 | *
|
---|
77 | * @opt_param string filter Lists the Revisions that match the filter
|
---|
78 | * expression. A filter expression filters the resources listed in the response.
|
---|
79 | * The expression must be of the form '{field} {operator} {value}' where
|
---|
80 | * operators: '<', '>', '<=', '>=', '!=', '=', ':' are supported (colon ':'
|
---|
81 | * represents a HAS operator which is roughly synonymous with equality). {field}
|
---|
82 | * can refer to a proto or JSON field, or a synthetic field. Field names can be
|
---|
83 | * camelCase or snake_case. Examples: - Filter by name: name =
|
---|
84 | * "projects/foo/locations/us-central1/deployments/dep/revisions/bar - Filter by
|
---|
85 | * labels: - Resources that have a key called 'foo' labels.foo:* - Resources
|
---|
86 | * that have a key called 'foo' whose value is 'bar' labels.foo = bar - Filter
|
---|
87 | * by state: - Revisions in CREATING state. state=CREATING
|
---|
88 | * @opt_param string orderBy Field to use to sort the list.
|
---|
89 | * @opt_param int pageSize When requesting a page of resources, `page_size`
|
---|
90 | * specifies number of resources to return. If unspecified, at most 500 will be
|
---|
91 | * returned. The maximum value is 1000.
|
---|
92 | * @opt_param string pageToken Token returned by previous call to
|
---|
93 | * 'ListRevisions' which specifies the position in the list from where to
|
---|
94 | * continue listing the resources.
|
---|
95 | * @return ListRevisionsResponse
|
---|
96 | * @throws \Google\Service\Exception
|
---|
97 | */
|
---|
98 | public function listProjectsLocationsDeploymentsRevisions($parent, $optParams = [])
|
---|
99 | {
|
---|
100 | $params = ['parent' => $parent];
|
---|
101 | $params = array_merge($params, $optParams);
|
---|
102 | return $this->call('list', [$params], ListRevisionsResponse::class);
|
---|
103 | }
|
---|
104 | }
|
---|
105 |
|
---|
106 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
107 | class_alias(ProjectsLocationsDeploymentsRevisions::class, 'Google_Service_Config_Resource_ProjectsLocationsDeploymentsRevisions');
|
---|