1# -*- coding: utf-8 -*-
2# Copyright 2025 Google LLC
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16from __future__ import annotations
17
18from typing import MutableMapping, MutableSequence
19
20from google.protobuf import field_mask_pb2 # type: ignore
21import proto # type: ignore
22
23from google.cloud.secretmanager_v1beta1.types import resources
24
25__protobuf__ = proto.module(
26 package="google.cloud.secrets.v1beta1",
27 manifest={
28 "ListSecretsRequest",
29 "ListSecretsResponse",
30 "CreateSecretRequest",
31 "AddSecretVersionRequest",
32 "GetSecretRequest",
33 "ListSecretVersionsRequest",
34 "ListSecretVersionsResponse",
35 "GetSecretVersionRequest",
36 "UpdateSecretRequest",
37 "AccessSecretVersionRequest",
38 "AccessSecretVersionResponse",
39 "DeleteSecretRequest",
40 "DisableSecretVersionRequest",
41 "EnableSecretVersionRequest",
42 "DestroySecretVersionRequest",
43 },
44)
45
46
47class ListSecretsRequest(proto.Message):
48 r"""Request message for
49 [SecretManagerService.ListSecrets][google.cloud.secrets.v1beta1.SecretManagerService.ListSecrets].
50
51 Attributes:
52 parent (str):
53 Required. The resource name of the project associated with
54 the [Secrets][google.cloud.secrets.v1beta1.Secret], in the
55 format ``projects/*``.
56 page_size (int):
57 Optional. The maximum number of results to be
58 returned in a single page. If set to 0, the
59 server decides the number of results to return.
60 If the number is greater than 25000, it is
61 capped at 25000.
62 page_token (str):
63 Optional. Pagination token, returned earlier via
64 [ListSecretsResponse.next_page_token][google.cloud.secrets.v1beta1.ListSecretsResponse.next_page_token].
65 """
66
67 parent: str = proto.Field(
68 proto.STRING,
69 number=1,
70 )
71 page_size: int = proto.Field(
72 proto.INT32,
73 number=2,
74 )
75 page_token: str = proto.Field(
76 proto.STRING,
77 number=3,
78 )
79
80
81class ListSecretsResponse(proto.Message):
82 r"""Response message for
83 [SecretManagerService.ListSecrets][google.cloud.secrets.v1beta1.SecretManagerService.ListSecrets].
84
85 Attributes:
86 secrets (MutableSequence[google.cloud.secretmanager_v1beta1.types.Secret]):
87 The list of [Secrets][google.cloud.secrets.v1beta1.Secret]
88 sorted in reverse by create_time (newest first).
89 next_page_token (str):
90 A token to retrieve the next page of results. Pass this
91 value in
92 [ListSecretsRequest.page_token][google.cloud.secrets.v1beta1.ListSecretsRequest.page_token]
93 to retrieve the next page.
94 total_size (int):
95 The total number of
96 [Secrets][google.cloud.secrets.v1beta1.Secret].
97 """
98
99 @property
100 def raw_page(self):
101 return self
102
103 secrets: MutableSequence[resources.Secret] = proto.RepeatedField(
104 proto.MESSAGE,
105 number=1,
106 message=resources.Secret,
107 )
108 next_page_token: str = proto.Field(
109 proto.STRING,
110 number=2,
111 )
112 total_size: int = proto.Field(
113 proto.INT32,
114 number=3,
115 )
116
117
118class CreateSecretRequest(proto.Message):
119 r"""Request message for
120 [SecretManagerService.CreateSecret][google.cloud.secrets.v1beta1.SecretManagerService.CreateSecret].
121
122 Attributes:
123 parent (str):
124 Required. The resource name of the project to associate with
125 the [Secret][google.cloud.secrets.v1beta1.Secret], in the
126 format ``projects/*``.
127 secret_id (str):
128 Required. This must be unique within the project.
129
130 A secret ID is a string with a maximum length of 255
131 characters and can contain uppercase and lowercase letters,
132 numerals, and the hyphen (``-``) and underscore (``_``)
133 characters.
134 secret (google.cloud.secretmanager_v1beta1.types.Secret):
135 Required. A [Secret][google.cloud.secrets.v1beta1.Secret]
136 with initial field values.
137 """
138
139 parent: str = proto.Field(
140 proto.STRING,
141 number=1,
142 )
143 secret_id: str = proto.Field(
144 proto.STRING,
145 number=2,
146 )
147 secret: resources.Secret = proto.Field(
148 proto.MESSAGE,
149 number=3,
150 message=resources.Secret,
151 )
152
153
154class AddSecretVersionRequest(proto.Message):
155 r"""Request message for
156 [SecretManagerService.AddSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.AddSecretVersion].
157
158 Attributes:
159 parent (str):
160 Required. The resource name of the
161 [Secret][google.cloud.secrets.v1beta1.Secret] to associate
162 with the
163 [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]
164 in the format ``projects/*/secrets/*``.
165 payload (google.cloud.secretmanager_v1beta1.types.SecretPayload):
166 Required. The secret payload of the
167 [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion].
168 """
169
170 parent: str = proto.Field(
171 proto.STRING,
172 number=1,
173 )
174 payload: resources.SecretPayload = proto.Field(
175 proto.MESSAGE,
176 number=2,
177 message=resources.SecretPayload,
178 )
179
180
181class GetSecretRequest(proto.Message):
182 r"""Request message for
183 [SecretManagerService.GetSecret][google.cloud.secrets.v1beta1.SecretManagerService.GetSecret].
184
185 Attributes:
186 name (str):
187 Required. The resource name of the
188 [Secret][google.cloud.secrets.v1beta1.Secret], in the format
189 ``projects/*/secrets/*``.
190 """
191
192 name: str = proto.Field(
193 proto.STRING,
194 number=1,
195 )
196
197
198class ListSecretVersionsRequest(proto.Message):
199 r"""Request message for
200 [SecretManagerService.ListSecretVersions][google.cloud.secrets.v1beta1.SecretManagerService.ListSecretVersions].
201
202 Attributes:
203 parent (str):
204 Required. The resource name of the
205 [Secret][google.cloud.secrets.v1beta1.Secret] associated
206 with the
207 [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion]
208 to list, in the format ``projects/*/secrets/*``.
209 page_size (int):
210 Optional. The maximum number of results to be
211 returned in a single page. If set to 0, the
212 server decides the number of results to return.
213 If the number is greater than 25000, it is
214 capped at 25000.
215 page_token (str):
216 Optional. Pagination token, returned earlier via
217 ListSecretVersionsResponse.next_page_token][].
218 """
219
220 parent: str = proto.Field(
221 proto.STRING,
222 number=1,
223 )
224 page_size: int = proto.Field(
225 proto.INT32,
226 number=2,
227 )
228 page_token: str = proto.Field(
229 proto.STRING,
230 number=3,
231 )
232
233
234class ListSecretVersionsResponse(proto.Message):
235 r"""Response message for
236 [SecretManagerService.ListSecretVersions][google.cloud.secrets.v1beta1.SecretManagerService.ListSecretVersions].
237
238 Attributes:
239 versions (MutableSequence[google.cloud.secretmanager_v1beta1.types.SecretVersion]):
240 The list of
241 [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion]
242 sorted in reverse by create_time (newest first).
243 next_page_token (str):
244 A token to retrieve the next page of results. Pass this
245 value in
246 [ListSecretVersionsRequest.page_token][google.cloud.secrets.v1beta1.ListSecretVersionsRequest.page_token]
247 to retrieve the next page.
248 total_size (int):
249 The total number of
250 [SecretVersions][google.cloud.secrets.v1beta1.SecretVersion].
251 """
252
253 @property
254 def raw_page(self):
255 return self
256
257 versions: MutableSequence[resources.SecretVersion] = proto.RepeatedField(
258 proto.MESSAGE,
259 number=1,
260 message=resources.SecretVersion,
261 )
262 next_page_token: str = proto.Field(
263 proto.STRING,
264 number=2,
265 )
266 total_size: int = proto.Field(
267 proto.INT32,
268 number=3,
269 )
270
271
272class GetSecretVersionRequest(proto.Message):
273 r"""Request message for
274 [SecretManagerService.GetSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.GetSecretVersion].
275
276 Attributes:
277 name (str):
278 Required. The resource name of the
279 [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]
280 in the format ``projects/*/secrets/*/versions/*``.
281 ``projects/*/secrets/*/versions/latest`` is an alias to the
282 ``latest``
283 [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion].
284 """
285
286 name: str = proto.Field(
287 proto.STRING,
288 number=1,
289 )
290
291
292class UpdateSecretRequest(proto.Message):
293 r"""Request message for
294 [SecretManagerService.UpdateSecret][google.cloud.secrets.v1beta1.SecretManagerService.UpdateSecret].
295
296 Attributes:
297 secret (google.cloud.secretmanager_v1beta1.types.Secret):
298 Required. [Secret][google.cloud.secrets.v1beta1.Secret] with
299 updated field values.
300 update_mask (google.protobuf.field_mask_pb2.FieldMask):
301 Required. Specifies the fields to be updated.
302 """
303
304 secret: resources.Secret = proto.Field(
305 proto.MESSAGE,
306 number=1,
307 message=resources.Secret,
308 )
309 update_mask: field_mask_pb2.FieldMask = proto.Field(
310 proto.MESSAGE,
311 number=2,
312 message=field_mask_pb2.FieldMask,
313 )
314
315
316class AccessSecretVersionRequest(proto.Message):
317 r"""Request message for
318 [SecretManagerService.AccessSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.AccessSecretVersion].
319
320 Attributes:
321 name (str):
322 Required. The resource name of the
323 [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]
324 in the format ``projects/*/secrets/*/versions/*``.
325 """
326
327 name: str = proto.Field(
328 proto.STRING,
329 number=1,
330 )
331
332
333class AccessSecretVersionResponse(proto.Message):
334 r"""Response message for
335 [SecretManagerService.AccessSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.AccessSecretVersion].
336
337 Attributes:
338 name (str):
339 The resource name of the
340 [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]
341 in the format ``projects/*/secrets/*/versions/*``.
342 payload (google.cloud.secretmanager_v1beta1.types.SecretPayload):
343 Secret payload
344 """
345
346 name: str = proto.Field(
347 proto.STRING,
348 number=1,
349 )
350 payload: resources.SecretPayload = proto.Field(
351 proto.MESSAGE,
352 number=2,
353 message=resources.SecretPayload,
354 )
355
356
357class DeleteSecretRequest(proto.Message):
358 r"""Request message for
359 [SecretManagerService.DeleteSecret][google.cloud.secrets.v1beta1.SecretManagerService.DeleteSecret].
360
361 Attributes:
362 name (str):
363 Required. The resource name of the
364 [Secret][google.cloud.secrets.v1beta1.Secret] to delete in
365 the format ``projects/*/secrets/*``.
366 """
367
368 name: str = proto.Field(
369 proto.STRING,
370 number=1,
371 )
372
373
374class DisableSecretVersionRequest(proto.Message):
375 r"""Request message for
376 [SecretManagerService.DisableSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.DisableSecretVersion].
377
378 Attributes:
379 name (str):
380 Required. The resource name of the
381 [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]
382 to disable in the format
383 ``projects/*/secrets/*/versions/*``.
384 """
385
386 name: str = proto.Field(
387 proto.STRING,
388 number=1,
389 )
390
391
392class EnableSecretVersionRequest(proto.Message):
393 r"""Request message for
394 [SecretManagerService.EnableSecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.EnableSecretVersion].
395
396 Attributes:
397 name (str):
398 Required. The resource name of the
399 [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]
400 to enable in the format ``projects/*/secrets/*/versions/*``.
401 """
402
403 name: str = proto.Field(
404 proto.STRING,
405 number=1,
406 )
407
408
409class DestroySecretVersionRequest(proto.Message):
410 r"""Request message for
411 [SecretManagerService.DestroySecretVersion][google.cloud.secrets.v1beta1.SecretManagerService.DestroySecretVersion].
412
413 Attributes:
414 name (str):
415 Required. The resource name of the
416 [SecretVersion][google.cloud.secrets.v1beta1.SecretVersion]
417 to destroy in the format
418 ``projects/*/secrets/*/versions/*``.
419 """
420
421 name: str = proto.Field(
422 proto.STRING,
423 number=1,
424 )
425
426
427__all__ = tuple(sorted(__protobuf__.manifest))