Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit e5e63a9

Browse files
docs: Add documentation for enums (#537)
* docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: googleapis/googleapis@a391fd1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 24bac81 commit e5e63a9

File tree

12 files changed

+160
-15
lines changed

12 files changed

+160
-15
lines changed

google/cloud/asset_v1/services/asset_service/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3342,7 +3342,7 @@ def sample_analyze_org_policy_governed_assets():
33423342
# Done; return the response.
33433343
return response
33443344

3345-
def __enter__(self):
3345+
def __enter__(self) -> "AssetServiceClient":
33463346
return self
33473347

33483348
def __exit__(self, type, value, traceback):

google/cloud/asset_v1/types/asset_service.py

+99-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,25 @@
9696

9797

9898
class ContentType(proto.Enum):
99-
r"""Asset content type."""
99+
r"""Asset content type.
100+
101+
Values:
102+
CONTENT_TYPE_UNSPECIFIED (0):
103+
Unspecified content type.
104+
RESOURCE (1):
105+
Resource metadata.
106+
IAM_POLICY (2):
107+
The actual IAM policy set on a resource.
108+
ORG_POLICY (4):
109+
The organization policy set on an asset.
110+
ACCESS_POLICY (5):
111+
The Access Context Manager policy set on an
112+
asset.
113+
OS_INVENTORY (6):
114+
The runtime OS Inventory information.
115+
RELATIONSHIP (7):
116+
The related resources.
117+
"""
100118
CONTENT_TYPE_UNSPECIFIED = 0
101119
RESOURCE = 1
102120
IAM_POLICY = 2
@@ -871,6 +889,25 @@ class PartitionKey(proto.Enum):
871889
partition key is a timestamp column, the actual partition is based
872890
on its date value (expressed in UTC. see details in
873891
https://cloud.google.com/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables).
892+
893+
Values:
894+
PARTITION_KEY_UNSPECIFIED (0):
895+
Unspecified partition key. If used, it means
896+
using non-partitioned table.
897+
READ_TIME (1):
898+
The time when the snapshot is taken. If specified as
899+
partition key, the result table(s) is partitoned by the
900+
additional timestamp column, readTime. If [read_time] in
901+
ExportAssetsRequest is specified, the readTime column's
902+
value will be the same as it. Otherwise, its value will be
903+
the current time that is used to take the snapshot.
904+
REQUEST_TIME (2):
905+
The time when the request is received and
906+
started to be processed. If specified as
907+
partition key, the result table(s) is partitoned
908+
by the requestTime column, an additional
909+
timestamp column representing when the request
910+
was received.
874911
"""
875912
PARTITION_KEY_UNSPECIFIED = 0
876913
READ_TIME = 1
@@ -1958,6 +1995,17 @@ class PartitionKey(proto.Enum):
19581995
reduce query cost by filtering partitions. Refer to
19591996
https://cloud.google.com/bigquery/docs/partitioned-tables for
19601997
details.
1998+
1999+
Values:
2000+
PARTITION_KEY_UNSPECIFIED (0):
2001+
Unspecified partition key. Tables won't be
2002+
partitioned using this option.
2003+
REQUEST_TIME (1):
2004+
The time when the request is received. If
2005+
specified as partition key, the result table(s)
2006+
is partitoned by the RequestTime column, an
2007+
additional timestamp column representing when
2008+
the request was received.
19612009
"""
19622010
PARTITION_KEY_UNSPECIFIED = 0
19632011
REQUEST_TIME = 1
@@ -2362,7 +2410,20 @@ class AnalyzeMoveRequest(proto.Message):
23622410
"""
23632411

23642412
class AnalysisView(proto.Enum):
2365-
r"""View enum for supporting partial analysis responses."""
2413+
r"""View enum for supporting partial analysis responses.
2414+
2415+
Values:
2416+
ANALYSIS_VIEW_UNSPECIFIED (0):
2417+
The default/unset value.
2418+
The API will default to the FULL view.
2419+
FULL (1):
2420+
Full analysis including all level of impacts
2421+
of the specified resource move.
2422+
BASIC (2):
2423+
Basic analysis only including blockers which
2424+
will prevent the specified resource move at
2425+
runtime.
2426+
"""
23662427
ANALYSIS_VIEW_UNSPECIFIED = 0
23672428
FULL = 1
23682429
BASIC = 2
@@ -3196,6 +3257,19 @@ class ConstraintDefault(proto.Enum):
31963257
r"""Specifies the default behavior in the absence of any ``Policy`` for
31973258
the ``Constraint``. This must not be
31983259
``CONSTRAINT_DEFAULT_UNSPECIFIED``.
3260+
3261+
Values:
3262+
CONSTRAINT_DEFAULT_UNSPECIFIED (0):
3263+
This is only used for distinguishing unset
3264+
values and should never be used.
3265+
ALLOW (1):
3266+
Indicate that all values are allowed for list
3267+
constraints. Indicate that enforcement is off
3268+
for boolean constraints.
3269+
DENY (2):
3270+
Indicate that all values are denied for list
3271+
constraints. Indicate that enforcement is on for
3272+
boolean constraints.
31993273
"""
32003274
CONSTRAINT_DEFAULT_UNSPECIFIED = 0
32013275
ALLOW = 1
@@ -3309,14 +3383,36 @@ class MethodType(proto.Enum):
33093383
If the constraint applies only when create VMs, the method_types
33103384
will be "CREATE" only. If the constraint applied when create or
33113385
delete VMs, the method_types will be "CREATE" and "DELETE".
3386+
3387+
Values:
3388+
METHOD_TYPE_UNSPECIFIED (0):
3389+
Unspecified. Will results in user error.
3390+
CREATE (1):
3391+
Constraint applied when creating the
3392+
resource.
3393+
UPDATE (2):
3394+
Constraint applied when updating the
3395+
resource.
3396+
DELETE (3):
3397+
Constraint applied when deleting the
3398+
resource.
33123399
"""
33133400
METHOD_TYPE_UNSPECIFIED = 0
33143401
CREATE = 1
33153402
UPDATE = 2
33163403
DELETE = 3
33173404

33183405
class ActionType(proto.Enum):
3319-
r"""Allow or deny type."""
3406+
r"""Allow or deny type.
3407+
3408+
Values:
3409+
ACTION_TYPE_UNSPECIFIED (0):
3410+
Unspecified. Will results in user error.
3411+
ALLOW (1):
3412+
Allowed action type.
3413+
DENY (2):
3414+
Deny action type.
3415+
"""
33203416
ACTION_TYPE_UNSPECIFIED = 0
33213417
ALLOW = 1
33223418
DENY = 2

google/cloud/asset_v1/types/assets.py

+28-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,20 @@ class TemporalAsset(proto.Message):
7373
"""
7474

7575
class PriorAssetState(proto.Enum):
76-
r"""State of prior asset."""
76+
r"""State of prior asset.
77+
78+
Values:
79+
PRIOR_ASSET_STATE_UNSPECIFIED (0):
80+
prior_asset is not applicable for the current asset.
81+
PRESENT (1):
82+
prior_asset is populated correctly.
83+
INVALID (2):
84+
Failed to set prior_asset.
85+
DOES_NOT_EXIST (3):
86+
Current asset is the first known state.
87+
DELETED (4):
88+
prior_asset is a deletion.
89+
"""
7790
PRIOR_ASSET_STATE_UNSPECIFIED = 0
7891
PRESENT = 1
7992
INVALID = 2
@@ -1210,7 +1223,20 @@ class ConditionEvaluation(proto.Message):
12101223
"""
12111224

12121225
class EvaluationValue(proto.Enum):
1213-
r"""Value of this expression."""
1226+
r"""Value of this expression.
1227+
1228+
Values:
1229+
EVALUATION_VALUE_UNSPECIFIED (0):
1230+
Reserved for future use.
1231+
TRUE (1):
1232+
The evaluation result is ``true``.
1233+
FALSE (2):
1234+
The evaluation result is ``false``.
1235+
CONDITIONAL (3):
1236+
The evaluation result is ``conditional`` when the condition
1237+
expression contains variables that are either missing input
1238+
values or have not been supported by Analyzer yet.
1239+
"""
12141240
EVALUATION_VALUE_UNSPECIFIED = 0
12151241
TRUE = 1
12161242
FALSE = 2

google/cloud/asset_v1p1beta1/services/asset_service/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ def sample_search_all_iam_policies():
701701
# Done; return the response.
702702
return response
703703

704-
def __enter__(self):
704+
def __enter__(self) -> "AssetServiceClient":
705705
return self
706706

707707
def __exit__(self, type, value, traceback):

google/cloud/asset_v1p2beta1/services/asset_service/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ def sample_delete_feed():
969969
metadata=metadata,
970970
)
971971

972-
def __enter__(self):
972+
def __enter__(self) -> "AssetServiceClient":
973973
return self
974974

975975
def __exit__(self, type, value, traceback):

google/cloud/asset_v1p2beta1/types/asset_service.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@
4040

4141

4242
class ContentType(proto.Enum):
43-
r"""Asset content type."""
43+
r"""Asset content type.
44+
45+
Values:
46+
CONTENT_TYPE_UNSPECIFIED (0):
47+
Unspecified content type.
48+
RESOURCE (1):
49+
Resource metadata.
50+
IAM_POLICY (2):
51+
The actual IAM policy set on a resource.
52+
"""
4453
CONTENT_TYPE_UNSPECIFIED = 0
4554
RESOURCE = 1
4655
IAM_POLICY = 2

google/cloud/asset_v1p5beta1/services/asset_service/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ def sample_list_assets():
594594
# Done; return the response.
595595
return response
596596

597-
def __enter__(self):
597+
def __enter__(self) -> "AssetServiceClient":
598598
return self
599599

600600
def __exit__(self, type, value, traceback):

google/cloud/asset_v1p5beta1/types/asset_service.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,21 @@
3232

3333

3434
class ContentType(proto.Enum):
35-
r"""Asset content type."""
35+
r"""Asset content type.
36+
37+
Values:
38+
CONTENT_TYPE_UNSPECIFIED (0):
39+
Unspecified content type.
40+
RESOURCE (1):
41+
Resource metadata.
42+
IAM_POLICY (2):
43+
The actual IAM policy set on a resource.
44+
ORG_POLICY (4):
45+
The organization policy set on an asset.
46+
ACCESS_POLICY (5):
47+
The Access Context Manager policy set on an
48+
asset.
49+
"""
3650
CONTENT_TYPE_UNSPECIFIED = 0
3751
RESOURCE = 1
3852
IAM_POLICY = 2

samples/generated_samples/snippet_metadata_google.cloud.asset.v1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-asset",
11-
"version": "3.17.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.asset.v1p1beta1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-asset",
11-
"version": "3.17.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.asset.v1p2beta1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-asset",
11-
"version": "3.17.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.asset.v1p5beta1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-asset",
11-
"version": "3.17.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)