Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/google/cloud/resourcemanager_v3/types/projects.py: 97%
65 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-06 06:03 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-06 06:03 +0000
1# -*- coding: utf-8 -*-
2# Copyright 2022 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
18from typing import MutableMapping, MutableSequence
20from google.protobuf import field_mask_pb2 # type: ignore
21from google.protobuf import timestamp_pb2 # type: ignore
22import proto # type: ignore
24__protobuf__ = proto.module(
25 package="google.cloud.resourcemanager.v3",
26 manifest={
27 "Project",
28 "GetProjectRequest",
29 "ListProjectsRequest",
30 "ListProjectsResponse",
31 "SearchProjectsRequest",
32 "SearchProjectsResponse",
33 "CreateProjectRequest",
34 "CreateProjectMetadata",
35 "UpdateProjectRequest",
36 "UpdateProjectMetadata",
37 "MoveProjectRequest",
38 "MoveProjectMetadata",
39 "DeleteProjectRequest",
40 "DeleteProjectMetadata",
41 "UndeleteProjectRequest",
42 "UndeleteProjectMetadata",
43 },
44)
47class Project(proto.Message):
48 r"""A project is a high-level Google Cloud entity. It is a
49 container for ACLs, APIs, App Engine Apps, VMs, and other Google
50 Cloud Platform resources.
52 Attributes:
53 name (str):
54 Output only. The unique resource name of the project. It is
55 an int64 generated number prefixed by "projects/".
57 Example: ``projects/415104041262``
58 parent (str):
59 Optional. A reference to a parent Resource. eg.,
60 ``organizations/123`` or ``folders/876``.
61 project_id (str):
62 Immutable. The unique, user-assigned id of the project. It
63 must be 6 to 30 lowercase ASCII letters, digits, or hyphens.
64 It must start with a letter. Trailing hyphens are
65 prohibited.
67 Example: ``tokyo-rain-123``
68 state (google.cloud.resourcemanager_v3.types.Project.State):
69 Output only. The project lifecycle state.
70 display_name (str):
71 Optional. A user-assigned display name of the project. When
72 present it must be between 4 to 30 characters. Allowed
73 characters are: lowercase and uppercase letters, numbers,
74 hyphen, single-quote, double-quote, space, and exclamation
75 point.
77 Example: ``My Project``
78 create_time (google.protobuf.timestamp_pb2.Timestamp):
79 Output only. Creation time.
80 update_time (google.protobuf.timestamp_pb2.Timestamp):
81 Output only. The most recent time this
82 resource was modified.
83 delete_time (google.protobuf.timestamp_pb2.Timestamp):
84 Output only. The time at which this resource
85 was requested for deletion.
86 etag (str):
87 Output only. A checksum computed by the
88 server based on the current value of the Project
89 resource. This may be sent on update and delete
90 requests to ensure the client has an up-to-date
91 value before proceeding.
92 labels (MutableMapping[str, str]):
93 Optional. The labels associated with this project.
95 Label keys must be between 1 and 63 characters long and must
96 conform to the following regular expression:
97 [a-z]([-a-z0-9]*[a-z0-9])?.
99 Label values must be between 0 and 63 characters long and
100 must conform to the regular expression
101 ([a-z]([-a-z0-9]*[a-z0-9])?)?.
103 No more than 64 labels can be associated with a given
104 resource.
106 Clients should store labels in a representation such as JSON
107 that does not depend on specific characters being
108 disallowed.
110 Example: ``"myBusinessDimension" : "businessValue"``
111 """
113 class State(proto.Enum):
114 r"""Project lifecycle states.
116 Values:
117 STATE_UNSPECIFIED (0):
118 Unspecified state. This is only used/useful
119 for distinguishing unset values.
120 ACTIVE (1):
121 The normal and active state.
122 DELETE_REQUESTED (2):
123 The project has been marked for deletion by the user (by
124 invoking
125 [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject])
126 or by the system (Google Cloud Platform). This can generally
127 be reversed by invoking [UndeleteProject]
128 [google.cloud.resourcemanager.v3.Projects.UndeleteProject].
129 """
130 STATE_UNSPECIFIED = 0
131 ACTIVE = 1
132 DELETE_REQUESTED = 2
134 name: str = proto.Field(
135 proto.STRING,
136 number=1,
137 )
138 parent: str = proto.Field(
139 proto.STRING,
140 number=2,
141 )
142 project_id: str = proto.Field(
143 proto.STRING,
144 number=3,
145 )
146 state: State = proto.Field(
147 proto.ENUM,
148 number=4,
149 enum=State,
150 )
151 display_name: str = proto.Field(
152 proto.STRING,
153 number=5,
154 )
155 create_time: timestamp_pb2.Timestamp = proto.Field(
156 proto.MESSAGE,
157 number=6,
158 message=timestamp_pb2.Timestamp,
159 )
160 update_time: timestamp_pb2.Timestamp = proto.Field(
161 proto.MESSAGE,
162 number=7,
163 message=timestamp_pb2.Timestamp,
164 )
165 delete_time: timestamp_pb2.Timestamp = proto.Field(
166 proto.MESSAGE,
167 number=8,
168 message=timestamp_pb2.Timestamp,
169 )
170 etag: str = proto.Field(
171 proto.STRING,
172 number=9,
173 )
174 labels: MutableMapping[str, str] = proto.MapField(
175 proto.STRING,
176 proto.STRING,
177 number=10,
178 )
181class GetProjectRequest(proto.Message):
182 r"""The request sent to the
183 [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject]
184 method.
186 Attributes:
187 name (str):
188 Required. The name of the project (for example,
189 ``projects/415104041262``).
190 """
192 name: str = proto.Field(
193 proto.STRING,
194 number=1,
195 )
198class ListProjectsRequest(proto.Message):
199 r"""The request sent to the
200 [ListProjects][google.cloud.resourcemanager.v3.Projects.ListProjects]
201 method.
203 Attributes:
204 parent (str):
205 Required. The name of the parent resource whose projects are
206 being listed. Only children of this parent resource are
207 listed; descendants are not listed.
209 If the parent is a folder, use the value
210 ``folders/{folder_id}``. If the parent is an organization,
211 use the value ``organizations/{org_id}``.
212 page_token (str):
213 Optional. A pagination token returned from a previous call
214 to [ListProjects]
215 [google.cloud.resourcemanager.v3.Projects.ListProjects] that
216 indicates from where listing should continue.
217 page_size (int):
218 Optional. The maximum number of projects to
219 return in the response. The server can return
220 fewer projects than requested. If unspecified,
221 server picks an appropriate default.
222 show_deleted (bool):
223 Optional. Indicate that projects in the ``DELETE_REQUESTED``
224 state should also be returned. Normally only ``ACTIVE``
225 projects are returned.
226 """
228 parent: str = proto.Field(
229 proto.STRING,
230 number=1,
231 )
232 page_token: str = proto.Field(
233 proto.STRING,
234 number=2,
235 )
236 page_size: int = proto.Field(
237 proto.INT32,
238 number=3,
239 )
240 show_deleted: bool = proto.Field(
241 proto.BOOL,
242 number=4,
243 )
246class ListProjectsResponse(proto.Message):
247 r"""A page of the response received from the
248 [ListProjects][google.cloud.resourcemanager.v3.Projects.ListProjects]
249 method.
251 A paginated response where more pages are available has
252 ``next_page_token`` set. This token can be used in a subsequent
253 request to retrieve the next request page.
255 NOTE: A response may contain fewer elements than the request
256 ``page_size`` and still have a ``next_page_token``.
258 Attributes:
259 projects (MutableSequence[google.cloud.resourcemanager_v3.types.Project]):
260 The list of Projects under the parent. This
261 list can be paginated.
262 next_page_token (str):
263 Pagination token.
265 If the result set is too large to fit in a single response,
266 this token is returned. It encodes the position of the
267 current result cursor. Feeding this value into a new list
268 request with the ``page_token`` parameter gives the next
269 page of the results.
271 When ``next_page_token`` is not filled in, there is no next
272 page and the list returned is the last page in the result
273 set.
275 Pagination tokens have a limited lifetime.
276 """
278 @property
279 def raw_page(self):
280 return self
282 projects: MutableSequence["Project"] = proto.RepeatedField(
283 proto.MESSAGE,
284 number=1,
285 message="Project",
286 )
287 next_page_token: str = proto.Field(
288 proto.STRING,
289 number=2,
290 )
293class SearchProjectsRequest(proto.Message):
294 r"""The request sent to the
295 [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects]
296 method.
298 Attributes:
299 query (str):
300 Optional. A query string for searching for projects that the
301 caller has ``resourcemanager.projects.get`` permission to.
302 If multiple fields are included in the query, then it will
303 return results that match any of the fields. Some eligible
304 fields are:
306 - **``displayName``, ``name``**: Filters by displayName.
307 - **``parent``**: Project's parent (for example:
308 ``folders/123``, ``organizations/*``). Prefer ``parent``
309 field over ``parent.type`` and ``parent.id``.
310 - **``parent.type``**: Parent's type: ``folder`` or
311 ``organization``.
312 - **``parent.id``**: Parent's id number (for example:
313 ``123``).
314 - **``id``, ``projectId``**: Filters by projectId.
315 - **``state``, ``lifecycleState``**: Filters by state.
316 - **``labels``**: Filters by label name or value.
317 - **``labels.<key>`` (where ``<key>`` is the name of a
318 label)**: Filters by label name.
320 Search expressions are case insensitive.
322 Some examples queries:
324 - **``name:how*``**: The project's name starts with "how".
325 - **``name:Howl``**: The project's name is ``Howl`` or
326 ``howl``.
327 - **``name:HOWL``**: Equivalent to above.
328 - **``NAME:howl``**: Equivalent to above.
329 - **``labels.color:*``**: The project has the label
330 ``color``.
331 - **``labels.color:red``**: The project's label ``color``
332 has the value ``red``.
333 - **``labels.color:red labels.size:big``**: The project's
334 label ``color`` has the value ``red`` or its label
335 ``size`` has the value ``big``.
337 If no query is specified, the call will return projects for
338 which the user has the ``resourcemanager.projects.get``
339 permission.
340 page_token (str):
341 Optional. A pagination token returned from a previous call
342 to [ListProjects]
343 [google.cloud.resourcemanager.v3.Projects.ListProjects] that
344 indicates from where listing should continue.
345 page_size (int):
346 Optional. The maximum number of projects to
347 return in the response. The server can return
348 fewer projects than requested. If unspecified,
349 server picks an appropriate default.
350 """
352 query: str = proto.Field(
353 proto.STRING,
354 number=1,
355 )
356 page_token: str = proto.Field(
357 proto.STRING,
358 number=2,
359 )
360 page_size: int = proto.Field(
361 proto.INT32,
362 number=3,
363 )
366class SearchProjectsResponse(proto.Message):
367 r"""A page of the response received from the
368 [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects]
369 method.
371 A paginated response where more pages are available has
372 ``next_page_token`` set. This token can be used in a subsequent
373 request to retrieve the next request page.
375 Attributes:
376 projects (MutableSequence[google.cloud.resourcemanager_v3.types.Project]):
377 The list of Projects that matched the list
378 filter query. This list can be paginated.
379 next_page_token (str):
380 Pagination token.
382 If the result set is too large to fit in a single response,
383 this token is returned. It encodes the position of the
384 current result cursor. Feeding this value into a new list
385 request with the ``page_token`` parameter gives the next
386 page of the results.
388 When ``next_page_token`` is not filled in, there is no next
389 page and the list returned is the last page in the result
390 set.
392 Pagination tokens have a limited lifetime.
393 """
395 @property
396 def raw_page(self):
397 return self
399 projects: MutableSequence["Project"] = proto.RepeatedField(
400 proto.MESSAGE,
401 number=1,
402 message="Project",
403 )
404 next_page_token: str = proto.Field(
405 proto.STRING,
406 number=2,
407 )
410class CreateProjectRequest(proto.Message):
411 r"""The request sent to the
412 [CreateProject][google.cloud.resourcemanager.v3.Projects.CreateProject]
413 method.
415 Attributes:
416 project (google.cloud.resourcemanager_v3.types.Project):
417 Required. The Project to create.
419 Project ID is required. If the requested ID is unavailable,
420 the request fails.
422 If the ``parent`` field is set, the
423 ``resourcemanager.projects.create`` permission is checked on
424 the parent resource. If no parent is set and the
425 authorization credentials belong to an Organization, the
426 parent will be set to that Organization.
427 """
429 project: "Project" = proto.Field(
430 proto.MESSAGE,
431 number=1,
432 message="Project",
433 )
436class CreateProjectMetadata(proto.Message):
437 r"""A status object which is used as the ``metadata`` field for the
438 Operation returned by CreateProject. It provides insight for when
439 significant phases of Project creation have completed.
441 Attributes:
442 create_time (google.protobuf.timestamp_pb2.Timestamp):
443 Creation time of the project creation
444 workflow.
445 gettable (bool):
446 True if the project can be retrieved using ``GetProject``.
447 No other operations on the project are guaranteed to work
448 until the project creation is complete.
449 ready (bool):
450 True if the project creation process is
451 complete.
452 """
454 create_time: timestamp_pb2.Timestamp = proto.Field(
455 proto.MESSAGE,
456 number=1,
457 message=timestamp_pb2.Timestamp,
458 )
459 gettable: bool = proto.Field(
460 proto.BOOL,
461 number=2,
462 )
463 ready: bool = proto.Field(
464 proto.BOOL,
465 number=3,
466 )
469class UpdateProjectRequest(proto.Message):
470 r"""The request sent to the
471 [UpdateProject][google.cloud.resourcemanager.v3.Projects.UpdateProject]
472 method.
474 Only the ``display_name`` and ``labels`` fields can be change. Use
475 the
476 [MoveProject][google.cloud.resourcemanager.v3.Projects.MoveProject]
477 method to change the ``parent`` field.
479 Attributes:
480 project (google.cloud.resourcemanager_v3.types.Project):
481 Required. The new definition of the project.
482 update_mask (google.protobuf.field_mask_pb2.FieldMask):
483 Optional. An update mask to selectively
484 update fields.
485 """
487 project: "Project" = proto.Field(
488 proto.MESSAGE,
489 number=1,
490 message="Project",
491 )
492 update_mask: field_mask_pb2.FieldMask = proto.Field(
493 proto.MESSAGE,
494 number=2,
495 message=field_mask_pb2.FieldMask,
496 )
499class UpdateProjectMetadata(proto.Message):
500 r"""A status object which is used as the ``metadata`` field for the
501 Operation returned by UpdateProject.
503 """
506class MoveProjectRequest(proto.Message):
507 r"""The request sent to
508 [MoveProject][google.cloud.resourcemanager.v3.Projects.MoveProject]
509 method.
511 Attributes:
512 name (str):
513 Required. The name of the project to move.
514 destination_parent (str):
515 Required. The new parent to move the Project
516 under.
517 """
519 name: str = proto.Field(
520 proto.STRING,
521 number=1,
522 )
523 destination_parent: str = proto.Field(
524 proto.STRING,
525 number=2,
526 )
529class MoveProjectMetadata(proto.Message):
530 r"""A status object which is used as the ``metadata`` field for the
531 Operation returned by MoveProject.
533 """
536class DeleteProjectRequest(proto.Message):
537 r"""[DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject]
538 method.
540 Attributes:
541 name (str):
542 Required. The name of the Project (for example,
543 ``projects/415104041262``).
544 """
546 name: str = proto.Field(
547 proto.STRING,
548 number=1,
549 )
552class DeleteProjectMetadata(proto.Message):
553 r"""A status object which is used as the ``metadata`` field for the
554 Operation returned by ``DeleteProject``.
556 """
559class UndeleteProjectRequest(proto.Message):
560 r"""The request sent to the [UndeleteProject]
561 [google.cloud.resourcemanager.v3.Projects.UndeleteProject] method.
563 Attributes:
564 name (str):
565 Required. The name of the project (for example,
566 ``projects/415104041262``).
568 Required.
569 """
571 name: str = proto.Field(
572 proto.STRING,
573 number=1,
574 )
577class UndeleteProjectMetadata(proto.Message):
578 r"""A status object which is used as the ``metadata`` field for the
579 Operation returned by ``UndeleteProject``.
581 """
584__all__ = tuple(sorted(__protobuf__.manifest))