From 518cf0d26dc0e850a20d8725d2ae7d15c8004684 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 17 Mar 2020 16:25:09 -0700 Subject: [PATCH] docs: update docstrings (via synth) (#19) --- .../asset_v1/gapic/asset_service_client.py | 148 +++++++++++------ google/cloud/asset_v1/gapic/enums.py | 8 +- .../asset_service_grpc_transport.py | 20 +-- .../cloud/asset_v1/proto/asset_service_pb2.py | 19 ++- .../gapic/asset_service_client.py | 78 +++++---- google/cloud/asset_v1beta1/gapic/enums.py | 12 +- .../asset_service_grpc_transport.py | 37 +++-- .../asset_v1beta1/proto/asset_service_pb2.py | 6 +- .../cloud/asset_v1beta1/proto/assets_pb2.py | 4 +- .../gapic/asset_service_client.py | 63 +++++--- .../proto/asset_service_pb2.py | 11 +- .../gapic/asset_service_client.py | 16 +- google/cloud/asset_v1p4beta1/gapic/enums.py | 150 ++++++++---------- .../asset_service_grpc_transport.py | 16 +- .../proto/asset_service_pb2.py | 16 +- synth.metadata | 30 ++-- 16 files changed, 366 insertions(+), 268 deletions(-) diff --git a/google/cloud/asset_v1/gapic/asset_service_client.py b/google/cloud/asset_v1/gapic/asset_service_client.py index 4be88395..1e5cafbf 100644 --- a/google/cloud/asset_v1/gapic/asset_service_client.py +++ b/google/cloud/asset_v1/gapic/asset_service_client.py @@ -215,10 +215,12 @@ def export_assets( metadata=None, ): """ - Exports assets with time and resource types to a given Cloud Storage - location. The output format is newline-delimited JSON. This API - implements the ``google.longrunning.Operation`` API allowing you to keep - track of the export. + Additional information regarding long-running operations. In + particular, this specifies the types that are returned from long-running + operations. + + Required for methods that return ``google.longrunning.Operation``; + invalid otherwise. Example: >>> from google.cloud import asset_v1 @@ -338,12 +340,10 @@ 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. + JSON name of this field. The value is set by protocol compiler. If + the user has set a "json_name" option on this field, that option's value + will be used. Otherwise, it's deduced from the field's name by + converting it to camelCase. Example: >>> from google.cloud import asset_v1 @@ -367,25 +367,22 @@ 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]): Manages long-running operations with an API service. + + When an API method normally takes long time to complete, it can be + designed to return ``Operation`` to the client, and the client can use + this interface to receive the real response asynchronously by polling + the operation resource, or pass the operation resource to another API + (such as Google Cloud Pub/Sub API) to receive the response. Any API + service that returns long-running operations should implement the + ``Operations`` interface so developers can have a consistent client + experience. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1.types.TimeWindow` - asset_names (list[str]): A list of the full names of the assets. For example: - ``//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1``. - See `Resource - Names `__ - and `Resource Name - Format `__ - for more info. - - The request becomes a no-op if the asset name list is empty, and the max - size of the asset name list is 100 in one request. + asset_names (list[str]): The resource has one pattern, but the API owner expects to add more + later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + that from being necessary once there are multiple patterns.) 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. @@ -476,11 +473,37 @@ 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]): Each of the definitions above may have "options" attached. These are + just annotations which may cause code to be generated slightly + differently or may contain hints for code that manipulates protocol + messages. + + Clients may define custom options as extensions of the \*Options + messages. These extensions may not yet be known at parsing time, so the + parser cannot store the values in them. Instead it stores them in a + field in the \*Options message called uninterpreted_option. This field + must have the same name across all \*Options messages. We then use this + field to populate the extensions when we build a descriptor, at which + point all protos have been parsed and so all extensions are known. + + Extension numbers for custom options may be chosen as follows: + + - For options which will only be used within a single application or + organization, or for experimental options, use field numbers 50000 + through 99999. It is up to you to ensure that you do not use the same + number for multiple options. + - For options which will be published and used publicly by multiple + independent entities, e-mail + protobuf-global-extension-registry@google.com to reserve extension + numbers. Simply provide your project name (e.g. Objective-C plugin) + and your project website (if available) -- there's no need to explain + how you intend to use them. Usually you only need one extension + number. You can declare multiple options with only one extension + number by putting them in a sub-message. See the Custom Options + section of the docs for examples: + https://developers.google.com/protocol-buffers/docs/proto#options If + this turns out to be popular, a web service will be set up to + automatically assign option numbers. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1.types.Feed` @@ -554,10 +577,16 @@ def get_feed( >>> response = client.get_feed(name) 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 + name (str): The resource type. It must be in the format of + {service_name}/{resource_type_kind}. The ``resource_type_kind`` must be + singular and must not include version numbers. + + Example: ``storage.googleapis.com/Bucket`` + + The value of the resource_type_kind must follow the regular expression + /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + should use PascalCase (UpperCamelCase). The maximum number of characters + allowed for the ``resource_type_kind`` is 100. 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. @@ -703,17 +732,36 @@ 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]): See ``HttpRule``. 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]): A URL/resource name that uniquely identifies the type of the + serialized protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must represent the + fully qualified name of the type (as in + ``path/google.protobuf.Duration``). The name should be in a canonical + form (e.g., leading "." is not accepted). + + In practice, teams usually precompile into the binary all types that + they expect it to use in the context of Any. However, for URLs which use + the scheme ``http``, ``https``, or no scheme, one can optionally set up + a type server that maps type URLs to message definitions as follows: + + - If no scheme is provided, ``https`` is assumed. + - An HTTP GET on the URL must yield a ``google.protobuf.Type`` value in + binary format, or produce an error. + - Applications are allowed to cache lookup results based on the URL, or + have them precompiled into a binary to avoid any lookup. Therefore, + binary compatibility needs to be preserved on changes to types. (Use + versioned type names to manage breaking changes.) + + Note: this functionality is not currently available in the official + protobuf release, and it is not used for type URLs beginning with + type.googleapis.com. + + Schemes other than ``http``, ``https`` (or the empty scheme) might be + used with implementation specific semantics. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1.types.FieldMask` @@ -787,10 +835,16 @@ def delete_feed( >>> client.delete_feed(name) 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 + name (str): A list of the full names of the assets. For example: + ``//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1``. + See `Resource + Names `__ + and `Resource Name + Format `__ + for more info. + + The request becomes a no-op if the asset name list is empty, and the max + size of the asset name list is 100 in one request. 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 c0f9fc85..9eca5c50 100644 --- a/google/cloud/asset_v1/gapic/enums.py +++ b/google/cloud/asset_v1/gapic/enums.py @@ -40,10 +40,10 @@ class ContentType(enum.IntEnum): class NullValue(enum.IntEnum): """ - ``NullValue`` is a singleton enumeration to represent the null value - for the ``Value`` type union. - - The JSON representation for ``NullValue`` is JSON ``null``. + 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 Attributes: NULL_VALUE (int): Null value. 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 9e8c0ecc..57a53847 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 @@ -119,10 +119,12 @@ def channel(self): def export_assets(self): """Return the gRPC stub for :meth:`AssetServiceClient.export_assets`. - Exports assets with time and resource types to a given Cloud Storage - location. The output format is newline-delimited JSON. This API - implements the ``google.longrunning.Operation`` API allowing you to keep - track of the export. + Additional information regarding long-running operations. In + particular, this specifies the types that are returned from long-running + operations. + + Required for methods that return ``google.longrunning.Operation``; + invalid otherwise. Returns: Callable: A callable which accepts the appropriate @@ -135,12 +137,10 @@ 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. + JSON name of this field. The value is set by protocol compiler. If + the user has set a "json_name" option on this field, that option's value + will be used. Otherwise, it's deduced from the field's name by + converting it to camelCase. 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 46ef64f7..28499ca6 100644 --- a/google/cloud/asset_v1/proto/asset_service_pb2.py +++ b/google/cloud/asset_v1/proto/asset_service_pb2.py @@ -1244,10 +1244,10 @@ te.googleapis.com/projects/my_project_123/zones/zone1/instance s/instance1``. See `Resource Names `__ and `Resource - Name Format `__ for more info. The - request becomes a no-op if the asset name list is empty, and - the max size of the asset name list is 100 in one request. + Name Format `__ for more info. The request becomes + a no-op if the asset name list is empty, and the max size of + the asset name list is 100 in one request. content_type: Optional. The content type. read_time_window: @@ -1559,9 +1559,8 @@ Attributes: name: - Required. The format will be - projects/{project_number}/feeds/{client- - assigned_feed_identifier} or + 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- @@ -1581,9 +1580,9 @@ 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 - Inventory `__ for all - supported asset types. + Inventory `__ for all supported asset + types. content_type: Asset content type. If not specified, no content but the asset name and type will be returned. diff --git a/google/cloud/asset_v1beta1/gapic/asset_service_client.py b/google/cloud/asset_v1beta1/gapic/asset_service_client.py index 58956ba2..1102fa63 100644 --- a/google/cloud/asset_v1beta1/gapic/asset_service_client.py +++ b/google/cloud/asset_v1beta1/gapic/asset_service_client.py @@ -206,10 +206,7 @@ def export_assets( metadata=None, ): """ - Exports assets with time and resource types to a given Cloud Storage - location. The output format is newline-delimited JSON. This API - implements the ``google.longrunning.Operation`` API allowing you to keep - track of the export. + See ``HttpRule``. Example: >>> from google.cloud import asset_v1beta1 @@ -250,11 +247,15 @@ def export_assets( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1beta1.types.Timestamp` - asset_types (list[str]): A list of asset types of which to take a snapshot for. For example: - "google.compute.Disk". If specified, only matching assets will be - returned. See `Introduction to Cloud Asset - Inventory `__ - for all supported asset types. + asset_types (list[str]): Waits for the specified long-running operation until it is done or + reaches at most a specified timeout, returning the latest state. If the + operation is already done, the latest state is immediately returned. If + the timeout specified is greater than the default HTTP/RPC timeout, the + HTTP/RPC timeout is used. If the server does not support this method, it + returns ``google.rpc.Code.UNIMPLEMENTED``. Note that this method is on a + best-effort basis. It may return the latest state before the specified + timeout (including immediately), meaning even an immediate response is + no guarantee that the operation is done. content_type (~google.cloud.asset_v1beta1.types.ContentType): Asset content type. If not specified, no content but the asset name will be returned. retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -328,12 +329,32 @@ 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. + A URL/resource name that uniquely identifies the type of the + serialized protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must represent the + fully qualified name of the type (as in + ``path/google.protobuf.Duration``). The name should be in a canonical + form (e.g., leading "." is not accepted). + + In practice, teams usually precompile into the binary all types that + they expect it to use in the context of Any. However, for URLs which use + the scheme ``http``, ``https``, or no scheme, one can optionally set up + a type server that maps type URLs to message definitions as follows: + + - If no scheme is provided, ``https`` is assumed. + - An HTTP GET on the URL must yield a ``google.protobuf.Type`` value in + binary format, or produce an error. + - Applications are allowed to cache lookup results based on the URL, or + have them precompiled into a binary to avoid any lookup. Therefore, + binary compatibility needs to be preserved on changes to types. (Use + versioned type names to manage breaking changes.) + + Note: this functionality is not currently available in the official + protobuf release, and it is not used for type URLs beginning with + type.googleapis.com. + + Schemes other than ``http``, ``https`` (or the empty scheme) might be + used with implementation specific semantics. Example: >>> from google.cloud import asset_v1beta1 @@ -356,23 +377,26 @@ 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]): If set, all the classes from the .proto file are wrapped in a single + outer class with the given name. This applies to both Proto1 (equivalent + to the old "--one_java_file" option) and Proto2 (where a .proto always + translates to a single class, but you may want to explicitly choose the + class name). If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1beta1.types.TimeWindow` - asset_names (list[str]): A list of the full names of the assets. For example: - ``//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1``. - See `Resource + asset_names (list[str]): The full name of the immediate parent of this resource. See + `Resource Names `__ - for more info. + for more information. - The request becomes a no-op if the asset name list is empty, and the max - size of the asset name list is 100 in one request. + For GCP assets, it is the parent resource defined in the `Cloud IAM + policy + hierarchy `__. + For example: + ``"//cloudresourcemanager.googleapis.com/projects/my_project_123"``. + + For third-party assets, it is up to the users to define. 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_v1beta1/gapic/enums.py b/google/cloud/asset_v1beta1/gapic/enums.py index 272f5f3a..efb95e06 100644 --- a/google/cloud/asset_v1beta1/gapic/enums.py +++ b/google/cloud/asset_v1beta1/gapic/enums.py @@ -36,10 +36,16 @@ class ContentType(enum.IntEnum): class NullValue(enum.IntEnum): """ - ``NullValue`` is a singleton enumeration to represent the null value - for the ``Value`` type union. + The resource type. It must be in the format of + {service_name}/{resource_type_kind}. The ``resource_type_kind`` must be + singular and must not include version numbers. - The JSON representation for ``NullValue`` is JSON ``null``. + Example: ``storage.googleapis.com/Bucket`` + + The value of the resource_type_kind must follow the regular expression + /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + should use PascalCase (UpperCamelCase). The maximum number of characters + allowed for the ``resource_type_kind`` is 100. Attributes: NULL_VALUE (int): Null value. 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 ec983c27..474df8ad 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 @@ -119,10 +119,7 @@ def channel(self): def export_assets(self): """Return the gRPC stub for :meth:`AssetServiceClient.export_assets`. - Exports assets with time and resource types to a given Cloud Storage - location. The output format is newline-delimited JSON. This API - implements the ``google.longrunning.Operation`` API allowing you to keep - track of the export. + See ``HttpRule``. Returns: Callable: A callable which accepts the appropriate @@ -135,12 +132,32 @@ 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. + A URL/resource name that uniquely identifies the type of the + serialized protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must represent the + fully qualified name of the type (as in + ``path/google.protobuf.Duration``). The name should be in a canonical + form (e.g., leading "." is not accepted). + + In practice, teams usually precompile into the binary all types that + they expect it to use in the context of Any. However, for URLs which use + the scheme ``http``, ``https``, or no scheme, one can optionally set up + a type server that maps type URLs to message definitions as follows: + + - If no scheme is provided, ``https`` is assumed. + - An HTTP GET on the URL must yield a ``google.protobuf.Type`` value in + binary format, or produce an error. + - Applications are allowed to cache lookup results based on the URL, or + have them precompiled into a binary to avoid any lookup. Therefore, + binary compatibility needs to be preserved on changes to types. (Use + versioned type names to manage breaking changes.) + + Note: this functionality is not currently available in the official + protobuf release, and it is not used for type URLs beginning with + type.googleapis.com. + + Schemes other than ``http``, ``https`` (or the empty scheme) might be + used with implementation specific semantics. 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 b5ab5d6c..aad2d93c 100644 --- a/google/cloud/asset_v1beta1/proto/asset_service_pb2.py +++ b/google/cloud/asset_v1beta1/proto/asset_service_pb2.py @@ -566,9 +566,9 @@ A list of asset types of which to take a snapshot for. For example: “google.compute.Disk”. If specified, only matching assets will be returned. See `Introduction to Cloud Asset - Inventory `__ for all - supported asset types. + Inventory `__ for all supported asset + types. content_type: Asset content type. If not specified, no content but the asset name will be returned. diff --git a/google/cloud/asset_v1beta1/proto/assets_pb2.py b/google/cloud/asset_v1beta1/proto/assets_pb2.py index 8669ddc4..38d8132b 100644 --- a/google/cloud/asset_v1beta1/proto/assets_pb2.py +++ b/google/cloud/asset_v1beta1/proto/assets_pb2.py @@ -463,8 +463,8 @@ { "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. + "__doc__": """Cloud asset. This includes all Google Cloud Platform + resources, Cloud IAM policies, and other non-GCP assets. Attributes: diff --git a/google/cloud/asset_v1p2beta1/gapic/asset_service_client.py b/google/cloud/asset_v1p2beta1/gapic/asset_service_client.py index faa70d88..b655fe2b 100644 --- a/google/cloud/asset_v1p2beta1/gapic/asset_service_client.py +++ b/google/cloud/asset_v1p2beta1/gapic/asset_service_client.py @@ -228,11 +228,16 @@ 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]): The resource type. It must be in the format of + {service_name}/{resource_type_kind}. The ``resource_type_kind`` must be + singular and must not include version numbers. + + Example: ``storage.googleapis.com/Bucket`` + + The value of the resource_type_kind must follow the regular expression + /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + should use PascalCase (UpperCamelCase). The maximum number of characters + allowed for the ``resource_type_kind`` is 100. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1p2beta1.types.Feed` @@ -306,10 +311,7 @@ def get_feed( >>> response = client.get_feed(name) 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 + name (str): See ``HttpRule``. 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. @@ -455,17 +457,39 @@ 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]): A URL/resource name that uniquely identifies the type of the + serialized protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must represent the + fully qualified name of the type (as in + ``path/google.protobuf.Duration``). The name should be in a canonical + form (e.g., leading "." is not accepted). + + In practice, teams usually precompile into the binary all types that + they expect it to use in the context of Any. However, for URLs which use + the scheme ``http``, ``https``, or no scheme, one can optionally set up + a type server that maps type URLs to message definitions as follows: + + - If no scheme is provided, ``https`` is assumed. + - An HTTP GET on the URL must yield a ``google.protobuf.Type`` value in + binary format, or produce an error. + - Applications are allowed to cache lookup results based on the URL, or + have them precompiled into a binary to avoid any lookup. Therefore, + binary compatibility needs to be preserved on changes to types. (Use + versioned type names to manage breaking changes.) + + Note: this functionality is not currently available in the official + protobuf release, and it is not used for type URLs beginning with + type.googleapis.com. + + Schemes other than ``http``, ``https`` (or the empty scheme) might be + used with implementation specific semantics. 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]): The REST URL for accessing the resource. An HTTP GET operation using + this URL returns the resource itself. Example: + ``https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123``. + It will be left unspecified for resources without a REST API. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.asset_v1p2beta1.types.FieldMask` @@ -539,10 +563,7 @@ def delete_feed( >>> client.delete_feed(name) 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 + name (str): Represents a repeated ``Value``. 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 40fe26ed..06f90c3c 100644 --- a/google/cloud/asset_v1p2beta1/proto/asset_service_pb2.py +++ b/google/cloud/asset_v1p2beta1/proto/asset_service_pb2.py @@ -932,9 +932,8 @@ Attributes: name: - Required. The format will be - projects/{project_number}/feeds/{client- - assigned_feed_identifier} or + 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- @@ -954,9 +953,9 @@ 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 - Inventory `__ for all - supported asset types. + Inventory `__ for all supported asset + types. content_type: Asset content type. If not specified, no content but the asset name and type will be returned. diff --git a/google/cloud/asset_v1p4beta1/gapic/asset_service_client.py b/google/cloud/asset_v1p4beta1/gapic/asset_service_client.py index 773d5d68..ebf21f50 100644 --- a/google/cloud/asset_v1p4beta1/gapic/asset_service_client.py +++ b/google/cloud/asset_v1p4beta1/gapic/asset_service_client.py @@ -193,8 +193,8 @@ def analyze_iam_policy( metadata=None, ): """ - Analyzes IAM policies based on the specified request. Returns a list - of ``IamPolicyAnalysisResult`` matching the request. + For extensions, this is the name of the type being extended. It is + resolved in the same manner as type_name. Example: >>> from google.cloud import asset_v1p4beta1 @@ -275,10 +275,14 @@ def export_iam_policy_analysis( 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. + The normal response of the operation in case of success. If the + original method returns no data on success, such as ``Delete``, the + response is ``google.protobuf.Empty``. If the original method is + standard ``Get``/``Create``/``Update``, the response should be the + resource. For other methods, the response should have the type + ``XxxResponse``, where ``Xxx`` is the original method name. For example, + if the original method name is ``TakeSnapshot()``, the inferred response + type is ``TakeSnapshotResponse``. Example: >>> from google.cloud import asset_v1p4beta1 diff --git a/google/cloud/asset_v1p4beta1/gapic/enums.py b/google/cloud/asset_v1p4beta1/gapic/enums.py index 8bf76999..2248f825 100644 --- a/google/cloud/asset_v1p4beta1/gapic/enums.py +++ b/google/cloud/asset_v1p4beta1/gapic/enums.py @@ -21,13 +21,9 @@ 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``. + Specifies a service that was configured for Cloud Audit Logging. For + example, ``storage.googleapis.com``, ``cloudsql.googleapis.com``. + ``allServices`` is a special value that covers all services. Required Attributes: OK (int): Not an error; returned on success @@ -36,19 +32,35 @@ class Code(enum.IntEnum): 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 + UNKNOWN (int): The service account impersonation analysis if + ``AnalyzeIamPolicyRequest.analyze_service_account_impersonation`` is + enabled. + INVALID_ARGUMENT (int): A URL/resource name that uniquely identifies the type of the + serialized protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must represent the + fully qualified name of the type (as in + ``path/google.protobuf.Duration``). The name should be in a canonical + form (e.g., leading "." is not accepted). + + In practice, teams usually precompile into the binary all types that + they expect it to use in the context of Any. However, for URLs which use + the scheme ``http``, ``https``, or no scheme, one can optionally set up + a type server that maps type URLs to message definitions as follows: + + - If no scheme is provided, ``https`` is assumed. + - An HTTP GET on the URL must yield a ``google.protobuf.Type`` value in + binary format, or produce an error. + - Applications are allowed to cache lookup results based on the URL, or + have them precompiled into a binary to avoid any lookup. Therefore, + binary compatibility needs to be preserved on changes to types. (Use + versioned type names to manage breaking changes.) + + Note: this functionality is not currently available in the official + protobuf release, and it is not used for type URLs beginning with + type.googleapis.com. + + Schemes other than ``http``, ``https`` (or the empty scheme) might be + used with implementation specific semantics. 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 @@ -56,28 +68,20 @@ class Code(enum.IntEnum): 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 + NOT_FOUND (int): A response message for ``AssetService.AnalyzeIamPolicy``. 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 + PERMISSION_DENIED (int): Required. The message name of the primary return type for this + long-running operation. This type will be used to deserialize the LRO's + response. + + If the response is in a different package from the rpc, a + fully-qualified message name must be used (e.g. + ``google.protobuf.Struct``). + + Note: Altering this value constitutes a breaking change. UNAUTHENTICATED (int): The request does not have valid authentication credentials for the operation. @@ -86,46 +90,16 @@ class Code(enum.IntEnum): 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 + FAILED_PRECONDITION (int): A single identity that is exempted from "data access" audit logging + for the ``service`` specified above. Follows the same format of + Binding.members. + ABORTED (int): 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. + OUT_OF_RANGE (int): The custom pattern is used for specifying an HTTP method that is not + included in the ``pattern`` field, such as HEAD, or "*" to leave the + HTTP method unspecified for this rule. The wild-card rule is useful for + services that provide content to Web (HTML) clients. UNIMPLEMENTED (int): The operation is not implemented or is not supported/enabled in this service. @@ -135,14 +109,18 @@ class Code(enum.IntEnum): 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 + UNAVAILABLE (int): 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. DATA_LOSS (int): Unrecoverable data loss or corruption. HTTP Mapping: 500 Internal Server Error 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 index 8695a6ff..e6e06d7e 100644 --- a/google/cloud/asset_v1p4beta1/gapic/transports/asset_service_grpc_transport.py +++ b/google/cloud/asset_v1p4beta1/gapic/transports/asset_service_grpc_transport.py @@ -119,8 +119,8 @@ def channel(self): 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. + For extensions, this is the name of the type being extended. It is + resolved in the same manner as type_name. Returns: Callable: A callable which accepts the appropriate @@ -133,10 +133,14 @@ def analyze_iam_policy(self): 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. + The normal response of the operation in case of success. If the + original method returns no data on success, such as ``Delete``, the + response is ``google.protobuf.Empty``. If the original method is + standard ``Get``/``Create``/``Update``, the response should be the + resource. For other methods, the response should have the type + ``XxxResponse``, where ``Xxx`` is the original method name. For example, + if the original method name is ``TakeSnapshot()``, the inferred response + type is ``TakeSnapshotResponse``. Returns: Callable: A callable which accepts the appropriate diff --git a/google/cloud/asset_v1p4beta1/proto/asset_service_pb2.py b/google/cloud/asset_v1p4beta1/proto/asset_service_pb2.py index ddce8824..ebf1e85a 100644 --- a/google/cloud/asset_v1p4beta1/proto/asset_service_pb2.py +++ b/google/cloud/asset_v1p4beta1/proto/asset_service_pb2.py @@ -1220,12 +1220,11 @@ 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 + 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. @@ -1328,9 +1327,8 @@ 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. + Object Metadata `__ for more information. """, # @@protoc_insertion_point(class_scope:google.cloud.asset.v1p4beta1.IamPolicyAnalysisOutputConfig.GcsDestination) }, diff --git a/synth.metadata b/synth.metadata index b66e0adb..48f5c103 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,47 +1,41 @@ { - "updateTime": "2020-03-16T17:29:50.350305Z", + "updateTime": "2020-03-17T12:16:54.059305Z", "sources": [ { "generator": { "name": "artman", - "version": "1.1.0", - "dockerImage": "googleapis/artman@sha256:f54b7644a1d2e7a37b23f5c0dfe9bba473e41c675002a507a244389e27487ca9" + "version": "1.1.1", + "dockerImage": "googleapis/artman@sha256:5ef340c8d9334719bc5c6981d95f4a5d2737b0a6a24f2b9a0d430e96fff85c5b" } }, { "generator": { "name": "artman", - "version": "1.1.0", - "dockerImage": "googleapis/artman@sha256:f54b7644a1d2e7a37b23f5c0dfe9bba473e41c675002a507a244389e27487ca9" + "version": "1.1.1", + "dockerImage": "googleapis/artman@sha256:5ef340c8d9334719bc5c6981d95f4a5d2737b0a6a24f2b9a0d430e96fff85c5b" } }, { "generator": { "name": "artman", - "version": "1.1.0", - "dockerImage": "googleapis/artman@sha256:f54b7644a1d2e7a37b23f5c0dfe9bba473e41c675002a507a244389e27487ca9" + "version": "1.1.1", + "dockerImage": "googleapis/artman@sha256:5ef340c8d9334719bc5c6981d95f4a5d2737b0a6a24f2b9a0d430e96fff85c5b" } }, { "generator": { "name": "artman", - "version": "1.1.0", - "dockerImage": "googleapis/artman@sha256:f54b7644a1d2e7a37b23f5c0dfe9bba473e41c675002a507a244389e27487ca9" - } - }, - { - "git": { - "name": ".", - "remote": "git@github.com:googleapis/python-asset.git", - "sha": "37067265776c1ee5e21feeb709679d5c1e981dee" + "version": "1.1.1", + "dockerImage": "googleapis/artman@sha256:5ef340c8d9334719bc5c6981d95f4a5d2737b0a6a24f2b9a0d430e96fff85c5b" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ae78682c05e864d71223ce22532219813b0245ac", - "internalRef": "301185150" + "sha": "23d5f09e670ebb0c1b36214acf78704e2ecfc2ac", + "internalRef": "301337970", + "log": "23d5f09e670ebb0c1b36214acf78704e2ecfc2ac\nUpdate field_behavior annotations in V1 and V2.\n\nPiperOrigin-RevId: 301337970\n\nb2cf37e7fd62383a811aa4d54d013ecae638851d\nData Catalog V1 API\n\nPiperOrigin-RevId: 301282503\n\n1976b9981e2900c8172b7d34b4220bdb18c5db42\nCloud DLP api update. Adds missing fields to Finding and adds support for hybrid jobs.\n\nPiperOrigin-RevId: 301205325\n\n" } }, {