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\CloudComposer\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudComposer\ComposerEmpty;
|
---|
21 | use Google\Service\CloudComposer\ListUserWorkloadsSecretsResponse;
|
---|
22 | use Google\Service\CloudComposer\UserWorkloadsSecret;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "userWorkloadsSecrets" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $composerService = new Google\Service\CloudComposer(...);
|
---|
29 | * $userWorkloadsSecrets = $composerService->projects_locations_environments_userWorkloadsSecrets;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsEnvironmentsUserWorkloadsSecrets extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a user workloads Secret. This method is supported for Cloud Composer
|
---|
36 | * environments in versions composer-3.*.*-airflow-*.*.* and newer.
|
---|
37 | * (userWorkloadsSecrets.create)
|
---|
38 | *
|
---|
39 | * @param string $parent Required. The environment name to create a Secret for,
|
---|
40 | * in the form:
|
---|
41 | * "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
|
---|
42 | * @param UserWorkloadsSecret $postBody
|
---|
43 | * @param array $optParams Optional parameters.
|
---|
44 | * @return UserWorkloadsSecret
|
---|
45 | * @throws \Google\Service\Exception
|
---|
46 | */
|
---|
47 | public function create($parent, UserWorkloadsSecret $postBody, $optParams = [])
|
---|
48 | {
|
---|
49 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
50 | $params = array_merge($params, $optParams);
|
---|
51 | return $this->call('create', [$params], UserWorkloadsSecret::class);
|
---|
52 | }
|
---|
53 | /**
|
---|
54 | * Deletes a user workloads Secret. This method is supported for Cloud Composer
|
---|
55 | * environments in versions composer-3.*.*-airflow-*.*.* and newer.
|
---|
56 | * (userWorkloadsSecrets.delete)
|
---|
57 | *
|
---|
58 | * @param string $name Required. The Secret to delete, in the form: "projects/{p
|
---|
59 | * rojectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsSe
|
---|
60 | * crets/{userWorkloadsSecretId}"
|
---|
61 | * @param array $optParams Optional parameters.
|
---|
62 | * @return ComposerEmpty
|
---|
63 | * @throws \Google\Service\Exception
|
---|
64 | */
|
---|
65 | public function delete($name, $optParams = [])
|
---|
66 | {
|
---|
67 | $params = ['name' => $name];
|
---|
68 | $params = array_merge($params, $optParams);
|
---|
69 | return $this->call('delete', [$params], ComposerEmpty::class);
|
---|
70 | }
|
---|
71 | /**
|
---|
72 | * Gets an existing user workloads Secret. Values of the "data" field in the
|
---|
73 | * response are cleared. This method is supported for Cloud Composer
|
---|
74 | * environments in versions composer-3.*.*-airflow-*.*.* and newer.
|
---|
75 | * (userWorkloadsSecrets.get)
|
---|
76 | *
|
---|
77 | * @param string $name Required. The resource name of the Secret to get, in the
|
---|
78 | * form: "projects/{projectId}/locations/{locationId}/environments/{environmentI
|
---|
79 | * d}/userWorkloadsSecrets/{userWorkloadsSecretId}"
|
---|
80 | * @param array $optParams Optional parameters.
|
---|
81 | * @return UserWorkloadsSecret
|
---|
82 | * @throws \Google\Service\Exception
|
---|
83 | */
|
---|
84 | public function get($name, $optParams = [])
|
---|
85 | {
|
---|
86 | $params = ['name' => $name];
|
---|
87 | $params = array_merge($params, $optParams);
|
---|
88 | return $this->call('get', [$params], UserWorkloadsSecret::class);
|
---|
89 | }
|
---|
90 | /**
|
---|
91 | * Lists user workloads Secrets. This method is supported for Cloud Composer
|
---|
92 | * environments in versions composer-3.*.*-airflow-*.*.* and newer.
|
---|
93 | * (userWorkloadsSecrets.listProjectsLocationsEnvironmentsUserWorkloadsSecrets)
|
---|
94 | *
|
---|
95 | * @param string $parent Required. List Secrets in the given environment, in the
|
---|
96 | * form:
|
---|
97 | * "projects/{projectId}/locations/{locationId}/environments/{environmentId}"
|
---|
98 | * @param array $optParams Optional parameters.
|
---|
99 | *
|
---|
100 | * @opt_param int pageSize Optional. The maximum number of Secrets to return.
|
---|
101 | * @opt_param string pageToken Optional. The next_page_token value returned from
|
---|
102 | * a previous List request, if any.
|
---|
103 | * @return ListUserWorkloadsSecretsResponse
|
---|
104 | * @throws \Google\Service\Exception
|
---|
105 | */
|
---|
106 | public function listProjectsLocationsEnvironmentsUserWorkloadsSecrets($parent, $optParams = [])
|
---|
107 | {
|
---|
108 | $params = ['parent' => $parent];
|
---|
109 | $params = array_merge($params, $optParams);
|
---|
110 | return $this->call('list', [$params], ListUserWorkloadsSecretsResponse::class);
|
---|
111 | }
|
---|
112 | /**
|
---|
113 | * Updates a user workloads Secret. This method is supported for Cloud Composer
|
---|
114 | * environments in versions composer-3.*.*-airflow-*.*.* and newer.
|
---|
115 | * (userWorkloadsSecrets.update)
|
---|
116 | *
|
---|
117 | * @param string $name Identifier. The resource name of the Secret, in the form:
|
---|
118 | * "projects/{projectId}/locations/{locationId}/environments/{environmentId}/use
|
---|
119 | * rWorkloadsSecrets/{userWorkloadsSecretId}"
|
---|
120 | * @param UserWorkloadsSecret $postBody
|
---|
121 | * @param array $optParams Optional parameters.
|
---|
122 | * @return UserWorkloadsSecret
|
---|
123 | * @throws \Google\Service\Exception
|
---|
124 | */
|
---|
125 | public function update($name, UserWorkloadsSecret $postBody, $optParams = [])
|
---|
126 | {
|
---|
127 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
128 | $params = array_merge($params, $optParams);
|
---|
129 | return $this->call('update', [$params], UserWorkloadsSecret::class);
|
---|
130 | }
|
---|
131 | }
|
---|
132 |
|
---|
133 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
134 | class_alias(ProjectsLocationsEnvironmentsUserWorkloadsSecrets::class, 'Google_Service_CloudComposer_Resource_ProjectsLocationsEnvironmentsUserWorkloadsSecrets');
|
---|