Skip to content

Commit

Permalink
docs: Add documentation for enums (#537)
Browse files Browse the repository at this point in the history
* 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: googleapis/googleapis-gen@0080f83
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>
  • Loading branch information
3 people committed Jan 20, 2023
1 parent e362a49 commit 020023c
Show file tree
Hide file tree
Showing 12 changed files with 160 additions and 15 deletions.
Expand Up @@ -3342,7 +3342,7 @@ def sample_analyze_org_policy_governed_assets():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "AssetServiceClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Expand Up @@ -96,7 +96,25 @@


class ContentType(proto.Enum):
r"""Asset content type."""
r"""Asset content type.
Values:
CONTENT_TYPE_UNSPECIFIED (0):
Unspecified content type.
RESOURCE (1):
Resource metadata.
IAM_POLICY (2):
The actual IAM policy set on a resource.
ORG_POLICY (4):
The organization policy set on an asset.
ACCESS_POLICY (5):
The Access Context Manager policy set on an
asset.
OS_INVENTORY (6):
The runtime OS Inventory information.
RELATIONSHIP (7):
The related resources.
"""
CONTENT_TYPE_UNSPECIFIED = 0
RESOURCE = 1
IAM_POLICY = 2
Expand Down Expand Up @@ -871,6 +889,25 @@ class PartitionKey(proto.Enum):
partition key is a timestamp column, the actual partition is based
on its date value (expressed in UTC. see details in
https://cloud.google.com/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables).
Values:
PARTITION_KEY_UNSPECIFIED (0):
Unspecified partition key. If used, it means
using non-partitioned table.
READ_TIME (1):
The time when the snapshot is taken. If specified as
partition key, the result table(s) is partitoned by the
additional timestamp column, readTime. If [read_time] in
ExportAssetsRequest is specified, the readTime column's
value will be the same as it. Otherwise, its value will be
the current time that is used to take the snapshot.
REQUEST_TIME (2):
The time when the request is received and
started to be processed. If specified as
partition key, the result table(s) is partitoned
by the requestTime column, an additional
timestamp column representing when the request
was received.
"""
PARTITION_KEY_UNSPECIFIED = 0
READ_TIME = 1
Expand Down Expand Up @@ -1958,6 +1995,17 @@ class PartitionKey(proto.Enum):
reduce query cost by filtering partitions. Refer to
https://cloud.google.com/bigquery/docs/partitioned-tables for
details.
Values:
PARTITION_KEY_UNSPECIFIED (0):
Unspecified partition key. Tables won't be
partitioned using this option.
REQUEST_TIME (1):
The time when the request is received. If
specified as partition key, the result table(s)
is partitoned by the RequestTime column, an
additional timestamp column representing when
the request was received.
"""
PARTITION_KEY_UNSPECIFIED = 0
REQUEST_TIME = 1
Expand Down Expand Up @@ -2362,7 +2410,20 @@ class AnalyzeMoveRequest(proto.Message):
"""

class AnalysisView(proto.Enum):
r"""View enum for supporting partial analysis responses."""
r"""View enum for supporting partial analysis responses.
Values:
ANALYSIS_VIEW_UNSPECIFIED (0):
The default/unset value.
The API will default to the FULL view.
FULL (1):
Full analysis including all level of impacts
of the specified resource move.
BASIC (2):
Basic analysis only including blockers which
will prevent the specified resource move at
runtime.
"""
ANALYSIS_VIEW_UNSPECIFIED = 0
FULL = 1
BASIC = 2
Expand Down Expand Up @@ -3196,6 +3257,19 @@ class ConstraintDefault(proto.Enum):
r"""Specifies the default behavior in the absence of any ``Policy`` for
the ``Constraint``. This must not be
``CONSTRAINT_DEFAULT_UNSPECIFIED``.
Values:
CONSTRAINT_DEFAULT_UNSPECIFIED (0):
This is only used for distinguishing unset
values and should never be used.
ALLOW (1):
Indicate that all values are allowed for list
constraints. Indicate that enforcement is off
for boolean constraints.
DENY (2):
Indicate that all values are denied for list
constraints. Indicate that enforcement is on for
boolean constraints.
"""
CONSTRAINT_DEFAULT_UNSPECIFIED = 0
ALLOW = 1
Expand Down Expand Up @@ -3309,14 +3383,36 @@ class MethodType(proto.Enum):
If the constraint applies only when create VMs, the method_types
will be "CREATE" only. If the constraint applied when create or
delete VMs, the method_types will be "CREATE" and "DELETE".
Values:
METHOD_TYPE_UNSPECIFIED (0):
Unspecified. Will results in user error.
CREATE (1):
Constraint applied when creating the
resource.
UPDATE (2):
Constraint applied when updating the
resource.
DELETE (3):
Constraint applied when deleting the
resource.
"""
METHOD_TYPE_UNSPECIFIED = 0
CREATE = 1
UPDATE = 2
DELETE = 3

class ActionType(proto.Enum):
r"""Allow or deny type."""
r"""Allow or deny type.
Values:
ACTION_TYPE_UNSPECIFIED (0):
Unspecified. Will results in user error.
ALLOW (1):
Allowed action type.
DENY (2):
Deny action type.
"""
ACTION_TYPE_UNSPECIFIED = 0
ALLOW = 1
DENY = 2
Expand Down
30 changes: 28 additions & 2 deletions packages/google-cloud-asset/google/cloud/asset_v1/types/assets.py
Expand Up @@ -73,7 +73,20 @@ class TemporalAsset(proto.Message):
"""

class PriorAssetState(proto.Enum):
r"""State of prior asset."""
r"""State of prior asset.
Values:
PRIOR_ASSET_STATE_UNSPECIFIED (0):
prior_asset is not applicable for the current asset.
PRESENT (1):
prior_asset is populated correctly.
INVALID (2):
Failed to set prior_asset.
DOES_NOT_EXIST (3):
Current asset is the first known state.
DELETED (4):
prior_asset is a deletion.
"""
PRIOR_ASSET_STATE_UNSPECIFIED = 0
PRESENT = 1
INVALID = 2
Expand Down Expand Up @@ -1210,7 +1223,20 @@ class ConditionEvaluation(proto.Message):
"""

class EvaluationValue(proto.Enum):
r"""Value of this expression."""
r"""Value of this expression.
Values:
EVALUATION_VALUE_UNSPECIFIED (0):
Reserved for future use.
TRUE (1):
The evaluation result is ``true``.
FALSE (2):
The evaluation result is ``false``.
CONDITIONAL (3):
The evaluation result is ``conditional`` when the condition
expression contains variables that are either missing input
values or have not been supported by Analyzer yet.
"""
EVALUATION_VALUE_UNSPECIFIED = 0
TRUE = 1
FALSE = 2
Expand Down
Expand Up @@ -701,7 +701,7 @@ def sample_search_all_iam_policies():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "AssetServiceClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Expand Up @@ -969,7 +969,7 @@ def sample_delete_feed():
metadata=metadata,
)

def __enter__(self):
def __enter__(self) -> "AssetServiceClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Expand Up @@ -40,7 +40,16 @@


class ContentType(proto.Enum):
r"""Asset content type."""
r"""Asset content type.
Values:
CONTENT_TYPE_UNSPECIFIED (0):
Unspecified content type.
RESOURCE (1):
Resource metadata.
IAM_POLICY (2):
The actual IAM policy set on a resource.
"""
CONTENT_TYPE_UNSPECIFIED = 0
RESOURCE = 1
IAM_POLICY = 2
Expand Down
Expand Up @@ -594,7 +594,7 @@ def sample_list_assets():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "AssetServiceClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Expand Up @@ -32,7 +32,21 @@


class ContentType(proto.Enum):
r"""Asset content type."""
r"""Asset content type.
Values:
CONTENT_TYPE_UNSPECIFIED (0):
Unspecified content type.
RESOURCE (1):
Resource metadata.
IAM_POLICY (2):
The actual IAM policy set on a resource.
ORG_POLICY (4):
The organization policy set on an asset.
ACCESS_POLICY (5):
The Access Context Manager policy set on an
asset.
"""
CONTENT_TYPE_UNSPECIFIED = 0
RESOURCE = 1
IAM_POLICY = 2
Expand Down
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-asset",
"version": "3.17.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-asset",
"version": "3.17.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-asset",
"version": "3.17.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-asset",
"version": "3.17.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down

0 comments on commit 020023c

Please sign in to comment.