diff --git a/docs/gapic/v1p4beta1/api.rst b/docs/gapic/v1p4beta1/api.rst new file mode 100644 index 00000000..0b2ea17d --- /dev/null +++ b/docs/gapic/v1p4beta1/api.rst @@ -0,0 +1,6 @@ +Client for Cloud Asset API +========================== + +.. automodule:: google.cloud.asset_v1p4beta1 + :members: + :inherited-members: \ No newline at end of file diff --git a/docs/gapic/v1p4beta1/types.rst b/docs/gapic/v1p4beta1/types.rst new file mode 100644 index 00000000..2a08e2d5 --- /dev/null +++ b/docs/gapic/v1p4beta1/types.rst @@ -0,0 +1,5 @@ +Types for Cloud Asset API Client +================================ + +.. automodule:: google.cloud.asset_v1p4beta1.types + :members: \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index f97e2b65..dc07fbc5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -14,11 +14,11 @@ v1 gapic/v1/api gapic/v1/types -Beta releases with additional features over the current stable version, spelled ``v1p1beta1`` and ``v1p2beta1``, -are provided to allow you to use these new features. These are expected to move into the stable release soon; +Beta releases with additional features over the current stable version. These are expected to move into the stable release soon; until then, the usual beta admonishment (changes are possible, etc.) applies. -An API and type reference is provided for this beta: +In order to use it, you will want to import from +``google.cloud.asset_v1p4beta1`` in lieu of ``google.cloud.asset_v1``. v1p1beta1 ~~~~~~~~~ @@ -37,9 +37,16 @@ v1p2beta1 gapic/v1p2beta1/api gapic/v1p2beta1/types -The previous beta release, spelled ``v1beta1`` is also provided to continue to support code -previously written against it. In order to use it, you will want to import from -``google.cloud.asset_v1beta1`` in lieu of ``google.cloud.asset_v1``. + +v1p4beta1 +~~~~~~~~~ +.. toctree:: + :maxdepth: 2 + + gapic/v1p4beta1/api + gapic/v1p4beta1/types + + v1beta1 ~~~~~~~~~ diff --git a/google/cloud/asset_v1/gapic/asset_service_client.py b/google/cloud/asset_v1/gapic/asset_service_client.py index d8a70733..4be88395 100644 --- a/google/cloud/asset_v1/gapic/asset_service_client.py +++ b/google/cloud/asset_v1/gapic/asset_service_client.py @@ -338,12 +338,12 @@ def batch_get_assets_history( metadata=None, ): """ - Batch gets the update history of assets that overlap a time window. For - RESOURCE content, this API outputs history with asset in both non-delete - or deleted status. For IAM\_POLICY content, this API outputs history - when the asset and its attached IAM POLICY both exist. This can create - gaps in the output history. If a specified asset does not exist, this - API returns an INVALID\_ARGUMENT error. + Batch gets the update history of assets that overlap a time window. + For RESOURCE content, this API outputs history with asset in both + non-delete or deleted status. For IAM_POLICY content, this API outputs + history when the asset and its attached IAM POLICY both exist. This can + create gaps in the output history. If a specified asset does not exist, + this API returns an INVALID_ARGUMENT error. Example: >>> from google.cloud import asset_v1 @@ -367,12 +367,12 @@ def batch_get_assets_history( organization number (such as "organizations/123"), a project ID (such as "projects/my-project-id")", or a project number (such as "projects/12345"). content_type (~google.cloud.asset_v1.types.ContentType): Optional. The content type. - read_time_window (Union[dict, ~google.cloud.asset_v1.types.TimeWindow]): Optional. The time window for the asset history. Both start\_time and - end\_time are optional and if set, it must be after 2018-10-02 UTC. If - end\_time is not set, it is default to current timestamp. If start\_time - is not set, the snapshot of the assets at end\_time will be returned. - The returned results contain all temporal assets whose time window - overlap with read\_time\_window. + read_time_window (Union[dict, ~google.cloud.asset_v1.types.TimeWindow]): Optional. The time window for the asset history. Both start_time and + end_time are optional and if set, it must be after 2018-10-02 UTC. If + end_time is not set, it is default to current timestamp. If start_time + is not set, the snapshot of the assets at end_time will be returned. The + returned results contain all temporal assets whose time window overlap + with read_time_window. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1.types.TimeWindow` @@ -476,10 +476,11 @@ def create_feed( "projects/12345"). feed_id (str): Required. This is the client-assigned asset feed identifier and it needs to be unique under a specific parent project/folder/organization. - feed (Union[dict, ~google.cloud.asset_v1.types.Feed]): Required. The feed details. The field ``name`` must be empty and it will - be generated in the format of: projects/project\_number/feeds/feed\_id - folders/folder\_number/feeds/feed\_id - organizations/organization\_number/feeds/feed\_id + feed (Union[dict, ~google.cloud.asset_v1.types.Feed]): Required. The feed details. The field ``name`` must be empty and it + will be generated in the format of: + projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1.types.Feed` @@ -554,9 +555,9 @@ def get_feed( Args: name (str): Required. The name of the Feed and it must be in the format of: - projects/project\_number/feeds/feed\_id - folders/folder\_number/feeds/feed\_id - organizations/organization\_number/feeds/feed\_id + projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -702,17 +703,17 @@ def update_feed( >>> response = client.update_feed(feed, update_mask) Args: - feed (Union[dict, ~google.cloud.asset_v1.types.Feed]): Required. The new values of feed details. It must match an existing feed - and the field ``name`` must be in the format of: - projects/project\_number/feeds/feed\_id or - folders/folder\_number/feeds/feed\_id or - organizations/organization\_number/feeds/feed\_id. + feed (Union[dict, ~google.cloud.asset_v1.types.Feed]): Required. The new values of feed details. It must match an existing + feed and the field ``name`` must be in the format of: + projects/project_number/feeds/feed_id or + folders/folder_number/feeds/feed_id or + organizations/organization_number/feeds/feed_id. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1.types.Feed` - update_mask (Union[dict, ~google.cloud.asset_v1.types.FieldMask]): Required. Only updates the ``feed`` fields indicated by this mask. The - field mask must not be empty, and it must not contain fields that are - immutable or only set by the server. + update_mask (Union[dict, ~google.cloud.asset_v1.types.FieldMask]): Required. Only updates the ``feed`` fields indicated by this mask. + The field mask must not be empty, and it must not contain fields that + are immutable or only set by the server. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1.types.FieldMask` @@ -787,9 +788,9 @@ def delete_feed( Args: name (str): Required. The name of the feed and it must be in the format of: - projects/project\_number/feeds/feed\_id - folders/folder\_number/feeds/feed\_id - organizations/organization\_number/feeds/feed\_id + projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. diff --git a/google/cloud/asset_v1/gapic/enums.py b/google/cloud/asset_v1/gapic/enums.py index 6c394aab..c0f9fc85 100644 --- a/google/cloud/asset_v1/gapic/enums.py +++ b/google/cloud/asset_v1/gapic/enums.py @@ -40,8 +40,8 @@ class ContentType(enum.IntEnum): class NullValue(enum.IntEnum): """ - ``NullValue`` is a singleton enumeration to represent the null value for - the ``Value`` type union. + ``NullValue`` is a singleton enumeration to represent the null value + for the ``Value`` type union. The JSON representation for ``NullValue`` is JSON ``null``. diff --git a/google/cloud/asset_v1/gapic/transports/asset_service_grpc_transport.py b/google/cloud/asset_v1/gapic/transports/asset_service_grpc_transport.py index 47301928..9e8c0ecc 100644 --- a/google/cloud/asset_v1/gapic/transports/asset_service_grpc_transport.py +++ b/google/cloud/asset_v1/gapic/transports/asset_service_grpc_transport.py @@ -135,12 +135,12 @@ def export_assets(self): def batch_get_assets_history(self): """Return the gRPC stub for :meth:`AssetServiceClient.batch_get_assets_history`. - Batch gets the update history of assets that overlap a time window. For - RESOURCE content, this API outputs history with asset in both non-delete - or deleted status. For IAM\_POLICY content, this API outputs history - when the asset and its attached IAM POLICY both exist. This can create - gaps in the output history. If a specified asset does not exist, this - API returns an INVALID\_ARGUMENT error. + Batch gets the update history of assets that overlap a time window. + For RESOURCE content, this API outputs history with asset in both + non-delete or deleted status. For IAM_POLICY content, this API outputs + history when the asset and its attached IAM POLICY both exist. This can + create gaps in the output history. If a specified asset does not exist, + this API returns an INVALID_ARGUMENT error. Returns: Callable: A callable which accepts the appropriate diff --git a/google/cloud/asset_v1/proto/asset_service_pb2.py b/google/cloud/asset_v1/proto/asset_service_pb2.py index 8c6edb2a..46ef64f7 100644 --- a/google/cloud/asset_v1/proto/asset_service_pb2.py +++ b/google/cloud/asset_v1/proto/asset_service_pb2.py @@ -2,9 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/asset_v1/proto/asset_service.proto -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -35,12 +32,8 @@ name="google/cloud/asset_v1/proto/asset_service.proto", package="google.cloud.asset.v1", syntax="proto3", - serialized_options=_b( - "\n\031com.google.cloud.asset.v1B\021AssetServiceProtoP\001Z:google.golang.org/genproto/googleapis/cloud/asset/v1;asset\252\002\025Google.Cloud.Asset.V1\312\002\025Google\\Cloud\\Asset\\V1" - ), - serialized_pb=_b( - '\n/google/cloud/asset_v1/proto/asset_service.proto\x12\x15google.cloud.asset.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/asset_v1/proto/assets.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x8d\x02\n\x13\x45xportAssetsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudasset.googleapis.com/Asset\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0b\x61sset_types\x18\x03 \x03(\t\x12\x38\n\x0c\x63ontent_type\x18\x04 \x01(\x0e\x32".google.cloud.asset.v1.ContentType\x12?\n\routput_config\x18\x05 \x01(\x0b\x32#.google.cloud.asset.v1.OutputConfigB\x03\xe0\x41\x02"\x81\x01\n\x14\x45xportAssetsResponse\x12-\n\tread_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12:\n\routput_config\x18\x02 \x01(\x0b\x32#.google.cloud.asset.v1.OutputConfig"\xed\x01\n\x1c\x42\x61tchGetAssetsHistoryRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudasset.googleapis.com/Asset\x12\x13\n\x0b\x61sset_names\x18\x02 \x03(\t\x12=\n\x0c\x63ontent_type\x18\x03 \x01(\x0e\x32".google.cloud.asset.v1.ContentTypeB\x03\xe0\x41\x01\x12@\n\x10read_time_window\x18\x04 \x01(\x0b\x32!.google.cloud.asset.v1.TimeWindowB\x03\xe0\x41\x01"U\n\x1d\x42\x61tchGetAssetsHistoryResponse\x12\x34\n\x06\x61ssets\x18\x01 \x03(\x0b\x32$.google.cloud.asset.v1.TemporalAsset"n\n\x11\x43reateFeedRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x66\x65\x65\x64_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12.\n\x04\x66\x65\x65\x64\x18\x03 \x01(\x0b\x32\x1b.google.cloud.asset.v1.FeedB\x03\xe0\x41\x02"F\n\x0eGetFeedRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudasset.googleapis.com/Feed"\'\n\x10ListFeedsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02"?\n\x11ListFeedsResponse\x12*\n\x05\x66\x65\x65\x64s\x18\x01 \x03(\x0b\x32\x1b.google.cloud.asset.v1.Feed"y\n\x11UpdateFeedRequest\x12.\n\x04\x66\x65\x65\x64\x18\x01 \x01(\x0b\x32\x1b.google.cloud.asset.v1.FeedB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02"I\n\x11\x44\x65leteFeedRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudasset.googleapis.com/Feed"\xab\x01\n\x0cOutputConfig\x12@\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32%.google.cloud.asset.v1.GcsDestinationH\x00\x12J\n\x14\x62igquery_destination\x18\x02 \x01(\x0b\x32*.google.cloud.asset.v1.BigQueryDestinationH\x00\x42\r\n\x0b\x64\x65stination"C\n\x0eGcsDestination\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x14\n\nuri_prefix\x18\x02 \x01(\tH\x00\x42\x0c\n\nobject_uri"N\n\x13\x42igQueryDestination\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05table\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05\x66orce\x18\x03 \x01(\x08""\n\x11PubsubDestination\x12\r\n\x05topic\x18\x01 \x01(\t"i\n\x10\x46\x65\x65\x64OutputConfig\x12\x46\n\x12pubsub_destination\x18\x01 \x01(\x0b\x32(.google.cloud.asset.v1.PubsubDestinationH\x00\x42\r\n\x0b\x64\x65stination"\xdb\x02\n\x04\x46\x65\x65\x64\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x61sset_names\x18\x02 \x03(\t\x12\x13\n\x0b\x61sset_types\x18\x03 \x03(\t\x12\x38\n\x0c\x63ontent_type\x18\x04 \x01(\x0e\x32".google.cloud.asset.v1.ContentType\x12H\n\x12\x66\x65\x65\x64_output_config\x18\x05 \x01(\x0b\x32\'.google.cloud.asset.v1.FeedOutputConfigB\x03\xe0\x41\x02:\x91\x01\xea\x41\x8d\x01\n\x1e\x63loudasset.googleapis.com/Feed\x12\x1fprojects/{project}/feeds/{feed}\x12\x1d\x66olders/{folder}/feeds/{feed}\x12)organizations/{organization}/feeds/{feed} \x01*l\n\x0b\x43ontentType\x12\x1c\n\x18\x43ONTENT_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08RESOURCE\x10\x01\x12\x0e\n\nIAM_POLICY\x10\x02\x12\x0e\n\nORG_POLICY\x10\x04\x12\x11\n\rACCESS_POLICY\x10\x05\x32\xf0\x08\n\x0c\x41ssetService\x12\xde\x01\n\x0c\x45xportAssets\x12*.google.cloud.asset.v1.ExportAssetsRequest\x1a\x1d.google.longrunning.Operation"\x82\x01\x82\xd3\xe4\x93\x02""\x1d/v1/{parent=*/*}:exportAssets:\x01*\xca\x41W\n*google.cloud.asset.v1.ExportAssetsResponse\x12)google.cloud.asset.v1.ExportAssetsRequest\x12\xb2\x01\n\x15\x42\x61tchGetAssetsHistory\x12\x33.google.cloud.asset.v1.BatchGetAssetsHistoryRequest\x1a\x34.google.cloud.asset.v1.BatchGetAssetsHistoryResponse".\x82\xd3\xe4\x93\x02(\x12&/v1/{parent=*/*}:batchGetAssetsHistory\x12\x7f\n\nCreateFeed\x12(.google.cloud.asset.v1.CreateFeedRequest\x1a\x1b.google.cloud.asset.v1.Feed"*\x82\xd3\xe4\x93\x02\x1b"\x16/v1/{parent=*/*}/feeds:\x01*\xda\x41\x06parent\x12t\n\x07GetFeed\x12%.google.cloud.asset.v1.GetFeedRequest\x1a\x1b.google.cloud.asset.v1.Feed"%\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/{name=*/*/feeds/*}\xda\x41\x04name\x12\x87\x01\n\tListFeeds\x12\'.google.cloud.asset.v1.ListFeedsRequest\x1a(.google.cloud.asset.v1.ListFeedsResponse"\'\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/{parent=*/*}/feeds\xda\x41\x06parent\x12\x82\x01\n\nUpdateFeed\x12(.google.cloud.asset.v1.UpdateFeedRequest\x1a\x1b.google.cloud.asset.v1.Feed"-\x82\xd3\xe4\x93\x02 2\x1b/v1/{feed.name=*/*/feeds/*}:\x01*\xda\x41\x04\x66\x65\x65\x64\x12u\n\nDeleteFeed\x12(.google.cloud.asset.v1.DeleteFeedRequest\x1a\x16.google.protobuf.Empty"%\x82\xd3\xe4\x93\x02\x18*\x16/v1/{name=*/*/feeds/*}\xda\x41\x04name\x1aM\xca\x41\x19\x63loudasset.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x9c\x01\n\x19\x63om.google.cloud.asset.v1B\x11\x41ssetServiceProtoP\x01Z:google.golang.org/genproto/googleapis/cloud/asset/v1;asset\xaa\x02\x15Google.Cloud.Asset.V1\xca\x02\x15Google\\Cloud\\Asset\\V1b\x06proto3' - ), + serialized_options=b"\n\031com.google.cloud.asset.v1B\021AssetServiceProtoP\001Z:google.golang.org/genproto/googleapis/cloud/asset/v1;asset\252\002\025Google.Cloud.Asset.V1\312\002\025Google\\Cloud\\Asset\\V1", + serialized_pb=b'\n/google/cloud/asset_v1/proto/asset_service.proto\x12\x15google.cloud.asset.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/asset_v1/proto/assets.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x8d\x02\n\x13\x45xportAssetsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudasset.googleapis.com/Asset\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0b\x61sset_types\x18\x03 \x03(\t\x12\x38\n\x0c\x63ontent_type\x18\x04 \x01(\x0e\x32".google.cloud.asset.v1.ContentType\x12?\n\routput_config\x18\x05 \x01(\x0b\x32#.google.cloud.asset.v1.OutputConfigB\x03\xe0\x41\x02"\x81\x01\n\x14\x45xportAssetsResponse\x12-\n\tread_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12:\n\routput_config\x18\x02 \x01(\x0b\x32#.google.cloud.asset.v1.OutputConfig"\xed\x01\n\x1c\x42\x61tchGetAssetsHistoryRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudasset.googleapis.com/Asset\x12\x13\n\x0b\x61sset_names\x18\x02 \x03(\t\x12=\n\x0c\x63ontent_type\x18\x03 \x01(\x0e\x32".google.cloud.asset.v1.ContentTypeB\x03\xe0\x41\x01\x12@\n\x10read_time_window\x18\x04 \x01(\x0b\x32!.google.cloud.asset.v1.TimeWindowB\x03\xe0\x41\x01"U\n\x1d\x42\x61tchGetAssetsHistoryResponse\x12\x34\n\x06\x61ssets\x18\x01 \x03(\x0b\x32$.google.cloud.asset.v1.TemporalAsset"n\n\x11\x43reateFeedRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x66\x65\x65\x64_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12.\n\x04\x66\x65\x65\x64\x18\x03 \x01(\x0b\x32\x1b.google.cloud.asset.v1.FeedB\x03\xe0\x41\x02"F\n\x0eGetFeedRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudasset.googleapis.com/Feed"\'\n\x10ListFeedsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02"?\n\x11ListFeedsResponse\x12*\n\x05\x66\x65\x65\x64s\x18\x01 \x03(\x0b\x32\x1b.google.cloud.asset.v1.Feed"y\n\x11UpdateFeedRequest\x12.\n\x04\x66\x65\x65\x64\x18\x01 \x01(\x0b\x32\x1b.google.cloud.asset.v1.FeedB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02"I\n\x11\x44\x65leteFeedRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudasset.googleapis.com/Feed"\xab\x01\n\x0cOutputConfig\x12@\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32%.google.cloud.asset.v1.GcsDestinationH\x00\x12J\n\x14\x62igquery_destination\x18\x02 \x01(\x0b\x32*.google.cloud.asset.v1.BigQueryDestinationH\x00\x42\r\n\x0b\x64\x65stination"C\n\x0eGcsDestination\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x14\n\nuri_prefix\x18\x02 \x01(\tH\x00\x42\x0c\n\nobject_uri"N\n\x13\x42igQueryDestination\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05table\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05\x66orce\x18\x03 \x01(\x08""\n\x11PubsubDestination\x12\r\n\x05topic\x18\x01 \x01(\t"i\n\x10\x46\x65\x65\x64OutputConfig\x12\x46\n\x12pubsub_destination\x18\x01 \x01(\x0b\x32(.google.cloud.asset.v1.PubsubDestinationH\x00\x42\r\n\x0b\x64\x65stination"\xdb\x02\n\x04\x46\x65\x65\x64\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x61sset_names\x18\x02 \x03(\t\x12\x13\n\x0b\x61sset_types\x18\x03 \x03(\t\x12\x38\n\x0c\x63ontent_type\x18\x04 \x01(\x0e\x32".google.cloud.asset.v1.ContentType\x12H\n\x12\x66\x65\x65\x64_output_config\x18\x05 \x01(\x0b\x32\'.google.cloud.asset.v1.FeedOutputConfigB\x03\xe0\x41\x02:\x91\x01\xea\x41\x8d\x01\n\x1e\x63loudasset.googleapis.com/Feed\x12\x1fprojects/{project}/feeds/{feed}\x12\x1d\x66olders/{folder}/feeds/{feed}\x12)organizations/{organization}/feeds/{feed} \x01*l\n\x0b\x43ontentType\x12\x1c\n\x18\x43ONTENT_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08RESOURCE\x10\x01\x12\x0e\n\nIAM_POLICY\x10\x02\x12\x0e\n\nORG_POLICY\x10\x04\x12\x11\n\rACCESS_POLICY\x10\x05\x32\xf0\x08\n\x0c\x41ssetService\x12\xde\x01\n\x0c\x45xportAssets\x12*.google.cloud.asset.v1.ExportAssetsRequest\x1a\x1d.google.longrunning.Operation"\x82\x01\x82\xd3\xe4\x93\x02""\x1d/v1/{parent=*/*}:exportAssets:\x01*\xca\x41W\n*google.cloud.asset.v1.ExportAssetsResponse\x12)google.cloud.asset.v1.ExportAssetsRequest\x12\xb2\x01\n\x15\x42\x61tchGetAssetsHistory\x12\x33.google.cloud.asset.v1.BatchGetAssetsHistoryRequest\x1a\x34.google.cloud.asset.v1.BatchGetAssetsHistoryResponse".\x82\xd3\xe4\x93\x02(\x12&/v1/{parent=*/*}:batchGetAssetsHistory\x12\x7f\n\nCreateFeed\x12(.google.cloud.asset.v1.CreateFeedRequest\x1a\x1b.google.cloud.asset.v1.Feed"*\x82\xd3\xe4\x93\x02\x1b"\x16/v1/{parent=*/*}/feeds:\x01*\xda\x41\x06parent\x12t\n\x07GetFeed\x12%.google.cloud.asset.v1.GetFeedRequest\x1a\x1b.google.cloud.asset.v1.Feed"%\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/{name=*/*/feeds/*}\xda\x41\x04name\x12\x87\x01\n\tListFeeds\x12\'.google.cloud.asset.v1.ListFeedsRequest\x1a(.google.cloud.asset.v1.ListFeedsResponse"\'\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/{parent=*/*}/feeds\xda\x41\x06parent\x12\x82\x01\n\nUpdateFeed\x12(.google.cloud.asset.v1.UpdateFeedRequest\x1a\x1b.google.cloud.asset.v1.Feed"-\x82\xd3\xe4\x93\x02 2\x1b/v1/{feed.name=*/*/feeds/*}:\x01*\xda\x41\x04\x66\x65\x65\x64\x12u\n\nDeleteFeed\x12(.google.cloud.asset.v1.DeleteFeedRequest\x1a\x16.google.protobuf.Empty"%\x82\xd3\xe4\x93\x02\x18*\x16/v1/{name=*/*/feeds/*}\xda\x41\x04name\x1aM\xca\x41\x19\x63loudasset.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x9c\x01\n\x19\x63om.google.cloud.asset.v1B\x11\x41ssetServiceProtoP\x01Z:google.golang.org/genproto/googleapis/cloud/asset/v1;asset\xaa\x02\x15Google.Cloud.Asset.V1\xca\x02\x15Google\\Cloud\\Asset\\V1b\x06proto3', dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, google_dot_api_dot_client__pb2.DESCRIPTOR, @@ -111,15 +104,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A!\022\037cloudasset.googleapis.com/Asset" - ), + serialized_options=b"\340A\002\372A!\022\037cloudasset.googleapis.com/Asset", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -191,7 +182,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), ], @@ -281,15 +272,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A!\022\037cloudasset.googleapis.com/Asset" - ), + serialized_options=b"\340A\002\372A!\022\037cloudasset.googleapis.com/Asset", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -325,7 +314,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -343,7 +332,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, ), ], @@ -415,13 +404,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -433,13 +422,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -457,7 +446,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), ], @@ -490,15 +479,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036cloudasset.googleapis.com/Feed" - ), + serialized_options=b"\340A\002\372A \n\036cloudasset.googleapis.com/Feed", file=DESCRIPTOR, ) ], @@ -531,13 +518,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ) ], @@ -615,7 +602,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -633,7 +620,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), ], @@ -666,15 +653,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036cloudasset.googleapis.com/Feed" - ), + serialized_options=b"\340A\002\372A \n\036cloudasset.googleapis.com/Feed", file=DESCRIPTOR, ) ], @@ -772,7 +757,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -790,7 +775,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -837,13 +822,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -855,13 +840,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -912,7 +897,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -998,13 +983,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -1076,16 +1061,14 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), ], extensions=[], nested_types=[], enum_types=[], - serialized_options=_b( - "\352A\215\001\n\036cloudasset.googleapis.com/Feed\022\037projects/{project}/feeds/{feed}\022\035folders/{folder}/feeds/{feed}\022)organizations/{organization}/feeds/{feed} \001" - ), + serialized_options=b"\352A\215\001\n\036cloudasset.googleapis.com/Feed\022\037projects/{project}/feeds/{feed}\022\035folders/{folder}/feeds/{feed}\022)organizations/{organization}/feeds/{feed} \001", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -1177,19 +1160,19 @@ ExportAssetsRequest = _reflection.GeneratedProtocolMessageType( "ExportAssetsRequest", (_message.Message,), - dict( - DESCRIPTOR=_EXPORTASSETSREQUEST, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""Export asset request. + { + "DESCRIPTOR": _EXPORTASSETSREQUEST, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """Export asset request. Attributes: parent: Required. The relative name of the root asset. This can only - be an organization number (such as "organizations/123"), a - project ID (such as "projects/my-project-id"), or a project - number (such as "projects/12345"), or a folder number (such as - "folders/123"). + be an organization number (such as “organizations/123”), a + project ID (such as “projects/my-project-id”), or a project + number (such as “projects/12345”), or a folder number (such as + “folders/123”). read_time: Timestamp to take an asset snapshot. This can only be set to a timestamp between 2018-10-02 UTC (inclusive) and the current @@ -1199,7 +1182,7 @@ different results. asset_types: A list of asset types of which to take a snapshot for. For - example: "compute.googleapis.com/Disk". If specified, only + example: “compute.googleapis.com/Disk”. If specified, only matching assets will be returned. See `Introduction to Cloud Asset Inventory `__ for all supported asset types. @@ -1212,17 +1195,17 @@ JSON format. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.ExportAssetsRequest) - ), + }, ) _sym_db.RegisterMessage(ExportAssetsRequest) ExportAssetsResponse = _reflection.GeneratedProtocolMessageType( "ExportAssetsResponse", (_message.Message,), - dict( - DESCRIPTOR=_EXPORTASSETSRESPONSE, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""The export asset response. This message is returned by the + { + "DESCRIPTOR": _EXPORTASSETSRESPONSE, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """The export asset response. This message is returned by the [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned [google.longrunning.Operation.response][google.longrunning.Operation.response] @@ -1237,25 +1220,25 @@ to. All results are in JSON format. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.ExportAssetsResponse) - ), + }, ) _sym_db.RegisterMessage(ExportAssetsResponse) BatchGetAssetsHistoryRequest = _reflection.GeneratedProtocolMessageType( "BatchGetAssetsHistoryRequest", (_message.Message,), - dict( - DESCRIPTOR=_BATCHGETASSETSHISTORYREQUEST, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""Batch get assets history request. + { + "DESCRIPTOR": _BATCHGETASSETSHISTORYREQUEST, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """Batch get assets history request. Attributes: parent: Required. The relative name of the root asset. It can only be - an organization number (such as "organizations/123"), a - project ID (such as "projects/my-project-id")", or a project - number (such as "projects/12345"). + an organization number (such as “organizations/123”), a + project ID (such as “projects/my-project-id”)“, or a project + number (such as”projects/12345"). asset_names: A list of the full names of the assets. For example: ``//compu te.googleapis.com/projects/my_project_123/zones/zone1/instance @@ -1269,25 +1252,25 @@ Optional. The content type. read_time_window: Optional. The time window for the asset history. Both - start\_time and end\_time are optional and if set, it must be - after 2018-10-02 UTC. If end\_time is not set, it is default - to current timestamp. If start\_time is not set, the snapshot - of the assets at end\_time will be returned. The returned - results contain all temporal assets whose time window overlap - with read\_time\_window. + start_time and end_time are optional and if set, it must be + after 2018-10-02 UTC. If end_time is not set, it is default to + current timestamp. If start_time is not set, the snapshot of + the assets at end_time will be returned. The returned results + contain all temporal assets whose time window overlap with + read_time_window. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.BatchGetAssetsHistoryRequest) - ), + }, ) _sym_db.RegisterMessage(BatchGetAssetsHistoryRequest) BatchGetAssetsHistoryResponse = _reflection.GeneratedProtocolMessageType( "BatchGetAssetsHistoryResponse", (_message.Message,), - dict( - DESCRIPTOR=_BATCHGETASSETSHISTORYRESPONSE, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""Batch get assets history response. + { + "DESCRIPTOR": _BATCHGETASSETSHISTORYRESPONSE, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """Batch get assets history response. Attributes: @@ -1295,26 +1278,26 @@ A list of assets with valid time windows. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.BatchGetAssetsHistoryResponse) - ), + }, ) _sym_db.RegisterMessage(BatchGetAssetsHistoryResponse) CreateFeedRequest = _reflection.GeneratedProtocolMessageType( "CreateFeedRequest", (_message.Message,), - dict( - DESCRIPTOR=_CREATEFEEDREQUEST, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""Create asset feed request. + { + "DESCRIPTOR": _CREATEFEEDREQUEST, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """Create asset feed request. Attributes: parent: Required. The name of the project/folder/organization where this feed should be created in. It can only be an organization - number (such as "organizations/123"), a folder number (such as - "folders/123"), a project ID (such as "projects/my-project- - id")", or a project number (such as "projects/12345"). + number (such as “organizations/123”), a folder number (such as + “folders/123”), a project ID (such as “projects/my-project- + id”)“, or a project number (such as”projects/12345"). feed_id: Required. This is the client-assigned asset feed identifier and it needs to be unique under a specific parent @@ -1322,125 +1305,125 @@ feed: Required. The feed details. The field ``name`` must be empty and it will be generated in the format of: - projects/project\_number/feeds/feed\_id - folders/folder\_number/feeds/feed\_id - organizations/organization\_number/feeds/feed\_id + projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.CreateFeedRequest) - ), + }, ) _sym_db.RegisterMessage(CreateFeedRequest) GetFeedRequest = _reflection.GeneratedProtocolMessageType( "GetFeedRequest", (_message.Message,), - dict( - DESCRIPTOR=_GETFEEDREQUEST, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""Get asset feed request. + { + "DESCRIPTOR": _GETFEEDREQUEST, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """Get asset feed request. Attributes: name: Required. The name of the Feed and it must be in the format - of: projects/project\_number/feeds/feed\_id - folders/folder\_number/feeds/feed\_id - organizations/organization\_number/feeds/feed\_id + of: projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.GetFeedRequest) - ), + }, ) _sym_db.RegisterMessage(GetFeedRequest) ListFeedsRequest = _reflection.GeneratedProtocolMessageType( "ListFeedsRequest", (_message.Message,), - dict( - DESCRIPTOR=_LISTFEEDSREQUEST, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""List asset feeds request. + { + "DESCRIPTOR": _LISTFEEDSREQUEST, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """List asset feeds request. Attributes: parent: Required. The parent project/folder/organization whose feeds are to be listed. It can only be using - project/folder/organization number (such as "folders/12345")", - or a project ID (such as "projects/my-project-id"). + project/folder/organization number (such as “folders/12345”)“, + or a project ID (such as”projects/my-project-id"). """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.ListFeedsRequest) - ), + }, ) _sym_db.RegisterMessage(ListFeedsRequest) ListFeedsResponse = _reflection.GeneratedProtocolMessageType( "ListFeedsResponse", (_message.Message,), - dict( - DESCRIPTOR=_LISTFEEDSRESPONSE, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__=""" + { + "DESCRIPTOR": _LISTFEEDSRESPONSE, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """ Attributes: feeds: A list of feeds. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.ListFeedsResponse) - ), + }, ) _sym_db.RegisterMessage(ListFeedsResponse) UpdateFeedRequest = _reflection.GeneratedProtocolMessageType( "UpdateFeedRequest", (_message.Message,), - dict( - DESCRIPTOR=_UPDATEFEEDREQUEST, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""Update asset feed request. + { + "DESCRIPTOR": _UPDATEFEEDREQUEST, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """Update asset feed request. Attributes: feed: Required. The new values of feed details. It must match an existing feed and the field ``name`` must be in the format of: - projects/project\_number/feeds/feed\_id or - folders/folder\_number/feeds/feed\_id or - organizations/organization\_number/feeds/feed\_id. + projects/project_number/feeds/feed_id or + folders/folder_number/feeds/feed_id or + organizations/organization_number/feeds/feed_id. update_mask: Required. Only updates the ``feed`` fields indicated by this mask. The field mask must not be empty, and it must not contain fields that are immutable or only set by the server. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.UpdateFeedRequest) - ), + }, ) _sym_db.RegisterMessage(UpdateFeedRequest) DeleteFeedRequest = _reflection.GeneratedProtocolMessageType( "DeleteFeedRequest", (_message.Message,), - dict( - DESCRIPTOR=_DELETEFEEDREQUEST, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__=""" + { + "DESCRIPTOR": _DELETEFEEDREQUEST, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """ Attributes: name: Required. The name of the feed and it must be in the format - of: projects/project\_number/feeds/feed\_id - folders/folder\_number/feeds/feed\_id - organizations/organization\_number/feeds/feed\_id + of: projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.DeleteFeedRequest) - ), + }, ) _sym_db.RegisterMessage(DeleteFeedRequest) OutputConfig = _reflection.GeneratedProtocolMessageType( "OutputConfig", (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""Output configuration for export assets destination. + { + "DESCRIPTOR": _OUTPUTCONFIG, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """Output configuration for export assets destination. Attributes: @@ -1450,62 +1433,62 @@ Destination on Cloud Storage. bigquery_destination: Destination on BigQuery. The output table stores the fields in - asset proto as columns in BigQuery. The resource/iam\_policy + asset proto as columns in BigQuery. The resource/iam_policy field is converted to a record with each field to a column, except metadata to a single JSON string. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.OutputConfig) - ), + }, ) _sym_db.RegisterMessage(OutputConfig) GcsDestination = _reflection.GeneratedProtocolMessageType( "GcsDestination", (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""A Cloud Storage location. + { + "DESCRIPTOR": _GCSDESTINATION, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """A Cloud Storage location. Attributes: object_uri: Required. uri: - The uri of the Cloud Storage object. It's the same uri that is - used by gsutil. For example: "gs://bucket\_name/object\_name". + The uri of the Cloud Storage object. It’s the same uri that is + used by gsutil. For example: “gs://bucket_name/object_name”. See `Viewing and Editing Object Metadata `__ for more information. uri_prefix: The uri prefix of all generated Cloud Storage objects. For - example: "gs://bucket\_name/object\_name\_prefix". Each object - uri is in format: "gs://bucket\_name/object\_name\_prefix// - and only contains assets for that type. starts from 0. For - example: "gs://bucket\_name/object\_name\_prefix/compute.googl - eapis.com/Disk/0" is the first shard of output objects - containing all compute.googleapis.com/Disk assets. An - INVALID\_ARGUMENT error will be returned if file with the same - name "gs://bucket\_name/object\_name\_prefix" already exists. + example: “gs://bucket_name/object_name_prefix”. Each object + uri is in format: “gs://bucket_name/object_name_prefix// and + only contains assets for that type. starts from 0. For example + :”gs://bucket_name/object_name_prefix/compute.googleapis.com/D + isk/0" is the first shard of output objects containing all + compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error + will be returned if file with the same name + “gs://bucket_name/object_name_prefix” already exists. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.GcsDestination) - ), + }, ) _sym_db.RegisterMessage(GcsDestination) BigQueryDestination = _reflection.GeneratedProtocolMessageType( "BigQueryDestination", (_message.Message,), - dict( - DESCRIPTOR=_BIGQUERYDESTINATION, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""A BigQuery destination. + { + "DESCRIPTOR": _BIGQUERYDESTINATION, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """A BigQuery destination. Attributes: dataset: Required. The BigQuery dataset in format - "projects/projectId/datasets/datasetId", to which the snapshot + “projects/projectId/datasets/datasetId”, to which the snapshot result should be exported. If this dataset does not exist, the export call returns an error. table: @@ -1519,17 +1502,17 @@ table already exists, the export call returns an error. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.BigQueryDestination) - ), + }, ) _sym_db.RegisterMessage(BigQueryDestination) PubsubDestination = _reflection.GeneratedProtocolMessageType( "PubsubDestination", (_message.Message,), - dict( - DESCRIPTOR=_PUBSUBDESTINATION, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""A Cloud Pubsub destination. + { + "DESCRIPTOR": _PUBSUBDESTINATION, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """A Cloud Pubsub destination. Attributes: @@ -1538,17 +1521,17 @@ example: ``projects/PROJECT_ID/topics/TOPIC_ID``. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.PubsubDestination) - ), + }, ) _sym_db.RegisterMessage(PubsubDestination) FeedOutputConfig = _reflection.GeneratedProtocolMessageType( "FeedOutputConfig", (_message.Message,), - dict( - DESCRIPTOR=_FEEDOUTPUTCONFIG, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""Output configuration for asset feed destination. + { + "DESCRIPTOR": _FEEDOUTPUTCONFIG, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """Output configuration for asset feed destination. Attributes: @@ -1558,17 +1541,17 @@ Destination on Cloud Pubsub. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.FeedOutputConfig) - ), + }, ) _sym_db.RegisterMessage(FeedOutputConfig) Feed = _reflection.GeneratedProtocolMessageType( "Feed", (_message.Message,), - dict( - DESCRIPTOR=_FEED, - __module__="google.cloud.asset_v1.proto.asset_service_pb2", - __doc__="""An asset feed used to export asset updates to a + { + "DESCRIPTOR": _FEED, + "__module__": "google.cloud.asset_v1.proto.asset_service_pb2", + "__doc__": """An asset feed used to export asset updates to a destinations. An asset feed filter controls what updates are exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: Cloud Pub/Sub topics. @@ -1577,28 +1560,27 @@ Attributes: name: Required. The format will be - projects/{project\_number}/feeds/{client- - assigned\_feed\_identifier} or - folders/{folder\_number}/feeds/{client- - assigned\_feed\_identifier} or - organizations/{organization\_number}/feeds/{client- - assigned\_feed\_identifier} The client-assigned feed - identifier must be unique within the parent - project/folder/organization. + projects/{project_number}/feeds/{client- + assigned_feed_identifier} or + folders/{folder_number}/feeds/{client- + assigned_feed_identifier} or + organizations/{organization_number}/feeds/{client- + assigned_feed_identifier} The client-assigned feed identifier + must be unique within the parent project/folder/organization. asset_names: A list of the full names of the assets to receive updates. You - must specify either or both of asset\_names and asset\_types. - Only asset updates matching specified asset\_names and - asset\_types are exported to the feed. For example: ``//comput - e.googleapis.com/projects/my_project_123/zones/zone1/instances - /instance1``. See `Resource Names `__ for more info. + must specify either or both of asset_names and asset_types. + Only asset updates matching specified asset_names and + asset_types are exported to the feed. For example: ``//compute + .googleapis.com/projects/my_project_123/zones/zone1/instances/ + instance1``. See `Resource Names `__ for more info. asset_types: A list of types of the assets to receive updates. You must - specify either or both of asset\_names and asset\_types. Only - asset updates matching specified asset\_names and asset\_types + specify either or both of asset_names and asset_types. Only + asset updates matching specified asset_names and asset_types are exported to the feed. For example: - "compute.googleapis.com/Disk" See `Introduction to Cloud Asset + “compute.googleapis.com/Disk” See `Introduction to Cloud Asset Inventory `__ for all supported asset types. @@ -1610,7 +1592,7 @@ updates are published to. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.Feed) - ), + }, ) _sym_db.RegisterMessage(Feed) @@ -1640,9 +1622,7 @@ full_name="google.cloud.asset.v1.AssetService", file=DESCRIPTOR, index=0, - serialized_options=_b( - "\312A\031cloudasset.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), + serialized_options=b"\312A\031cloudasset.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform", serialized_start=2510, serialized_end=3646, methods=[ @@ -1653,9 +1633,7 @@ containing_service=None, input_type=_EXPORTASSETSREQUEST, output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002""\035/v1/{parent=*/*}:exportAssets:\001*\312AW\n*google.cloud.asset.v1.ExportAssetsResponse\022)google.cloud.asset.v1.ExportAssetsRequest' - ), + serialized_options=b'\202\323\344\223\002""\035/v1/{parent=*/*}:exportAssets:\001*\312AW\n*google.cloud.asset.v1.ExportAssetsResponse\022)google.cloud.asset.v1.ExportAssetsRequest', ), _descriptor.MethodDescriptor( name="BatchGetAssetsHistory", @@ -1664,9 +1642,7 @@ containing_service=None, input_type=_BATCHGETASSETSHISTORYREQUEST, output_type=_BATCHGETASSETSHISTORYRESPONSE, - serialized_options=_b( - "\202\323\344\223\002(\022&/v1/{parent=*/*}:batchGetAssetsHistory" - ), + serialized_options=b"\202\323\344\223\002(\022&/v1/{parent=*/*}:batchGetAssetsHistory", ), _descriptor.MethodDescriptor( name="CreateFeed", @@ -1675,9 +1651,7 @@ containing_service=None, input_type=_CREATEFEEDREQUEST, output_type=_FEED, - serialized_options=_b( - '\202\323\344\223\002\033"\026/v1/{parent=*/*}/feeds:\001*\332A\006parent' - ), + serialized_options=b'\202\323\344\223\002\033"\026/v1/{parent=*/*}/feeds:\001*\332A\006parent', ), _descriptor.MethodDescriptor( name="GetFeed", @@ -1686,9 +1660,7 @@ containing_service=None, input_type=_GETFEEDREQUEST, output_type=_FEED, - serialized_options=_b( - "\202\323\344\223\002\030\022\026/v1/{name=*/*/feeds/*}\332A\004name" - ), + serialized_options=b"\202\323\344\223\002\030\022\026/v1/{name=*/*/feeds/*}\332A\004name", ), _descriptor.MethodDescriptor( name="ListFeeds", @@ -1697,9 +1669,7 @@ containing_service=None, input_type=_LISTFEEDSREQUEST, output_type=_LISTFEEDSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002\030\022\026/v1/{parent=*/*}/feeds\332A\006parent" - ), + serialized_options=b"\202\323\344\223\002\030\022\026/v1/{parent=*/*}/feeds\332A\006parent", ), _descriptor.MethodDescriptor( name="UpdateFeed", @@ -1708,9 +1678,7 @@ containing_service=None, input_type=_UPDATEFEEDREQUEST, output_type=_FEED, - serialized_options=_b( - "\202\323\344\223\002 2\033/v1/{feed.name=*/*/feeds/*}:\001*\332A\004feed" - ), + serialized_options=b"\202\323\344\223\002 2\033/v1/{feed.name=*/*/feeds/*}:\001*\332A\004feed", ), _descriptor.MethodDescriptor( name="DeleteFeed", @@ -1719,9 +1687,7 @@ containing_service=None, input_type=_DELETEFEEDREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002\030*\026/v1/{name=*/*/feeds/*}\332A\004name" - ), + serialized_options=b"\202\323\344\223\002\030*\026/v1/{name=*/*/feeds/*}\332A\004name", ), ], ) diff --git a/google/cloud/asset_v1/proto/assets_pb2.py b/google/cloud/asset_v1/proto/assets_pb2.py index b3f9b943..75314cf0 100644 --- a/google/cloud/asset_v1/proto/assets_pb2.py +++ b/google/cloud/asset_v1/proto/assets_pb2.py @@ -2,9 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/asset_v1/proto/assets.proto -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -27,12 +24,8 @@ name="google/cloud/asset_v1/proto/assets.proto", package="google.cloud.asset.v1", syntax="proto3", - serialized_options=_b( - "\n\031com.google.cloud.asset.v1B\nAssetProtoP\001Z:google.golang.org/genproto/googleapis/cloud/asset/v1;asset\370\001\001\252\002\025Google.Cloud.Asset.V1\312\002\025Google\\Cloud\\Asset\\V1" - ), - serialized_pb=_b( - '\n(google/cloud/asset_v1/proto/assets.proto\x12\x15google.cloud.asset.v1\x1a\x19google/api/resource.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\x80\x01\n\rTemporalAsset\x12\x31\n\x06window\x18\x01 \x01(\x0b\x32!.google.cloud.asset.v1.TimeWindow\x12\x0f\n\x07\x64\x65leted\x18\x02 \x01(\x08\x12+\n\x05\x61sset\x18\x03 \x01(\x0b\x32\x1c.google.cloud.asset.v1.Asset"j\n\nTimeWindow\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\xc3\x01\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nasset_type\x18\x02 \x01(\t\x12\x31\n\x08resource\x18\x03 \x01(\x0b\x32\x1f.google.cloud.asset.v1.Resource\x12)\n\niam_policy\x18\x04 \x01(\x0b\x32\x15.google.iam.v1.Policy\x12\x11\n\tancestors\x18\n \x03(\t:\'\xea\x41$\n\x1f\x63loudasset.googleapis.com/Asset\x12\x01*"\xa0\x01\n\x08Resource\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x1e\n\x16\x64iscovery_document_uri\x18\x02 \x01(\t\x12\x16\n\x0e\x64iscovery_name\x18\x03 \x01(\t\x12\x14\n\x0cresource_url\x18\x04 \x01(\t\x12\x0e\n\x06parent\x18\x05 \x01(\t\x12%\n\x04\x64\x61ta\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\x98\x01\n\x19\x63om.google.cloud.asset.v1B\nAssetProtoP\x01Z:google.golang.org/genproto/googleapis/cloud/asset/v1;asset\xf8\x01\x01\xaa\x02\x15Google.Cloud.Asset.V1\xca\x02\x15Google\\Cloud\\Asset\\V1b\x06proto3' - ), + serialized_options=b"\n\031com.google.cloud.asset.v1B\nAssetProtoP\001Z:google.golang.org/genproto/googleapis/cloud/asset/v1;asset\370\001\001\252\002\025Google.Cloud.Asset.V1\312\002\025Google\\Cloud\\Asset\\V1", + serialized_pb=b'\n(google/cloud/asset_v1/proto/assets.proto\x12\x15google.cloud.asset.v1\x1a\x19google/api/resource.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\x80\x01\n\rTemporalAsset\x12\x31\n\x06window\x18\x01 \x01(\x0b\x32!.google.cloud.asset.v1.TimeWindow\x12\x0f\n\x07\x64\x65leted\x18\x02 \x01(\x08\x12+\n\x05\x61sset\x18\x03 \x01(\x0b\x32\x1c.google.cloud.asset.v1.Asset"j\n\nTimeWindow\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\xc3\x01\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nasset_type\x18\x02 \x01(\t\x12\x31\n\x08resource\x18\x03 \x01(\x0b\x32\x1f.google.cloud.asset.v1.Resource\x12)\n\niam_policy\x18\x04 \x01(\x0b\x32\x15.google.iam.v1.Policy\x12\x11\n\tancestors\x18\n \x03(\t:\'\xea\x41$\n\x1f\x63loudasset.googleapis.com/Asset\x12\x01*"\xa0\x01\n\x08Resource\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x1e\n\x16\x64iscovery_document_uri\x18\x02 \x01(\t\x12\x16\n\x0e\x64iscovery_name\x18\x03 \x01(\t\x12\x14\n\x0cresource_url\x18\x04 \x01(\t\x12\x0e\n\x06parent\x18\x05 \x01(\t\x12%\n\x04\x64\x61ta\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\x98\x01\n\x19\x63om.google.cloud.asset.v1B\nAssetProtoP\x01Z:google.golang.org/genproto/googleapis/cloud/asset/v1;asset\xf8\x01\x01\xaa\x02\x15Google.Cloud.Asset.V1\xca\x02\x15Google\\Cloud\\Asset\\V1b\x06proto3', dependencies=[ google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_iam_dot_v1_dot_policy__pb2.DESCRIPTOR, @@ -192,7 +185,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -210,7 +203,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -277,7 +270,7 @@ extensions=[], nested_types=[], enum_types=[], - serialized_options=_b("\352A$\n\037cloudasset.googleapis.com/Asset\022\001*"), + serialized_options=b"\352A$\n\037cloudasset.googleapis.com/Asset\022\001*", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -303,7 +296,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -321,7 +314,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -339,7 +332,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -357,7 +350,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -375,7 +368,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -441,10 +434,10 @@ TemporalAsset = _reflection.GeneratedProtocolMessageType( "TemporalAsset", (_message.Message,), - dict( - DESCRIPTOR=_TEMPORALASSET, - __module__="google.cloud.asset_v1.proto.assets_pb2", - __doc__="""Temporal asset. In addition to the asset, the temporal + { + "DESCRIPTOR": _TEMPORALASSET, + "__module__": "google.cloud.asset_v1.proto.assets_pb2", + "__doc__": """Temporal asset. In addition to the asset, the temporal asset includes the status of the asset and valid from and to time of it. @@ -457,17 +450,17 @@ Asset. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.TemporalAsset) - ), + }, ) _sym_db.RegisterMessage(TemporalAsset) TimeWindow = _reflection.GeneratedProtocolMessageType( "TimeWindow", (_message.Message,), - dict( - DESCRIPTOR=_TIMEWINDOW, - __module__="google.cloud.asset_v1.proto.assets_pb2", - __doc__="""A time window of (start\_time, end\_time]. + { + "DESCRIPTOR": _TIMEWINDOW, + "__module__": "google.cloud.asset_v1.proto.assets_pb2", + "__doc__": """A time window of (start_time, end_time]. Attributes: @@ -478,17 +471,17 @@ not specified. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.TimeWindow) - ), + }, ) _sym_db.RegisterMessage(TimeWindow) Asset = _reflection.GeneratedProtocolMessageType( "Asset", (_message.Message,), - dict( - DESCRIPTOR=_ASSET, - __module__="google.cloud.asset_v1.proto.assets_pb2", - __doc__="""Cloud asset. This includes all Google Cloud Platform + { + "DESCRIPTOR": _ASSET, + "__module__": "google.cloud.asset_v1.proto.assets_pb2", + "__doc__": """Cloud asset. This includes all Google Cloud Platform resources, Cloud IAM policies, and other non-GCP assets. @@ -500,7 +493,7 @@ See https://cloud.google.com/apis/design/resource_names#full_resource_name for more information. asset_type: - Type of the asset. Example: "compute.googleapis.com/Disk". + Type of the asset. Example: “compute.googleapis.com/Disk”. resource: Representation of the resource. iam_policy: @@ -508,39 +501,39 @@ resource. For each resource, there must be at most one Cloud IAM policy set on it. ancestors: - Asset's ancestry path in Cloud Resource Manager (CRM) + Asset’s ancestry path in Cloud Resource Manager (CRM) hierarchy, represented as a list of relative resource names. Ancestry path starts with the closest CRM ancestor and ends at root. If the asset is a CRM project/folder/organization, this - starts from the asset itself. Example: ["projects/123456789", - "folders/5432", "organizations/1234"] + starts from the asset itself. Example: [“projects/123456789”, + “folders/5432”, “organizations/1234”] """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.Asset) - ), + }, ) _sym_db.RegisterMessage(Asset) Resource = _reflection.GeneratedProtocolMessageType( "Resource", (_message.Message,), - dict( - DESCRIPTOR=_RESOURCE, - __module__="google.cloud.asset_v1.proto.assets_pb2", - __doc__="""Representation of a cloud resource. + { + "DESCRIPTOR": _RESOURCE, + "__module__": "google.cloud.asset_v1.proto.assets_pb2", + "__doc__": """Representation of a cloud resource. Attributes: version: - The API version. Example: "v1". + The API version. Example: “v1”. discovery_document_uri: - The URL of the discovery document containing the resource's + The URL of the discovery document containing the resource’s JSON schema. For example: ``"https://www.googleapis.com/discov ery/v1/apis/compute/v1/rest"``. It will be left unspecified for resources without a discovery-based API, such as Cloud Bigtable. discovery_name: The JSON schema name listed in the discovery document. - Example: "Project". It will be left unspecified for resources + Example: “Project”. It will be left unspecified for resources (such as Cloud Bigtable) without a discovery-based API. resource_url: The REST URL for accessing the resource. An HTTP GET operation @@ -562,7 +555,7 @@ are scrubbed away and may not be present. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1.Resource) - ), + }, ) _sym_db.RegisterMessage(Resource) diff --git a/google/cloud/asset_v1beta1/gapic/asset_service_client.py b/google/cloud/asset_v1beta1/gapic/asset_service_client.py index 3a615892..58956ba2 100644 --- a/google/cloud/asset_v1beta1/gapic/asset_service_client.py +++ b/google/cloud/asset_v1beta1/gapic/asset_service_client.py @@ -328,12 +328,12 @@ def batch_get_assets_history( metadata=None, ): """ - Batch gets the update history of assets that overlap a time window. For - RESOURCE content, this API outputs history with asset in both non-delete - or deleted status. For IAM\_POLICY content, this API outputs history - when the asset and its attached IAM POLICY both exist. This can create - gaps in the output history. If a specified asset does not exist, this - API returns an INVALID\_ARGUMENT error. + Batch gets the update history of assets that overlap a time window. + For RESOURCE content, this API outputs history with asset in both + non-delete or deleted status. For IAM_POLICY content, this API outputs + history when the asset and its attached IAM POLICY both exist. This can + create gaps in the output history. If a specified asset does not exist, + this API returns an INVALID_ARGUMENT error. Example: >>> from google.cloud import asset_v1beta1 @@ -356,12 +356,12 @@ def batch_get_assets_history( organization number (such as "organizations/123"), a project ID (such as "projects/my-project-id")", or a project number (such as "projects/12345"). content_type (~google.cloud.asset_v1beta1.types.ContentType): Optional. The content type. - read_time_window (Union[dict, ~google.cloud.asset_v1beta1.types.TimeWindow]): Optional. The time window for the asset history. Both start\_time and - end\_time are optional and if set, it must be after 2018-10-02 UTC. If - end\_time is not set, it is default to current timestamp. If start\_time - is not set, the snapshot of the assets at end\_time will be returned. - The returned results contain all temporal assets whose time window - overlap with read\_time\_window. + read_time_window (Union[dict, ~google.cloud.asset_v1beta1.types.TimeWindow]): Optional. The time window for the asset history. Both start_time and + end_time are optional and if set, it must be after 2018-10-02 UTC. If + end_time is not set, it is default to current timestamp. If start_time + is not set, the snapshot of the assets at end_time will be returned. The + returned results contain all temporal assets whose time window overlap + with read_time_window. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1beta1.types.TimeWindow` diff --git a/google/cloud/asset_v1beta1/gapic/enums.py b/google/cloud/asset_v1beta1/gapic/enums.py index aa17ba4b..272f5f3a 100644 --- a/google/cloud/asset_v1beta1/gapic/enums.py +++ b/google/cloud/asset_v1beta1/gapic/enums.py @@ -36,8 +36,8 @@ class ContentType(enum.IntEnum): class NullValue(enum.IntEnum): """ - ``NullValue`` is a singleton enumeration to represent the null value for - the ``Value`` type union. + ``NullValue`` is a singleton enumeration to represent the null value + for the ``Value`` type union. The JSON representation for ``NullValue`` is JSON ``null``. diff --git a/google/cloud/asset_v1beta1/gapic/transports/asset_service_grpc_transport.py b/google/cloud/asset_v1beta1/gapic/transports/asset_service_grpc_transport.py index abe776b7..ec983c27 100644 --- a/google/cloud/asset_v1beta1/gapic/transports/asset_service_grpc_transport.py +++ b/google/cloud/asset_v1beta1/gapic/transports/asset_service_grpc_transport.py @@ -135,12 +135,12 @@ def export_assets(self): def batch_get_assets_history(self): """Return the gRPC stub for :meth:`AssetServiceClient.batch_get_assets_history`. - Batch gets the update history of assets that overlap a time window. For - RESOURCE content, this API outputs history with asset in both non-delete - or deleted status. For IAM\_POLICY content, this API outputs history - when the asset and its attached IAM POLICY both exist. This can create - gaps in the output history. If a specified asset does not exist, this - API returns an INVALID\_ARGUMENT error. + Batch gets the update history of assets that overlap a time window. + For RESOURCE content, this API outputs history with asset in both + non-delete or deleted status. For IAM_POLICY content, this API outputs + history when the asset and its attached IAM POLICY both exist. This can + create gaps in the output history. If a specified asset does not exist, + this API returns an INVALID_ARGUMENT error. Returns: Callable: A callable which accepts the appropriate diff --git a/google/cloud/asset_v1beta1/proto/asset_service_pb2.py b/google/cloud/asset_v1beta1/proto/asset_service_pb2.py index 2d3b457a..b5ab5d6c 100644 --- a/google/cloud/asset_v1beta1/proto/asset_service_pb2.py +++ b/google/cloud/asset_v1beta1/proto/asset_service_pb2.py @@ -2,9 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/asset_v1beta1/proto/asset_service.proto -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -33,12 +30,8 @@ name="google/cloud/asset_v1beta1/proto/asset_service.proto", package="google.cloud.asset.v1beta1", syntax="proto3", - serialized_options=_b( - "\n\036com.google.cloud.asset.v1beta1B\021AssetServiceProtoP\001Z?google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset\252\002\032Google.Cloud.Asset.V1Beta1\312\002\032Google\\Cloud\\Asset\\V1beta1" - ), - serialized_pb=_b( - '\n4google/cloud/asset_v1beta1/proto/asset_service.proto\x12\x1agoogle.cloud.asset.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/asset_v1beta1/proto/assets.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x97\x02\n\x13\x45xportAssetsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudasset.googleapis.com/Asset\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0b\x61sset_types\x18\x03 \x03(\t\x12=\n\x0c\x63ontent_type\x18\x04 \x01(\x0e\x32\'.google.cloud.asset.v1beta1.ContentType\x12\x44\n\routput_config\x18\x05 \x01(\x0b\x32(.google.cloud.asset.v1beta1.OutputConfigB\x03\xe0\x41\x02"\x86\x01\n\x14\x45xportAssetsResponse\x12-\n\tread_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12?\n\routput_config\x18\x02 \x01(\x0b\x32(.google.cloud.asset.v1beta1.OutputConfig"\xf7\x01\n\x1c\x42\x61tchGetAssetsHistoryRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudasset.googleapis.com/Asset\x12\x13\n\x0b\x61sset_names\x18\x02 \x03(\t\x12\x42\n\x0c\x63ontent_type\x18\x03 \x01(\x0e\x32\'.google.cloud.asset.v1beta1.ContentTypeB\x03\xe0\x41\x01\x12\x45\n\x10read_time_window\x18\x04 \x01(\x0b\x32&.google.cloud.asset.v1beta1.TimeWindowB\x03\xe0\x41\x01"Z\n\x1d\x42\x61tchGetAssetsHistoryResponse\x12\x39\n\x06\x61ssets\x18\x01 \x03(\x0b\x32).google.cloud.asset.v1beta1.TemporalAsset"d\n\x0cOutputConfig\x12\x45\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32*.google.cloud.asset.v1beta1.GcsDestinationH\x00\x42\r\n\x0b\x64\x65stination"C\n\x0eGcsDestination\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x14\n\nuri_prefix\x18\x02 \x01(\tH\x00\x42\x0c\n\nobject_uri*I\n\x0b\x43ontentType\x12\x1c\n\x18\x43ONTENT_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08RESOURCE\x10\x01\x12\x0e\n\nIAM_POLICY\x10\x02\x32\xc4\x05\n\x0c\x41ssetService\x12\xde\x02\n\x0c\x45xportAssets\x12/.google.cloud.asset.v1beta1.ExportAssetsRequest\x1a\x1d.google.longrunning.Operation"\xfd\x01\x82\xd3\xe4\x93\x02\x92\x01")/v1beta1/{parent=projects/*}:exportAssets:\x01*Z-"(/v1beta1/{parent=folders/*}:exportAssets:\x01*Z3"./v1beta1/{parent=organizations/*}:exportAssets:\x01*\xca\x41\x61\n/google.cloud.asset.v1beta1.ExportAssetsResponse\x12.google.cloud.asset.v1beta1.ExportAssetsRequest\x12\x83\x02\n\x15\x42\x61tchGetAssetsHistory\x12\x38.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest\x1a\x39.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse"u\x82\xd3\xe4\x93\x02o\x12\x32/v1beta1/{parent=projects/*}:batchGetAssetsHistoryZ9\x12\x37/v1beta1/{parent=organizations/*}:batchGetAssetsHistory\x1aM\xca\x41\x19\x63loudasset.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb0\x01\n\x1e\x63om.google.cloud.asset.v1beta1B\x11\x41ssetServiceProtoP\x01Z?google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset\xaa\x02\x1aGoogle.Cloud.Asset.V1Beta1\xca\x02\x1aGoogle\\Cloud\\Asset\\V1beta1b\x06proto3' - ), + serialized_options=b"\n\036com.google.cloud.asset.v1beta1B\021AssetServiceProtoP\001Z?google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset\252\002\032Google.Cloud.Asset.V1Beta1\312\002\032Google\\Cloud\\Asset\\V1beta1", + serialized_pb=b'\n4google/cloud/asset_v1beta1/proto/asset_service.proto\x12\x1agoogle.cloud.asset.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/asset_v1beta1/proto/assets.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x97\x02\n\x13\x45xportAssetsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudasset.googleapis.com/Asset\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0b\x61sset_types\x18\x03 \x03(\t\x12=\n\x0c\x63ontent_type\x18\x04 \x01(\x0e\x32\'.google.cloud.asset.v1beta1.ContentType\x12\x44\n\routput_config\x18\x05 \x01(\x0b\x32(.google.cloud.asset.v1beta1.OutputConfigB\x03\xe0\x41\x02"\x86\x01\n\x14\x45xportAssetsResponse\x12-\n\tread_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12?\n\routput_config\x18\x02 \x01(\x0b\x32(.google.cloud.asset.v1beta1.OutputConfig"\xf7\x01\n\x1c\x42\x61tchGetAssetsHistoryRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudasset.googleapis.com/Asset\x12\x13\n\x0b\x61sset_names\x18\x02 \x03(\t\x12\x42\n\x0c\x63ontent_type\x18\x03 \x01(\x0e\x32\'.google.cloud.asset.v1beta1.ContentTypeB\x03\xe0\x41\x01\x12\x45\n\x10read_time_window\x18\x04 \x01(\x0b\x32&.google.cloud.asset.v1beta1.TimeWindowB\x03\xe0\x41\x01"Z\n\x1d\x42\x61tchGetAssetsHistoryResponse\x12\x39\n\x06\x61ssets\x18\x01 \x03(\x0b\x32).google.cloud.asset.v1beta1.TemporalAsset"d\n\x0cOutputConfig\x12\x45\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32*.google.cloud.asset.v1beta1.GcsDestinationH\x00\x42\r\n\x0b\x64\x65stination"C\n\x0eGcsDestination\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x12\x14\n\nuri_prefix\x18\x02 \x01(\tH\x00\x42\x0c\n\nobject_uri*I\n\x0b\x43ontentType\x12\x1c\n\x18\x43ONTENT_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08RESOURCE\x10\x01\x12\x0e\n\nIAM_POLICY\x10\x02\x32\xc4\x05\n\x0c\x41ssetService\x12\xde\x02\n\x0c\x45xportAssets\x12/.google.cloud.asset.v1beta1.ExportAssetsRequest\x1a\x1d.google.longrunning.Operation"\xfd\x01\x82\xd3\xe4\x93\x02\x92\x01")/v1beta1/{parent=projects/*}:exportAssets:\x01*Z-"(/v1beta1/{parent=folders/*}:exportAssets:\x01*Z3"./v1beta1/{parent=organizations/*}:exportAssets:\x01*\xca\x41\x61\n/google.cloud.asset.v1beta1.ExportAssetsResponse\x12.google.cloud.asset.v1beta1.ExportAssetsRequest\x12\x83\x02\n\x15\x42\x61tchGetAssetsHistory\x12\x38.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest\x1a\x39.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse"u\x82\xd3\xe4\x93\x02o\x12\x32/v1beta1/{parent=projects/*}:batchGetAssetsHistoryZ9\x12\x37/v1beta1/{parent=organizations/*}:batchGetAssetsHistory\x1aM\xca\x41\x19\x63loudasset.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb0\x01\n\x1e\x63om.google.cloud.asset.v1beta1B\x11\x41ssetServiceProtoP\x01Z?google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset\xaa\x02\x1aGoogle.Cloud.Asset.V1Beta1\xca\x02\x1aGoogle\\Cloud\\Asset\\V1beta1b\x06proto3', dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, google_dot_api_dot_client__pb2.DESCRIPTOR, @@ -99,15 +92,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A!\022\037cloudasset.googleapis.com/Asset" - ), + serialized_options=b"\340A\002\372A!\022\037cloudasset.googleapis.com/Asset", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -179,7 +170,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), ], @@ -269,15 +260,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A!\022\037cloudasset.googleapis.com/Asset" - ), + serialized_options=b"\340A\002\372A!\022\037cloudasset.googleapis.com/Asset", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -313,7 +302,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -331,7 +320,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, ), ], @@ -450,7 +439,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -468,7 +457,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -553,19 +542,19 @@ ExportAssetsRequest = _reflection.GeneratedProtocolMessageType( "ExportAssetsRequest", (_message.Message,), - dict( - DESCRIPTOR=_EXPORTASSETSREQUEST, - __module__="google.cloud.asset_v1beta1.proto.asset_service_pb2", - __doc__="""Export asset request. + { + "DESCRIPTOR": _EXPORTASSETSREQUEST, + "__module__": "google.cloud.asset_v1beta1.proto.asset_service_pb2", + "__doc__": """Export asset request. Attributes: parent: Required. The relative name of the root asset. This can only - be an organization number (such as "organizations/123"), a - project ID (such as "projects/my-project-id"), a project - number (such as "projects/12345"), or a folder number (such as - "folders/123"). + be an organization number (such as “organizations/123”), a + project ID (such as “projects/my-project-id”), a project + number (such as “projects/12345”), or a folder number (such as + “folders/123”). read_time: Timestamp to take an asset snapshot. This can only be set to a timestamp between 2018-10-02 UTC (inclusive) and the current @@ -575,7 +564,7 @@ different results. asset_types: A list of asset types of which to take a snapshot for. For - example: "google.compute.Disk". If specified, only matching + example: “google.compute.Disk”. If specified, only matching assets will be returned. See `Introduction to Cloud Asset Inventory `__ for all @@ -589,17 +578,17 @@ JSON format. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.ExportAssetsRequest) - ), + }, ) _sym_db.RegisterMessage(ExportAssetsRequest) ExportAssetsResponse = _reflection.GeneratedProtocolMessageType( "ExportAssetsResponse", (_message.Message,), - dict( - DESCRIPTOR=_EXPORTASSETSRESPONSE, - __module__="google.cloud.asset_v1beta1.proto.asset_service_pb2", - __doc__="""The export asset response. This message is returned by the + { + "DESCRIPTOR": _EXPORTASSETSRESPONSE, + "__module__": "google.cloud.asset_v1beta1.proto.asset_service_pb2", + "__doc__": """The export asset response. This message is returned by the [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned [google.longrunning.Operation.response][google.longrunning.Operation.response] @@ -614,25 +603,25 @@ to. All results are in JSON format. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.ExportAssetsResponse) - ), + }, ) _sym_db.RegisterMessage(ExportAssetsResponse) BatchGetAssetsHistoryRequest = _reflection.GeneratedProtocolMessageType( "BatchGetAssetsHistoryRequest", (_message.Message,), - dict( - DESCRIPTOR=_BATCHGETASSETSHISTORYREQUEST, - __module__="google.cloud.asset_v1beta1.proto.asset_service_pb2", - __doc__="""Batch get assets history request. + { + "DESCRIPTOR": _BATCHGETASSETSHISTORYREQUEST, + "__module__": "google.cloud.asset_v1beta1.proto.asset_service_pb2", + "__doc__": """Batch get assets history request. Attributes: parent: Required. The relative name of the root asset. It can only be - an organization number (such as "organizations/123"), a - project ID (such as "projects/my-project-id")", or a project - number (such as "projects/12345"). + an organization number (such as “organizations/123”), a + project ID (such as “projects/my-project-id”)“, or a project + number (such as”projects/12345"). asset_names: A list of the full names of the assets. For example: ``//compu te.googleapis.com/projects/my_project_123/zones/zone1/instance @@ -645,25 +634,25 @@ Optional. The content type. read_time_window: Optional. The time window for the asset history. Both - start\_time and end\_time are optional and if set, it must be - after 2018-10-02 UTC. If end\_time is not set, it is default - to current timestamp. If start\_time is not set, the snapshot - of the assets at end\_time will be returned. The returned - results contain all temporal assets whose time window overlap - with read\_time\_window. + start_time and end_time are optional and if set, it must be + after 2018-10-02 UTC. If end_time is not set, it is default to + current timestamp. If start_time is not set, the snapshot of + the assets at end_time will be returned. The returned results + contain all temporal assets whose time window overlap with + read_time_window. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest) - ), + }, ) _sym_db.RegisterMessage(BatchGetAssetsHistoryRequest) BatchGetAssetsHistoryResponse = _reflection.GeneratedProtocolMessageType( "BatchGetAssetsHistoryResponse", (_message.Message,), - dict( - DESCRIPTOR=_BATCHGETASSETSHISTORYRESPONSE, - __module__="google.cloud.asset_v1beta1.proto.asset_service_pb2", - __doc__="""Batch get assets history response. + { + "DESCRIPTOR": _BATCHGETASSETSHISTORYRESPONSE, + "__module__": "google.cloud.asset_v1beta1.proto.asset_service_pb2", + "__doc__": """Batch get assets history response. Attributes: @@ -671,17 +660,17 @@ A list of assets with valid time windows. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) - ), + }, ) _sym_db.RegisterMessage(BatchGetAssetsHistoryResponse) OutputConfig = _reflection.GeneratedProtocolMessageType( "OutputConfig", (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.asset_v1beta1.proto.asset_service_pb2", - __doc__="""Output configuration for export assets destination. + { + "DESCRIPTOR": _OUTPUTCONFIG, + "__module__": "google.cloud.asset_v1beta1.proto.asset_service_pb2", + "__doc__": """Output configuration for export assets destination. Attributes: @@ -691,42 +680,41 @@ Destination on Cloud Storage. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.OutputConfig) - ), + }, ) _sym_db.RegisterMessage(OutputConfig) GcsDestination = _reflection.GeneratedProtocolMessageType( "GcsDestination", (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.asset_v1beta1.proto.asset_service_pb2", - __doc__="""A Cloud Storage location. + { + "DESCRIPTOR": _GCSDESTINATION, + "__module__": "google.cloud.asset_v1beta1.proto.asset_service_pb2", + "__doc__": """A Cloud Storage location. Attributes: object_uri: Required. uri: - The uri of the Cloud Storage object. It's the same uri that is - used by gsutil. For example: "gs://bucket\_name/object\_name". + The uri of the Cloud Storage object. It’s the same uri that is + used by gsutil. For example: “gs://bucket_name/object_name”. See `Viewing and Editing Object Metadata `__ for more information. uri_prefix: The uri prefix of all generated Cloud Storage objects. For - example: "gs://bucket\_name/object\_name\_prefix". Each object - uri is in format: "gs://bucket\_name/object\_name\_prefix// - and only contains assets for that type. starts from 0. For - example: - "gs://bucket\_name/object\_name\_prefix/google.compute.disk/0" + example: “gs://bucket_name/object_name_prefix”. Each object + uri is in format: “gs://bucket_name/object_name_prefix// and + only contains assets for that type. starts from 0. For example + :”gs://bucket_name/object_name_prefix/google.compute.disk/0" is the first shard of output objects containing all - google.compute.disk assets. An INVALID\_ARGUMENT error will be + google.compute.disk assets. An INVALID_ARGUMENT error will be returned if file with the same name - "gs://bucket\_name/object\_name\_prefix" already exists. + “gs://bucket_name/object_name_prefix” already exists. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.GcsDestination) - ), + }, ) _sym_db.RegisterMessage(GcsDestination) @@ -743,9 +731,7 @@ full_name="google.cloud.asset.v1beta1.AssetService", file=DESCRIPTOR, index=0, - serialized_options=_b( - "\312A\031cloudasset.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), + serialized_options=b"\312A\031cloudasset.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform", serialized_start=1324, serialized_end=2032, methods=[ @@ -756,9 +742,7 @@ containing_service=None, input_type=_EXPORTASSETSREQUEST, output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002\222\001")/v1beta1/{parent=projects/*}:exportAssets:\001*Z-"(/v1beta1/{parent=folders/*}:exportAssets:\001*Z3"./v1beta1/{parent=organizations/*}:exportAssets:\001*\312Aa\n/google.cloud.asset.v1beta1.ExportAssetsResponse\022.google.cloud.asset.v1beta1.ExportAssetsRequest' - ), + serialized_options=b'\202\323\344\223\002\222\001")/v1beta1/{parent=projects/*}:exportAssets:\001*Z-"(/v1beta1/{parent=folders/*}:exportAssets:\001*Z3"./v1beta1/{parent=organizations/*}:exportAssets:\001*\312Aa\n/google.cloud.asset.v1beta1.ExportAssetsResponse\022.google.cloud.asset.v1beta1.ExportAssetsRequest', ), _descriptor.MethodDescriptor( name="BatchGetAssetsHistory", @@ -767,9 +751,7 @@ containing_service=None, input_type=_BATCHGETASSETSHISTORYREQUEST, output_type=_BATCHGETASSETSHISTORYRESPONSE, - serialized_options=_b( - "\202\323\344\223\002o\0222/v1beta1/{parent=projects/*}:batchGetAssetsHistoryZ9\0227/v1beta1/{parent=organizations/*}:batchGetAssetsHistory" - ), + serialized_options=b"\202\323\344\223\002o\0222/v1beta1/{parent=projects/*}:batchGetAssetsHistoryZ9\0227/v1beta1/{parent=organizations/*}:batchGetAssetsHistory", ), ], ) diff --git a/google/cloud/asset_v1beta1/proto/assets_pb2.py b/google/cloud/asset_v1beta1/proto/assets_pb2.py index ad741851..8669ddc4 100644 --- a/google/cloud/asset_v1beta1/proto/assets_pb2.py +++ b/google/cloud/asset_v1beta1/proto/assets_pb2.py @@ -2,9 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/asset_v1beta1/proto/assets.proto -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -27,12 +24,8 @@ name="google/cloud/asset_v1beta1/proto/assets.proto", package="google.cloud.asset.v1beta1", syntax="proto3", - serialized_options=_b( - "\n\036com.google.cloud.asset.v1beta1B\nAssetProtoP\001Z?google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset\370\001\001\252\002\032Google.Cloud.Asset.V1Beta1\312\002\032Google\\Cloud\\Asset\\V1beta1" - ), - serialized_pb=_b( - '\n-google/cloud/asset_v1beta1/proto/assets.proto\x12\x1agoogle.cloud.asset.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x8a\x01\n\rTemporalAsset\x12\x36\n\x06window\x18\x01 \x01(\x0b\x32&.google.cloud.asset.v1beta1.TimeWindow\x12\x0f\n\x07\x64\x65leted\x18\x02 \x01(\x08\x12\x30\n\x05\x61sset\x18\x03 \x01(\x0b\x32!.google.cloud.asset.v1beta1.Asset"j\n\nTimeWindow\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\xb5\x01\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nasset_type\x18\x02 \x01(\t\x12\x36\n\x08resource\x18\x03 \x01(\x0b\x32$.google.cloud.asset.v1beta1.Resource\x12)\n\niam_policy\x18\x04 \x01(\x0b\x32\x15.google.iam.v1.Policy:\'\xea\x41$\n\x1f\x63loudasset.googleapis.com/Asset\x12\x01*"\xa0\x01\n\x08Resource\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x1e\n\x16\x64iscovery_document_uri\x18\x02 \x01(\t\x12\x16\n\x0e\x64iscovery_name\x18\x03 \x01(\t\x12\x14\n\x0cresource_url\x18\x04 \x01(\t\x12\x0e\n\x06parent\x18\x05 \x01(\t\x12%\n\x04\x64\x61ta\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\xac\x01\n\x1e\x63om.google.cloud.asset.v1beta1B\nAssetProtoP\x01Z?google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset\xf8\x01\x01\xaa\x02\x1aGoogle.Cloud.Asset.V1Beta1\xca\x02\x1aGoogle\\Cloud\\Asset\\V1beta1b\x06proto3' - ), + serialized_options=b"\n\036com.google.cloud.asset.v1beta1B\nAssetProtoP\001Z?google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset\370\001\001\252\002\032Google.Cloud.Asset.V1Beta1\312\002\032Google\\Cloud\\Asset\\V1beta1", + serialized_pb=b'\n-google/cloud/asset_v1beta1/proto/assets.proto\x12\x1agoogle.cloud.asset.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x8a\x01\n\rTemporalAsset\x12\x36\n\x06window\x18\x01 \x01(\x0b\x32&.google.cloud.asset.v1beta1.TimeWindow\x12\x0f\n\x07\x64\x65leted\x18\x02 \x01(\x08\x12\x30\n\x05\x61sset\x18\x03 \x01(\x0b\x32!.google.cloud.asset.v1beta1.Asset"j\n\nTimeWindow\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\xb5\x01\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nasset_type\x18\x02 \x01(\t\x12\x36\n\x08resource\x18\x03 \x01(\x0b\x32$.google.cloud.asset.v1beta1.Resource\x12)\n\niam_policy\x18\x04 \x01(\x0b\x32\x15.google.iam.v1.Policy:\'\xea\x41$\n\x1f\x63loudasset.googleapis.com/Asset\x12\x01*"\xa0\x01\n\x08Resource\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x1e\n\x16\x64iscovery_document_uri\x18\x02 \x01(\t\x12\x16\n\x0e\x64iscovery_name\x18\x03 \x01(\t\x12\x14\n\x0cresource_url\x18\x04 \x01(\t\x12\x0e\n\x06parent\x18\x05 \x01(\t\x12%\n\x04\x64\x61ta\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\xac\x01\n\x1e\x63om.google.cloud.asset.v1beta1B\nAssetProtoP\x01Z?google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset\xf8\x01\x01\xaa\x02\x1aGoogle.Cloud.Asset.V1Beta1\xca\x02\x1aGoogle\\Cloud\\Asset\\V1beta1b\x06proto3', dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, google_dot_api_dot_resource__pb2.DESCRIPTOR, @@ -192,7 +185,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -210,7 +203,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -259,7 +252,7 @@ extensions=[], nested_types=[], enum_types=[], - serialized_options=_b("\352A$\n\037cloudasset.googleapis.com/Asset\022\001*"), + serialized_options=b"\352A$\n\037cloudasset.googleapis.com/Asset\022\001*", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -285,7 +278,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -303,7 +296,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -321,7 +314,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -339,7 +332,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -357,7 +350,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -423,11 +416,11 @@ TemporalAsset = _reflection.GeneratedProtocolMessageType( "TemporalAsset", (_message.Message,), - dict( - DESCRIPTOR=_TEMPORALASSET, - __module__="google.cloud.asset_v1beta1.proto.assets_pb2", - __doc__="""Temporal asset. In addition to the asset, the temporal asset includes - the status of the asset and valid from and to time of it. + { + "DESCRIPTOR": _TEMPORALASSET, + "__module__": "google.cloud.asset_v1beta1.proto.assets_pb2", + "__doc__": """Temporal asset. In addition to the asset, the temporal + asset includes the status of the asset and valid from and to time of it. Attributes: @@ -439,17 +432,17 @@ Asset. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.TemporalAsset) - ), + }, ) _sym_db.RegisterMessage(TemporalAsset) TimeWindow = _reflection.GeneratedProtocolMessageType( "TimeWindow", (_message.Message,), - dict( - DESCRIPTOR=_TIMEWINDOW, - __module__="google.cloud.asset_v1beta1.proto.assets_pb2", - __doc__="""A time window of (start\_time, end\_time]. + { + "DESCRIPTOR": _TIMEWINDOW, + "__module__": "google.cloud.asset_v1beta1.proto.assets_pb2", + "__doc__": """A time window of (start_time, end_time]. Attributes: @@ -460,18 +453,18 @@ not specified. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.TimeWindow) - ), + }, ) _sym_db.RegisterMessage(TimeWindow) Asset = _reflection.GeneratedProtocolMessageType( "Asset", (_message.Message,), - dict( - DESCRIPTOR=_ASSET, - __module__="google.cloud.asset_v1beta1.proto.assets_pb2", - __doc__="""Cloud asset. This includes all Google Cloud Platform - resources, Cloud IAM policies, and other non-GCP assets. + { + "DESCRIPTOR": _ASSET, + "__module__": "google.cloud.asset_v1beta1.proto.assets_pb2", + "__doc__": """Cloud asset. This includes all Google Cloud Platform resources, Cloud + IAM policies, and other non-GCP assets. Attributes: @@ -482,7 +475,7 @@ See https://cloud.google.com/apis/design/resource_names#full_resource_name for more information. asset_type: - Type of the asset. Example: "google.compute.Disk". + Type of the asset. Example: “google.compute.Disk”. resource: Representation of the resource. iam_policy: @@ -491,31 +484,31 @@ IAM policy set on it. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.Asset) - ), + }, ) _sym_db.RegisterMessage(Asset) Resource = _reflection.GeneratedProtocolMessageType( "Resource", (_message.Message,), - dict( - DESCRIPTOR=_RESOURCE, - __module__="google.cloud.asset_v1beta1.proto.assets_pb2", - __doc__="""Representation of a cloud resource. + { + "DESCRIPTOR": _RESOURCE, + "__module__": "google.cloud.asset_v1beta1.proto.assets_pb2", + "__doc__": """Representation of a cloud resource. Attributes: version: - The API version. Example: "v1". + The API version. Example: “v1”. discovery_document_uri: - The URL of the discovery document containing the resource's + The URL of the discovery document containing the resource’s JSON schema. For example: ``"https://www.googleapis.com/discov ery/v1/apis/compute/v1/rest"``. It will be left unspecified for resources without a discovery-based API, such as Cloud Bigtable. discovery_name: The JSON schema name listed in the discovery document. - Example: "Project". It will be left unspecified for resources + Example: “Project”. It will be left unspecified for resources (such as Cloud Bigtable) without a discovery-based API. resource_url: The REST URL for accessing the resource. An HTTP GET operation @@ -537,7 +530,7 @@ are scrubbed away and may not be present. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.Resource) - ), + }, ) _sym_db.RegisterMessage(Resource) diff --git a/google/cloud/asset_v1p2beta1/gapic/asset_service_client.py b/google/cloud/asset_v1p2beta1/gapic/asset_service_client.py index 452566f1..faa70d88 100644 --- a/google/cloud/asset_v1p2beta1/gapic/asset_service_client.py +++ b/google/cloud/asset_v1p2beta1/gapic/asset_service_client.py @@ -228,10 +228,11 @@ def create_feed( "projects/12345"). feed_id (str): Required. This is the client-assigned asset feed identifier and it needs to be unique under a specific parent project/folder/organization. - feed (Union[dict, ~google.cloud.asset_v1p2beta1.types.Feed]): Required. The feed details. The field ``name`` must be empty and it will - be generated in the format of: projects/project\_number/feeds/feed\_id - folders/folder\_number/feeds/feed\_id - organizations/organization\_number/feeds/feed\_id + feed (Union[dict, ~google.cloud.asset_v1p2beta1.types.Feed]): Required. The feed details. The field ``name`` must be empty and it + will be generated in the format of: + projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1p2beta1.types.Feed` @@ -306,9 +307,9 @@ def get_feed( Args: name (str): Required. The name of the Feed and it must be in the format of: - projects/project\_number/feeds/feed\_id - folders/folder\_number/feeds/feed\_id - organizations/organization\_number/feeds/feed\_id + projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -454,17 +455,17 @@ def update_feed( >>> response = client.update_feed(feed, update_mask) Args: - feed (Union[dict, ~google.cloud.asset_v1p2beta1.types.Feed]): Required. The new values of feed details. It must match an existing feed - and the field ``name`` must be in the format of: - projects/project\_number/feeds/feed\_id or - folders/folder\_number/feeds/feed\_id or - organizations/organization\_number/feeds/feed\_id. + feed (Union[dict, ~google.cloud.asset_v1p2beta1.types.Feed]): Required. The new values of feed details. It must match an existing + feed and the field ``name`` must be in the format of: + projects/project_number/feeds/feed_id or + folders/folder_number/feeds/feed_id or + organizations/organization_number/feeds/feed_id. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1p2beta1.types.Feed` - update_mask (Union[dict, ~google.cloud.asset_v1p2beta1.types.FieldMask]): Required. Only updates the ``feed`` fields indicated by this mask. The - field mask must not be empty, and it must not contain fields that are - immutable or only set by the server. + update_mask (Union[dict, ~google.cloud.asset_v1p2beta1.types.FieldMask]): Required. Only updates the ``feed`` fields indicated by this mask. + The field mask must not be empty, and it must not contain fields that + are immutable or only set by the server. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1p2beta1.types.FieldMask` @@ -539,9 +540,9 @@ def delete_feed( Args: name (str): Required. The name of the feed and it must be in the format of: - projects/project\_number/feeds/feed\_id - folders/folder\_number/feeds/feed\_id - organizations/organization\_number/feeds/feed\_id + projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. diff --git a/google/cloud/asset_v1p2beta1/proto/asset_service_pb2.py b/google/cloud/asset_v1p2beta1/proto/asset_service_pb2.py index 4a97fd76..40fe26ed 100644 --- a/google/cloud/asset_v1p2beta1/proto/asset_service_pb2.py +++ b/google/cloud/asset_v1p2beta1/proto/asset_service_pb2.py @@ -2,9 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/asset_v1p2beta1/proto/asset_service.proto -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -35,12 +32,8 @@ name="google/cloud/asset_v1p2beta1/proto/asset_service.proto", package="google.cloud.asset.v1p2beta1", syntax="proto3", - serialized_options=_b( - "\n com.google.cloud.asset.v1p2beta1B\021AssetServiceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset\252\002\034Google.Cloud.Asset.V1p2Beta1\312\002\034Google\\Cloud\\Asset\\V1p2Beta1" - ), - serialized_pb=_b( - '\n6google/cloud/asset_v1p2beta1/proto/asset_service.proto\x12\x1cgoogle.cloud.asset.v1p2beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/cloud/asset_v1p2beta1/proto/assets.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto"u\n\x11\x43reateFeedRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x66\x65\x65\x64_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x35\n\x04\x66\x65\x65\x64\x18\x03 \x01(\x0b\x32".google.cloud.asset.v1p2beta1.FeedB\x03\xe0\x41\x02"F\n\x0eGetFeedRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudasset.googleapis.com/Feed"\'\n\x10ListFeedsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02"F\n\x11ListFeedsResponse\x12\x31\n\x05\x66\x65\x65\x64s\x18\x01 \x03(\x0b\x32".google.cloud.asset.v1p2beta1.Feed"\x80\x01\n\x11UpdateFeedRequest\x12\x35\n\x04\x66\x65\x65\x64\x18\x01 \x01(\x0b\x32".google.cloud.asset.v1p2beta1.FeedB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02"I\n\x11\x44\x65leteFeedRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudasset.googleapis.com/Feed"f\n\x0cOutputConfig\x12G\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32,.google.cloud.asset.v1p2beta1.GcsDestinationH\x00\x42\r\n\x0b\x64\x65stination"-\n\x0eGcsDestination\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x42\x0c\n\nobject_uri""\n\x11PubsubDestination\x12\r\n\x05topic\x18\x01 \x01(\t"p\n\x10\x46\x65\x65\x64OutputConfig\x12M\n\x12pubsub_destination\x18\x01 \x01(\x0b\x32/.google.cloud.asset.v1p2beta1.PubsubDestinationH\x00\x42\r\n\x0b\x64\x65stination"\xe9\x02\n\x04\x46\x65\x65\x64\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x61sset_names\x18\x02 \x03(\t\x12\x13\n\x0b\x61sset_types\x18\x03 \x03(\t\x12?\n\x0c\x63ontent_type\x18\x04 \x01(\x0e\x32).google.cloud.asset.v1p2beta1.ContentType\x12O\n\x12\x66\x65\x65\x64_output_config\x18\x05 \x01(\x0b\x32..google.cloud.asset.v1p2beta1.FeedOutputConfigB\x03\xe0\x41\x02:\x91\x01\xea\x41\x8d\x01\n\x1e\x63loudasset.googleapis.com/Feed\x12\x1fprojects/{project}/feeds/{feed}\x12\x1d\x66olders/{folder}/feeds/{feed}\x12)organizations/{organization}/feeds/{feed} \x01*I\n\x0b\x43ontentType\x12\x1c\n\x18\x43ONTENT_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08RESOURCE\x10\x01\x12\x0e\n\nIAM_POLICY\x10\x02\x32\xbf\x06\n\x0c\x41ssetService\x12\x94\x01\n\nCreateFeed\x12/.google.cloud.asset.v1p2beta1.CreateFeedRequest\x1a".google.cloud.asset.v1p2beta1.Feed"1\x82\xd3\xe4\x93\x02""\x1d/v1p2beta1/{parent=*/*}/feeds:\x01*\xda\x41\x06parent\x12\x89\x01\n\x07GetFeed\x12,.google.cloud.asset.v1p2beta1.GetFeedRequest\x1a".google.cloud.asset.v1p2beta1.Feed",\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1p2beta1/{name=*/*/feeds/*}\xda\x41\x04name\x12\x9c\x01\n\tListFeeds\x12..google.cloud.asset.v1p2beta1.ListFeedsRequest\x1a/.google.cloud.asset.v1p2beta1.ListFeedsResponse".\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1p2beta1/{parent=*/*}/feeds\xda\x41\x06parent\x12\x97\x01\n\nUpdateFeed\x12/.google.cloud.asset.v1p2beta1.UpdateFeedRequest\x1a".google.cloud.asset.v1p2beta1.Feed"4\x82\xd3\xe4\x93\x02\'2"/v1p2beta1/{feed.name=*/*/feeds/*}:\x01*\xda\x41\x04\x66\x65\x65\x64\x12\x83\x01\n\nDeleteFeed\x12/.google.cloud.asset.v1p2beta1.DeleteFeedRequest\x1a\x16.google.protobuf.Empty",\x82\xd3\xe4\x93\x02\x1f*\x1d/v1p2beta1/{name=*/*/feeds/*}\xda\x41\x04name\x1aM\xca\x41\x19\x63loudasset.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb8\x01\n com.google.cloud.asset.v1p2beta1B\x11\x41ssetServiceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset\xaa\x02\x1cGoogle.Cloud.Asset.V1p2Beta1\xca\x02\x1cGoogle\\Cloud\\Asset\\V1p2Beta1b\x06proto3' - ), + serialized_options=b"\n com.google.cloud.asset.v1p2beta1B\021AssetServiceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset\252\002\034Google.Cloud.Asset.V1p2Beta1\312\002\034Google\\Cloud\\Asset\\V1p2Beta1", + serialized_pb=b'\n6google/cloud/asset_v1p2beta1/proto/asset_service.proto\x12\x1cgoogle.cloud.asset.v1p2beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/cloud/asset_v1p2beta1/proto/assets.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto"u\n\x11\x43reateFeedRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x66\x65\x65\x64_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x35\n\x04\x66\x65\x65\x64\x18\x03 \x01(\x0b\x32".google.cloud.asset.v1p2beta1.FeedB\x03\xe0\x41\x02"F\n\x0eGetFeedRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudasset.googleapis.com/Feed"\'\n\x10ListFeedsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02"F\n\x11ListFeedsResponse\x12\x31\n\x05\x66\x65\x65\x64s\x18\x01 \x03(\x0b\x32".google.cloud.asset.v1p2beta1.Feed"\x80\x01\n\x11UpdateFeedRequest\x12\x35\n\x04\x66\x65\x65\x64\x18\x01 \x01(\x0b\x32".google.cloud.asset.v1p2beta1.FeedB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02"I\n\x11\x44\x65leteFeedRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudasset.googleapis.com/Feed"f\n\x0cOutputConfig\x12G\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32,.google.cloud.asset.v1p2beta1.GcsDestinationH\x00\x42\r\n\x0b\x64\x65stination"-\n\x0eGcsDestination\x12\r\n\x03uri\x18\x01 \x01(\tH\x00\x42\x0c\n\nobject_uri""\n\x11PubsubDestination\x12\r\n\x05topic\x18\x01 \x01(\t"p\n\x10\x46\x65\x65\x64OutputConfig\x12M\n\x12pubsub_destination\x18\x01 \x01(\x0b\x32/.google.cloud.asset.v1p2beta1.PubsubDestinationH\x00\x42\r\n\x0b\x64\x65stination"\xe9\x02\n\x04\x46\x65\x65\x64\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x61sset_names\x18\x02 \x03(\t\x12\x13\n\x0b\x61sset_types\x18\x03 \x03(\t\x12?\n\x0c\x63ontent_type\x18\x04 \x01(\x0e\x32).google.cloud.asset.v1p2beta1.ContentType\x12O\n\x12\x66\x65\x65\x64_output_config\x18\x05 \x01(\x0b\x32..google.cloud.asset.v1p2beta1.FeedOutputConfigB\x03\xe0\x41\x02:\x91\x01\xea\x41\x8d\x01\n\x1e\x63loudasset.googleapis.com/Feed\x12\x1fprojects/{project}/feeds/{feed}\x12\x1d\x66olders/{folder}/feeds/{feed}\x12)organizations/{organization}/feeds/{feed} \x01*I\n\x0b\x43ontentType\x12\x1c\n\x18\x43ONTENT_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08RESOURCE\x10\x01\x12\x0e\n\nIAM_POLICY\x10\x02\x32\xbf\x06\n\x0c\x41ssetService\x12\x94\x01\n\nCreateFeed\x12/.google.cloud.asset.v1p2beta1.CreateFeedRequest\x1a".google.cloud.asset.v1p2beta1.Feed"1\x82\xd3\xe4\x93\x02""\x1d/v1p2beta1/{parent=*/*}/feeds:\x01*\xda\x41\x06parent\x12\x89\x01\n\x07GetFeed\x12,.google.cloud.asset.v1p2beta1.GetFeedRequest\x1a".google.cloud.asset.v1p2beta1.Feed",\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1p2beta1/{name=*/*/feeds/*}\xda\x41\x04name\x12\x9c\x01\n\tListFeeds\x12..google.cloud.asset.v1p2beta1.ListFeedsRequest\x1a/.google.cloud.asset.v1p2beta1.ListFeedsResponse".\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1p2beta1/{parent=*/*}/feeds\xda\x41\x06parent\x12\x97\x01\n\nUpdateFeed\x12/.google.cloud.asset.v1p2beta1.UpdateFeedRequest\x1a".google.cloud.asset.v1p2beta1.Feed"4\x82\xd3\xe4\x93\x02\'2"/v1p2beta1/{feed.name=*/*/feeds/*}:\x01*\xda\x41\x04\x66\x65\x65\x64\x12\x83\x01\n\nDeleteFeed\x12/.google.cloud.asset.v1p2beta1.DeleteFeedRequest\x1a\x16.google.protobuf.Empty",\x82\xd3\xe4\x93\x02\x1f*\x1d/v1p2beta1/{name=*/*/feeds/*}\xda\x41\x04name\x1aM\xca\x41\x19\x63loudasset.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb8\x01\n com.google.cloud.asset.v1p2beta1B\x11\x41ssetServiceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset\xaa\x02\x1cGoogle.Cloud.Asset.V1p2Beta1\xca\x02\x1cGoogle\\Cloud\\Asset\\V1p2Beta1b\x06proto3', dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, google_dot_api_dot_client__pb2.DESCRIPTOR, @@ -103,13 +96,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -121,13 +114,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -145,7 +138,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), ], @@ -178,15 +171,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036cloudasset.googleapis.com/Feed" - ), + serialized_options=b"\340A\002\372A \n\036cloudasset.googleapis.com/Feed", file=DESCRIPTOR, ) ], @@ -219,13 +210,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ) ], @@ -303,7 +294,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -321,7 +312,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), ], @@ -354,15 +345,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036cloudasset.googleapis.com/Feed" - ), + serialized_options=b"\340A\002\372A \n\036cloudasset.googleapis.com/Feed", file=DESCRIPTOR, ) ], @@ -442,7 +431,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -489,7 +478,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -575,13 +564,13 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -653,16 +642,14 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, ), ], extensions=[], nested_types=[], enum_types=[], - serialized_options=_b( - "\352A\215\001\n\036cloudasset.googleapis.com/Feed\022\037projects/{project}/feeds/{feed}\022\035folders/{folder}/feeds/{feed}\022)organizations/{organization}/feeds/{feed} \001" - ), + serialized_options=b"\352A\215\001\n\036cloudasset.googleapis.com/Feed\022\037projects/{project}/feeds/{feed}\022\035folders/{folder}/feeds/{feed}\022)organizations/{organization}/feeds/{feed} \001", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -716,19 +703,19 @@ CreateFeedRequest = _reflection.GeneratedProtocolMessageType( "CreateFeedRequest", (_message.Message,), - dict( - DESCRIPTOR=_CREATEFEEDREQUEST, - __module__="google.cloud.asset_v1p2beta1.proto.asset_service_pb2", - __doc__="""Create asset feed request. + { + "DESCRIPTOR": _CREATEFEEDREQUEST, + "__module__": "google.cloud.asset_v1p2beta1.proto.asset_service_pb2", + "__doc__": """Create asset feed request. Attributes: parent: Required. The name of the project/folder/organization where this feed should be created in. It can only be an organization - number (such as "organizations/123"), a folder number (such as - "folders/123"), a project ID (such as "projects/my-project- - id")", or a project number (such as "projects/12345"). + number (such as “organizations/123”), a folder number (such as + “folders/123”), a project ID (such as “projects/my-project- + id”)“, or a project number (such as”projects/12345"). feed_id: Required. This is the client-assigned asset feed identifier and it needs to be unique under a specific parent @@ -736,125 +723,125 @@ feed: Required. The feed details. The field ``name`` must be empty and it will be generated in the format of: - projects/project\_number/feeds/feed\_id - folders/folder\_number/feeds/feed\_id - organizations/organization\_number/feeds/feed\_id + projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.CreateFeedRequest) - ), + }, ) _sym_db.RegisterMessage(CreateFeedRequest) GetFeedRequest = _reflection.GeneratedProtocolMessageType( "GetFeedRequest", (_message.Message,), - dict( - DESCRIPTOR=_GETFEEDREQUEST, - __module__="google.cloud.asset_v1p2beta1.proto.asset_service_pb2", - __doc__="""Get asset feed request. + { + "DESCRIPTOR": _GETFEEDREQUEST, + "__module__": "google.cloud.asset_v1p2beta1.proto.asset_service_pb2", + "__doc__": """Get asset feed request. Attributes: name: Required. The name of the Feed and it must be in the format - of: projects/project\_number/feeds/feed\_id - folders/folder\_number/feeds/feed\_id - organizations/organization\_number/feeds/feed\_id + of: projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.GetFeedRequest) - ), + }, ) _sym_db.RegisterMessage(GetFeedRequest) ListFeedsRequest = _reflection.GeneratedProtocolMessageType( "ListFeedsRequest", (_message.Message,), - dict( - DESCRIPTOR=_LISTFEEDSREQUEST, - __module__="google.cloud.asset_v1p2beta1.proto.asset_service_pb2", - __doc__="""List asset feeds request. + { + "DESCRIPTOR": _LISTFEEDSREQUEST, + "__module__": "google.cloud.asset_v1p2beta1.proto.asset_service_pb2", + "__doc__": """List asset feeds request. Attributes: parent: Required. The parent project/folder/organization whose feeds are to be listed. It can only be using - project/folder/organization number (such as "folders/12345")", - or a project ID (such as "projects/my-project-id"). + project/folder/organization number (such as “folders/12345”)“, + or a project ID (such as”projects/my-project-id"). """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.ListFeedsRequest) - ), + }, ) _sym_db.RegisterMessage(ListFeedsRequest) ListFeedsResponse = _reflection.GeneratedProtocolMessageType( "ListFeedsResponse", (_message.Message,), - dict( - DESCRIPTOR=_LISTFEEDSRESPONSE, - __module__="google.cloud.asset_v1p2beta1.proto.asset_service_pb2", - __doc__=""" + { + "DESCRIPTOR": _LISTFEEDSRESPONSE, + "__module__": "google.cloud.asset_v1p2beta1.proto.asset_service_pb2", + "__doc__": """ Attributes: feeds: A list of feeds. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.ListFeedsResponse) - ), + }, ) _sym_db.RegisterMessage(ListFeedsResponse) UpdateFeedRequest = _reflection.GeneratedProtocolMessageType( "UpdateFeedRequest", (_message.Message,), - dict( - DESCRIPTOR=_UPDATEFEEDREQUEST, - __module__="google.cloud.asset_v1p2beta1.proto.asset_service_pb2", - __doc__="""Update asset feed request. + { + "DESCRIPTOR": _UPDATEFEEDREQUEST, + "__module__": "google.cloud.asset_v1p2beta1.proto.asset_service_pb2", + "__doc__": """Update asset feed request. Attributes: feed: Required. The new values of feed details. It must match an existing feed and the field ``name`` must be in the format of: - projects/project\_number/feeds/feed\_id or - folders/folder\_number/feeds/feed\_id or - organizations/organization\_number/feeds/feed\_id. + projects/project_number/feeds/feed_id or + folders/folder_number/feeds/feed_id or + organizations/organization_number/feeds/feed_id. update_mask: Required. Only updates the ``feed`` fields indicated by this mask. The field mask must not be empty, and it must not contain fields that are immutable or only set by the server. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.UpdateFeedRequest) - ), + }, ) _sym_db.RegisterMessage(UpdateFeedRequest) DeleteFeedRequest = _reflection.GeneratedProtocolMessageType( "DeleteFeedRequest", (_message.Message,), - dict( - DESCRIPTOR=_DELETEFEEDREQUEST, - __module__="google.cloud.asset_v1p2beta1.proto.asset_service_pb2", - __doc__=""" + { + "DESCRIPTOR": _DELETEFEEDREQUEST, + "__module__": "google.cloud.asset_v1p2beta1.proto.asset_service_pb2", + "__doc__": """ Attributes: name: Required. The name of the feed and it must be in the format - of: projects/project\_number/feeds/feed\_id - folders/folder\_number/feeds/feed\_id - organizations/organization\_number/feeds/feed\_id + of: projects/project_number/feeds/feed_id + folders/folder_number/feeds/feed_id + organizations/organization_number/feeds/feed_id """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.DeleteFeedRequest) - ), + }, ) _sym_db.RegisterMessage(DeleteFeedRequest) OutputConfig = _reflection.GeneratedProtocolMessageType( "OutputConfig", (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.asset_v1p2beta1.proto.asset_service_pb2", - __doc__="""Output configuration for export assets destination. + { + "DESCRIPTOR": _OUTPUTCONFIG, + "__module__": "google.cloud.asset_v1p2beta1.proto.asset_service_pb2", + "__doc__": """Output configuration for export assets destination. Attributes: @@ -864,41 +851,41 @@ Destination on Cloud Storage. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.OutputConfig) - ), + }, ) _sym_db.RegisterMessage(OutputConfig) GcsDestination = _reflection.GeneratedProtocolMessageType( "GcsDestination", (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.asset_v1p2beta1.proto.asset_service_pb2", - __doc__="""A Cloud Storage location. + { + "DESCRIPTOR": _GCSDESTINATION, + "__module__": "google.cloud.asset_v1p2beta1.proto.asset_service_pb2", + "__doc__": """A Cloud Storage location. Attributes: object_uri: Required. uri: - The uri of the Cloud Storage object. It's the same uri that is - used by gsutil. For example: "gs://bucket\_name/object\_name". + The uri of the Cloud Storage object. It’s the same uri that is + used by gsutil. For example: “gs://bucket_name/object_name”. See `Viewing and Editing Object Metadata `__ for more information. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.GcsDestination) - ), + }, ) _sym_db.RegisterMessage(GcsDestination) PubsubDestination = _reflection.GeneratedProtocolMessageType( "PubsubDestination", (_message.Message,), - dict( - DESCRIPTOR=_PUBSUBDESTINATION, - __module__="google.cloud.asset_v1p2beta1.proto.asset_service_pb2", - __doc__="""A Cloud Pubsub destination. + { + "DESCRIPTOR": _PUBSUBDESTINATION, + "__module__": "google.cloud.asset_v1p2beta1.proto.asset_service_pb2", + "__doc__": """A Cloud Pubsub destination. Attributes: @@ -907,17 +894,17 @@ example: ``projects/PROJECT_ID/topics/TOPIC_ID``. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.PubsubDestination) - ), + }, ) _sym_db.RegisterMessage(PubsubDestination) FeedOutputConfig = _reflection.GeneratedProtocolMessageType( "FeedOutputConfig", (_message.Message,), - dict( - DESCRIPTOR=_FEEDOUTPUTCONFIG, - __module__="google.cloud.asset_v1p2beta1.proto.asset_service_pb2", - __doc__="""Output configuration for asset feed destination. + { + "DESCRIPTOR": _FEEDOUTPUTCONFIG, + "__module__": "google.cloud.asset_v1p2beta1.proto.asset_service_pb2", + "__doc__": """Output configuration for asset feed destination. Attributes: @@ -927,17 +914,17 @@ Destination on Cloud Pubsub. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.FeedOutputConfig) - ), + }, ) _sym_db.RegisterMessage(FeedOutputConfig) Feed = _reflection.GeneratedProtocolMessageType( "Feed", (_message.Message,), - dict( - DESCRIPTOR=_FEED, - __module__="google.cloud.asset_v1p2beta1.proto.asset_service_pb2", - __doc__="""An asset feed used to export asset updates to a + { + "DESCRIPTOR": _FEED, + "__module__": "google.cloud.asset_v1p2beta1.proto.asset_service_pb2", + "__doc__": """An asset feed used to export asset updates to a destinations. An asset feed filter controls what updates are exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: Cloud Pub/Sub topics. @@ -946,28 +933,27 @@ Attributes: name: Required. The format will be - projects/{project\_number}/feeds/{client- - assigned\_feed\_identifier} or - folders/{folder\_number}/feeds/{client- - assigned\_feed\_identifier} or - organizations/{organization\_number}/feeds/{client- - assigned\_feed\_identifier} The client-assigned feed - identifier must be unique within the parent - project/folder/organization. + projects/{project_number}/feeds/{client- + assigned_feed_identifier} or + folders/{folder_number}/feeds/{client- + assigned_feed_identifier} or + organizations/{organization_number}/feeds/{client- + assigned_feed_identifier} The client-assigned feed identifier + must be unique within the parent project/folder/organization. asset_names: A list of the full names of the assets to receive updates. You - must specify either or both of asset\_names and asset\_types. - Only asset updates matching specified asset\_names and - asset\_types are exported to the feed. For example: ``//comput - e.googleapis.com/projects/my_project_123/zones/zone1/instances - /instance1``. See `Resource Names `__ for more info. + must specify either or both of asset_names and asset_types. + Only asset updates matching specified asset_names and + asset_types are exported to the feed. For example: ``//compute + .googleapis.com/projects/my_project_123/zones/zone1/instances/ + instance1``. See `Resource Names `__ for more info. asset_types: A list of types of the assets to receive updates. You must - specify either or both of asset\_names and asset\_types. Only - asset updates matching specified asset\_names and asset\_types + specify either or both of asset_names and asset_types. Only + asset updates matching specified asset_names and asset_types are exported to the feed. For example: - "compute.googleapis.com/Disk" See `Introduction to Cloud Asset + “compute.googleapis.com/Disk” See `Introduction to Cloud Asset Inventory `__ for all supported asset types. @@ -979,7 +965,7 @@ updates are published to. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.Feed) - ), + }, ) _sym_db.RegisterMessage(Feed) @@ -1002,9 +988,7 @@ full_name="google.cloud.asset.v1p2beta1.AssetService", file=DESCRIPTOR, index=0, - serialized_options=_b( - "\312A\031cloudasset.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), + serialized_options=b"\312A\031cloudasset.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform", serialized_start=1636, serialized_end=2467, methods=[ @@ -1015,9 +999,7 @@ containing_service=None, input_type=_CREATEFEEDREQUEST, output_type=_FEED, - serialized_options=_b( - '\202\323\344\223\002""\035/v1p2beta1/{parent=*/*}/feeds:\001*\332A\006parent' - ), + serialized_options=b'\202\323\344\223\002""\035/v1p2beta1/{parent=*/*}/feeds:\001*\332A\006parent', ), _descriptor.MethodDescriptor( name="GetFeed", @@ -1026,9 +1008,7 @@ containing_service=None, input_type=_GETFEEDREQUEST, output_type=_FEED, - serialized_options=_b( - "\202\323\344\223\002\037\022\035/v1p2beta1/{name=*/*/feeds/*}\332A\004name" - ), + serialized_options=b"\202\323\344\223\002\037\022\035/v1p2beta1/{name=*/*/feeds/*}\332A\004name", ), _descriptor.MethodDescriptor( name="ListFeeds", @@ -1037,9 +1017,7 @@ containing_service=None, input_type=_LISTFEEDSREQUEST, output_type=_LISTFEEDSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002\037\022\035/v1p2beta1/{parent=*/*}/feeds\332A\006parent" - ), + serialized_options=b"\202\323\344\223\002\037\022\035/v1p2beta1/{parent=*/*}/feeds\332A\006parent", ), _descriptor.MethodDescriptor( name="UpdateFeed", @@ -1048,9 +1026,7 @@ containing_service=None, input_type=_UPDATEFEEDREQUEST, output_type=_FEED, - serialized_options=_b( - "\202\323\344\223\002'2\"/v1p2beta1/{feed.name=*/*/feeds/*}:\001*\332A\004feed" - ), + serialized_options=b"\202\323\344\223\002'2\"/v1p2beta1/{feed.name=*/*/feeds/*}:\001*\332A\004feed", ), _descriptor.MethodDescriptor( name="DeleteFeed", @@ -1059,9 +1035,7 @@ containing_service=None, input_type=_DELETEFEEDREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002\037*\035/v1p2beta1/{name=*/*/feeds/*}\332A\004name" - ), + serialized_options=b"\202\323\344\223\002\037*\035/v1p2beta1/{name=*/*/feeds/*}\332A\004name", ), ], ) diff --git a/google/cloud/asset_v1p2beta1/proto/assets_pb2.py b/google/cloud/asset_v1p2beta1/proto/assets_pb2.py index 24f9eca6..37d796ca 100644 --- a/google/cloud/asset_v1p2beta1/proto/assets_pb2.py +++ b/google/cloud/asset_v1p2beta1/proto/assets_pb2.py @@ -2,9 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/asset_v1p2beta1/proto/assets.proto -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -26,12 +23,8 @@ name="google/cloud/asset_v1p2beta1/proto/assets.proto", package="google.cloud.asset.v1p2beta1", syntax="proto3", - serialized_options=_b( - "\n com.google.cloud.asset.v1p2beta1B\nAssetProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset\370\001\001\252\002\034Google.Cloud.Asset.v1p2beta1\312\002\034Google\\Cloud\\Asset\\v1p2beta1" - ), - serialized_pb=_b( - '\n/google/cloud/asset_v1p2beta1/proto/assets.proto\x12\x1cgoogle.cloud.asset.v1p2beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x8e\x01\n\rTemporalAsset\x12\x38\n\x06window\x18\x01 \x01(\x0b\x32(.google.cloud.asset.v1p2beta1.TimeWindow\x12\x0f\n\x07\x64\x65leted\x18\x02 \x01(\x08\x12\x32\n\x05\x61sset\x18\x03 \x01(\x0b\x32#.google.cloud.asset.v1p2beta1.Asset"j\n\nTimeWindow\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\xa1\x01\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nasset_type\x18\x02 \x01(\t\x12\x38\n\x08resource\x18\x03 \x01(\x0b\x32&.google.cloud.asset.v1p2beta1.Resource\x12)\n\niam_policy\x18\x04 \x01(\x0b\x32\x15.google.iam.v1.Policy\x12\x11\n\tancestors\x18\x06 \x03(\t"\xa0\x01\n\x08Resource\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x1e\n\x16\x64iscovery_document_uri\x18\x02 \x01(\t\x12\x16\n\x0e\x64iscovery_name\x18\x03 \x01(\t\x12\x14\n\x0cresource_url\x18\x04 \x01(\t\x12\x0e\n\x06parent\x18\x05 \x01(\t\x12%\n\x04\x64\x61ta\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\xb4\x01\n com.google.cloud.asset.v1p2beta1B\nAssetProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset\xf8\x01\x01\xaa\x02\x1cGoogle.Cloud.Asset.v1p2beta1\xca\x02\x1cGoogle\\Cloud\\Asset\\v1p2beta1b\x06proto3' - ), + serialized_options=b"\n com.google.cloud.asset.v1p2beta1B\nAssetProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset\370\001\001\252\002\034Google.Cloud.Asset.v1p2beta1\312\002\034Google\\Cloud\\Asset\\v1p2beta1", + serialized_pb=b'\n/google/cloud/asset_v1p2beta1/proto/assets.proto\x12\x1cgoogle.cloud.asset.v1p2beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x8e\x01\n\rTemporalAsset\x12\x38\n\x06window\x18\x01 \x01(\x0b\x32(.google.cloud.asset.v1p2beta1.TimeWindow\x12\x0f\n\x07\x64\x65leted\x18\x02 \x01(\x08\x12\x32\n\x05\x61sset\x18\x03 \x01(\x0b\x32#.google.cloud.asset.v1p2beta1.Asset"j\n\nTimeWindow\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\xa1\x01\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nasset_type\x18\x02 \x01(\t\x12\x38\n\x08resource\x18\x03 \x01(\x0b\x32&.google.cloud.asset.v1p2beta1.Resource\x12)\n\niam_policy\x18\x04 \x01(\x0b\x32\x15.google.iam.v1.Policy\x12\x11\n\tancestors\x18\x06 \x03(\t"\xa0\x01\n\x08Resource\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x1e\n\x16\x64iscovery_document_uri\x18\x02 \x01(\t\x12\x16\n\x0e\x64iscovery_name\x18\x03 \x01(\t\x12\x14\n\x0cresource_url\x18\x04 \x01(\t\x12\x0e\n\x06parent\x18\x05 \x01(\t\x12%\n\x04\x64\x61ta\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructB\xb4\x01\n com.google.cloud.asset.v1p2beta1B\nAssetProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/asset/v1p2beta1;asset\xf8\x01\x01\xaa\x02\x1cGoogle.Cloud.Asset.v1p2beta1\xca\x02\x1cGoogle\\Cloud\\Asset\\v1p2beta1b\x06proto3', dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, google_dot_iam_dot_v1_dot_policy__pb2.DESCRIPTOR, @@ -190,7 +183,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -208,7 +201,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -301,7 +294,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -319,7 +312,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -337,7 +330,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -355,7 +348,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -373,7 +366,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -439,10 +432,10 @@ TemporalAsset = _reflection.GeneratedProtocolMessageType( "TemporalAsset", (_message.Message,), - dict( - DESCRIPTOR=_TEMPORALASSET, - __module__="google.cloud.asset_v1p2beta1.proto.assets_pb2", - __doc__="""Temporal asset. In addition to the asset, the temporal + { + "DESCRIPTOR": _TEMPORALASSET, + "__module__": "google.cloud.asset_v1p2beta1.proto.assets_pb2", + "__doc__": """Temporal asset. In addition to the asset, the temporal asset includes the status of the asset and valid from and to time of it. @@ -455,17 +448,17 @@ Asset. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.TemporalAsset) - ), + }, ) _sym_db.RegisterMessage(TemporalAsset) TimeWindow = _reflection.GeneratedProtocolMessageType( "TimeWindow", (_message.Message,), - dict( - DESCRIPTOR=_TIMEWINDOW, - __module__="google.cloud.asset_v1p2beta1.proto.assets_pb2", - __doc__="""A time window of (start\_time, end\_time]. + { + "DESCRIPTOR": _TIMEWINDOW, + "__module__": "google.cloud.asset_v1p2beta1.proto.assets_pb2", + "__doc__": """A time window of (start_time, end_time]. Attributes: @@ -476,17 +469,17 @@ not specified. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.TimeWindow) - ), + }, ) _sym_db.RegisterMessage(TimeWindow) Asset = _reflection.GeneratedProtocolMessageType( "Asset", (_message.Message,), - dict( - DESCRIPTOR=_ASSET, - __module__="google.cloud.asset_v1p2beta1.proto.assets_pb2", - __doc__="""Cloud asset. This includes all Google Cloud Platform + { + "DESCRIPTOR": _ASSET, + "__module__": "google.cloud.asset_v1p2beta1.proto.assets_pb2", + "__doc__": """Cloud asset. This includes all Google Cloud Platform resources, Cloud IAM policies, and other non-GCP assets. @@ -498,7 +491,7 @@ See https://cloud.google.com/apis/design/resource_names#full_resource_name for more information. asset_type: - Type of the asset. Example: "compute.googleapis.com/Disk". + Type of the asset. Example: “compute.googleapis.com/Disk”. resource: Representation of the resource. iam_policy: @@ -506,39 +499,39 @@ resource. For each resource, there must be at most one Cloud IAM policy set on it. ancestors: - Asset's ancestry path in Cloud Resource Manager (CRM) + Asset’s ancestry path in Cloud Resource Manager (CRM) hierarchy, represented as a list of relative resource names. Ancestry path starts with the closest CRM ancestor and ends at root. If the asset is a CRM project/folder/organization, this - starts from the asset itself. Example: ["projects/123456789", - "folders/5432", "organizations/1234"] + starts from the asset itself. Example: [“projects/123456789”, + “folders/5432”, “organizations/1234”] """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.Asset) - ), + }, ) _sym_db.RegisterMessage(Asset) Resource = _reflection.GeneratedProtocolMessageType( "Resource", (_message.Message,), - dict( - DESCRIPTOR=_RESOURCE, - __module__="google.cloud.asset_v1p2beta1.proto.assets_pb2", - __doc__="""Representation of a cloud resource. + { + "DESCRIPTOR": _RESOURCE, + "__module__": "google.cloud.asset_v1p2beta1.proto.assets_pb2", + "__doc__": """Representation of a cloud resource. Attributes: version: - The API version. Example: "v1". + The API version. Example: “v1”. discovery_document_uri: - The URL of the discovery document containing the resource's + The URL of the discovery document containing the resource’s JSON schema. For example: ``"https://www.googleapis.com/discov ery/v1/apis/compute/v1/rest"``. It will be left unspecified for resources without a discovery-based API, such as Cloud Bigtable. discovery_name: The JSON schema name listed in the discovery document. - Example: "Project". It will be left unspecified for resources + Example: “Project”. It will be left unspecified for resources (such as Cloud Bigtable) without a discovery-based API. resource_url: The REST URL for accessing the resource. An HTTP GET operation @@ -560,7 +553,7 @@ are scrubbed away and may not be present. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.Resource) - ), + }, ) _sym_db.RegisterMessage(Resource) diff --git a/google/cloud/asset_v1p4beta1/__init__.py b/google/cloud/asset_v1p4beta1/__init__.py new file mode 100644 index 00000000..867a9481 --- /dev/null +++ b/google/cloud/asset_v1p4beta1/__init__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import absolute_import +import sys +import warnings + +from google.cloud.asset_v1p4beta1 import types +from google.cloud.asset_v1p4beta1.gapic import asset_service_client +from google.cloud.asset_v1p4beta1.gapic import enums + + +if sys.version_info[:2] == (2, 7): + message = ( + "A future version of this library will drop support for Python 2.7." + "More details about Python 2 support for Google Cloud Client Libraries" + "can be found at https://cloud.google.com/python/docs/python2-sunset/" + ) + warnings.warn(message, DeprecationWarning) + + +class AssetServiceClient(asset_service_client.AssetServiceClient): + __doc__ = asset_service_client.AssetServiceClient.__doc__ + enums = enums + + +__all__ = ("enums", "types", "AssetServiceClient") diff --git a/google/cloud/asset_v1p4beta1/gapic/__init__.py b/google/cloud/asset_v1p4beta1/gapic/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/google/cloud/asset_v1p4beta1/gapic/asset_service_client.py b/google/cloud/asset_v1p4beta1/gapic/asset_service_client.py new file mode 100644 index 00000000..773d5d68 --- /dev/null +++ b/google/cloud/asset_v1p4beta1/gapic/asset_service_client.py @@ -0,0 +1,372 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Accesses the google.cloud.asset.v1p4beta1 AssetService API.""" + +import pkg_resources +import warnings + +from google.oauth2 import service_account +import google.api_core.client_options +import google.api_core.gapic_v1.client_info +import google.api_core.gapic_v1.config +import google.api_core.gapic_v1.method +import google.api_core.gapic_v1.routing_header +import google.api_core.grpc_helpers +import google.api_core.operation +import google.api_core.operations_v1 +import grpc + +from google.cloud.asset_v1p4beta1.gapic import asset_service_client_config +from google.cloud.asset_v1p4beta1.gapic import enums +from google.cloud.asset_v1p4beta1.gapic.transports import asset_service_grpc_transport +from google.cloud.asset_v1p4beta1.proto import asset_service_pb2 +from google.cloud.asset_v1p4beta1.proto import asset_service_pb2_grpc +from google.longrunning import operations_pb2 + + +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-asset").version + + +class AssetServiceClient(object): + """Asset service definition.""" + + SERVICE_ADDRESS = "cloudasset.googleapis.com:443" + """The default address of the service.""" + + # The name of the interface for this client. This is the key used to + # find the method configuration in the client_config dictionary. + _INTERFACE_NAME = "google.cloud.asset.v1p4beta1.AssetService" + + @classmethod + def from_service_account_file(cls, filename, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + AssetServiceClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file(filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + def __init__( + self, + transport=None, + channel=None, + credentials=None, + client_config=None, + client_info=None, + client_options=None, + ): + """Constructor. + + Args: + transport (Union[~.AssetServiceGrpcTransport, + Callable[[~.Credentials, type], ~.AssetServiceGrpcTransport]): A transport + instance, responsible for actually making the API calls. + The default transport uses the gRPC protocol. + This argument may also be a callable which returns a + transport instance. Callables will be sent the credentials + as the first argument and the default transport class as + the second argument. + channel (grpc.Channel): DEPRECATED. A ``Channel`` instance + through which to make calls. This argument is mutually exclusive + with ``credentials``; providing both will raise an exception. + credentials (google.auth.credentials.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is mutually exclusive with providing a + transport instance to ``transport``; doing so will raise + an exception. + client_config (dict): DEPRECATED. A dictionary of call options for + each method. If not specified, the default configuration is used. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + client_options (Union[dict, google.api_core.client_options.ClientOptions]): + Client options used to set user options on the client. API Endpoint + should be set through client_options. + """ + # Raise deprecation warnings for things we want to go away. + if client_config is not None: + warnings.warn( + "The `client_config` argument is deprecated.", + PendingDeprecationWarning, + stacklevel=2, + ) + else: + client_config = asset_service_client_config.config + + if channel: + warnings.warn( + "The `channel` argument is deprecated; use " "`transport` instead.", + PendingDeprecationWarning, + stacklevel=2, + ) + + api_endpoint = self.SERVICE_ADDRESS + if client_options: + if type(client_options) == dict: + client_options = google.api_core.client_options.from_dict( + client_options + ) + if client_options.api_endpoint: + api_endpoint = client_options.api_endpoint + + # Instantiate the transport. + # The transport is responsible for handling serialization and + # deserialization and actually sending data to the service. + if transport: + if callable(transport): + self.transport = transport( + credentials=credentials, + default_class=asset_service_grpc_transport.AssetServiceGrpcTransport, + address=api_endpoint, + ) + else: + if credentials: + raise ValueError( + "Received both a transport instance and " + "credentials; these are mutually exclusive." + ) + self.transport = transport + else: + self.transport = asset_service_grpc_transport.AssetServiceGrpcTransport( + address=api_endpoint, channel=channel, credentials=credentials + ) + + if client_info is None: + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION + ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION + self._client_info = client_info + + # Parse out the default settings for retry and timeout for each RPC + # from the client configuration. + # (Ordinarily, these are the defaults specified in the `*_config.py` + # file next to this one.) + self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( + client_config["interfaces"][self._INTERFACE_NAME] + ) + + # Save a dictionary of cached API call functions. + # These are the actual callables which invoke the proper + # transport methods, wrapped with `wrap_method` to add retry, + # timeout, and the like. + self._inner_api_calls = {} + + # Service calls + def analyze_iam_policy( + self, + analysis_query, + options_=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Analyzes IAM policies based on the specified request. Returns a list + of ``IamPolicyAnalysisResult`` matching the request. + + Example: + >>> from google.cloud import asset_v1p4beta1 + >>> + >>> client = asset_v1p4beta1.AssetServiceClient() + >>> + >>> # TODO: Initialize `analysis_query`: + >>> analysis_query = {} + >>> + >>> response = client.analyze_iam_policy(analysis_query) + + Args: + analysis_query (Union[dict, ~google.cloud.asset_v1p4beta1.types.IamPolicyAnalysisQuery]): Required. The request query. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.asset_v1p4beta1.types.IamPolicyAnalysisQuery` + options_ (Union[dict, ~google.cloud.asset_v1p4beta1.types.Options]): Optional. The request options. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.asset_v1p4beta1.types.Options` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.asset_v1p4beta1.types.AnalyzeIamPolicyResponse` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "analyze_iam_policy" not in self._inner_api_calls: + self._inner_api_calls[ + "analyze_iam_policy" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.analyze_iam_policy, + default_retry=self._method_configs["AnalyzeIamPolicy"].retry, + default_timeout=self._method_configs["AnalyzeIamPolicy"].timeout, + client_info=self._client_info, + ) + + request = asset_service_pb2.AnalyzeIamPolicyRequest( + analysis_query=analysis_query, options=options_ + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("analysis_query.parent", analysis_query.parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["analyze_iam_policy"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def export_iam_policy_analysis( + self, + analysis_query, + output_config, + options_=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Exports IAM policy analysis based on the specified request. This API + implements the ``google.longrunning.Operation`` API allowing you to keep + track of the export. The metadata contains the request to help callers + to map responses to requests. + + Example: + >>> from google.cloud import asset_v1p4beta1 + >>> + >>> client = asset_v1p4beta1.AssetServiceClient() + >>> + >>> # TODO: Initialize `analysis_query`: + >>> analysis_query = {} + >>> + >>> # TODO: Initialize `output_config`: + >>> output_config = {} + >>> + >>> response = client.export_iam_policy_analysis(analysis_query, output_config) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + analysis_query (Union[dict, ~google.cloud.asset_v1p4beta1.types.IamPolicyAnalysisQuery]): Required. The request query. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.asset_v1p4beta1.types.IamPolicyAnalysisQuery` + output_config (Union[dict, ~google.cloud.asset_v1p4beta1.types.IamPolicyAnalysisOutputConfig]): Required. Output configuration indicating where the results will be output to. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.asset_v1p4beta1.types.IamPolicyAnalysisOutputConfig` + options_ (Union[dict, ~google.cloud.asset_v1p4beta1.types.Options]): Optional. The request options. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.asset_v1p4beta1.types.Options` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.asset_v1p4beta1.types._OperationFuture` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "export_iam_policy_analysis" not in self._inner_api_calls: + self._inner_api_calls[ + "export_iam_policy_analysis" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.export_iam_policy_analysis, + default_retry=self._method_configs["ExportIamPolicyAnalysis"].retry, + default_timeout=self._method_configs["ExportIamPolicyAnalysis"].timeout, + client_info=self._client_info, + ) + + request = asset_service_pb2.ExportIamPolicyAnalysisRequest( + analysis_query=analysis_query, output_config=output_config, options=options_ + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("analysis_query.parent", analysis_query.parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + operation = self._inner_api_calls["export_iam_policy_analysis"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + asset_service_pb2.ExportIamPolicyAnalysisResponse, + metadata_type=asset_service_pb2.ExportIamPolicyAnalysisRequest, + ) diff --git a/google/cloud/asset_v1p4beta1/gapic/asset_service_client_config.py b/google/cloud/asset_v1p4beta1/gapic/asset_service_client_config.py new file mode 100644 index 00000000..0246a2c1 --- /dev/null +++ b/google/cloud/asset_v1p4beta1/gapic/asset_service_client_config.py @@ -0,0 +1,33 @@ +config = { + "interfaces": { + "google.cloud.asset.v1p4beta1.AssetService": { + "retry_codes": { + "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], + "non_idempotent": [], + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000, + } + }, + "methods": { + "AnalyzeIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "ExportIamPolicyAnalysis": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + }, + } + } +} diff --git a/google/cloud/asset_v1p4beta1/gapic/enums.py b/google/cloud/asset_v1p4beta1/gapic/enums.py new file mode 100644 index 00000000..8bf76999 --- /dev/null +++ b/google/cloud/asset_v1p4beta1/gapic/enums.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Wrappers for protocol buffer enum types.""" + +import enum + + +class Code(enum.IntEnum): + """ + The canonical error codes for gRPC APIs. + + Sometimes multiple error codes may apply. Services should return the + most specific error code that applies. For example, prefer + ``OUT_OF_RANGE`` over ``FAILED_PRECONDITION`` if both codes apply. + Similarly prefer ``NOT_FOUND`` or ``ALREADY_EXISTS`` over + ``FAILED_PRECONDITION``. + + Attributes: + OK (int): Not an error; returned on success + + HTTP Mapping: 200 OK + CANCELLED (int): The operation was cancelled, typically by the caller. + + HTTP Mapping: 499 Client Closed Request + UNKNOWN (int): Unknown error. For example, this error may be returned when a + ``Status`` value received from another address space belongs to an error + space that is not known in this address space. Also errors raised by + APIs that do not return enough error information may be converted to + this error. + + HTTP Mapping: 500 Internal Server Error + INVALID_ARGUMENT (int): The client specified an invalid argument. Note that this differs + from ``FAILED_PRECONDITION``. ``INVALID_ARGUMENT`` indicates arguments + that are problematic regardless of the state of the system (e.g., a + malformed file name). + + HTTP Mapping: 400 Bad Request + DEADLINE_EXCEEDED (int): The deadline expired before the operation could complete. For operations + that change the state of the system, this error may be returned + even if the operation has completed successfully. For example, a + successful response from a server could have been delayed long + enough for the deadline to expire. + + HTTP Mapping: 504 Gateway Timeout + NOT_FOUND (int): Some requested entity (e.g., file or directory) was not found. + + Note to server developers: if a request is denied for an entire class of + users, such as gradual feature rollout or undocumented whitelist, + ``NOT_FOUND`` may be used. If a request is denied for some users within + a class of users, such as user-based access control, + ``PERMISSION_DENIED`` must be used. + + HTTP Mapping: 404 Not Found + ALREADY_EXISTS (int): The entity that a client attempted to create (e.g., file or directory) + already exists. + + HTTP Mapping: 409 Conflict + PERMISSION_DENIED (int): The caller does not have permission to execute the specified + operation. ``PERMISSION_DENIED`` must not be used for rejections caused + by exhausting some resource (use ``RESOURCE_EXHAUSTED`` instead for + those errors). ``PERMISSION_DENIED`` must not be used if the caller can + not be identified (use ``UNAUTHENTICATED`` instead for those errors). + This error code does not imply the request is valid or the requested + entity exists or satisfies other pre-conditions. + + HTTP Mapping: 403 Forbidden + UNAUTHENTICATED (int): The request does not have valid authentication credentials for the + operation. + + HTTP Mapping: 401 Unauthorized + RESOURCE_EXHAUSTED (int): Some resource has been exhausted, perhaps a per-user quota, or + perhaps the entire file system is out of space. + + HTTP Mapping: 429 Too Many Requests + FAILED_PRECONDITION (int): The operation was rejected because the system is not in a state + required for the operation's execution. For example, the directory to be + deleted is non-empty, an rmdir operation is applied to a non-directory, + etc. + + Service implementors can use the following guidelines to decide between + ``FAILED_PRECONDITION``, ``ABORTED``, and ``UNAVAILABLE``: (a) Use + ``UNAVAILABLE`` if the client can retry just the failing call. (b) Use + ``ABORTED`` if the client should retry at a higher level (e.g., when a + client-specified test-and-set fails, indicating the client should + restart a read-modify-write sequence). (c) Use ``FAILED_PRECONDITION`` + if the client should not retry until the system state has been + explicitly fixed. E.g., if an "rmdir" fails because the directory is + non-empty, ``FAILED_PRECONDITION`` should be returned since the client + should not retry unless the files are deleted from the directory. + + HTTP Mapping: 400 Bad Request + ABORTED (int): The operation was aborted, typically due to a concurrency issue such + as a sequencer check failure or transaction abort. + + See the guidelines above for deciding between ``FAILED_PRECONDITION``, + ``ABORTED``, and ``UNAVAILABLE``. + + HTTP Mapping: 409 Conflict + OUT_OF_RANGE (int): The operation was attempted past the valid range. E.g., seeking or + reading past end-of-file. + + Unlike ``INVALID_ARGUMENT``, this error indicates a problem that may be + fixed if the system state changes. For example, a 32-bit file system + will generate ``INVALID_ARGUMENT`` if asked to read at an offset that is + not in the range [0,2^32-1], but it will generate ``OUT_OF_RANGE`` if + asked to read from an offset past the current file size. + + There is a fair bit of overlap between ``FAILED_PRECONDITION`` and + ``OUT_OF_RANGE``. We recommend using ``OUT_OF_RANGE`` (the more specific + error) when it applies so that callers who are iterating through a space + can easily look for an ``OUT_OF_RANGE`` error to detect when they are + done. + + HTTP Mapping: 400 Bad Request + UNIMPLEMENTED (int): The operation is not implemented or is not supported/enabled in this + service. + + HTTP Mapping: 501 Not Implemented + INTERNAL (int): Internal errors. This means that some invariants expected by the + underlying system have been broken. This error code is reserved + for serious errors. + + HTTP Mapping: 500 Internal Server Error + UNAVAILABLE (int): The service is currently unavailable. This is most likely a + transient condition, which can be corrected by retrying with a backoff. + Note that it is not always safe to retry non-idempotent operations. + + See the guidelines above for deciding between ``FAILED_PRECONDITION``, + ``ABORTED``, and ``UNAVAILABLE``. + + HTTP Mapping: 503 Service Unavailable + DATA_LOSS (int): Unrecoverable data loss or corruption. + + HTTP Mapping: 500 Internal Server Error + """ + + OK = 0 + CANCELLED = 1 + UNKNOWN = 2 + INVALID_ARGUMENT = 3 + DEADLINE_EXCEEDED = 4 + NOT_FOUND = 5 + ALREADY_EXISTS = 6 + PERMISSION_DENIED = 7 + UNAUTHENTICATED = 16 + RESOURCE_EXHAUSTED = 8 + FAILED_PRECONDITION = 9 + ABORTED = 10 + OUT_OF_RANGE = 11 + UNIMPLEMENTED = 12 + INTERNAL = 13 + UNAVAILABLE = 14 + DATA_LOSS = 15 diff --git a/google/cloud/asset_v1p4beta1/gapic/transports/__init__.py b/google/cloud/asset_v1p4beta1/gapic/transports/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/google/cloud/asset_v1p4beta1/gapic/transports/asset_service_grpc_transport.py b/google/cloud/asset_v1p4beta1/gapic/transports/asset_service_grpc_transport.py new file mode 100644 index 00000000..8695a6ff --- /dev/null +++ b/google/cloud/asset_v1p4beta1/gapic/transports/asset_service_grpc_transport.py @@ -0,0 +1,146 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import google.api_core.grpc_helpers +import google.api_core.operations_v1 + +from google.cloud.asset_v1p4beta1.proto import asset_service_pb2_grpc + + +class AssetServiceGrpcTransport(object): + """gRPC transport class providing stubs for + google.cloud.asset.v1p4beta1 AssetService API. + + The transport provides access to the raw gRPC stubs, + which can be used to take advantage of advanced + features of gRPC. + """ + + # The scopes needed to make gRPC calls to all of the methods defined + # in this service. + _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) + + def __init__( + self, channel=None, credentials=None, address="cloudasset.googleapis.com:443" + ): + """Instantiate the transport class. + + Args: + channel (grpc.Channel): A ``Channel`` instance through + which to make calls. This argument is mutually exclusive + with ``credentials``; providing both will raise an exception. + credentials (google.auth.credentials.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If none + are specified, the client will attempt to ascertain the + credentials from the environment. + address (str): The address where the service is hosted. + """ + # If both `channel` and `credentials` are specified, raise an + # exception (channels come with credentials baked in already). + if channel is not None and credentials is not None: + raise ValueError( + "The `channel` and `credentials` arguments are mutually " "exclusive." + ) + + # Create the channel. + if channel is None: + channel = self.create_channel( + address=address, + credentials=credentials, + options={ + "grpc.max_send_message_length": -1, + "grpc.max_receive_message_length": -1, + }.items(), + ) + + self._channel = channel + + # gRPC uses objects called "stubs" that are bound to the + # channel and provide a basic method for each RPC. + self._stubs = { + "asset_service_stub": asset_service_pb2_grpc.AssetServiceStub(channel) + } + + # Because this API includes a method that returns a + # long-running operation (proto: google.longrunning.Operation), + # instantiate an LRO client. + self._operations_client = google.api_core.operations_v1.OperationsClient( + channel + ) + + @classmethod + def create_channel( + cls, address="cloudasset.googleapis.com:443", credentials=None, **kwargs + ): + """Create and return a gRPC channel object. + + Args: + address (str): The host for the channel to use. + credentials (~.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If + none are specified, the client will attempt to ascertain + the credentials from the environment. + kwargs (dict): Keyword arguments, which are passed to the + channel creation. + + Returns: + grpc.Channel: A gRPC channel object. + """ + return google.api_core.grpc_helpers.create_channel( + address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs + ) + + @property + def channel(self): + """The gRPC channel used by the transport. + + Returns: + grpc.Channel: A gRPC channel object. + """ + return self._channel + + @property + def analyze_iam_policy(self): + """Return the gRPC stub for :meth:`AssetServiceClient.analyze_iam_policy`. + + Analyzes IAM policies based on the specified request. Returns a list + of ``IamPolicyAnalysisResult`` matching the request. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["asset_service_stub"].AnalyzeIamPolicy + + @property + def export_iam_policy_analysis(self): + """Return the gRPC stub for :meth:`AssetServiceClient.export_iam_policy_analysis`. + + Exports IAM policy analysis based on the specified request. This API + implements the ``google.longrunning.Operation`` API allowing you to keep + track of the export. The metadata contains the request to help callers + to map responses to requests. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["asset_service_stub"].ExportIamPolicyAnalysis diff --git a/google/cloud/asset_v1p4beta1/proto/__init__.py b/google/cloud/asset_v1p4beta1/proto/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/google/cloud/asset_v1p4beta1/proto/asset_service_pb2.py b/google/cloud/asset_v1p4beta1/proto/asset_service_pb2.py new file mode 100644 index 00000000..ddce8824 --- /dev/null +++ b/google/cloud/asset_v1p4beta1/proto/asset_service_pb2.py @@ -0,0 +1,1545 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/asset_v1p4beta1/proto/asset_service.proto + +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.cloud.asset_v1p4beta1.proto import ( + assets_pb2 as google_dot_cloud_dot_asset__v1p4beta1_dot_proto_dot_assets__pb2, +) +from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2 +from google.longrunning import ( + operations_pb2 as google_dot_longrunning_dot_operations__pb2, +) +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.api import client_pb2 as google_dot_api_dot_client__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/asset_v1p4beta1/proto/asset_service.proto", + package="google.cloud.asset.v1p4beta1", + syntax="proto3", + serialized_options=b"\n com.google.cloud.asset.v1p4beta1B\021AssetServiceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/asset/v1p4beta1;asset\252\002\034Google.Cloud.Asset.V1P4Beta1\312\002\034Google\\Cloud\\Asset\\V1p4beta1", + serialized_pb=b'\n6google/cloud/asset_v1p4beta1/proto/asset_service.proto\x12\x1cgoogle.cloud.asset.v1p4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a/google/cloud/asset_v1p4beta1/proto/assets.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x17google/api/client.proto"\xfe\x03\n\x16IamPolicyAnalysisQuery\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x65\n\x11resource_selector\x18\x02 \x01(\x0b\x32\x45.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelectorB\x03\xe0\x41\x01\x12\x65\n\x11identity_selector\x18\x03 \x01(\x0b\x32\x45.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelectorB\x03\xe0\x41\x01\x12\x61\n\x0f\x61\x63\x63\x65ss_selector\x18\x04 \x01(\x0b\x32\x43.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelectorB\x03\xe0\x41\x01\x1a\x33\n\x10ResourceSelector\x12\x1f\n\x12\x66ull_resource_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a)\n\x10IdentitySelector\x12\x15\n\x08identity\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a>\n\x0e\x41\x63\x63\x65ssSelector\x12\x12\n\x05roles\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x18\n\x0bpermissions\x18\x02 \x03(\tB\x03\xe0\x41\x01"\xd7\x03\n\x17\x41nalyzeIamPolicyRequest\x12Q\n\x0e\x61nalysis_query\x18\x01 \x01(\x0b\x32\x34.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQueryB\x03\xe0\x41\x02\x12S\n\x07options\x18\x02 \x01(\x0b\x32=.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.OptionsB\x03\xe0\x41\x01\x1a\x93\x02\n\x07Options\x12\x1a\n\rexpand_groups\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x19\n\x0c\x65xpand_roles\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1d\n\x10\x65xpand_resources\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12"\n\x15output_resource_edges\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\x12output_group_edges\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x32\n%analyze_service_account_impersonation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12\x39\n\x11\x65xecution_timeout\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01"\xbc\x04\n\x18\x41nalyzeIamPolicyResponse\x12_\n\rmain_analysis\x18\x01 \x01(\x0b\x32H.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis\x12x\n&service_account_impersonation_analysis\x18\x02 \x03(\x0b\x32H.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis\x12\x16\n\x0e\x66ully_explored\x18\x03 \x01(\x08\x12`\n\x13non_critical_errors\x18\x04 \x03(\x0b\x32\x43.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState\x1a\xca\x01\n\x11IamPolicyAnalysis\x12L\n\x0e\x61nalysis_query\x18\x01 \x01(\x0b\x32\x34.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery\x12O\n\x10\x61nalysis_results\x18\x02 \x03(\x0b\x32\x35.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult\x12\x16\n\x0e\x66ully_explored\x18\x03 \x01(\x08"\xb9\x01\n\x1dIamPolicyAnalysisOutputConfig\x12\x65\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32J.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestinationH\x00\x1a"\n\x0eGcsDestination\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\r\n\x0b\x64\x65stination"\x83\x04\n\x1e\x45xportIamPolicyAnalysisRequest\x12Q\n\x0e\x61nalysis_query\x18\x01 \x01(\x0b\x32\x34.google.cloud.asset.v1p4beta1.IamPolicyAnalysisQueryB\x03\xe0\x41\x02\x12Z\n\x07options\x18\x02 \x01(\x0b\x32\x44.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.OptionsB\x03\xe0\x41\x01\x12W\n\routput_config\x18\x03 \x01(\x0b\x32;.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfigB\x03\xe0\x41\x02\x1a\xd8\x01\n\x07Options\x12\x1a\n\rexpand_groups\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x19\n\x0c\x65xpand_roles\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1d\n\x10\x65xpand_resources\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12"\n\x15output_resource_edges\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\x12output_group_edges\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x32\n%analyze_service_account_impersonation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01"u\n\x1f\x45xportIamPolicyAnalysisResponse\x12R\n\routput_config\x18\x01 \x01(\x0b\x32;.google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig2\xe5\x04\n\x0c\x41ssetService\x12\xc2\x01\n\x10\x41nalyzeIamPolicy\x12\x35.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest\x1a\x36.google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse"?\x82\xd3\xe4\x93\x02\x39\x12\x37/v1p4beta1/{analysis_query.parent=*/*}:analyzeIamPolicy\x12\xc0\x02\n\x17\x45xportIamPolicyAnalysis\x12<.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest\x1a\x1d.google.longrunning.Operation"\xc7\x01\x82\xd3\xe4\x93\x02\x43">/v1p4beta1/{analysis_query.parent=*/*}:exportIamPolicyAnalysis:\x01*\xca\x41{\n`__ . + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.ResourceSelector) + }, + ), + "IdentitySelector": _reflection.GeneratedProtocolMessageType( + "IdentitySelector", + (_message.Message,), + { + "DESCRIPTOR": _IAMPOLICYANALYSISQUERY_IDENTITYSELECTOR, + "__module__": "google.cloud.asset_v1p4beta1.proto.asset_service_pb2", + "__doc__": """Specifies an identity for which to determine resource + access, based on roles assigned either directly to them or to the groups + they belong to, directly or indirectly. + + + Attributes: + identity: + Required. The identity appear in the form of members in `IAM + policy binding + `__. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.IdentitySelector) + }, + ), + "AccessSelector": _reflection.GeneratedProtocolMessageType( + "AccessSelector", + (_message.Message,), + { + "DESCRIPTOR": _IAMPOLICYANALYSISQUERY_ACCESSSELECTOR, + "__module__": "google.cloud.asset_v1p4beta1.proto.asset_service_pb2", + "__doc__": """Specifies roles and/or permissions to analyze, to + determine both the identities possessing them and the resources they + control. If multiple values are specified, results will include + identities and resources matching any of them. + + + Attributes: + roles: + Optional. The roles to appear in result. + permissions: + Optional. The permissions to appear in result. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery.AccessSelector) + }, + ), + "DESCRIPTOR": _IAMPOLICYANALYSISQUERY, + "__module__": "google.cloud.asset_v1p4beta1.proto.asset_service_pb2", + "__doc__": """IAM policy analysis query message. + + + Attributes: + parent: + Required. The relative name of the root asset. Only resources + and IAM policies within the parent will be analyzed. This can + only be an organization number (such as “organizations/123”) + or a folder number (such as “folders/123”). + resource_selector: + Optional. Specifies a resource for analysis. Leaving it empty + means ANY. + identity_selector: + Optional. Specifies an identity for analysis. Leaving it empty + means ANY. + access_selector: + Optional. Specifies roles or permissions for analysis. Leaving + it empty means ANY. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisQuery) + }, +) +_sym_db.RegisterMessage(IamPolicyAnalysisQuery) +_sym_db.RegisterMessage(IamPolicyAnalysisQuery.ResourceSelector) +_sym_db.RegisterMessage(IamPolicyAnalysisQuery.IdentitySelector) +_sym_db.RegisterMessage(IamPolicyAnalysisQuery.AccessSelector) + +AnalyzeIamPolicyRequest = _reflection.GeneratedProtocolMessageType( + "AnalyzeIamPolicyRequest", + (_message.Message,), + { + "Options": _reflection.GeneratedProtocolMessageType( + "Options", + (_message.Message,), + { + "DESCRIPTOR": _ANALYZEIAMPOLICYREQUEST_OPTIONS, + "__module__": "google.cloud.asset_v1p4beta1.proto.asset_service_pb2", + "__doc__": """Contains request options. + + + Attributes: + expand_groups: + Optional. If true, the identities section of the result will + expand any Google groups appearing in an IAM policy binding. + If [identity_selector][] is specified, the identity in the + result will be determined by the selector, and this flag will + have no effect. Default is false. + expand_roles: + Optional. If true, the access section of result will expand + any roles appearing in IAM policy bindings to include their + permissions. If [access_selector][] is specified, the access + section of the result will be determined by the selector, and + this flag will have no effect. Default is false. + expand_resources: + Optional. If true, the resource section of the result will + expand any resource attached to an IAM policy to include + resources lower in the resource hierarchy. For example, if + the request analyzes for which resources user A has permission + P, and the results include an IAM policy with P on a GCP + folder, the results will also include resources in that folder + with permission P. If [resource_selector][] is specified, the + resource section of the result will be determined by the + selector, and this flag will have no effect. Default is false. + output_resource_edges: + Optional. If true, the result will output resource edges, + starting from the policy attached resource, to any expanded + resources. Default is false. + output_group_edges: + Optional. If true, the result will output group identity + edges, starting from the binding’s group members, to any + expanded identities. Default is false. + analyze_service_account_impersonation: + Optional. If true, the response will include access analysis + from identities to resources via service account + impersonation. This is a very expensive operation, because + many derived queries will be executed. We highly recommend you + use ExportIamPolicyAnalysis rpc instead. For example, if the + request analyzes for which resources user A has permission P, + and there’s an IAM policy states user A has + iam.serviceAccounts.getAccessToken permission to a service + account SA, and there’s another IAM policy states service + account SA has permission P to a GCP folder F, then user A + potentially has access to the GCP folder F. And those advanced + analysis results will be included in [AnalyzeIamPolicyResponse + .service_account_impersonation_analysis][google.cloud.asset.v1 + p4beta1.AnalyzeIamPolicyResponse.service_account_impersonation + _analysis]. Another example, if the request analyzes for who + has permission P to a GCP folder F, and there’s an IAM policy + states user A has iam.serviceAccounts.actAs permission to a + service account SA, and there’s another IAM policy states + service account SA has permission P to the GCP folder F, then + user A potentially has access to the GCP folder F. And those + advanced analysis results will be included in [AnalyzeIamPolic + yResponse.service_account_impersonation_analysis][google.cloud + .asset.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impe + rsonation_analysis]. Default is false. + execution_timeout: + Optional. Amount of time executable has to complete. See JSON + representation of `Duration + `__. If this field is set with a + value less than the RPC deadline, and the execution of your + query hasn’t finished in the specified execution timeout, you + will get a response with partial result. Otherwise, your + query’s execution will continue until the RPC deadline. If + it’s not finished until then, you will get a DEADLINE_EXCEEDED + error. Default is empty. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest.Options) + }, + ), + "DESCRIPTOR": _ANALYZEIAMPOLICYREQUEST, + "__module__": "google.cloud.asset_v1p4beta1.proto.asset_service_pb2", + "__doc__": """A request message for + [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicy]. + + + Attributes: + analysis_query: + Required. The request query. + options: + Optional. The request options. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.AnalyzeIamPolicyRequest) + }, +) +_sym_db.RegisterMessage(AnalyzeIamPolicyRequest) +_sym_db.RegisterMessage(AnalyzeIamPolicyRequest.Options) + +AnalyzeIamPolicyResponse = _reflection.GeneratedProtocolMessageType( + "AnalyzeIamPolicyResponse", + (_message.Message,), + { + "IamPolicyAnalysis": _reflection.GeneratedProtocolMessageType( + "IamPolicyAnalysis", + (_message.Message,), + { + "DESCRIPTOR": _ANALYZEIAMPOLICYRESPONSE_IAMPOLICYANALYSIS, + "__module__": "google.cloud.asset_v1p4beta1.proto.asset_service_pb2", + "__doc__": """An analysis message to group the query and results. + + + Attributes: + analysis_query: + The analysis query. + analysis_results: + A list of [IamPolicyAnalysisResult][google.cloud.asset.v1p4bet + a1.IamPolicyAnalysisResult] that matches the analysis query, + or empty if no result is found. + fully_explored: + Represents whether all entries in the [analysis_results][googl + e.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnal + ysis.analysis_results] have been fully explored to answer the + query. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse.IamPolicyAnalysis) + }, + ), + "DESCRIPTOR": _ANALYZEIAMPOLICYRESPONSE, + "__module__": "google.cloud.asset_v1p4beta1.proto.asset_service_pb2", + "__doc__": """A response message for + [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicy]. + + + Attributes: + main_analysis: + The main analysis that matches the original request. + service_account_impersonation_analysis: + The service account impersonation analysis if [AnalyzeIamPolic + yRequest.analyze_service_account_impersonation][] is enabled. + fully_explored: + Represents whether all entries in the [main_analysis][google.c + loud.asset.v1p4beta1.AnalyzeIamPolicyResponse.main_analysis] + and [service_account_impersonation_analysis][google.cloud.asse + t.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impersona + tion_analysis] have been fully explored to answer the query in + the request. + non_critical_errors: + A list of non-critical errors happened during the request + handling to explain why ``fully_explored`` is false, or empty + if no error happened. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.AnalyzeIamPolicyResponse) + }, +) +_sym_db.RegisterMessage(AnalyzeIamPolicyResponse) +_sym_db.RegisterMessage(AnalyzeIamPolicyResponse.IamPolicyAnalysis) + +IamPolicyAnalysisOutputConfig = _reflection.GeneratedProtocolMessageType( + "IamPolicyAnalysisOutputConfig", + (_message.Message,), + { + "GcsDestination": _reflection.GeneratedProtocolMessageType( + "GcsDestination", + (_message.Message,), + { + "DESCRIPTOR": _IAMPOLICYANALYSISOUTPUTCONFIG_GCSDESTINATION, + "__module__": "google.cloud.asset_v1p4beta1.proto.asset_service_pb2", + "__doc__": """A Cloud Storage location. + + + Attributes: + uri: + Required. The uri of the Cloud Storage object. It’s the same + uri that is used by gsutil. For example: + “gs://bucket_name/object_name”. See `Viewing and Editing + Object Metadata + `__ for more information. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination) + }, + ), + "DESCRIPTOR": _IAMPOLICYANALYSISOUTPUTCONFIG, + "__module__": "google.cloud.asset_v1p4beta1.proto.asset_service_pb2", + "__doc__": """Output configuration for export IAM policy analysis + destination. + + + Attributes: + destination: + IAM policy analysis export destination. + gcs_destination: + Destination on Cloud Storage. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig) + }, +) +_sym_db.RegisterMessage(IamPolicyAnalysisOutputConfig) +_sym_db.RegisterMessage(IamPolicyAnalysisOutputConfig.GcsDestination) + +ExportIamPolicyAnalysisRequest = _reflection.GeneratedProtocolMessageType( + "ExportIamPolicyAnalysisRequest", + (_message.Message,), + { + "Options": _reflection.GeneratedProtocolMessageType( + "Options", + (_message.Message,), + { + "DESCRIPTOR": _EXPORTIAMPOLICYANALYSISREQUEST_OPTIONS, + "__module__": "google.cloud.asset_v1p4beta1.proto.asset_service_pb2", + "__doc__": """Contains request options. + + + Attributes: + expand_groups: + Optional. If true, the identities section of the result will + expand any Google groups appearing in an IAM policy binding. + If [identity_selector][] is specified, the identity in the + result will be determined by the selector, and this flag will + have no effect. Default is false. + expand_roles: + Optional. If true, the access section of result will expand + any roles appearing in IAM policy bindings to include their + permissions. If [access_selector][] is specified, the access + section of the result will be determined by the selector, and + this flag will have no effect. Default is false. + expand_resources: + Optional. If true, the resource section of the result will + expand any resource attached to an IAM policy to include + resources lower in the resource hierarchy. For example, if + the request analyzes for which resources user A has permission + P, and the results include an IAM policy with P on a GCP + folder, the results will also include resources in that folder + with permission P. If [resource_selector][] is specified, the + resource section of the result will be determined by the + selector, and this flag will have no effect. Default is false. + output_resource_edges: + Optional. If true, the result will output resource edges, + starting from the policy attached resource, to any expanded + resources. Default is false. + output_group_edges: + Optional. If true, the result will output group identity + edges, starting from the binding’s group members, to any + expanded identities. Default is false. + analyze_service_account_impersonation: + Optional. If true, the response will include access analysis + from identities to resources via service account + impersonation. This is a very expensive operation, because + many derived queries will be executed. For example, if the + request analyzes for which resources user A has permission P, + and there’s an IAM policy states user A has + iam.serviceAccounts.getAccessToken permission to a service + account SA, and there’s another IAM policy states service + account SA has permission P to a GCP folder F, then user A + potentially has access to the GCP folder F. And those advanced + analysis results will be included in [AnalyzeIamPolicyResponse + .service_account_impersonation_analysis][google.cloud.asset.v1 + p4beta1.AnalyzeIamPolicyResponse.service_account_impersonation + _analysis]. Another example, if the request analyzes for who + has permission P to a GCP folder F, and there’s an IAM policy + states user A has iam.serviceAccounts.actAs permission to a + service account SA, and there’s another IAM policy states + service account SA has permission P to the GCP folder F, then + user A potentially has access to the GCP folder F. And those + advanced analysis results will be included in [AnalyzeIamPolic + yResponse.service_account_impersonation_analysis][google.cloud + .asset.v1p4beta1.AnalyzeIamPolicyResponse.service_account_impe + rsonation_analysis]. Default is false. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest.Options) + }, + ), + "DESCRIPTOR": _EXPORTIAMPOLICYANALYSISREQUEST, + "__module__": "google.cloud.asset_v1p4beta1.proto.asset_service_pb2", + "__doc__": """A request message for + [AssetService.ExportIamPolicyAnalysis][google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysis]. + + + Attributes: + analysis_query: + Required. The request query. + options: + Optional. The request options. + output_config: + Required. Output configuration indicating where the results + will be output to. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest) + }, +) +_sym_db.RegisterMessage(ExportIamPolicyAnalysisRequest) +_sym_db.RegisterMessage(ExportIamPolicyAnalysisRequest.Options) + +ExportIamPolicyAnalysisResponse = _reflection.GeneratedProtocolMessageType( + "ExportIamPolicyAnalysisResponse", + (_message.Message,), + { + "DESCRIPTOR": _EXPORTIAMPOLICYANALYSISRESPONSE, + "__module__": "google.cloud.asset_v1p4beta1.proto.asset_service_pb2", + "__doc__": """The export IAM policy analysis response. This message is + returned by the [google.longrunning.Operations.GetOperation][] method in + the returned [google.longrunning.Operation.response][] field. + + + Attributes: + output_config: + Output configuration indicating where the results were output + to. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse) + }, +) +_sym_db.RegisterMessage(ExportIamPolicyAnalysisResponse) + + +DESCRIPTOR._options = None +_IAMPOLICYANALYSISQUERY_RESOURCESELECTOR.fields_by_name[ + "full_resource_name" +]._options = None +_IAMPOLICYANALYSISQUERY_IDENTITYSELECTOR.fields_by_name["identity"]._options = None +_IAMPOLICYANALYSISQUERY_ACCESSSELECTOR.fields_by_name["roles"]._options = None +_IAMPOLICYANALYSISQUERY_ACCESSSELECTOR.fields_by_name["permissions"]._options = None +_IAMPOLICYANALYSISQUERY.fields_by_name["parent"]._options = None +_IAMPOLICYANALYSISQUERY.fields_by_name["resource_selector"]._options = None +_IAMPOLICYANALYSISQUERY.fields_by_name["identity_selector"]._options = None +_IAMPOLICYANALYSISQUERY.fields_by_name["access_selector"]._options = None +_ANALYZEIAMPOLICYREQUEST_OPTIONS.fields_by_name["expand_groups"]._options = None +_ANALYZEIAMPOLICYREQUEST_OPTIONS.fields_by_name["expand_roles"]._options = None +_ANALYZEIAMPOLICYREQUEST_OPTIONS.fields_by_name["expand_resources"]._options = None +_ANALYZEIAMPOLICYREQUEST_OPTIONS.fields_by_name["output_resource_edges"]._options = None +_ANALYZEIAMPOLICYREQUEST_OPTIONS.fields_by_name["output_group_edges"]._options = None +_ANALYZEIAMPOLICYREQUEST_OPTIONS.fields_by_name[ + "analyze_service_account_impersonation" +]._options = None +_ANALYZEIAMPOLICYREQUEST_OPTIONS.fields_by_name["execution_timeout"]._options = None +_ANALYZEIAMPOLICYREQUEST.fields_by_name["analysis_query"]._options = None +_ANALYZEIAMPOLICYREQUEST.fields_by_name["options"]._options = None +_IAMPOLICYANALYSISOUTPUTCONFIG_GCSDESTINATION.fields_by_name["uri"]._options = None +_EXPORTIAMPOLICYANALYSISREQUEST_OPTIONS.fields_by_name["expand_groups"]._options = None +_EXPORTIAMPOLICYANALYSISREQUEST_OPTIONS.fields_by_name["expand_roles"]._options = None +_EXPORTIAMPOLICYANALYSISREQUEST_OPTIONS.fields_by_name[ + "expand_resources" +]._options = None +_EXPORTIAMPOLICYANALYSISREQUEST_OPTIONS.fields_by_name[ + "output_resource_edges" +]._options = None +_EXPORTIAMPOLICYANALYSISREQUEST_OPTIONS.fields_by_name[ + "output_group_edges" +]._options = None +_EXPORTIAMPOLICYANALYSISREQUEST_OPTIONS.fields_by_name[ + "analyze_service_account_impersonation" +]._options = None +_EXPORTIAMPOLICYANALYSISREQUEST.fields_by_name["analysis_query"]._options = None +_EXPORTIAMPOLICYANALYSISREQUEST.fields_by_name["options"]._options = None +_EXPORTIAMPOLICYANALYSISREQUEST.fields_by_name["output_config"]._options = None + +_ASSETSERVICE = _descriptor.ServiceDescriptor( + name="AssetService", + full_name="google.cloud.asset.v1p4beta1.AssetService", + file=DESCRIPTOR, + index=0, + serialized_options=b"\312A\031cloudasset.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform", + serialized_start=2710, + serialized_end=3323, + methods=[ + _descriptor.MethodDescriptor( + name="AnalyzeIamPolicy", + full_name="google.cloud.asset.v1p4beta1.AssetService.AnalyzeIamPolicy", + index=0, + containing_service=None, + input_type=_ANALYZEIAMPOLICYREQUEST, + output_type=_ANALYZEIAMPOLICYRESPONSE, + serialized_options=b"\202\323\344\223\0029\0227/v1p4beta1/{analysis_query.parent=*/*}:analyzeIamPolicy", + ), + _descriptor.MethodDescriptor( + name="ExportIamPolicyAnalysis", + full_name="google.cloud.asset.v1p4beta1.AssetService.ExportIamPolicyAnalysis", + index=1, + containing_service=None, + input_type=_EXPORTIAMPOLICYANALYSISREQUEST, + output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, + serialized_options=b'\202\323\344\223\002C">/v1p4beta1/{analysis_query.parent=*/*}:exportIamPolicyAnalysis:\001*\312A{\n\n\rAnalysisState\x12\x1e\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x10.google.rpc.Code\x12\r\n\x05\x63\x61use\x18\x02 \x01(\t\x1a\x83\x01\n\x08Resource\x12\x1a\n\x12\x66ull_resource_name\x18\x01 \x01(\t\x12[\n\x0e\x61nalysis_state\x18\x02 \x01(\x0b\x32\x43.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState\x1a\x9b\x01\n\x06\x41\x63\x63\x65ss\x12\x0e\n\x04role\x18\x01 \x01(\tH\x00\x12\x14\n\npermission\x18\x02 \x01(\tH\x00\x12[\n\x0e\x61nalysis_state\x18\x03 \x01(\x0b\x32\x43.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisStateB\x0e\n\x0coneof_access\x1a\x30\n\x04\x45\x64ge\x12\x13\n\x0bsource_node\x18\x01 \x01(\t\x12\x13\n\x0btarget_node\x18\x02 \x01(\t\x1au\n\x08Identity\x12\x0c\n\x04name\x18\x01 \x01(\t\x12[\n\x0e\x61nalysis_state\x18\x02 \x01(\x0b\x32\x43.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState\x1a\x8a\x02\n\x11\x41\x63\x63\x65ssControlList\x12Q\n\tresources\x18\x01 \x03(\x0b\x32>.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource\x12N\n\x08\x61\x63\x63\x65sses\x18\x02 \x03(\x0b\x32<.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access\x12R\n\x0eresource_edges\x18\x03 \x03(\x0b\x32:.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge\x1a\xb3\x01\n\x0cIdentityList\x12R\n\nidentities\x18\x01 \x03(\x0b\x32>.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity\x12O\n\x0bgroup_edges\x18\x02 \x03(\x0b\x32:.google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.EdgeB\xb4\x01\n com.google.cloud.asset.v1p4beta1B\nAssetProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/asset/v1p4beta1;asset\xf8\x01\x01\xaa\x02\x1cGoogle.Cloud.Asset.V1P4Beta1\xca\x02\x1cGoogle\\Cloud\\Asset\\V1p4beta1b\x06proto3', + dependencies=[ + google_dot_iam_dot_v1_dot_policy__pb2.DESCRIPTOR, + google_dot_rpc_dot_code__pb2.DESCRIPTOR, + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + ], +) + + +_IAMPOLICYANALYSISRESULT_ANALYSISSTATE = _descriptor.Descriptor( + name="AnalysisState", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="code", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.code", + index=0, + number=1, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="cause", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState.cause", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=490, + serialized_end=552, +) + +_IAMPOLICYANALYSISRESULT_RESOURCE = _descriptor.Descriptor( + name="Resource", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="full_resource_name", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.full_resource_name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="analysis_state", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource.analysis_state", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=555, + serialized_end=686, +) + +_IAMPOLICYANALYSISRESULT_ACCESS = _descriptor.Descriptor( + name="Access", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="role", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.role", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="permission", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.permission", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="analysis_state", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.analysis_state", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="oneof_access", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access.oneof_access", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=689, + serialized_end=844, +) + +_IAMPOLICYANALYSISRESULT_EDGE = _descriptor.Descriptor( + name="Edge", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="source_node", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.source_node", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="target_node", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.target_node", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=846, + serialized_end=894, +) + +_IAMPOLICYANALYSISRESULT_IDENTITY = _descriptor.Descriptor( + name="Identity", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="analysis_state", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity.analysis_state", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=896, + serialized_end=1013, +) + +_IAMPOLICYANALYSISRESULT_ACCESSCONTROLLIST = _descriptor.Descriptor( + name="AccessControlList", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="resources", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.resources", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="accesses", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.accesses", + index=1, + number=2, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="resource_edges", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList.resource_edges", + index=2, + number=3, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1016, + serialized_end=1282, +) + +_IAMPOLICYANALYSISRESULT_IDENTITYLIST = _descriptor.Descriptor( + name="IdentityList", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="identities", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.identities", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="group_edges", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList.group_edges", + index=1, + number=2, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1285, + serialized_end=1464, +) + +_IAMPOLICYANALYSISRESULT = _descriptor.Descriptor( + name="IamPolicyAnalysisResult", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="attached_resource_full_name", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.attached_resource_full_name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="iam_binding", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.iam_binding", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="access_control_lists", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.access_control_lists", + index=2, + number=3, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="identity_list", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.identity_list", + index=3, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="fully_explored", + full_name="google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.fully_explored", + index=4, + number=5, + type=8, + cpp_type=7, + label=1, + has_default_value=False, + default_value=False, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[ + _IAMPOLICYANALYSISRESULT_ANALYSISSTATE, + _IAMPOLICYANALYSISRESULT_RESOURCE, + _IAMPOLICYANALYSISRESULT_ACCESS, + _IAMPOLICYANALYSISRESULT_EDGE, + _IAMPOLICYANALYSISRESULT_IDENTITY, + _IAMPOLICYANALYSISRESULT_ACCESSCONTROLLIST, + _IAMPOLICYANALYSISRESULT_IDENTITYLIST, + ], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=163, + serialized_end=1464, +) + +_IAMPOLICYANALYSISRESULT_ANALYSISSTATE.fields_by_name[ + "code" +].enum_type = google_dot_rpc_dot_code__pb2._CODE +_IAMPOLICYANALYSISRESULT_ANALYSISSTATE.containing_type = _IAMPOLICYANALYSISRESULT +_IAMPOLICYANALYSISRESULT_RESOURCE.fields_by_name[ + "analysis_state" +].message_type = _IAMPOLICYANALYSISRESULT_ANALYSISSTATE +_IAMPOLICYANALYSISRESULT_RESOURCE.containing_type = _IAMPOLICYANALYSISRESULT +_IAMPOLICYANALYSISRESULT_ACCESS.fields_by_name[ + "analysis_state" +].message_type = _IAMPOLICYANALYSISRESULT_ANALYSISSTATE +_IAMPOLICYANALYSISRESULT_ACCESS.containing_type = _IAMPOLICYANALYSISRESULT +_IAMPOLICYANALYSISRESULT_ACCESS.oneofs_by_name["oneof_access"].fields.append( + _IAMPOLICYANALYSISRESULT_ACCESS.fields_by_name["role"] +) +_IAMPOLICYANALYSISRESULT_ACCESS.fields_by_name[ + "role" +].containing_oneof = _IAMPOLICYANALYSISRESULT_ACCESS.oneofs_by_name["oneof_access"] +_IAMPOLICYANALYSISRESULT_ACCESS.oneofs_by_name["oneof_access"].fields.append( + _IAMPOLICYANALYSISRESULT_ACCESS.fields_by_name["permission"] +) +_IAMPOLICYANALYSISRESULT_ACCESS.fields_by_name[ + "permission" +].containing_oneof = _IAMPOLICYANALYSISRESULT_ACCESS.oneofs_by_name["oneof_access"] +_IAMPOLICYANALYSISRESULT_EDGE.containing_type = _IAMPOLICYANALYSISRESULT +_IAMPOLICYANALYSISRESULT_IDENTITY.fields_by_name[ + "analysis_state" +].message_type = _IAMPOLICYANALYSISRESULT_ANALYSISSTATE +_IAMPOLICYANALYSISRESULT_IDENTITY.containing_type = _IAMPOLICYANALYSISRESULT +_IAMPOLICYANALYSISRESULT_ACCESSCONTROLLIST.fields_by_name[ + "resources" +].message_type = _IAMPOLICYANALYSISRESULT_RESOURCE +_IAMPOLICYANALYSISRESULT_ACCESSCONTROLLIST.fields_by_name[ + "accesses" +].message_type = _IAMPOLICYANALYSISRESULT_ACCESS +_IAMPOLICYANALYSISRESULT_ACCESSCONTROLLIST.fields_by_name[ + "resource_edges" +].message_type = _IAMPOLICYANALYSISRESULT_EDGE +_IAMPOLICYANALYSISRESULT_ACCESSCONTROLLIST.containing_type = _IAMPOLICYANALYSISRESULT +_IAMPOLICYANALYSISRESULT_IDENTITYLIST.fields_by_name[ + "identities" +].message_type = _IAMPOLICYANALYSISRESULT_IDENTITY +_IAMPOLICYANALYSISRESULT_IDENTITYLIST.fields_by_name[ + "group_edges" +].message_type = _IAMPOLICYANALYSISRESULT_EDGE +_IAMPOLICYANALYSISRESULT_IDENTITYLIST.containing_type = _IAMPOLICYANALYSISRESULT +_IAMPOLICYANALYSISRESULT.fields_by_name[ + "iam_binding" +].message_type = ( + google_dot_iam_dot_v1_dot_policy__pb2.google_dot_iam_dot_v1_dot_policy__pb2._BINDING +) +_IAMPOLICYANALYSISRESULT.fields_by_name[ + "access_control_lists" +].message_type = _IAMPOLICYANALYSISRESULT_ACCESSCONTROLLIST +_IAMPOLICYANALYSISRESULT.fields_by_name[ + "identity_list" +].message_type = _IAMPOLICYANALYSISRESULT_IDENTITYLIST +DESCRIPTOR.message_types_by_name["IamPolicyAnalysisResult"] = _IAMPOLICYANALYSISRESULT +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +IamPolicyAnalysisResult = _reflection.GeneratedProtocolMessageType( + "IamPolicyAnalysisResult", + (_message.Message,), + { + "AnalysisState": _reflection.GeneratedProtocolMessageType( + "AnalysisState", + (_message.Message,), + { + "DESCRIPTOR": _IAMPOLICYANALYSISRESULT_ANALYSISSTATE, + "__module__": "google.cloud.asset_v1p4beta1.proto.assets_pb2", + "__doc__": """Represents analysis state of each node in the result graph + or non-critical errors in the response. + + + Attributes: + code: + The Google standard error code that best describes the state. + For example: - OK means the node has been successfully + explored; - PERMISSION_DENIED means an access denied error is + encountered; - DEADLINE_EXCEEDED means the node hasn’t been + explored in time; + cause: + The human-readable description of the cause of failure. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AnalysisState) + }, + ), + "Resource": _reflection.GeneratedProtocolMessageType( + "Resource", + (_message.Message,), + { + "DESCRIPTOR": _IAMPOLICYANALYSISRESULT_RESOURCE, + "__module__": "google.cloud.asset_v1p4beta1.proto.assets_pb2", + "__doc__": """A GCP resource that appears in an access control list. + + + Attributes: + full_resource_name: + The `full resource name `__. + analysis_state: + The analysis state of this resource node. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Resource) + }, + ), + "Access": _reflection.GeneratedProtocolMessageType( + "Access", + (_message.Message,), + { + "DESCRIPTOR": _IAMPOLICYANALYSISRESULT_ACCESS, + "__module__": "google.cloud.asset_v1p4beta1.proto.assets_pb2", + "__doc__": """A role or permission that appears in an access control + list. + + + Attributes: + role: + The role. + permission: + The permission. + analysis_state: + The analysis state of this access node. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Access) + }, + ), + "Edge": _reflection.GeneratedProtocolMessageType( + "Edge", + (_message.Message,), + { + "DESCRIPTOR": _IAMPOLICYANALYSISRESULT_EDGE, + "__module__": "google.cloud.asset_v1p4beta1.proto.assets_pb2", + "__doc__": """A directional edge. + + + Attributes: + source_node: + The source node of the edge. + target_node: + The target node of the edge. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge) + }, + ), + "Identity": _reflection.GeneratedProtocolMessageType( + "Identity", + (_message.Message,), + { + "DESCRIPTOR": _IAMPOLICYANALYSISRESULT_IDENTITY, + "__module__": "google.cloud.asset_v1p4beta1.proto.assets_pb2", + "__doc__": """An identity that appears in an access control list. + + + Attributes: + name: + The identity name in any form of members appear in `IAM policy + binding + `__, + such as: - user:foo@google.com - group:group1@google.com - + serviceAccount:s1@prj1.iam.gserviceaccount.com - + projectOwner:some_project_id - domain:google.com - allUsers - + etc. + analysis_state: + The analysis state of this identity node. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Identity) + }, + ), + "AccessControlList": _reflection.GeneratedProtocolMessageType( + "AccessControlList", + (_message.Message,), + { + "DESCRIPTOR": _IAMPOLICYANALYSISRESULT_ACCESSCONTROLLIST, + "__module__": "google.cloud.asset_v1p4beta1.proto.assets_pb2", + "__doc__": """An access control list, derived from the above IAM policy + binding, which contains a set of resources and accesses. May include one + item from each set to compose an access control entry. + + NOTICE that there could be multiple access control lists for one IAM + policy binding. The access control lists are created based on resource + and access combinations. + + For example, assume we have the following cases in one IAM policy + binding: - Permission P1 and P2 apply to resource R1 and R2; - + Permission P3 applies to resource R2 and R3; + + This will result in the following access control lists: - + AccessControlList 1: [R1, R2], [P1, P2] - AccessControlList 2: [R2, R3], + [P3] + + + Attributes: + resources: + The resources that match one of the following conditions: - + The resource_selector, if it is specified in request; - + Otherwise, resources reachable from the policy attached + resource. + accesses: + The accesses that match one of the following conditions: - The + access_selector, if it is specified in request; - Otherwise, + access specifiers reachable from the policy binding’s role. + resource_edges: + Resource edges of the graph starting from the policy attached + resource to any descendant resources. The [Edge.source_node][g + oogle.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.Edge.sourc + e_node] contains the full resource name of a parent resource + and [Edge.target_node][google.cloud.asset.v1p4beta1.IamPolicyA + nalysisResult.Edge.target_node] contains the full resource + name of a child resource. This field is present only if the + output_resource_edges option is enabled in request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.AccessControlList) + }, + ), + "IdentityList": _reflection.GeneratedProtocolMessageType( + "IdentityList", + (_message.Message,), + { + "DESCRIPTOR": _IAMPOLICYANALYSISRESULT_IDENTITYLIST, + "__module__": "google.cloud.asset_v1p4beta1.proto.assets_pb2", + "__doc__": """ + Attributes: + identities: + Only the identities that match one of the following conditions + will be presented: - The identity_selector, if it is specified + in request; - Otherwise, identities reachable from the policy + binding’s members. + group_edges: + Group identity edges of the graph starting from the binding’s + group members to any node of the [identities][google.cloud.ass + et.v1p4beta1.IamPolicyAnalysisResult.IdentityList.identities]. + The [Edge.source_node][google.cloud.asset.v1p4beta1.IamPolicyA + nalysisResult.Edge.source_node] contains a group, such as + “group:parent@google.com”. The [Edge.target_node][google.cloud + .asset.v1p4beta1.IamPolicyAnalysisResult.Edge.target_node] + contains a member of the group, such as + “group:child@google.com” or “user:foo@google.com”. This field + is present only if the output_group_edges option is enabled in + request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.IdentityList) + }, + ), + "DESCRIPTOR": _IAMPOLICYANALYSISRESULT, + "__module__": "google.cloud.asset_v1p4beta1.proto.assets_pb2", + "__doc__": """IAM Policy analysis result, consisting of one IAM policy + binding and derived access control lists. + + + Attributes: + attached_resource_full_name: + The full name of the resource to which the [iam_binding][googl + e.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.iam_binding] + policy attaches. + iam_binding: + The Cloud IAM policy binding under analysis. + access_control_lists: + The access control lists derived from the [iam_binding][google + .cloud.asset.v1p4beta1.IamPolicyAnalysisResult.iam_binding] + that match or potentially match resource and access selectors + specified in the request. + identity_list: + The identity list derived from members of the [iam_binding][go + ogle.cloud.asset.v1p4beta1.IamPolicyAnalysisResult.iam_binding + ] that match or potentially match identity selector specified + in the request. + fully_explored: + Represents whether all nodes in the transitive closure of the + [iam_binding][google.cloud.asset.v1p4beta1.IamPolicyAnalysisRe + sult.iam_binding] node have been explored. + """, + # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisResult) + }, +) +_sym_db.RegisterMessage(IamPolicyAnalysisResult) +_sym_db.RegisterMessage(IamPolicyAnalysisResult.AnalysisState) +_sym_db.RegisterMessage(IamPolicyAnalysisResult.Resource) +_sym_db.RegisterMessage(IamPolicyAnalysisResult.Access) +_sym_db.RegisterMessage(IamPolicyAnalysisResult.Edge) +_sym_db.RegisterMessage(IamPolicyAnalysisResult.Identity) +_sym_db.RegisterMessage(IamPolicyAnalysisResult.AccessControlList) +_sym_db.RegisterMessage(IamPolicyAnalysisResult.IdentityList) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/google/cloud/asset_v1p4beta1/proto/assets_pb2_grpc.py b/google/cloud/asset_v1p4beta1/proto/assets_pb2_grpc.py new file mode 100644 index 00000000..07cb78fe --- /dev/null +++ b/google/cloud/asset_v1p4beta1/proto/assets_pb2_grpc.py @@ -0,0 +1,2 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc diff --git a/google/cloud/asset_v1p4beta1/types.py b/google/cloud/asset_v1p4beta1/types.py new file mode 100644 index 00000000..6edd4433 --- /dev/null +++ b/google/cloud/asset_v1p4beta1/types.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from __future__ import absolute_import +import sys + +from google.api_core.protobuf_helpers import get_messages + +from google.cloud.asset_v1p4beta1.proto import asset_service_pb2 +from google.cloud.asset_v1p4beta1.proto import assets_pb2 +from google.iam.v1 import policy_pb2 +from google.longrunning import operations_pb2 +from google.protobuf import any_pb2 +from google.protobuf import duration_pb2 +from google.rpc import status_pb2 +from google.type import expr_pb2 + + +_shared_modules = [ + policy_pb2, + operations_pb2, + any_pb2, + duration_pb2, + status_pb2, + expr_pb2, +] + +_local_modules = [asset_service_pb2, assets_pb2] + +names = [] + +for module in _shared_modules: # pragma: NO COVER + for name, message in get_messages(module).items(): + setattr(sys.modules[__name__], name, message) + names.append(name) +for module in _local_modules: + for name, message in get_messages(module).items(): + message.__module__ = "google.cloud.asset_v1p4beta1.types" + setattr(sys.modules[__name__], name, message) + names.append(name) + + +__all__ = tuple(sorted(names)) diff --git a/synth.metadata b/synth.metadata index 2dcc7ca9..b66e0adb 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,20 +1,47 @@ { - "updateTime": "2020-03-03T13:13:26.707956Z", + "updateTime": "2020-03-16T17:29:50.350305Z", "sources": [ { "generator": { "name": "artman", - "version": "0.47.0", - "dockerImage": "googleapis/artman@sha256:b3e50d6b8de03920b9f065bbc3d210e2ca93a043446f1fa16cdf567393c09678" + "version": "1.1.0", + "dockerImage": "googleapis/artman@sha256:f54b7644a1d2e7a37b23f5c0dfe9bba473e41c675002a507a244389e27487ca9" + } + }, + { + "generator": { + "name": "artman", + "version": "1.1.0", + "dockerImage": "googleapis/artman@sha256:f54b7644a1d2e7a37b23f5c0dfe9bba473e41c675002a507a244389e27487ca9" + } + }, + { + "generator": { + "name": "artman", + "version": "1.1.0", + "dockerImage": "googleapis/artman@sha256:f54b7644a1d2e7a37b23f5c0dfe9bba473e41c675002a507a244389e27487ca9" + } + }, + { + "generator": { + "name": "artman", + "version": "1.1.0", + "dockerImage": "googleapis/artman@sha256:f54b7644a1d2e7a37b23f5c0dfe9bba473e41c675002a507a244389e27487ca9" + } + }, + { + "git": { + "name": ".", + "remote": "git@github.com:googleapis/python-asset.git", + "sha": "37067265776c1ee5e21feeb709679d5c1e981dee" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4a180bfff8a21645b3a935c2756e8d6ab18a74e0", - "internalRef": "298484782", - "log": "4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\ne7d8a694f4559201e6913f6610069cb08b39274e\nDepend on the latest gapic-generator and resource names plugin.\n\nThis fixes the very old an very annoying bug: https://github.com/googleapis/gapic-generator/pull/3087\n\nPiperOrigin-RevId: 293903652\n\n806b2854a966d55374ee26bb0cef4e30eda17b58\nfix: correct capitalization of Ruby namespaces in SecurityCenter V1p1beta1\n\nPiperOrigin-RevId: 293903613\n\n1b83c92462b14d67a7644e2980f723112472e03a\nPublish annotations and grpc service config for Logging API.\n\nPiperOrigin-RevId: 293893514\n\n" + "sha": "ae78682c05e864d71223ce22532219813b0245ac", + "internalRef": "301185150" } }, { @@ -32,8 +59,7 @@ "apiName": "asset", "apiVersion": "v1beta1", "language": "python", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1beta1.yaml" + "generator": "bazel" } }, { @@ -42,18 +68,16 @@ "apiName": "asset", "apiVersion": "v1p2beta1", "language": "python", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1p2beta1.yaml" + "generator": "bazel" } }, { "client": { "source": "googleapis", "apiName": "asset", - "apiVersion": "v1p1beta1", + "apiVersion": "v1p4beta1", "language": "python", - "generator": "gapic", - "config": "google/cloud/asset/v1p1beta1/artman_cloudasset_v1p1beta1.yaml" + "generator": "bazel" } }, { @@ -62,8 +86,7 @@ "apiName": "asset", "apiVersion": "v1", "language": "python", - "generator": "gapic", - "config": "google/cloud/asset/artman_cloudasset_v1.yaml" + "generator": "bazel" } } ] diff --git a/synth.py b/synth.py index 075edeeb..39633ce5 100644 --- a/synth.py +++ b/synth.py @@ -17,9 +17,9 @@ import synthtool as s from synthtool import gcp -gapic = gcp.GAPICGenerator() +gapic = gcp.GAPICBazel() common = gcp.CommonTemplates() -versions = ["v1beta1", "v1p2beta1", "v1p1beta1", "v1"] +versions = ["v1beta1", "v1p2beta1", "v1p4beta1", "v1"] excludes = ["setup.py", "nox*.py", "README.rst", "docs/conf.py", "docs/index.rst"] @@ -27,17 +27,19 @@ # Generate asset GAPIC layer # ---------------------------------------------------------------------------- for version in versions: + # v1p1beta1 is missing a BUILD.bazel file + # Don't use Artman once that is resolved + artman_gapic = gcp.GAPICGenerator() if version == "v1p1beta1": - config_path = "/google/cloud/asset/v1p1beta1/artman_cloudasset_v1p1beta1.yaml" + library = artman_gapic.py_library( + "asset", + version=version, + ) else: - config_path = f"/google/cloud/asset/artman_cloudasset_{version}.yaml" - library = gapic.py_library( - "asset", - version, - config_path=config_path, - artman_output_name=f"asset-{version}", - include_protos=True, - ) + library = gapic.py_library( + "asset", + version, + ) s.move(library, excludes=excludes) @@ -65,14 +67,12 @@ s.replace( "google/cloud/asset_v*/proto/assets_pb2.py", - "_IAMPOLICYSEARCHRESULT\.fields_by_name\['policy'\]\.message_type " - "= google_dot_iam_dot_v1_dot_policy__pb2\._POLICY", - "_IAMPOLICYSEARCHRESULT.fields_by_name['policy'].message_type = google_dot_iam_dot" - "_v1_dot_policy__pb2.google_dot_iam_dot_v1_dot_policy__pb2._POLICY", + "_IAMPOLICYANALYSISRESULT\.fields_by_name\['iam_binding'\]\.message_type " + "= google_dot_iam_dot_v1_dot_policy__pb2\._BINDING", + "_IAMPOLICYANALYSISRESULT.fields_by_name['iam_binding'].message_type = google_dot_iam_dot" + "_v1_dot_policy__pb2.google_dot_iam_dot_v1_dot_policy__pb2._BINDING", ) - - _BORKED_ASSET_DOCSTRING = """\ The full name of the asset. For example: ``//compute.googleapi s.com/projects/my_project_123/zones/zone1/instances/instance1` @@ -101,8 +101,8 @@ # Fix docstrings with no summary line s.replace( "google/cloud/**/proto/*_pb2.py", - r'''__doc__\s*=\s*"""Attributes:''', - '''__doc__ = """ + r''''__doc__': """Attributes:''', + ''''__doc__' : """ Attributes:''', ) diff --git a/tests/unit/gapic/v1p4beta1/test_asset_service_client_v1p4beta1.py b/tests/unit/gapic/v1p4beta1/test_asset_service_client_v1p4beta1.py new file mode 100644 index 00000000..2af93af0 --- /dev/null +++ b/tests/unit/gapic/v1p4beta1/test_asset_service_client_v1p4beta1.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests.""" + +import mock +import pytest + +from google.rpc import status_pb2 + +from google.cloud import asset_v1p4beta1 +from google.cloud.asset_v1p4beta1.proto import asset_service_pb2 +from google.longrunning import operations_pb2 + + +class MultiCallableStub(object): + """Stub for the grpc.UnaryUnaryMultiCallable interface.""" + + def __init__(self, method, channel_stub): + self.method = method + self.channel_stub = channel_stub + + def __call__(self, request, timeout=None, metadata=None, credentials=None): + self.channel_stub.requests.append((self.method, request)) + + response = None + if self.channel_stub.responses: + response = self.channel_stub.responses.pop() + + if isinstance(response, Exception): + raise response + + if response: + return response + + +class ChannelStub(object): + """Stub for the grpc.Channel interface.""" + + def __init__(self, responses=[]): + self.responses = responses + self.requests = [] + + def unary_unary(self, method, request_serializer=None, response_deserializer=None): + return MultiCallableStub(method, self) + + +class CustomException(Exception): + pass + + +class TestAssetServiceClient(object): + def test_analyze_iam_policy(self): + # Setup Expected Response + fully_explored = True + expected_response = {"fully_explored": fully_explored} + expected_response = asset_service_pb2.AnalyzeIamPolicyResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = asset_v1p4beta1.AssetServiceClient() + + # Setup Request + analysis_query = {} + + response = client.analyze_iam_policy(analysis_query) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = asset_service_pb2.AnalyzeIamPolicyRequest( + analysis_query=analysis_query + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_analyze_iam_policy_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = asset_v1p4beta1.AssetServiceClient() + + # Setup request + analysis_query = {} + + with pytest.raises(CustomException): + client.analyze_iam_policy(analysis_query) + + def test_export_iam_policy_analysis(self): + # Setup Expected Response + expected_response = {} + expected_response = asset_service_pb2.ExportIamPolicyAnalysisResponse( + **expected_response + ) + operation = operations_pb2.Operation( + name="operations/test_export_iam_policy_analysis", done=True + ) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = asset_v1p4beta1.AssetServiceClient() + + # Setup Request + analysis_query = {} + output_config = {} + + response = client.export_iam_policy_analysis(analysis_query, output_config) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = asset_service_pb2.ExportIamPolicyAnalysisRequest( + analysis_query=analysis_query, output_config=output_config + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_export_iam_policy_analysis_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name="operations/test_export_iam_policy_analysis_exception", done=True + ) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = asset_v1p4beta1.AssetServiceClient() + + # Setup Request + analysis_query = {} + output_config = {} + + response = client.export_iam_policy_analysis(analysis_query, output_config) + exception = response.exception() + assert exception.errors[0] == error