Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit ee08408

Browse files
feat: add new searchable fields (memberTypes, roles, project, folders and organization), new request fields (assetTypes and orderBy) and new response fields (assetType, folders and organization) in SearchAllIamPolicies (#768)
PiperOrigin-RevId: 381145907 Source-Link: googleapis/googleapis@5d301f9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/9b332fd884d84662522abad820fa5835cae8688a
1 parent 92a0034 commit ee08408

File tree

10 files changed

+2049
-192
lines changed

10 files changed

+2049
-192
lines changed

google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceClient.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,9 @@ public final SearchAllResourcesPagedResponse searchAllResources(
11381138
* the searchable fields (except for the included permissions).
11391139
* <li>`resource:(instance1 OR instance2) policy:amy` to find IAM policy bindings that are
11401140
* set on resources "instance1" or "instance2" and also specify user "amy".
1141+
* <li>`roles:roles/compute.admin` to find IAM policy bindings that specify the Compute
1142+
* Admin role.
1143+
* <li>`memberTypes:user` to find IAM policy bindings that contain the "user" member type.
11411144
* </ul>
11421145
*
11431146
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1164,6 +1167,8 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(String scope
11641167
* .setQuery("query107944136")
11651168
* .setPageSize(883849137)
11661169
* .setPageToken("pageToken873572522")
1170+
* .addAllAssetTypes(new ArrayList<String>())
1171+
* .setOrderBy("orderBy-1207110587")
11671172
* .build();
11681173
* for (IamPolicySearchResult element :
11691174
* assetServiceClient.searchAllIamPolicies(request).iterateAll()) {
@@ -1196,6 +1201,8 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(
11961201
* .setQuery("query107944136")
11971202
* .setPageSize(883849137)
11981203
* .setPageToken("pageToken873572522")
1204+
* .addAllAssetTypes(new ArrayList<String>())
1205+
* .setOrderBy("orderBy-1207110587")
11991206
* .build();
12001207
* ApiFuture<IamPolicySearchResult> future =
12011208
* assetServiceClient.searchAllIamPoliciesPagedCallable().futureCall(request);
@@ -1227,6 +1234,8 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(
12271234
* .setQuery("query107944136")
12281235
* .setPageSize(883849137)
12291236
* .setPageToken("pageToken873572522")
1237+
* .addAllAssetTypes(new ArrayList<String>())
1238+
* .setOrderBy("orderBy-1207110587")
12301239
* .build();
12311240
* while (true) {
12321241
* SearchAllIamPoliciesResponse response =

google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,7 @@ public static class Builder extends StubSettings.Builder<AssetServiceStubSetting
560560
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
561561
definitions.put(
562562
"retry_policy_2_codes",
563-
ImmutableSet.copyOf(
564-
Lists.<StatusCode.Code>newArrayList(
565-
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
563+
ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList(StatusCode.Code.UNAVAILABLE)));
566564
definitions.put(
567565
"retry_policy_3_codes",
568566
ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList(StatusCode.Code.UNAVAILABLE)));
@@ -598,10 +596,10 @@ public static class Builder extends StubSettings.Builder<AssetServiceStubSetting
598596
.setInitialRetryDelay(Duration.ofMillis(100L))
599597
.setRetryDelayMultiplier(1.3)
600598
.setMaxRetryDelay(Duration.ofMillis(60000L))
601-
.setInitialRpcTimeout(Duration.ofMillis(15000L))
599+
.setInitialRpcTimeout(Duration.ofMillis(30000L))
602600
.setRpcTimeoutMultiplier(1.0)
603-
.setMaxRpcTimeout(Duration.ofMillis(15000L))
604-
.setTotalTimeout(Duration.ofMillis(15000L))
601+
.setMaxRpcTimeout(Duration.ofMillis(30000L))
602+
.setTotalTimeout(Duration.ofMillis(30000L))
605603
.build();
606604
definitions.put("retry_policy_2_params", settings);
607605
settings =

proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetProto.java

Lines changed: 62 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -171,60 +171,61 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
171171
+ "_attributes\030\t \001(\0132\027.google.protobuf.Stru"
172172
+ "ct\022!\n\031parent_full_resource_name\030\023 \001(\t\022\031\n"
173173
+ "\021parent_asset_type\030g \001(\t\032-\n\013LabelsEntry\022"
174-
+ "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\324\003\n\025IamP"
175-
+ "olicySearchResult\022\020\n\010resource\030\001 \001(\t\022\017\n\007p"
176-
+ "roject\030\002 \001(\t\022%\n\006policy\030\003 \001(\0132\025.google.ia"
177-
+ "m.v1.Policy\022M\n\013explanation\030\004 \001(\01328.googl"
178-
+ "e.cloud.asset.v1.IamPolicySearchResult.E"
179-
+ "xplanation\032\241\002\n\013Explanation\022m\n\023matched_pe"
180-
+ "rmissions\030\001 \003(\0132P.google.cloud.asset.v1."
181-
+ "IamPolicySearchResult.Explanation.Matche"
182-
+ "dPermissionsEntry\032\"\n\013Permissions\022\023\n\013perm"
183-
+ "issions\030\001 \003(\t\032\177\n\027MatchedPermissionsEntry"
184-
+ "\022\013\n\003key\030\001 \001(\t\022S\n\005value\030\002 \001(\0132D.google.cl"
185-
+ "oud.asset.v1.IamPolicySearchResult.Expla"
186-
+ "nation.Permissions:\0028\001\"G\n\026IamPolicyAnaly"
187-
+ "sisState\022\036\n\004code\030\001 \001(\0162\020.google.rpc.Code"
188-
+ "\022\r\n\005cause\030\002 \001(\t\"\306\001\n\023ConditionEvaluation\022"
189-
+ "T\n\020evaluation_value\030\001 \001(\0162:.google.cloud"
190-
+ ".asset.v1.ConditionEvaluation.Evaluation"
191-
+ "Value\"Y\n\017EvaluationValue\022 \n\034EVALUATION_V"
192-
+ "ALUE_UNSPECIFIED\020\000\022\010\n\004TRUE\020\001\022\t\n\005FALSE\020\002\022"
193-
+ "\017\n\013CONDITIONAL\020\003\"\253\t\n\027IamPolicyAnalysisRe"
194-
+ "sult\022#\n\033attached_resource_full_name\030\001 \001("
195-
+ "\t\022+\n\013iam_binding\030\002 \001(\0132\026.google.iam.v1.B"
196-
+ "inding\022^\n\024access_control_lists\030\003 \003(\013[email protected]"
197-
+ "oogle.cloud.asset.v1.IamPolicyAnalysisRe"
198-
+ "sult.AccessControlList\022R\n\ridentity_list\030"
199-
+ "\004 \001(\0132;.google.cloud.asset.v1.IamPolicyA"
200-
+ "nalysisResult.IdentityList\022\026\n\016fully_expl"
201-
+ "ored\030\005 \001(\010\032m\n\010Resource\022\032\n\022full_resource_"
202-
+ "name\030\001 \001(\t\022E\n\016analysis_state\030\002 \001(\0132-.goo"
203-
+ "gle.cloud.asset.v1.IamPolicyAnalysisStat"
204-
+ "e\032\205\001\n\006Access\022\016\n\004role\030\001 \001(\tH\000\022\024\n\npermissi"
205-
+ "on\030\002 \001(\tH\000\022E\n\016analysis_state\030\003 \001(\0132-.goo"
206-
+ "gle.cloud.asset.v1.IamPolicyAnalysisStat"
207-
+ "eB\016\n\014oneof_access\032_\n\010Identity\022\014\n\004name\030\001 "
208-
+ "\001(\t\022E\n\016analysis_state\030\002 \001(\0132-.google.clo"
209-
+ "ud.asset.v1.IamPolicyAnalysisState\0320\n\004Ed"
210-
+ "ge\022\023\n\013source_node\030\001 \001(\t\022\023\n\013target_node\030\002"
211-
+ " \001(\t\032\277\002\n\021AccessControlList\022J\n\tresources\030"
212-
+ "\001 \003(\01327.google.cloud.asset.v1.IamPolicyA"
213-
+ "nalysisResult.Resource\022G\n\010accesses\030\002 \003(\013"
214-
+ "25.google.cloud.asset.v1.IamPolicyAnalys"
215-
+ "isResult.Access\022K\n\016resource_edges\030\003 \003(\0132"
216-
+ "3.google.cloud.asset.v1.IamPolicyAnalysi"
217-
+ "sResult.Edge\022H\n\024condition_evaluation\030\004 \001"
218-
+ "(\0132*.google.cloud.asset.v1.ConditionEval"
219-
+ "uation\032\245\001\n\014IdentityList\022K\n\nidentities\030\001 "
220-
+ "\003(\01327.google.cloud.asset.v1.IamPolicyAna"
221-
+ "lysisResult.Identity\022H\n\013group_edges\030\002 \003("
222-
+ "\01323.google.cloud.asset.v1.IamPolicyAnaly"
223-
+ "sisResult.EdgeB\230\001\n\031com.google.cloud.asse"
224-
+ "t.v1B\nAssetProtoP\001Z:google.golang.org/ge"
225-
+ "nproto/googleapis/cloud/asset/v1;asset\370\001"
226-
+ "\001\252\002\025Google.Cloud.Asset.V1\312\002\025Google\\Cloud"
227-
+ "\\Asset\\V1b\006proto3"
174+
+ "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\217\004\n\025IamP"
175+
+ "olicySearchResult\022\020\n\010resource\030\001 \001(\t\022\022\n\na"
176+
+ "sset_type\030\005 \001(\t\022\017\n\007project\030\002 \001(\t\022\017\n\007fold"
177+
+ "ers\030\006 \003(\t\022\024\n\014organization\030\007 \001(\t\022%\n\006polic"
178+
+ "y\030\003 \001(\0132\025.google.iam.v1.Policy\022M\n\013explan"
179+
+ "ation\030\004 \001(\01328.google.cloud.asset.v1.IamP"
180+
+ "olicySearchResult.Explanation\032\241\002\n\013Explan"
181+
+ "ation\022m\n\023matched_permissions\030\001 \003(\0132P.goo"
182+
+ "gle.cloud.asset.v1.IamPolicySearchResult"
183+
+ ".Explanation.MatchedPermissionsEntry\032\"\n\013"
184+
+ "Permissions\022\023\n\013permissions\030\001 \003(\t\032\177\n\027Matc"
185+
+ "hedPermissionsEntry\022\013\n\003key\030\001 \001(\t\022S\n\005valu"
186+
+ "e\030\002 \001(\0132D.google.cloud.asset.v1.IamPolic"
187+
+ "ySearchResult.Explanation.Permissions:\0028"
188+
+ "\001\"G\n\026IamPolicyAnalysisState\022\036\n\004code\030\001 \001("
189+
+ "\0162\020.google.rpc.Code\022\r\n\005cause\030\002 \001(\t\"\306\001\n\023C"
190+
+ "onditionEvaluation\022T\n\020evaluation_value\030\001"
191+
+ " \001(\0162:.google.cloud.asset.v1.ConditionEv"
192+
+ "aluation.EvaluationValue\"Y\n\017EvaluationVa"
193+
+ "lue\022 \n\034EVALUATION_VALUE_UNSPECIFIED\020\000\022\010\n"
194+
+ "\004TRUE\020\001\022\t\n\005FALSE\020\002\022\017\n\013CONDITIONAL\020\003\"\253\t\n\027"
195+
+ "IamPolicyAnalysisResult\022#\n\033attached_reso"
196+
+ "urce_full_name\030\001 \001(\t\022+\n\013iam_binding\030\002 \001("
197+
+ "\0132\026.google.iam.v1.Binding\022^\n\024access_cont"
198+
+ "rol_lists\030\003 \003(\013[email protected]."
199+
+ "IamPolicyAnalysisResult.AccessControlLis"
200+
+ "t\022R\n\ridentity_list\030\004 \001(\0132;.google.cloud."
201+
+ "asset.v1.IamPolicyAnalysisResult.Identit"
202+
+ "yList\022\026\n\016fully_explored\030\005 \001(\010\032m\n\010Resourc"
203+
+ "e\022\032\n\022full_resource_name\030\001 \001(\t\022E\n\016analysi"
204+
+ "s_state\030\002 \001(\0132-.google.cloud.asset.v1.Ia"
205+
+ "mPolicyAnalysisState\032\205\001\n\006Access\022\016\n\004role\030"
206+
+ "\001 \001(\tH\000\022\024\n\npermission\030\002 \001(\tH\000\022E\n\016analysi"
207+
+ "s_state\030\003 \001(\0132-.google.cloud.asset.v1.Ia"
208+
+ "mPolicyAnalysisStateB\016\n\014oneof_access\032_\n\010"
209+
+ "Identity\022\014\n\004name\030\001 \001(\t\022E\n\016analysis_state"
210+
+ "\030\002 \001(\0132-.google.cloud.asset.v1.IamPolicy"
211+
+ "AnalysisState\0320\n\004Edge\022\023\n\013source_node\030\001 \001"
212+
+ "(\t\022\023\n\013target_node\030\002 \001(\t\032\277\002\n\021AccessContro"
213+
+ "lList\022J\n\tresources\030\001 \003(\01327.google.cloud."
214+
+ "asset.v1.IamPolicyAnalysisResult.Resourc"
215+
+ "e\022G\n\010accesses\030\002 \003(\01325.google.cloud.asset"
216+
+ ".v1.IamPolicyAnalysisResult.Access\022K\n\016re"
217+
+ "source_edges\030\003 \003(\01323.google.cloud.asset."
218+
+ "v1.IamPolicyAnalysisResult.Edge\022H\n\024condi"
219+
+ "tion_evaluation\030\004 \001(\0132*.google.cloud.ass"
220+
+ "et.v1.ConditionEvaluation\032\245\001\n\014IdentityLi"
221+
+ "st\022K\n\nidentities\030\001 \003(\01327.google.cloud.as"
222+
+ "set.v1.IamPolicyAnalysisResult.Identity\022"
223+
+ "H\n\013group_edges\030\002 \003(\01323.google.cloud.asse"
224+
+ "t.v1.IamPolicyAnalysisResult.EdgeB\230\001\n\031co"
225+
+ "m.google.cloud.asset.v1B\nAssetProtoP\001Z:g"
226+
+ "oogle.golang.org/genproto/googleapis/clo"
227+
+ "ud/asset/v1;asset\370\001\001\252\002\025Google.Cloud.Asse"
228+
+ "t.V1\312\002\025Google\\Cloud\\Asset\\V1b\006proto3"
228229
};
229230
descriptor =
230231
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -332,7 +333,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
332333
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
333334
internal_static_google_cloud_asset_v1_IamPolicySearchResult_descriptor,
334335
new java.lang.String[] {
335-
"Resource", "Project", "Policy", "Explanation",
336+
"Resource",
337+
"AssetType",
338+
"Project",
339+
"Folders",
340+
"Organization",
341+
"Policy",
342+
"Explanation",
336343
});
337344
internal_static_google_cloud_asset_v1_IamPolicySearchResult_Explanation_descriptor =
338345
internal_static_google_cloud_asset_v1_IamPolicySearchResult_descriptor

0 commit comments

Comments
 (0)