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

Commit 00dcd06

Browse files
feat: Add client library support for AnalyzeOrgPolicies API (#560)
* 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: https://github.com/googleapis/googleapis-gen/commit/f4b9936403faf847180a353636be515d21d5cac4 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>
1 parent c485429 commit 00dcd06

9 files changed

+96
-37
lines changed

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

+36-6
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,8 @@ async def sample_create_feed():
621621
be an organization number (such as
622622
"organizations/123"), a folder number
623623
(such as "folders/123"), a project ID
624-
(such as "projects/my-project-id")", or
625-
a project number (such as
624+
(such as "projects/my-project-id"), or a
625+
project number (such as
626626
"projects/12345").
627627
628628
This corresponds to the ``parent`` field
@@ -2016,7 +2016,7 @@ async def sample_create_saved_query():
20162016
where this saved_query should be created in. It can only
20172017
be an organization number (such as "organizations/123"),
20182018
a folder number (such as "folders/123"), a project ID
2019-
(such as "projects/my-project-id")", or a project number
2019+
(such as "projects/my-project-id"), or a project number
20202020
(such as "projects/12345").
20212021
20222022
This corresponds to the ``parent`` field
@@ -2779,7 +2779,17 @@ async def sample_analyze_org_policies():
27792779
# and friendly error handling.
27802780
rpc = gapic_v1.method_async.wrap_method(
27812781
self._client._transport.analyze_org_policies,
2782-
default_timeout=None,
2782+
default_retry=retries.Retry(
2783+
initial=0.1,
2784+
maximum=60.0,
2785+
multiplier=1.3,
2786+
predicate=retries.if_exception_type(
2787+
core_exceptions.DeadlineExceeded,
2788+
core_exceptions.ServiceUnavailable,
2789+
),
2790+
deadline=60.0,
2791+
),
2792+
default_timeout=60.0,
27832793
client_info=DEFAULT_CLIENT_INFO,
27842794
)
27852795

@@ -2930,7 +2940,17 @@ async def sample_analyze_org_policy_governed_containers():
29302940
# and friendly error handling.
29312941
rpc = gapic_v1.method_async.wrap_method(
29322942
self._client._transport.analyze_org_policy_governed_containers,
2933-
default_timeout=None,
2943+
default_retry=retries.Retry(
2944+
initial=0.1,
2945+
maximum=60.0,
2946+
multiplier=1.3,
2947+
predicate=retries.if_exception_type(
2948+
core_exceptions.DeadlineExceeded,
2949+
core_exceptions.ServiceUnavailable,
2950+
),
2951+
deadline=60.0,
2952+
),
2953+
default_timeout=60.0,
29342954
client_info=DEFAULT_CLIENT_INFO,
29352955
)
29362956

@@ -3110,7 +3130,17 @@ async def sample_analyze_org_policy_governed_assets():
31103130
# and friendly error handling.
31113131
rpc = gapic_v1.method_async.wrap_method(
31123132
self._client._transport.analyze_org_policy_governed_assets,
3113-
default_timeout=None,
3133+
default_retry=retries.Retry(
3134+
initial=0.1,
3135+
maximum=60.0,
3136+
multiplier=1.3,
3137+
predicate=retries.if_exception_type(
3138+
core_exceptions.DeadlineExceeded,
3139+
core_exceptions.ServiceUnavailable,
3140+
),
3141+
deadline=60.0,
3142+
),
3143+
default_timeout=60.0,
31143144
client_info=DEFAULT_CLIENT_INFO,
31153145
)
31163146

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,8 @@ def sample_create_feed():
916916
be an organization number (such as
917917
"organizations/123"), a folder number
918918
(such as "folders/123"), a project ID
919-
(such as "projects/my-project-id")", or
920-
a project number (such as
919+
(such as "projects/my-project-id"), or a
920+
project number (such as
921921
"projects/12345").
922922
923923
This corresponds to the ``parent`` field
@@ -2251,7 +2251,7 @@ def sample_create_saved_query():
22512251
where this saved_query should be created in. It can only
22522252
be an organization number (such as "organizations/123"),
22532253
a folder number (such as "folders/123"), a project ID
2254-
(such as "projects/my-project-id")", or a project number
2254+
(such as "projects/my-project-id"), or a project number
22552255
(such as "projects/12345").
22562256
22572257
This corresponds to the ``parent`` field

google/cloud/asset_v1/services/asset_service/transports/base.py

+33-3
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,47 @@ def _prep_wrapped_messages(self, client_info):
354354
),
355355
self.analyze_org_policies: gapic_v1.method.wrap_method(
356356
self.analyze_org_policies,
357-
default_timeout=None,
357+
default_retry=retries.Retry(
358+
initial=0.1,
359+
maximum=60.0,
360+
multiplier=1.3,
361+
predicate=retries.if_exception_type(
362+
core_exceptions.DeadlineExceeded,
363+
core_exceptions.ServiceUnavailable,
364+
),
365+
deadline=60.0,
366+
),
367+
default_timeout=60.0,
358368
client_info=client_info,
359369
),
360370
self.analyze_org_policy_governed_containers: gapic_v1.method.wrap_method(
361371
self.analyze_org_policy_governed_containers,
362-
default_timeout=None,
372+
default_retry=retries.Retry(
373+
initial=0.1,
374+
maximum=60.0,
375+
multiplier=1.3,
376+
predicate=retries.if_exception_type(
377+
core_exceptions.DeadlineExceeded,
378+
core_exceptions.ServiceUnavailable,
379+
),
380+
deadline=60.0,
381+
),
382+
default_timeout=60.0,
363383
client_info=client_info,
364384
),
365385
self.analyze_org_policy_governed_assets: gapic_v1.method.wrap_method(
366386
self.analyze_org_policy_governed_assets,
367-
default_timeout=None,
387+
default_retry=retries.Retry(
388+
initial=0.1,
389+
maximum=60.0,
390+
multiplier=1.3,
391+
predicate=retries.if_exception_type(
392+
core_exceptions.DeadlineExceeded,
393+
core_exceptions.ServiceUnavailable,
394+
),
395+
deadline=60.0,
396+
),
397+
default_timeout=60.0,
368398
client_info=client_info,
369399
),
370400
}

google/cloud/asset_v1/types/asset_service.py

+19-20
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ class CreateFeedRequest(proto.Message):
521521
organization number (such as
522522
"organizations/123"), a folder number (such as
523523
"folders/123"), a project ID (such as
524-
"projects/my-project-id")", or a project number
524+
"projects/my-project-id"), or a project number
525525
(such as "projects/12345").
526526
feed_id (str):
527527
Required. This is the client-assigned asset
@@ -2202,7 +2202,7 @@ class CreateSavedQueryRequest(proto.Message):
22022202
this saved_query should be created in. It can only be an
22032203
organization number (such as "organizations/123"), a folder
22042204
number (such as "folders/123"), a project ID (such as
2205-
"projects/my-project-id")", or a project number (such as
2205+
"projects/my-project-id"), or a project number (such as
22062206
"projects/12345").
22072207
saved_query (google.cloud.asset_v1.types.SavedQuery):
22082208
Required. The saved_query details. The ``name`` field must
@@ -2280,9 +2280,8 @@ class ListSavedQueriesRequest(proto.Message):
22802280
Optional. The maximum number of saved queries
22812281
to return per page. The service may return fewer
22822282
than this value. If unspecified, at most 50 will
2283-
be returned.
2284-
The maximum value is 1000; values above 1000
2285-
will be coerced to 1000.
2283+
be returned. The maximum value is 1000; values
2284+
above 1000 will be coerced to 1000.
22862285
page_token (str):
22872286
Optional. A page token, received from a previous
22882287
``ListSavedQueries`` call. Provide this to retrieve the
@@ -3855,19 +3854,19 @@ class GovernedResource(proto.Message):
38553854
of the parent of
38563855
[AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name].
38573856
project (str):
3858-
The project that this resource belongs to, in the form of
3857+
The project that this resource belongs to, in the format of
38593858
projects/{PROJECT_NUMBER}. This field is available when the
38603859
resource belongs to a project.
38613860
folders (MutableSequence[str]):
3862-
The folder(s) that this resource belongs to, in the form of
3863-
folders/{FOLDER_NUMBER}. This field is available when the
3864-
resource belongs(directly or cascadingly) to one or more
3861+
The folder(s) that this resource belongs to, in the format
3862+
of folders/{FOLDER_NUMBER}. This field is available when the
3863+
resource belongs (directly or cascadingly) to one or more
38653864
folders.
38663865
organization (str):
3867-
The organization that this resource belongs to, in the form
3868-
of organizations/{ORGANIZATION_NUMBER}. This field is
3869-
available when the resource belongs(directly or cascadingly)
3870-
to an organization.
3866+
The organization that this resource belongs to, in the
3867+
format of organizations/{ORGANIZATION_NUMBER}. This field is
3868+
available when the resource belongs (directly or
3869+
cascadingly) to an organization.
38713870
"""
38723871

38733872
full_resource_name: str = proto.Field(
@@ -3907,18 +3906,18 @@ class GovernedIamPolicy(proto.Message):
39073906
The IAM policy directly set on the given
39083907
resource.
39093908
project (str):
3910-
The project that this IAM policy belongs to, in the form of
3911-
projects/{PROJECT_NUMBER}. This field is available when the
3912-
IAM policy belongs to a project.
3909+
The project that this IAM policy belongs to, in the format
3910+
of projects/{PROJECT_NUMBER}. This field is available when
3911+
the IAM policy belongs to a project.
39133912
folders (MutableSequence[str]):
3914-
The folder(s) that this IAM policy belongs to, in the form
3913+
The folder(s) that this IAM policy belongs to, in the format
39153914
of folders/{FOLDER_NUMBER}. This field is available when the
3916-
IAM policy belongs(directly or cascadingly) to one or more
3915+
IAM policy belongs (directly or cascadingly) to one or more
39173916
folders.
39183917
organization (str):
39193918
The organization that this IAM policy belongs to, in the
3920-
form of organizations/{ORGANIZATION_NUMBER}. This field is
3921-
available when the IAM policy belongs(directly or
3919+
format of organizations/{ORGANIZATION_NUMBER}. This field is
3920+
available when the IAM policy belongs (directly or
39223921
cascadingly) to an organization.
39233922
"""
39243923

google/cloud/asset_v1/types/assets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ class RelatedAsset(proto.Message):
512512

513513
class ResourceSearchResult(proto.Message):
514514
r"""A result of Resource Search, containing information of a
515-
cloud resource. Next ID: 31
515+
cloud resource. Next ID: 32
516516
517517
Attributes:
518518
name (str):

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)