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

Commit

Permalink
feat: Add client library support for AnalyzeOrgPolicies API (#560)
Browse files Browse the repository at this point in the history
* feat: Add client library support for AssetService v1 AnalyzeOrgPolicies API
feat: Add client library support for AssetService v1 AnalyzeOrgPolicyGovernedContainers API
feat: Add client library support for AssetService v1 AnalyzeOrgPolicyGovernedAssets API

PiperOrigin-RevId: 520696122

Source-Link: googleapis/googleapis@fb446a2

Source-Link: googleapis/googleapis-gen@f4b9936
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjRiOTkzNjQwM2ZhZjg0NzE4MGEzNTM2MzZiZTUxNWQyMWQ1Y2FjNCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Mar 31, 2023
1 parent c485429 commit 00dcd06
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 37 deletions.
42 changes: 36 additions & 6 deletions google/cloud/asset_v1/services/asset_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,8 @@ async def sample_create_feed():
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
(such as "projects/my-project-id"), or a
project number (such as
"projects/12345").
This corresponds to the ``parent`` field
Expand Down Expand Up @@ -2016,7 +2016,7 @@ async def sample_create_saved_query():
where this saved_query 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/my-project-id"), or a project number
(such as "projects/12345").
This corresponds to the ``parent`` field
Expand Down Expand Up @@ -2779,7 +2779,17 @@ async def sample_analyze_org_policies():
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.analyze_org_policies,
default_timeout=None,
default_retry=retries.Retry(
initial=0.1,
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down Expand Up @@ -2930,7 +2940,17 @@ async def sample_analyze_org_policy_governed_containers():
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.analyze_org_policy_governed_containers,
default_timeout=None,
default_retry=retries.Retry(
initial=0.1,
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down Expand Up @@ -3110,7 +3130,17 @@ async def sample_analyze_org_policy_governed_assets():
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.analyze_org_policy_governed_assets,
default_timeout=None,
default_retry=retries.Retry(
initial=0.1,
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down
6 changes: 3 additions & 3 deletions google/cloud/asset_v1/services/asset_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,8 +916,8 @@ def sample_create_feed():
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
(such as "projects/my-project-id"), or a
project number (such as
"projects/12345").
This corresponds to the ``parent`` field
Expand Down Expand Up @@ -2251,7 +2251,7 @@ def sample_create_saved_query():
where this saved_query 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/my-project-id"), or a project number
(such as "projects/12345").
This corresponds to the ``parent`` field
Expand Down
36 changes: 33 additions & 3 deletions google/cloud/asset_v1/services/asset_service/transports/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,17 +354,47 @@ def _prep_wrapped_messages(self, client_info):
),
self.analyze_org_policies: gapic_v1.method.wrap_method(
self.analyze_org_policies,
default_timeout=None,
default_retry=retries.Retry(
initial=0.1,
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=client_info,
),
self.analyze_org_policy_governed_containers: gapic_v1.method.wrap_method(
self.analyze_org_policy_governed_containers,
default_timeout=None,
default_retry=retries.Retry(
initial=0.1,
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=client_info,
),
self.analyze_org_policy_governed_assets: gapic_v1.method.wrap_method(
self.analyze_org_policy_governed_assets,
default_timeout=None,
default_retry=retries.Retry(
initial=0.1,
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=client_info,
),
}
Expand Down
39 changes: 19 additions & 20 deletions google/cloud/asset_v1/types/asset_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ class CreateFeedRequest(proto.Message):
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
"projects/my-project-id"), or a project number
(such as "projects/12345").
feed_id (str):
Required. This is the client-assigned asset
Expand Down Expand Up @@ -2202,7 +2202,7 @@ class CreateSavedQueryRequest(proto.Message):
this saved_query 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/my-project-id"), or a project number (such as
"projects/12345").
saved_query (google.cloud.asset_v1.types.SavedQuery):
Required. The saved_query details. The ``name`` field must
Expand Down Expand Up @@ -2280,9 +2280,8 @@ class ListSavedQueriesRequest(proto.Message):
Optional. The maximum number of saved queries
to return per page. The service may return fewer
than this value. If unspecified, at most 50 will
be returned.
The maximum value is 1000; values above 1000
will be coerced to 1000.
be returned. The maximum value is 1000; values
above 1000 will be coerced to 1000.
page_token (str):
Optional. A page token, received from a previous
``ListSavedQueries`` call. Provide this to retrieve the
Expand Down Expand Up @@ -3855,19 +3854,19 @@ class GovernedResource(proto.Message):
of the parent of
[AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name].
project (str):
The project that this resource belongs to, in the form of
The project that this resource belongs to, in the format of
projects/{PROJECT_NUMBER}. This field is available when the
resource belongs to a project.
folders (MutableSequence[str]):
The folder(s) that this resource belongs to, in the form of
folders/{FOLDER_NUMBER}. This field is available when the
resource belongs(directly or cascadingly) to one or more
The folder(s) that this resource belongs to, in the format
of folders/{FOLDER_NUMBER}. This field is available when the
resource belongs (directly or cascadingly) to one or more
folders.
organization (str):
The organization that this resource belongs to, in the form
of organizations/{ORGANIZATION_NUMBER}. This field is
available when the resource belongs(directly or cascadingly)
to an organization.
The organization that this resource belongs to, in the
format of organizations/{ORGANIZATION_NUMBER}. This field is
available when the resource belongs (directly or
cascadingly) to an organization.
"""

full_resource_name: str = proto.Field(
Expand Down Expand Up @@ -3907,18 +3906,18 @@ class GovernedIamPolicy(proto.Message):
The IAM policy directly set on the given
resource.
project (str):
The project that this IAM policy belongs to, in the form of
projects/{PROJECT_NUMBER}. This field is available when the
IAM policy belongs to a project.
The project that this IAM policy belongs to, in the format
of projects/{PROJECT_NUMBER}. This field is available when
the IAM policy belongs to a project.
folders (MutableSequence[str]):
The folder(s) that this IAM policy belongs to, in the form
The folder(s) that this IAM policy belongs to, in the format
of folders/{FOLDER_NUMBER}. This field is available when the
IAM policy belongs(directly or cascadingly) to one or more
IAM policy belongs (directly or cascadingly) to one or more
folders.
organization (str):
The organization that this IAM policy belongs to, in the
form of organizations/{ORGANIZATION_NUMBER}. This field is
available when the IAM policy belongs(directly or
format of organizations/{ORGANIZATION_NUMBER}. This field is
available when the IAM policy belongs (directly or
cascadingly) to an organization.
"""

Expand Down
2 changes: 1 addition & 1 deletion google/cloud/asset_v1/types/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ class RelatedAsset(proto.Message):

class ResourceSearchResult(proto.Message):
r"""A result of Resource Search, containing information of a
cloud resource. Next ID: 31
cloud resource. Next ID: 32
Attributes:
name (str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-asset",
"version": "3.18.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-asset",
"version": "3.18.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-asset",
"version": "3.18.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-asset",
"version": "3.18.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down

0 comments on commit 00dcd06

Please sign in to comment.