source: vendor/google/apiclient-services/src/SecretManager/Resource/ProjectsLocationsSecretsVersions.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload project files

  • Property mode set to 100644
File size: 6.6 KB
Line 
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
18namespace Google\Service\SecretManager\Resource;
19
20use Google\Service\SecretManager\AccessSecretVersionResponse;
21use Google\Service\SecretManager\DestroySecretVersionRequest;
22use Google\Service\SecretManager\DisableSecretVersionRequest;
23use Google\Service\SecretManager\EnableSecretVersionRequest;
24use Google\Service\SecretManager\ListSecretVersionsResponse;
25use Google\Service\SecretManager\SecretVersion;
26
27/**
28 * The "versions" collection of methods.
29 * Typical usage is:
30 * <code>
31 * $secretmanagerService = new Google\Service\SecretManager(...);
32 * $versions = $secretmanagerService->projects_locations_secrets_versions;
33 * </code>
34 */
35class ProjectsLocationsSecretsVersions extends \Google\Service\Resource
36{
37 /**
38 * Accesses a SecretVersion. This call returns the secret data.
39 * `projects/secrets/versions/latest` is an alias to the most recently created
40 * SecretVersion. (versions.access)
41 *
42 * @param string $name Required. The resource name of the SecretVersion in the
43 * format `projects/secrets/versions` or `projects/locations/secrets/versions`.
44 * `projects/secrets/versions/latest` or
45 * `projects/locations/secrets/versions/latest` is an alias to the most recently
46 * created SecretVersion.
47 * @param array $optParams Optional parameters.
48 * @return AccessSecretVersionResponse
49 * @throws \Google\Service\Exception
50 */
51 public function access($name, $optParams = [])
52 {
53 $params = ['name' => $name];
54 $params = array_merge($params, $optParams);
55 return $this->call('access', [$params], AccessSecretVersionResponse::class);
56 }
57 /**
58 * Destroys a SecretVersion. Sets the state of the SecretVersion to DESTROYED
59 * and irrevocably destroys the secret data. (versions.destroy)
60 *
61 * @param string $name Required. The resource name of the SecretVersion to
62 * destroy in the format `projects/secrets/versions` or
63 * `projects/locations/secrets/versions`.
64 * @param DestroySecretVersionRequest $postBody
65 * @param array $optParams Optional parameters.
66 * @return SecretVersion
67 * @throws \Google\Service\Exception
68 */
69 public function destroy($name, DestroySecretVersionRequest $postBody, $optParams = [])
70 {
71 $params = ['name' => $name, 'postBody' => $postBody];
72 $params = array_merge($params, $optParams);
73 return $this->call('destroy', [$params], SecretVersion::class);
74 }
75 /**
76 * Disables a SecretVersion. Sets the state of the SecretVersion to DISABLED.
77 * (versions.disable)
78 *
79 * @param string $name Required. The resource name of the SecretVersion to
80 * disable in the format `projects/secrets/versions` or
81 * `projects/locations/secrets/versions`.
82 * @param DisableSecretVersionRequest $postBody
83 * @param array $optParams Optional parameters.
84 * @return SecretVersion
85 * @throws \Google\Service\Exception
86 */
87 public function disable($name, DisableSecretVersionRequest $postBody, $optParams = [])
88 {
89 $params = ['name' => $name, 'postBody' => $postBody];
90 $params = array_merge($params, $optParams);
91 return $this->call('disable', [$params], SecretVersion::class);
92 }
93 /**
94 * Enables a SecretVersion. Sets the state of the SecretVersion to ENABLED.
95 * (versions.enable)
96 *
97 * @param string $name Required. The resource name of the SecretVersion to
98 * enable in the format `projects/secrets/versions` or
99 * `projects/locations/secrets/versions`.
100 * @param EnableSecretVersionRequest $postBody
101 * @param array $optParams Optional parameters.
102 * @return SecretVersion
103 * @throws \Google\Service\Exception
104 */
105 public function enable($name, EnableSecretVersionRequest $postBody, $optParams = [])
106 {
107 $params = ['name' => $name, 'postBody' => $postBody];
108 $params = array_merge($params, $optParams);
109 return $this->call('enable', [$params], SecretVersion::class);
110 }
111 /**
112 * Gets metadata for a SecretVersion. `projects/secrets/versions/latest` is an
113 * alias to the most recently created SecretVersion. (versions.get)
114 *
115 * @param string $name Required. The resource name of the SecretVersion in the
116 * format `projects/secrets/versions` or `projects/locations/secrets/versions`.
117 * `projects/secrets/versions/latest` or
118 * `projects/locations/secrets/versions/latest` is an alias to the most recently
119 * created SecretVersion.
120 * @param array $optParams Optional parameters.
121 * @return SecretVersion
122 * @throws \Google\Service\Exception
123 */
124 public function get($name, $optParams = [])
125 {
126 $params = ['name' => $name];
127 $params = array_merge($params, $optParams);
128 return $this->call('get', [$params], SecretVersion::class);
129 }
130 /**
131 * Lists SecretVersions. This call does not return secret data.
132 * (versions.listProjectsLocationsSecretsVersions)
133 *
134 * @param string $parent Required. The resource name of the Secret associated
135 * with the SecretVersions to list, in the format `projects/secrets` or
136 * `projects/locations/secrets`.
137 * @param array $optParams Optional parameters.
138 *
139 * @opt_param string filter Optional. Filter string, adhering to the rules in
140 * [List-operation filtering](https://cloud.google.com/secret-
141 * manager/docs/filtering). List only secret versions matching the filter. If
142 * filter is empty, all secret versions are listed.
143 * @opt_param int pageSize Optional. The maximum number of results to be
144 * returned in a single page. If set to 0, the server decides the number of
145 * results to return. If the number is greater than 25000, it is capped at
146 * 25000.
147 * @opt_param string pageToken Optional. Pagination token, returned earlier via
148 * ListSecretVersionsResponse.next_page_token][].
149 * @return ListSecretVersionsResponse
150 * @throws \Google\Service\Exception
151 */
152 public function listProjectsLocationsSecretsVersions($parent, $optParams = [])
153 {
154 $params = ['parent' => $parent];
155 $params = array_merge($params, $optParams);
156 return $this->call('list', [$params], ListSecretVersionsResponse::class);
157 }
158}
159
160// Adding a class alias for backwards compatibility with the previous class name.
161class_alias(ProjectsLocationsSecretsVersions::class, 'Google_Service_SecretManager_Resource_ProjectsLocationsSecretsVersions');
Note: See TracBrowser for help on using the repository browser.