From fac71543ed0a7e5a2730474d85f4ebdcacd3bf72 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 5 May 2020 08:38:05 -0700 Subject: [PATCH] feat(v1p1beta1): add orderBy to SearchAllResourcesRequest, explanation to IamPolicySearchResults, location, labels, networkTags to StandardResourceMetadata (#175) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/e1a15d5b-1fd7-45a1-8d45-78b4d9a7e5a6/targets --- .../asset/v1p1beta1/AssetServiceClient.java | 4 +- .../clirr-ignored-differences.xml | 5 + .../clirr-ignored-differences.xml | 11 +- .../cloud/asset/v1p1beta1/AssetProto.java | 97 +- .../asset/v1p1beta1/AssetServiceProto.java | 62 +- .../v1p1beta1/IamPolicySearchResult.java | 1322 ++++++++++++++++- .../IamPolicySearchResultOrBuilder.java | 57 +- .../cloud/asset/v1p1beta1/Permissions.java | 735 +++++++++ .../asset/v1p1beta1/PermissionsOrBuilder.java | 76 + .../SearchAllIamPoliciesRequest.java | 7 + .../SearchAllIamPoliciesRequestOrBuilder.java | 2 + .../v1p1beta1/SearchAllResourcesRequest.java | 205 +++ .../SearchAllResourcesRequestOrBuilder.java | 33 + .../v1p1beta1/StandardResourceMetadata.java | 831 +++++++++++ .../StandardResourceMetadataOrBuilder.java | 154 ++ .../cloud/asset/v1p1beta1/asset_service.proto | 11 +- .../google/cloud/asset/v1p1beta1/assets.proto | 44 +- .../clirr-ignored-differences.xml | 95 +- .../clirr-ignored-differences.xml | 19 + synth.metadata | 24 +- 20 files changed, 3602 insertions(+), 192 deletions(-) create mode 100644 proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/Permissions.java create mode 100644 proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/PermissionsOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p4beta1/clirr-ignored-differences.xml diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceClient.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceClient.java index 03358db03..0aa3572cc 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceClient.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceClient.java @@ -180,7 +180,7 @@ public AssetServiceStub getStub() { * @param scope Required. The relative name of an asset. The search is limited to the resources * within the `scope`. The allowed value must be: * Organization number (such as * "organizations/123") * Folder number(such as "folders/1234") * Project number (such - * as "projects/12345") + * as "projects/12345") * Project id (such as "projects/abc") * @param query Optional. The query statement. * @param assetTypes Optional. A list of asset types that this request searches for. If empty, it * will search all the supported asset types. @@ -315,7 +315,7 @@ public final SearchAllResourcesPagedResponse searchAllResources( * @param scope Required. The relative name of an asset. The search is limited to the resources * within the `scope`. The allowed value must be: * Organization number (such as * "organizations/123") * Folder number(such as "folders/1234") * Project number (such - * as "projects/12345") + * as "projects/12345") * Project id (such as "projects/abc") * @param query Optional. The query statement. Examples: * * "policy:myuser{@literal @}mydomain.com" * "policy:(myuser{@literal @}mydomain.com * viewer)" diff --git a/proto-google-cloud-asset-v1beta1/clirr-ignored-differences.xml b/proto-google-cloud-asset-v1beta1/clirr-ignored-differences.xml index cb68a6b3c..61dd57fd3 100644 --- a/proto-google-cloud-asset-v1beta1/clirr-ignored-differences.xml +++ b/proto-google-cloud-asset-v1beta1/clirr-ignored-differences.xml @@ -11,4 +11,9 @@ com/google/cloud/asset/v1beta1/*OrBuilder boolean contains*(*) + + 7012 + com/google/cloud/asset/v1beta1/*OrBuilder + boolean has*(*) + diff --git a/proto-google-cloud-asset-v1p1beta1/clirr-ignored-differences.xml b/proto-google-cloud-asset-v1p1beta1/clirr-ignored-differences.xml index 786de7a83..c9f2dad04 100644 --- a/proto-google-cloud-asset-v1p1beta1/clirr-ignored-differences.xml +++ b/proto-google-cloud-asset-v1p1beta1/clirr-ignored-differences.xml @@ -11,14 +11,9 @@ com/google/cloud/asset/v1p1beta1/*OrBuilder boolean contains*(*) - - - 8001 - com/google/cloud/asset/v1p1beta1/SearchIamPolicies* - - - 8001 - com/google/cloud/asset/v1p1beta1/SearchResources* + 7012 + com/google/cloud/asset/v1p1beta1/*OrBuilder + boolean has*(*) diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetProto.java b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetProto.java index 15f5d04e4..dec4e4f90 100644 --- a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetProto.java +++ b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetProto.java @@ -31,10 +31,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_asset_v1p1beta1_StandardResourceMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_asset_v1p1beta1_StandardResourceMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p1beta1_StandardResourceMetadata_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p1beta1_StandardResourceMetadata_LabelsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_MatchedPermissionsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_MatchedPermissionsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p1beta1_Permissions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p1beta1_Permissions_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -47,18 +63,31 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n)google/cloud/asset/v1p1beta1/assets.pr" + "oto\022\034google.cloud.asset.v1p1beta1\032\032googl" + "e/iam/v1/policy.proto\032\034google/api/annota" - + "tions.proto\"\227\001\n\030StandardResourceMetadata" + + "tions.proto\"\302\002\n\030StandardResourceMetadata" + "\022\014\n\004name\030\001 \001(\t\022\022\n\nasset_type\030\002 \001(\t\022\017\n\007pr" + "oject\030\003 \001(\t\022\024\n\014display_name\030\004 \001(\t\022\023\n\013des" + "cription\030\005 \001(\t\022\035\n\025additional_attributes\030" - + "\n \003(\t\"a\n\025IamPolicySearchResult\022\020\n\010resour" - + "ce\030\001 \001(\t\022\017\n\007project\030\003 \001(\t\022%\n\006policy\030\004 \001(" - + "\0132\025.google.iam.v1.PolicyB\264\001\n com.google." - + "cloud.asset.v1p1beta1B\nAssetProtoP\001ZAgoo" - + "gle.golang.org/genproto/googleapis/cloud" - + "/asset/v1p1beta1;asset\370\001\001\252\002\034Google.Cloud" - + ".Asset.V1P1Beta1\312\002\034Google\\Cloud\\Asset\\V1" - + "p1beta1b\006proto3" + + "\n \003(\t\022\020\n\010location\030\013 \001(\t\022R\n\006labels\030\014 \003(\0132" + + "B.google.cloud.asset.v1p1beta1.StandardR" + + "esourceMetadata.LabelsEntry\022\024\n\014network_t" + + "ags\030\r \003(\t\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"\243\003\n\025IamPolicySearchResu" + + "lt\022\020\n\010resource\030\001 \001(\t\022\017\n\007project\030\003 \001(\t\022%\n" + + "\006policy\030\004 \001(\0132\025.google.iam.v1.Policy\022T\n\013" + + "explanation\030\005 \001(\0132?.google.cloud.asset.v" + + "1p1beta1.IamPolicySearchResult.Explanati" + + "on\032\351\001\n\013Explanation\022t\n\023matched_permission" + + "s\030\001 \003(\0132W.google.cloud.asset.v1p1beta1.I" + + "amPolicySearchResult.Explanation.Matched" + + "PermissionsEntry\032d\n\027MatchedPermissionsEn" + + "try\022\013\n\003key\030\001 \001(\t\0228\n\005value\030\002 \001(\0132).google" + + ".cloud.asset.v1p1beta1.Permissions:\0028\001\"\"" + + "\n\013Permissions\022\023\n\013permissions\030\001 \003(\tB\264\001\n c" + + "om.google.cloud.asset.v1p1beta1B\nAssetPr" + + "otoP\001ZAgoogle.golang.org/genproto/google" + + "apis/cloud/asset/v1p1beta1;asset\370\001\001\252\002\034Go" + + "ogle.Cloud.Asset.V1P1Beta1\312\002\034Google\\Clou" + + "d\\Asset\\V1p1beta1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -73,7 +102,25 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_asset_v1p1beta1_StandardResourceMetadata_descriptor, new java.lang.String[] { - "Name", "AssetType", "Project", "DisplayName", "Description", "AdditionalAttributes", + "Name", + "AssetType", + "Project", + "DisplayName", + "Description", + "AdditionalAttributes", + "Location", + "Labels", + "NetworkTags", + }); + internal_static_google_cloud_asset_v1p1beta1_StandardResourceMetadata_LabelsEntry_descriptor = + internal_static_google_cloud_asset_v1p1beta1_StandardResourceMetadata_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_asset_v1p1beta1_StandardResourceMetadata_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p1beta1_StandardResourceMetadata_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", }); internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_descriptor = getDescriptor().getMessageTypes().get(1); @@ -81,7 +128,35 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_descriptor, new java.lang.String[] { - "Resource", "Project", "Policy", + "Resource", "Project", "Policy", "Explanation", + }); + internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_descriptor = + internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_descriptor, + new java.lang.String[] { + "MatchedPermissions", + }); + internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_MatchedPermissionsEntry_descriptor = + internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_MatchedPermissionsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_MatchedPermissionsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_asset_v1p1beta1_Permissions_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_asset_v1p1beta1_Permissions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p1beta1_Permissions_descriptor, + new java.lang.String[] { + "Permissions", }); com.google.iam.v1.PolicyProto.getDescriptor(); com.google.api.AnnotationsProto.getDescriptor(); diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceProto.java b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceProto.java index 8ba13c72f..1b0e9289c 100644 --- a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceProto.java +++ b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceProto.java @@ -57,38 +57,38 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\032\034google/api/annotations.proto\032\027google/a" + "pi/client.proto\032\037google/api/field_behavi" + "or.proto\032)google/cloud/asset/v1p1beta1/a" - + "ssets.proto\"\216\001\n\031SearchAllResourcesReques" + + "ssets.proto\"\245\001\n\031SearchAllResourcesReques" + "t\022\022\n\005scope\030\001 \001(\tB\003\340A\002\022\022\n\005query\030\002 \001(\tB\003\340A" + "\001\022\030\n\013asset_types\030\003 \003(\tB\003\340A\001\022\026\n\tpage_size" - + "\030\004 \001(\005B\003\340A\001\022\027\n\npage_token\030\005 \001(\tB\003\340A\001\"~\n\032" - + "SearchAllResourcesResponse\022G\n\007results\030\001 " - + "\003(\01326.google.cloud.asset.v1p1beta1.Stand" - + "ardResourceMetadata\022\027\n\017next_page_token\030\002" - + " \001(\t\"v\n\033SearchAllIamPoliciesRequest\022\022\n\005s" - + "cope\030\001 \001(\tB\003\340A\002\022\022\n\005query\030\002 \001(\tB\003\340A\001\022\026\n\tp" - + "age_size\030\003 \001(\005B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB" - + "\003\340A\001\"}\n\034SearchAllIamPoliciesResponse\022D\n\007" - + "results\030\001 \003(\01323.google.cloud.asset.v1p1b" - + "eta1.IamPolicySearchResult\022\027\n\017next_page_" - + "token\030\002 \001(\t2\211\004\n\014AssetService\022\325\001\n\022SearchA" - + "llResources\0227.google.cloud.asset.v1p1bet" - + "a1.SearchAllResourcesRequest\0328.google.cl" - + "oud.asset.v1p1beta1.SearchAllResourcesRe" - + "sponse\"L\202\323\344\223\002,\022*/v1p1beta1/{scope=*/*}/r" - + "esources:searchAll\332A\027scope,query,asset_t" - + "ypes\022\321\001\n\024SearchAllIamPolicies\0229.google.c" - + "loud.asset.v1p1beta1.SearchAllIamPolicie" - + "sRequest\032:.google.cloud.asset.v1p1beta1." - + "SearchAllIamPoliciesResponse\"B\202\323\344\223\002.\022,/v" - + "1p1beta1/{scope=*/*}/iamPolicies:searchA" - + "ll\332A\013scope,query\032M\312A\031cloudasset.googleap" - + "is.com\322A.https://www.googleapis.com/auth" - + "/cloud-platformB\270\001\n com.google.cloud.ass" - + "et.v1p1beta1B\021AssetServiceProtoP\001ZAgoogl" - + "e.golang.org/genproto/googleapis/cloud/a" - + "sset/v1p1beta1;asset\252\002\034Google.Cloud.Asse" - + "t.V1P1Beta1\312\002\034Google\\Cloud\\Asset\\V1p1bet" - + "a1b\006proto3" + + "\030\004 \001(\005B\003\340A\001\022\027\n\npage_token\030\005 \001(\tB\003\340A\001\022\025\n\010" + + "order_by\030\n \001(\tB\003\340A\001\"~\n\032SearchAllResource" + + "sResponse\022G\n\007results\030\001 \003(\01326.google.clou" + + "d.asset.v1p1beta1.StandardResourceMetada" + + "ta\022\027\n\017next_page_token\030\002 \001(\t\"v\n\033SearchAll" + + "IamPoliciesRequest\022\022\n\005scope\030\001 \001(\tB\003\340A\002\022\022" + + "\n\005query\030\002 \001(\tB\003\340A\001\022\026\n\tpage_size\030\003 \001(\005B\003\340" + + "A\001\022\027\n\npage_token\030\004 \001(\tB\003\340A\001\"}\n\034SearchAll" + + "IamPoliciesResponse\022D\n\007results\030\001 \003(\01323.g" + + "oogle.cloud.asset.v1p1beta1.IamPolicySea" + + "rchResult\022\027\n\017next_page_token\030\002 \001(\t2\211\004\n\014A" + + "ssetService\022\325\001\n\022SearchAllResources\0227.goo" + + "gle.cloud.asset.v1p1beta1.SearchAllResou" + + "rcesRequest\0328.google.cloud.asset.v1p1bet" + + "a1.SearchAllResourcesResponse\"L\202\323\344\223\002,\022*/" + + "v1p1beta1/{scope=*/*}/resources:searchAl" + + "l\332A\027scope,query,asset_types\022\321\001\n\024SearchAl" + + "lIamPolicies\0229.google.cloud.asset.v1p1be" + + "ta1.SearchAllIamPoliciesRequest\032:.google" + + ".cloud.asset.v1p1beta1.SearchAllIamPolic" + + "iesResponse\"B\202\323\344\223\002.\022,/v1p1beta1/{scope=*" + + "/*}/iamPolicies:searchAll\332A\013scope,query\032" + + "M\312A\031cloudasset.googleapis.com\322A.https://" + + "www.googleapis.com/auth/cloud-platformB\270" + + "\001\n com.google.cloud.asset.v1p1beta1B\021Ass" + + "etServiceProtoP\001ZAgoogle.golang.org/genp" + + "roto/googleapis/cloud/asset/v1p1beta1;as" + + "set\252\002\034Google.Cloud.Asset.V1P1Beta1\312\002\034Goo" + + "gle\\Cloud\\Asset\\V1p1beta1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -105,7 +105,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_asset_v1p1beta1_SearchAllResourcesRequest_descriptor, new java.lang.String[] { - "Scope", "Query", "AssetTypes", "PageSize", "PageToken", + "Scope", "Query", "AssetTypes", "PageSize", "PageToken", "OrderBy", }); internal_static_google_cloud_asset_v1p1beta1_SearchAllResourcesResponse_descriptor = getDescriptor().getMessageTypes().get(1); diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/IamPolicySearchResult.java b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/IamPolicySearchResult.java index 854e725ad..429acb8f1 100644 --- a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/IamPolicySearchResult.java +++ b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/IamPolicySearchResult.java @@ -97,6 +97,24 @@ private IamPolicySearchResult( policy_ = subBuilder.buildPartial(); } + break; + } + case 42: + { + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.Builder + subBuilder = null; + if (explanation_ != null) { + subBuilder = explanation_.toBuilder(); + } + explanation_ = + input.readMessage( + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(explanation_); + explanation_ = subBuilder.buildPartial(); + } + break; } default: @@ -133,6 +151,958 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Builder.class); } + public interface ExplanationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The map from roles to their included permission matching the permission
+     * query (e.g. containing `policy.role.permissions:`). A sample role string:
+     * "roles/compute.instanceAdmin". The roles can also be found in the
+     * returned `policy` bindings. Note that the map is populated only if
+     * requesting with a permission query.
+     * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + int getMatchedPermissionsCount(); + /** + * + * + *
+     * The map from roles to their included permission matching the permission
+     * query (e.g. containing `policy.role.permissions:`). A sample role string:
+     * "roles/compute.instanceAdmin". The roles can also be found in the
+     * returned `policy` bindings. Note that the map is populated only if
+     * requesting with a permission query.
+     * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + boolean containsMatchedPermissions(java.lang.String key); + /** Use {@link #getMatchedPermissionsMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getMatchedPermissions(); + /** + * + * + *
+     * The map from roles to their included permission matching the permission
+     * query (e.g. containing `policy.role.permissions:`). A sample role string:
+     * "roles/compute.instanceAdmin". The roles can also be found in the
+     * returned `policy` bindings. Note that the map is populated only if
+     * requesting with a permission query.
+     * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + java.util.Map + getMatchedPermissionsMap(); + /** + * + * + *
+     * The map from roles to their included permission matching the permission
+     * query (e.g. containing `policy.role.permissions:`). A sample role string:
+     * "roles/compute.instanceAdmin". The roles can also be found in the
+     * returned `policy` bindings. Note that the map is populated only if
+     * requesting with a permission query.
+     * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + com.google.cloud.asset.v1p1beta1.Permissions getMatchedPermissionsOrDefault( + java.lang.String key, com.google.cloud.asset.v1p1beta1.Permissions defaultValue); + /** + * + * + *
+     * The map from roles to their included permission matching the permission
+     * query (e.g. containing `policy.role.permissions:`). A sample role string:
+     * "roles/compute.instanceAdmin". The roles can also be found in the
+     * returned `policy` bindings. Note that the map is populated only if
+     * requesting with a permission query.
+     * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + com.google.cloud.asset.v1p1beta1.Permissions getMatchedPermissionsOrThrow(java.lang.String key); + } + /** + * + * + *
+   * Explanation about the IAM policy search result.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation} + */ + public static final class Explanation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation) + ExplanationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Explanation.newBuilder() to construct. + private Explanation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Explanation() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Explanation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Explanation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + matchedPermissions_ = + com.google.protobuf.MapField.newMapField( + MatchedPermissionsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.asset.v1p1beta1.Permissions> + matchedPermissions__ = + input.readMessage( + MatchedPermissionsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + matchedPermissions_ + .getMutableMap() + .put(matchedPermissions__.getKey(), matchedPermissions__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p1beta1.AssetProto + .internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetMatchedPermissions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p1beta1.AssetProto + .internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.class, + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.Builder.class); + } + + public static final int MATCHED_PERMISSIONS_FIELD_NUMBER = 1; + + private static final class MatchedPermissionsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.asset.v1p1beta1.Permissions> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.asset.v1p1beta1.AssetProto + .internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_MatchedPermissionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.asset.v1p1beta1.Permissions.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.asset.v1p1beta1.Permissions> + matchedPermissions_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.asset.v1p1beta1.Permissions> + internalGetMatchedPermissions() { + if (matchedPermissions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MatchedPermissionsDefaultEntryHolder.defaultEntry); + } + return matchedPermissions_; + } + + public int getMatchedPermissionsCount() { + return internalGetMatchedPermissions().getMap().size(); + } + /** + * + * + *
+     * The map from roles to their included permission matching the permission
+     * query (e.g. containing `policy.role.permissions:`). A sample role string:
+     * "roles/compute.instanceAdmin". The roles can also be found in the
+     * returned `policy` bindings. Note that the map is populated only if
+     * requesting with a permission query.
+     * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + public boolean containsMatchedPermissions(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMatchedPermissions().getMap().containsKey(key); + } + /** Use {@link #getMatchedPermissionsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map + getMatchedPermissions() { + return getMatchedPermissionsMap(); + } + /** + * + * + *
+     * The map from roles to their included permission matching the permission
+     * query (e.g. containing `policy.role.permissions:`). A sample role string:
+     * "roles/compute.instanceAdmin". The roles can also be found in the
+     * returned `policy` bindings. Note that the map is populated only if
+     * requesting with a permission query.
+     * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + public java.util.Map + getMatchedPermissionsMap() { + return internalGetMatchedPermissions().getMap(); + } + /** + * + * + *
+     * The map from roles to their included permission matching the permission
+     * query (e.g. containing `policy.role.permissions:`). A sample role string:
+     * "roles/compute.instanceAdmin". The roles can also be found in the
+     * returned `policy` bindings. Note that the map is populated only if
+     * requesting with a permission query.
+     * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + public com.google.cloud.asset.v1p1beta1.Permissions getMatchedPermissionsOrDefault( + java.lang.String key, com.google.cloud.asset.v1p1beta1.Permissions defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetMatchedPermissions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The map from roles to their included permission matching the permission
+     * query (e.g. containing `policy.role.permissions:`). A sample role string:
+     * "roles/compute.instanceAdmin". The roles can also be found in the
+     * returned `policy` bindings. Note that the map is populated only if
+     * requesting with a permission query.
+     * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + public com.google.cloud.asset.v1p1beta1.Permissions getMatchedPermissionsOrThrow( + java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetMatchedPermissions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetMatchedPermissions(), + MatchedPermissionsDefaultEntryHolder.defaultEntry, + 1); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry + entry : internalGetMatchedPermissions().getMap().entrySet()) { + com.google.protobuf.MapEntry + matchedPermissions__ = + MatchedPermissionsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, matchedPermissions__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation other = + (com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation) obj; + + if (!internalGetMatchedPermissions().equals(other.internalGetMatchedPermissions())) + return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetMatchedPermissions().getMap().isEmpty()) { + hash = (37 * hash) + MATCHED_PERMISSIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetMatchedPermissions().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Explanation about the IAM policy search result.
+     * 
+ * + * Protobuf type {@code google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation) + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.ExplanationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p1beta1.AssetProto + .internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetMatchedPermissions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableMatchedPermissions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p1beta1.AssetProto + .internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.class, + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.Builder.class); + } + + // Construct using + // com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableMatchedPermissions().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p1beta1.AssetProto + .internal_static_google_cloud_asset_v1p1beta1_IamPolicySearchResult_Explanation_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + getDefaultInstanceForType() { + return com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation build() { + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation buildPartial() { + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation result = + new com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation(this); + int from_bitField0_ = bitField0_; + result.matchedPermissions_ = internalGetMatchedPermissions(); + result.matchedPermissions_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation) { + return mergeFrom( + (com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation other) { + if (other + == com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + .getDefaultInstance()) return this; + internalGetMutableMatchedPermissions().mergeFrom(other.internalGetMatchedPermissions()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.asset.v1p1beta1.Permissions> + matchedPermissions_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.asset.v1p1beta1.Permissions> + internalGetMatchedPermissions() { + if (matchedPermissions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MatchedPermissionsDefaultEntryHolder.defaultEntry); + } + return matchedPermissions_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.asset.v1p1beta1.Permissions> + internalGetMutableMatchedPermissions() { + onChanged(); + ; + if (matchedPermissions_ == null) { + matchedPermissions_ = + com.google.protobuf.MapField.newMapField( + MatchedPermissionsDefaultEntryHolder.defaultEntry); + } + if (!matchedPermissions_.isMutable()) { + matchedPermissions_ = matchedPermissions_.copy(); + } + return matchedPermissions_; + } + + public int getMatchedPermissionsCount() { + return internalGetMatchedPermissions().getMap().size(); + } + /** + * + * + *
+       * The map from roles to their included permission matching the permission
+       * query (e.g. containing `policy.role.permissions:`). A sample role string:
+       * "roles/compute.instanceAdmin". The roles can also be found in the
+       * returned `policy` bindings. Note that the map is populated only if
+       * requesting with a permission query.
+       * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + public boolean containsMatchedPermissions(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMatchedPermissions().getMap().containsKey(key); + } + /** Use {@link #getMatchedPermissionsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map + getMatchedPermissions() { + return getMatchedPermissionsMap(); + } + /** + * + * + *
+       * The map from roles to their included permission matching the permission
+       * query (e.g. containing `policy.role.permissions:`). A sample role string:
+       * "roles/compute.instanceAdmin". The roles can also be found in the
+       * returned `policy` bindings. Note that the map is populated only if
+       * requesting with a permission query.
+       * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + public java.util.Map + getMatchedPermissionsMap() { + return internalGetMatchedPermissions().getMap(); + } + /** + * + * + *
+       * The map from roles to their included permission matching the permission
+       * query (e.g. containing `policy.role.permissions:`). A sample role string:
+       * "roles/compute.instanceAdmin". The roles can also be found in the
+       * returned `policy` bindings. Note that the map is populated only if
+       * requesting with a permission query.
+       * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + public com.google.cloud.asset.v1p1beta1.Permissions getMatchedPermissionsOrDefault( + java.lang.String key, com.google.cloud.asset.v1p1beta1.Permissions defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetMatchedPermissions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+       * The map from roles to their included permission matching the permission
+       * query (e.g. containing `policy.role.permissions:`). A sample role string:
+       * "roles/compute.instanceAdmin". The roles can also be found in the
+       * returned `policy` bindings. Note that the map is populated only if
+       * requesting with a permission query.
+       * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + public com.google.cloud.asset.v1p1beta1.Permissions getMatchedPermissionsOrThrow( + java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetMatchedPermissions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMatchedPermissions() { + internalGetMutableMatchedPermissions().getMutableMap().clear(); + return this; + } + /** + * + * + *
+       * The map from roles to their included permission matching the permission
+       * query (e.g. containing `policy.role.permissions:`). A sample role string:
+       * "roles/compute.instanceAdmin". The roles can also be found in the
+       * returned `policy` bindings. Note that the map is populated only if
+       * requesting with a permission query.
+       * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + public Builder removeMatchedPermissions(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMatchedPermissions().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableMatchedPermissions() { + return internalGetMutableMatchedPermissions().getMutableMap(); + } + /** + * + * + *
+       * The map from roles to their included permission matching the permission
+       * query (e.g. containing `policy.role.permissions:`). A sample role string:
+       * "roles/compute.instanceAdmin". The roles can also be found in the
+       * returned `policy` bindings. Note that the map is populated only if
+       * requesting with a permission query.
+       * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + public Builder putMatchedPermissions( + java.lang.String key, com.google.cloud.asset.v1p1beta1.Permissions value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMatchedPermissions().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+       * The map from roles to their included permission matching the permission
+       * query (e.g. containing `policy.role.permissions:`). A sample role string:
+       * "roles/compute.instanceAdmin". The roles can also be found in the
+       * returned `policy` bindings. Note that the map is populated only if
+       * requesting with a permission query.
+       * 
+ * + * map<string, .google.cloud.asset.v1p1beta1.Permissions> matched_permissions = 1; + * + */ + public Builder putAllMatchedPermissions( + java.util.Map values) { + internalGetMutableMatchedPermissions().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation) + private static final com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation(); + } + + public static com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Explanation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Explanation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + public static final int RESOURCE_FIELD_NUMBER = 1; private volatile java.lang.Object resource_; /** @@ -245,8 +1215,10 @@ public com.google.protobuf.ByteString getProjectBytes() { * * *
-   * Representation of the actual Cloud IAM policy set on a cloud resource. For
-   * each resource, there must be at most one Cloud IAM policy set on it.
+   * The IAM policy directly set on the given resource. Note that the original
+   * IAM policy can contain multiple bindings. This only contains the bindings
+   * that match the given query. For queries that don't contain a constrain on
+   * policies (e.g. an empty query), this contains all the bindings.
    * 
* * .google.iam.v1.Policy policy = 4; @@ -260,8 +1232,10 @@ public boolean hasPolicy() { * * *
-   * Representation of the actual Cloud IAM policy set on a cloud resource. For
-   * each resource, there must be at most one Cloud IAM policy set on it.
+   * The IAM policy directly set on the given resource. Note that the original
+   * IAM policy can contain multiple bindings. This only contains the bindings
+   * that match the given query. For queries that don't contain a constrain on
+   * policies (e.g. an empty query), this contains all the bindings.
    * 
* * .google.iam.v1.Policy policy = 4; @@ -275,8 +1249,10 @@ public com.google.iam.v1.Policy getPolicy() { * * *
-   * Representation of the actual Cloud IAM policy set on a cloud resource. For
-   * each resource, there must be at most one Cloud IAM policy set on it.
+   * The IAM policy directly set on the given resource. Note that the original
+   * IAM policy can contain multiple bindings. This only contains the bindings
+   * that match the given query. For queries that don't contain a constrain on
+   * policies (e.g. an empty query), this contains all the bindings.
    * 
* * .google.iam.v1.Policy policy = 4; @@ -285,6 +1261,55 @@ public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { return getPolicy(); } + public static final int EXPLANATION_FIELD_NUMBER = 5; + private com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation_; + /** + * + * + *
+   * Explanation about the IAM policy search result. It contains additional
+   * information to explain why the search result matches the query.
+   * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + * + * @return Whether the explanation field is set. + */ + public boolean hasExplanation() { + return explanation_ != null; + } + /** + * + * + *
+   * Explanation about the IAM policy search result. It contains additional
+   * information to explain why the search result matches the query.
+   * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + * + * @return The explanation. + */ + public com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation getExplanation() { + return explanation_ == null + ? com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.getDefaultInstance() + : explanation_; + } + /** + * + * + *
+   * Explanation about the IAM policy search result. It contains additional
+   * information to explain why the search result matches the query.
+   * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + */ + public com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.ExplanationOrBuilder + getExplanationOrBuilder() { + return getExplanation(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -308,6 +1333,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (policy_ != null) { output.writeMessage(4, getPolicy()); } + if (explanation_ != null) { + output.writeMessage(5, getExplanation()); + } unknownFields.writeTo(output); } @@ -326,6 +1354,9 @@ public int getSerializedSize() { if (policy_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPolicy()); } + if (explanation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getExplanation()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -348,6 +1379,10 @@ public boolean equals(final java.lang.Object obj) { if (hasPolicy()) { if (!getPolicy().equals(other.getPolicy())) return false; } + if (hasExplanation() != other.hasExplanation()) return false; + if (hasExplanation()) { + if (!getExplanation().equals(other.getExplanation())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -367,6 +1402,10 @@ public int hashCode() { hash = (37 * hash) + POLICY_FIELD_NUMBER; hash = (53 * hash) + getPolicy().hashCode(); } + if (hasExplanation()) { + hash = (37 * hash) + EXPLANATION_FIELD_NUMBER; + hash = (53 * hash) + getExplanation().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -523,6 +1562,12 @@ public Builder clear() { policy_ = null; policyBuilder_ = null; } + if (explanationBuilder_ == null) { + explanation_ = null; + } else { + explanation_ = null; + explanationBuilder_ = null; + } return this; } @@ -557,6 +1602,11 @@ public com.google.cloud.asset.v1p1beta1.IamPolicySearchResult buildPartial() { } else { result.policy_ = policyBuilder_.build(); } + if (explanationBuilder_ == null) { + result.explanation_ = explanation_; + } else { + result.explanation_ = explanationBuilder_.build(); + } onBuilt(); return result; } @@ -618,6 +1668,9 @@ public Builder mergeFrom(com.google.cloud.asset.v1p1beta1.IamPolicySearchResult if (other.hasPolicy()) { mergePolicy(other.getPolicy()); } + if (other.hasExplanation()) { + mergeExplanation(other.getExplanation()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -900,8 +1953,10 @@ public Builder setProjectBytes(com.google.protobuf.ByteString value) { * * *
-     * Representation of the actual Cloud IAM policy set on a cloud resource. For
-     * each resource, there must be at most one Cloud IAM policy set on it.
+     * The IAM policy directly set on the given resource. Note that the original
+     * IAM policy can contain multiple bindings. This only contains the bindings
+     * that match the given query. For queries that don't contain a constrain on
+     * policies (e.g. an empty query), this contains all the bindings.
      * 
* * .google.iam.v1.Policy policy = 4; @@ -915,8 +1970,10 @@ public boolean hasPolicy() { * * *
-     * Representation of the actual Cloud IAM policy set on a cloud resource. For
-     * each resource, there must be at most one Cloud IAM policy set on it.
+     * The IAM policy directly set on the given resource. Note that the original
+     * IAM policy can contain multiple bindings. This only contains the bindings
+     * that match the given query. For queries that don't contain a constrain on
+     * policies (e.g. an empty query), this contains all the bindings.
      * 
* * .google.iam.v1.Policy policy = 4; @@ -934,8 +1991,10 @@ public com.google.iam.v1.Policy getPolicy() { * * *
-     * Representation of the actual Cloud IAM policy set on a cloud resource. For
-     * each resource, there must be at most one Cloud IAM policy set on it.
+     * The IAM policy directly set on the given resource. Note that the original
+     * IAM policy can contain multiple bindings. This only contains the bindings
+     * that match the given query. For queries that don't contain a constrain on
+     * policies (e.g. an empty query), this contains all the bindings.
      * 
* * .google.iam.v1.Policy policy = 4; @@ -957,8 +2016,10 @@ public Builder setPolicy(com.google.iam.v1.Policy value) { * * *
-     * Representation of the actual Cloud IAM policy set on a cloud resource. For
-     * each resource, there must be at most one Cloud IAM policy set on it.
+     * The IAM policy directly set on the given resource. Note that the original
+     * IAM policy can contain multiple bindings. This only contains the bindings
+     * that match the given query. For queries that don't contain a constrain on
+     * policies (e.g. an empty query), this contains all the bindings.
      * 
* * .google.iam.v1.Policy policy = 4; @@ -977,8 +2038,10 @@ public Builder setPolicy(com.google.iam.v1.Policy.Builder builderForValue) { * * *
-     * Representation of the actual Cloud IAM policy set on a cloud resource. For
-     * each resource, there must be at most one Cloud IAM policy set on it.
+     * The IAM policy directly set on the given resource. Note that the original
+     * IAM policy can contain multiple bindings. This only contains the bindings
+     * that match the given query. For queries that don't contain a constrain on
+     * policies (e.g. an empty query), this contains all the bindings.
      * 
* * .google.iam.v1.Policy policy = 4; @@ -1001,8 +2064,10 @@ public Builder mergePolicy(com.google.iam.v1.Policy value) { * * *
-     * Representation of the actual Cloud IAM policy set on a cloud resource. For
-     * each resource, there must be at most one Cloud IAM policy set on it.
+     * The IAM policy directly set on the given resource. Note that the original
+     * IAM policy can contain multiple bindings. This only contains the bindings
+     * that match the given query. For queries that don't contain a constrain on
+     * policies (e.g. an empty query), this contains all the bindings.
      * 
* * .google.iam.v1.Policy policy = 4; @@ -1022,8 +2087,10 @@ public Builder clearPolicy() { * * *
-     * Representation of the actual Cloud IAM policy set on a cloud resource. For
-     * each resource, there must be at most one Cloud IAM policy set on it.
+     * The IAM policy directly set on the given resource. Note that the original
+     * IAM policy can contain multiple bindings. This only contains the bindings
+     * that match the given query. For queries that don't contain a constrain on
+     * policies (e.g. an empty query), this contains all the bindings.
      * 
* * .google.iam.v1.Policy policy = 4; @@ -1037,8 +2104,10 @@ public com.google.iam.v1.Policy.Builder getPolicyBuilder() { * * *
-     * Representation of the actual Cloud IAM policy set on a cloud resource. For
-     * each resource, there must be at most one Cloud IAM policy set on it.
+     * The IAM policy directly set on the given resource. Note that the original
+     * IAM policy can contain multiple bindings. This only contains the bindings
+     * that match the given query. For queries that don't contain a constrain on
+     * policies (e.g. an empty query), this contains all the bindings.
      * 
* * .google.iam.v1.Policy policy = 4; @@ -1054,8 +2123,10 @@ public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { * * *
-     * Representation of the actual Cloud IAM policy set on a cloud resource. For
-     * each resource, there must be at most one Cloud IAM policy set on it.
+     * The IAM policy directly set on the given resource. Note that the original
+     * IAM policy can contain multiple bindings. This only contains the bindings
+     * that match the given query. For queries that don't contain a constrain on
+     * policies (e.g. an empty query), this contains all the bindings.
      * 
* * .google.iam.v1.Policy policy = 4; @@ -1076,6 +2147,209 @@ public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { return policyBuilder_; } + private com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation, + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.Builder, + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.ExplanationOrBuilder> + explanationBuilder_; + /** + * + * + *
+     * Explanation about the IAM policy search result. It contains additional
+     * information to explain why the search result matches the query.
+     * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + * + * @return Whether the explanation field is set. + */ + public boolean hasExplanation() { + return explanationBuilder_ != null || explanation_ != null; + } + /** + * + * + *
+     * Explanation about the IAM policy search result. It contains additional
+     * information to explain why the search result matches the query.
+     * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + * + * @return The explanation. + */ + public com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation getExplanation() { + if (explanationBuilder_ == null) { + return explanation_ == null + ? com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + .getDefaultInstance() + : explanation_; + } else { + return explanationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Explanation about the IAM policy search result. It contains additional
+     * information to explain why the search result matches the query.
+     * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + */ + public Builder setExplanation( + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation value) { + if (explanationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explanation_ = value; + onChanged(); + } else { + explanationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Explanation about the IAM policy search result. It contains additional
+     * information to explain why the search result matches the query.
+     * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + */ + public Builder setExplanation( + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.Builder + builderForValue) { + if (explanationBuilder_ == null) { + explanation_ = builderForValue.build(); + onChanged(); + } else { + explanationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Explanation about the IAM policy search result. It contains additional
+     * information to explain why the search result matches the query.
+     * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + */ + public Builder mergeExplanation( + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation value) { + if (explanationBuilder_ == null) { + if (explanation_ != null) { + explanation_ = + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.newBuilder( + explanation_) + .mergeFrom(value) + .buildPartial(); + } else { + explanation_ = value; + } + onChanged(); + } else { + explanationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Explanation about the IAM policy search result. It contains additional
+     * information to explain why the search result matches the query.
+     * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + */ + public Builder clearExplanation() { + if (explanationBuilder_ == null) { + explanation_ = null; + onChanged(); + } else { + explanation_ = null; + explanationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Explanation about the IAM policy search result. It contains additional
+     * information to explain why the search result matches the query.
+     * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + */ + public com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.Builder + getExplanationBuilder() { + + onChanged(); + return getExplanationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Explanation about the IAM policy search result. It contains additional
+     * information to explain why the search result matches the query.
+     * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + */ + public com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.ExplanationOrBuilder + getExplanationOrBuilder() { + if (explanationBuilder_ != null) { + return explanationBuilder_.getMessageOrBuilder(); + } else { + return explanation_ == null + ? com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + .getDefaultInstance() + : explanation_; + } + } + /** + * + * + *
+     * Explanation about the IAM policy search result. It contains additional
+     * information to explain why the search result matches the query.
+     * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation, + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.Builder, + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.ExplanationOrBuilder> + getExplanationFieldBuilder() { + if (explanationBuilder_ == null) { + explanationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation, + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.Builder, + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.ExplanationOrBuilder>( + getExplanation(), getParentForChildren(), isClean()); + explanation_ = null; + } + return explanationBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/IamPolicySearchResultOrBuilder.java b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/IamPolicySearchResultOrBuilder.java index 6c6a03ea3..908e23727 100644 --- a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/IamPolicySearchResultOrBuilder.java +++ b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/IamPolicySearchResultOrBuilder.java @@ -89,8 +89,10 @@ public interface IamPolicySearchResultOrBuilder * * *
-   * Representation of the actual Cloud IAM policy set on a cloud resource. For
-   * each resource, there must be at most one Cloud IAM policy set on it.
+   * The IAM policy directly set on the given resource. Note that the original
+   * IAM policy can contain multiple bindings. This only contains the bindings
+   * that match the given query. For queries that don't contain a constrain on
+   * policies (e.g. an empty query), this contains all the bindings.
    * 
* * .google.iam.v1.Policy policy = 4; @@ -102,8 +104,10 @@ public interface IamPolicySearchResultOrBuilder * * *
-   * Representation of the actual Cloud IAM policy set on a cloud resource. For
-   * each resource, there must be at most one Cloud IAM policy set on it.
+   * The IAM policy directly set on the given resource. Note that the original
+   * IAM policy can contain multiple bindings. This only contains the bindings
+   * that match the given query. For queries that don't contain a constrain on
+   * policies (e.g. an empty query), this contains all the bindings.
    * 
* * .google.iam.v1.Policy policy = 4; @@ -115,11 +119,52 @@ public interface IamPolicySearchResultOrBuilder * * *
-   * Representation of the actual Cloud IAM policy set on a cloud resource. For
-   * each resource, there must be at most one Cloud IAM policy set on it.
+   * The IAM policy directly set on the given resource. Note that the original
+   * IAM policy can contain multiple bindings. This only contains the bindings
+   * that match the given query. For queries that don't contain a constrain on
+   * policies (e.g. an empty query), this contains all the bindings.
    * 
* * .google.iam.v1.Policy policy = 4; */ com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder(); + + /** + * + * + *
+   * Explanation about the IAM policy search result. It contains additional
+   * information to explain why the search result matches the query.
+   * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + * + * @return Whether the explanation field is set. + */ + boolean hasExplanation(); + /** + * + * + *
+   * Explanation about the IAM policy search result. It contains additional
+   * information to explain why the search result matches the query.
+   * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + * + * @return The explanation. + */ + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation getExplanation(); + /** + * + * + *
+   * Explanation about the IAM policy search result. It contains additional
+   * information to explain why the search result matches the query.
+   * 
+ * + * .google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation explanation = 5; + */ + com.google.cloud.asset.v1p1beta1.IamPolicySearchResult.ExplanationOrBuilder + getExplanationOrBuilder(); } diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/Permissions.java b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/Permissions.java new file mode 100644 index 000000000..0888755bd --- /dev/null +++ b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/Permissions.java @@ -0,0 +1,735 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/asset/v1p1beta1/assets.proto + +package com.google.cloud.asset.v1p1beta1; + +/** + * + * + *
+ * IAM permissions
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p1beta1.Permissions} + */ +public final class Permissions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p1beta1.Permissions) + PermissionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Permissions.newBuilder() to construct. + private Permissions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Permissions() { + permissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Permissions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Permissions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + permissions_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + permissions_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + permissions_ = permissions_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p1beta1.AssetProto + .internal_static_google_cloud_asset_v1p1beta1_Permissions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p1beta1.AssetProto + .internal_static_google_cloud_asset_v1p1beta1_Permissions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p1beta1.Permissions.class, + com.google.cloud.asset.v1p1beta1.Permissions.Builder.class); + } + + public static final int PERMISSIONS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList permissions_; + /** + * + * + *
+   * A list of permissions. A sample permission string: "compute.disk.get".
+   * 
+ * + * repeated string permissions = 1; + * + * @return A list containing the permissions. + */ + public com.google.protobuf.ProtocolStringList getPermissionsList() { + return permissions_; + } + /** + * + * + *
+   * A list of permissions. A sample permission string: "compute.disk.get".
+   * 
+ * + * repeated string permissions = 1; + * + * @return The count of permissions. + */ + public int getPermissionsCount() { + return permissions_.size(); + } + /** + * + * + *
+   * A list of permissions. A sample permission string: "compute.disk.get".
+   * 
+ * + * repeated string permissions = 1; + * + * @param index The index of the element to return. + * @return The permissions at the given index. + */ + public java.lang.String getPermissions(int index) { + return permissions_.get(index); + } + /** + * + * + *
+   * A list of permissions. A sample permission string: "compute.disk.get".
+   * 
+ * + * repeated string permissions = 1; + * + * @param index The index of the value to return. + * @return The bytes of the permissions at the given index. + */ + public com.google.protobuf.ByteString getPermissionsBytes(int index) { + return permissions_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < permissions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, permissions_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < permissions_.size(); i++) { + dataSize += computeStringSizeNoTag(permissions_.getRaw(i)); + } + size += dataSize; + size += 1 * getPermissionsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.asset.v1p1beta1.Permissions)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p1beta1.Permissions other = + (com.google.cloud.asset.v1p1beta1.Permissions) obj; + + if (!getPermissionsList().equals(other.getPermissionsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPermissionsCount() > 0) { + hash = (37 * hash) + PERMISSIONS_FIELD_NUMBER; + hash = (53 * hash) + getPermissionsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p1beta1.Permissions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p1beta1.Permissions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p1beta1.Permissions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p1beta1.Permissions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p1beta1.Permissions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p1beta1.Permissions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p1beta1.Permissions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p1beta1.Permissions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.asset.v1p1beta1.Permissions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p1beta1.Permissions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.asset.v1p1beta1.Permissions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p1beta1.Permissions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.asset.v1p1beta1.Permissions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * IAM permissions
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p1beta1.Permissions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p1beta1.Permissions) + com.google.cloud.asset.v1p1beta1.PermissionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p1beta1.AssetProto + .internal_static_google_cloud_asset_v1p1beta1_Permissions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p1beta1.AssetProto + .internal_static_google_cloud_asset_v1p1beta1_Permissions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p1beta1.Permissions.class, + com.google.cloud.asset.v1p1beta1.Permissions.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p1beta1.Permissions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + permissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p1beta1.AssetProto + .internal_static_google_cloud_asset_v1p1beta1_Permissions_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p1beta1.Permissions getDefaultInstanceForType() { + return com.google.cloud.asset.v1p1beta1.Permissions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p1beta1.Permissions build() { + com.google.cloud.asset.v1p1beta1.Permissions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p1beta1.Permissions buildPartial() { + com.google.cloud.asset.v1p1beta1.Permissions result = + new com.google.cloud.asset.v1p1beta1.Permissions(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + permissions_ = permissions_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.permissions_ = permissions_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.asset.v1p1beta1.Permissions) { + return mergeFrom((com.google.cloud.asset.v1p1beta1.Permissions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p1beta1.Permissions other) { + if (other == com.google.cloud.asset.v1p1beta1.Permissions.getDefaultInstance()) return this; + if (!other.permissions_.isEmpty()) { + if (permissions_.isEmpty()) { + permissions_ = other.permissions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePermissionsIsMutable(); + permissions_.addAll(other.permissions_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.asset.v1p1beta1.Permissions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1p1beta1.Permissions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList permissions_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePermissionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + permissions_ = new com.google.protobuf.LazyStringArrayList(permissions_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * A list of permissions. A sample permission string: "compute.disk.get".
+     * 
+ * + * repeated string permissions = 1; + * + * @return A list containing the permissions. + */ + public com.google.protobuf.ProtocolStringList getPermissionsList() { + return permissions_.getUnmodifiableView(); + } + /** + * + * + *
+     * A list of permissions. A sample permission string: "compute.disk.get".
+     * 
+ * + * repeated string permissions = 1; + * + * @return The count of permissions. + */ + public int getPermissionsCount() { + return permissions_.size(); + } + /** + * + * + *
+     * A list of permissions. A sample permission string: "compute.disk.get".
+     * 
+ * + * repeated string permissions = 1; + * + * @param index The index of the element to return. + * @return The permissions at the given index. + */ + public java.lang.String getPermissions(int index) { + return permissions_.get(index); + } + /** + * + * + *
+     * A list of permissions. A sample permission string: "compute.disk.get".
+     * 
+ * + * repeated string permissions = 1; + * + * @param index The index of the value to return. + * @return The bytes of the permissions at the given index. + */ + public com.google.protobuf.ByteString getPermissionsBytes(int index) { + return permissions_.getByteString(index); + } + /** + * + * + *
+     * A list of permissions. A sample permission string: "compute.disk.get".
+     * 
+ * + * repeated string permissions = 1; + * + * @param index The index to set the value at. + * @param value The permissions to set. + * @return This builder for chaining. + */ + public Builder setPermissions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePermissionsIsMutable(); + permissions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of permissions. A sample permission string: "compute.disk.get".
+     * 
+ * + * repeated string permissions = 1; + * + * @param value The permissions to add. + * @return This builder for chaining. + */ + public Builder addPermissions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePermissionsIsMutable(); + permissions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of permissions. A sample permission string: "compute.disk.get".
+     * 
+ * + * repeated string permissions = 1; + * + * @param values The permissions to add. + * @return This builder for chaining. + */ + public Builder addAllPermissions(java.lang.Iterable values) { + ensurePermissionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, permissions_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of permissions. A sample permission string: "compute.disk.get".
+     * 
+ * + * repeated string permissions = 1; + * + * @return This builder for chaining. + */ + public Builder clearPermissions() { + permissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of permissions. A sample permission string: "compute.disk.get".
+     * 
+ * + * repeated string permissions = 1; + * + * @param value The bytes of the permissions to add. + * @return This builder for chaining. + */ + public Builder addPermissionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePermissionsIsMutable(); + permissions_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1p1beta1.Permissions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p1beta1.Permissions) + private static final com.google.cloud.asset.v1p1beta1.Permissions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p1beta1.Permissions(); + } + + public static com.google.cloud.asset.v1p1beta1.Permissions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Permissions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Permissions(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.asset.v1p1beta1.Permissions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/PermissionsOrBuilder.java b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/PermissionsOrBuilder.java new file mode 100644 index 000000000..8a7116a8c --- /dev/null +++ b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/PermissionsOrBuilder.java @@ -0,0 +1,76 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/asset/v1p1beta1/assets.proto + +package com.google.cloud.asset.v1p1beta1; + +public interface PermissionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p1beta1.Permissions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of permissions. A sample permission string: "compute.disk.get".
+   * 
+ * + * repeated string permissions = 1; + * + * @return A list containing the permissions. + */ + java.util.List getPermissionsList(); + /** + * + * + *
+   * A list of permissions. A sample permission string: "compute.disk.get".
+   * 
+ * + * repeated string permissions = 1; + * + * @return The count of permissions. + */ + int getPermissionsCount(); + /** + * + * + *
+   * A list of permissions. A sample permission string: "compute.disk.get".
+   * 
+ * + * repeated string permissions = 1; + * + * @param index The index of the element to return. + * @return The permissions at the given index. + */ + java.lang.String getPermissions(int index); + /** + * + * + *
+   * A list of permissions. A sample permission string: "compute.disk.get".
+   * 
+ * + * repeated string permissions = 1; + * + * @param index The index of the value to return. + * @return The bytes of the permissions at the given index. + */ + com.google.protobuf.ByteString getPermissionsBytes(int index); +} diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllIamPoliciesRequest.java b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllIamPoliciesRequest.java index b3a8d42d2..90836a61d 100644 --- a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllIamPoliciesRequest.java +++ b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllIamPoliciesRequest.java @@ -143,6 +143,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -169,6 +170,7 @@ public java.lang.String getScope() { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -691,6 +693,7 @@ public Builder mergeFrom( * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -717,6 +720,7 @@ public java.lang.String getScope() { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -743,6 +747,7 @@ public com.google.protobuf.ByteString getScopeBytes() { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -768,6 +773,7 @@ public Builder setScope(java.lang.String value) { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -789,6 +795,7 @@ public Builder clearScope() { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllIamPoliciesRequestOrBuilder.java b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllIamPoliciesRequestOrBuilder.java index 5855985fe..91f2d39a5 100644 --- a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllIamPoliciesRequestOrBuilder.java +++ b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllIamPoliciesRequestOrBuilder.java @@ -32,6 +32,7 @@ public interface SearchAllIamPoliciesRequestOrBuilder * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -48,6 +49,7 @@ public interface SearchAllIamPoliciesRequestOrBuilder * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllResourcesRequest.java b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllResourcesRequest.java index fc5159c7a..0ca0132b2 100644 --- a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllResourcesRequest.java +++ b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllResourcesRequest.java @@ -42,6 +42,7 @@ private SearchAllResourcesRequest() { query_ = ""; assetTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; pageToken_ = ""; + orderBy_ = ""; } @java.lang.Override @@ -110,6 +111,13 @@ private SearchAllResourcesRequest( pageToken_ = s; break; } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -158,6 +166,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -184,6 +193,7 @@ public java.lang.String getScope() { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -387,6 +397,59 @@ public com.google.protobuf.ByteString getPageTokenBytes() { } } + public static final int ORDER_BY_FIELD_NUMBER = 10; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Optional. A comma separated list of fields specifying the sorting order of the
+   * results. The default order is ascending. Add " desc" after the field name
+   * to indicate descending order. Redundant space characters are ignored. For
+   * example, "  foo ,  bar  desc  ".
+   * 
+ * + * string order_by = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A comma separated list of fields specifying the sorting order of the
+   * results. The default order is ascending. Add " desc" after the field name
+   * to indicate descending order. Redundant space characters are ignored. For
+   * example, "  foo ,  bar  desc  ".
+   * 
+ * + * string order_by = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -416,6 +479,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pageToken_); } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, orderBy_); + } unknownFields.writeTo(output); } @@ -445,6 +511,9 @@ public int getSerializedSize() { if (!getPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_); } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, orderBy_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -466,6 +535,7 @@ public boolean equals(final java.lang.Object obj) { if (!getAssetTypesList().equals(other.getAssetTypesList())) return false; if (getPageSize() != other.getPageSize()) return false; if (!getPageToken().equals(other.getPageToken())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -489,6 +559,8 @@ public int hashCode() { hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -645,6 +717,8 @@ public Builder clear() { pageToken_ = ""; + orderBy_ = ""; + return this; } @@ -682,6 +756,7 @@ public com.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest buildPartial() result.assetTypes_ = assetTypes_; result.pageSize_ = pageSize_; result.pageToken_ = pageToken_; + result.orderBy_ = orderBy_; onBuilt(); return result; } @@ -757,6 +832,10 @@ public Builder mergeFrom(com.google.cloud.asset.v1p1beta1.SearchAllResourcesRequ pageToken_ = other.pageToken_; onChanged(); } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -799,6 +878,7 @@ public Builder mergeFrom( * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -825,6 +905,7 @@ public java.lang.String getScope() { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -851,6 +932,7 @@ public com.google.protobuf.ByteString getScopeBytes() { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -876,6 +958,7 @@ public Builder setScope(java.lang.String value) { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -897,6 +980,7 @@ public Builder clearScope() { * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -1379,6 +1463,127 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. A comma separated list of fields specifying the sorting order of the
+     * results. The default order is ascending. Add " desc" after the field name
+     * to indicate descending order. Redundant space characters are ignored. For
+     * example, "  foo ,  bar  desc  ".
+     * 
+ * + * string order_by = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A comma separated list of fields specifying the sorting order of the
+     * results. The default order is ascending. Add " desc" after the field name
+     * to indicate descending order. Redundant space characters are ignored. For
+     * example, "  foo ,  bar  desc  ".
+     * 
+ * + * string order_by = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A comma separated list of fields specifying the sorting order of the
+     * results. The default order is ascending. Add " desc" after the field name
+     * to indicate descending order. Redundant space characters are ignored. For
+     * example, "  foo ,  bar  desc  ".
+     * 
+ * + * string order_by = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A comma separated list of fields specifying the sorting order of the
+     * results. The default order is ascending. Add " desc" after the field name
+     * to indicate descending order. Redundant space characters are ignored. For
+     * example, "  foo ,  bar  desc  ".
+     * 
+ * + * string order_by = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A comma separated list of fields specifying the sorting order of the
+     * results. The default order is ascending. Add " desc" after the field name
+     * to indicate descending order. Redundant space characters are ignored. For
+     * example, "  foo ,  bar  desc  ".
+     * 
+ * + * string order_by = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllResourcesRequestOrBuilder.java b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllResourcesRequestOrBuilder.java index 10f9b9711..9b27969f4 100644 --- a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllResourcesRequestOrBuilder.java +++ b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllResourcesRequestOrBuilder.java @@ -32,6 +32,7 @@ public interface SearchAllResourcesRequestOrBuilder * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -48,6 +49,7 @@ public interface SearchAllResourcesRequestOrBuilder * * Organization number (such as "organizations/123") * * Folder number(such as "folders/1234") * * Project number (such as "projects/12345") + * * Project id (such as "projects/abc") * * * string scope = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -182,4 +184,35 @@ public interface SearchAllResourcesRequestOrBuilder * @return The bytes for pageToken. */ com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. A comma separated list of fields specifying the sorting order of the
+   * results. The default order is ascending. Add " desc" after the field name
+   * to indicate descending order. Redundant space characters are ignored. For
+   * example, "  foo ,  bar  desc  ".
+   * 
+ * + * string order_by = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. A comma separated list of fields specifying the sorting order of the
+   * results. The default order is ascending. Add " desc" after the field name
+   * to indicate descending order. Redundant space characters are ignored. For
+   * example, "  foo ,  bar  desc  ".
+   * 
+ * + * string order_by = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); } diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/StandardResourceMetadata.java b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/StandardResourceMetadata.java index 762584a78..18f82185c 100644 --- a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/StandardResourceMetadata.java +++ b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/StandardResourceMetadata.java @@ -44,6 +44,8 @@ private StandardResourceMetadata() { displayName_ = ""; description_ = ""; additionalAttributes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + location_ = ""; + networkTags_ = com.google.protobuf.LazyStringArrayList.EMPTY; } @java.lang.Override @@ -121,6 +123,36 @@ private StandardResourceMetadata( additionalAttributes_.add(s); break; } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + location_ = s; + break; + } + case 98: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + networkTags_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + networkTags_.add(s); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -138,6 +170,9 @@ private StandardResourceMetadata( if (((mutable_bitField0_ & 0x00000001) != 0)) { additionalAttributes_ = additionalAttributes_.getUnmodifiableView(); } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + networkTags_ = networkTags_.getUnmodifiableView(); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -148,6 +183,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_cloud_asset_v1p1beta1_StandardResourceMetadata_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 12: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -476,6 +522,229 @@ public com.google.protobuf.ByteString getAdditionalAttributesBytes(int index) { return additionalAttributes_.getByteString(index); } + public static final int LOCATION_FIELD_NUMBER = 11; + private volatile java.lang.Object location_; + /** + * + * + *
+   * Location can be "global", regional like "us-east1", or zonal like
+   * "us-west1-b".
+   * 
+ * + * string location = 11; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + /** + * + * + *
+   * Location can be "global", regional like "us-east1", or zonal like
+   * "us-west1-b".
+   * 
+ * + * string location = 11; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 12; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.asset.v1p1beta1.AssetProto + .internal_static_google_cloud_asset_v1p1beta1_StandardResourceMetadata_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels associated with this resource. See [Labelling and grouping GCP
+   * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * map<string, string> labels = 12; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels associated with this resource. See [Labelling and grouping GCP
+   * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * map<string, string> labels = 12; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels associated with this resource. See [Labelling and grouping GCP
+   * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * map<string, string> labels = 12; + */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels associated with this resource. See [Labelling and grouping GCP
+   * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * map<string, string> labels = 12; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NETWORK_TAGS_FIELD_NUMBER = 13; + private com.google.protobuf.LazyStringList networkTags_; + /** + * + * + *
+   * Network tags associated with this resource. Like labels, network tags are a
+   * type of annotations used to group GCP resources. See [Labelling GCP
+   * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * repeated string network_tags = 13; + * + * @return A list containing the networkTags. + */ + public com.google.protobuf.ProtocolStringList getNetworkTagsList() { + return networkTags_; + } + /** + * + * + *
+   * Network tags associated with this resource. Like labels, network tags are a
+   * type of annotations used to group GCP resources. See [Labelling GCP
+   * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * repeated string network_tags = 13; + * + * @return The count of networkTags. + */ + public int getNetworkTagsCount() { + return networkTags_.size(); + } + /** + * + * + *
+   * Network tags associated with this resource. Like labels, network tags are a
+   * type of annotations used to group GCP resources. See [Labelling GCP
+   * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * repeated string network_tags = 13; + * + * @param index The index of the element to return. + * @return The networkTags at the given index. + */ + public java.lang.String getNetworkTags(int index) { + return networkTags_.get(index); + } + /** + * + * + *
+   * Network tags associated with this resource. Like labels, network tags are a
+   * type of annotations used to group GCP resources. See [Labelling GCP
+   * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * repeated string network_tags = 13; + * + * @param index The index of the value to return. + * @return The bytes of the networkTags at the given index. + */ + public com.google.protobuf.ByteString getNetworkTagsBytes(int index) { + return networkTags_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -509,6 +778,14 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io com.google.protobuf.GeneratedMessageV3.writeString( output, 10, additionalAttributes_.getRaw(i)); } + if (!getLocationBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, location_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 12); + for (int i = 0; i < networkTags_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, networkTags_.getRaw(i)); + } unknownFields.writeTo(output); } @@ -541,6 +818,27 @@ public int getSerializedSize() { size += dataSize; size += 1 * getAdditionalAttributesList().size(); } + if (!getLocationBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, location_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, labels__); + } + { + int dataSize = 0; + for (int i = 0; i < networkTags_.size(); i++) { + dataSize += computeStringSizeNoTag(networkTags_.getRaw(i)); + } + size += dataSize; + size += 1 * getNetworkTagsList().size(); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -563,6 +861,9 @@ public boolean equals(final java.lang.Object obj) { if (!getDisplayName().equals(other.getDisplayName())) return false; if (!getDescription().equals(other.getDescription())) return false; if (!getAdditionalAttributesList().equals(other.getAdditionalAttributesList())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getNetworkTagsList().equals(other.getNetworkTagsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -588,6 +889,16 @@ public int hashCode() { hash = (37 * hash) + ADDITIONAL_ATTRIBUTES_FIELD_NUMBER; hash = (53 * hash) + getAdditionalAttributesList().hashCode(); } + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (getNetworkTagsCount() > 0) { + hash = (37 * hash) + NETWORK_TAGS_FIELD_NUMBER; + hash = (53 * hash) + getNetworkTagsList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -707,6 +1018,26 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_cloud_asset_v1p1beta1_StandardResourceMetadata_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 12: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 12: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -746,6 +1077,11 @@ public Builder clear() { additionalAttributes_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); + location_ = ""; + + internalGetMutableLabels().clear(); + networkTags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -784,6 +1120,14 @@ public com.google.cloud.asset.v1p1beta1.StandardResourceMetadata buildPartial() bitField0_ = (bitField0_ & ~0x00000001); } result.additionalAttributes_ = additionalAttributes_; + result.location_ = location_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (((bitField0_ & 0x00000004) != 0)) { + networkTags_ = networkTags_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.networkTags_ = networkTags_; onBuilt(); return result; } @@ -864,6 +1208,21 @@ public Builder mergeFrom(com.google.cloud.asset.v1p1beta1.StandardResourceMetada } onChanged(); } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (!other.networkTags_.isEmpty()) { + if (networkTags_.isEmpty()) { + networkTags_ = other.networkTags_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureNetworkTagsIsMutable(); + networkTags_.addAll(other.networkTags_); + } + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1647,6 +2006,478 @@ public Builder addAdditionalAttributesBytes(com.google.protobuf.ByteString value return this; } + private java.lang.Object location_ = ""; + /** + * + * + *
+     * Location can be "global", regional like "us-east1", or zonal like
+     * "us-west1-b".
+     * 
+ * + * string location = 11; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Location can be "global", regional like "us-east1", or zonal like
+     * "us-west1-b".
+     * 
+ * + * string location = 11; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Location can be "global", regional like "us-east1", or zonal like
+     * "us-west1-b".
+     * 
+ * + * string location = 11; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + location_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Location can be "global", regional like "us-east1", or zonal like
+     * "us-west1-b".
+     * 
+ * + * string location = 11; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + + location_ = getDefaultInstance().getLocation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Location can be "global", regional like "us-east1", or zonal like
+     * "us-west1-b".
+     * 
+ * + * string location = 11; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + location_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels associated with this resource. See [Labelling and grouping GCP
+     * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * map<string, string> labels = 12; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels associated with this resource. See [Labelling and grouping GCP
+     * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * map<string, string> labels = 12; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels associated with this resource. See [Labelling and grouping GCP
+     * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * map<string, string> labels = 12; + */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels associated with this resource. See [Labelling and grouping GCP
+     * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * map<string, string> labels = 12; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels associated with this resource. See [Labelling and grouping GCP
+     * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * map<string, string> labels = 12; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels associated with this resource. See [Labelling and grouping GCP
+     * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * map<string, string> labels = 12; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels associated with this resource. See [Labelling and grouping GCP
+     * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * map<string, string> labels = 12; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.LazyStringList networkTags_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureNetworkTagsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + networkTags_ = new com.google.protobuf.LazyStringArrayList(networkTags_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Network tags associated with this resource. Like labels, network tags are a
+     * type of annotations used to group GCP resources. See [Labelling GCP
+     * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * repeated string network_tags = 13; + * + * @return A list containing the networkTags. + */ + public com.google.protobuf.ProtocolStringList getNetworkTagsList() { + return networkTags_.getUnmodifiableView(); + } + /** + * + * + *
+     * Network tags associated with this resource. Like labels, network tags are a
+     * type of annotations used to group GCP resources. See [Labelling GCP
+     * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * repeated string network_tags = 13; + * + * @return The count of networkTags. + */ + public int getNetworkTagsCount() { + return networkTags_.size(); + } + /** + * + * + *
+     * Network tags associated with this resource. Like labels, network tags are a
+     * type of annotations used to group GCP resources. See [Labelling GCP
+     * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * repeated string network_tags = 13; + * + * @param index The index of the element to return. + * @return The networkTags at the given index. + */ + public java.lang.String getNetworkTags(int index) { + return networkTags_.get(index); + } + /** + * + * + *
+     * Network tags associated with this resource. Like labels, network tags are a
+     * type of annotations used to group GCP resources. See [Labelling GCP
+     * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * repeated string network_tags = 13; + * + * @param index The index of the value to return. + * @return The bytes of the networkTags at the given index. + */ + public com.google.protobuf.ByteString getNetworkTagsBytes(int index) { + return networkTags_.getByteString(index); + } + /** + * + * + *
+     * Network tags associated with this resource. Like labels, network tags are a
+     * type of annotations used to group GCP resources. See [Labelling GCP
+     * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * repeated string network_tags = 13; + * + * @param index The index to set the value at. + * @param value The networkTags to set. + * @return This builder for chaining. + */ + public Builder setNetworkTags(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworkTagsIsMutable(); + networkTags_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Network tags associated with this resource. Like labels, network tags are a
+     * type of annotations used to group GCP resources. See [Labelling GCP
+     * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * repeated string network_tags = 13; + * + * @param value The networkTags to add. + * @return This builder for chaining. + */ + public Builder addNetworkTags(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNetworkTagsIsMutable(); + networkTags_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Network tags associated with this resource. Like labels, network tags are a
+     * type of annotations used to group GCP resources. See [Labelling GCP
+     * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * repeated string network_tags = 13; + * + * @param values The networkTags to add. + * @return This builder for chaining. + */ + public Builder addAllNetworkTags(java.lang.Iterable values) { + ensureNetworkTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, networkTags_); + onChanged(); + return this; + } + /** + * + * + *
+     * Network tags associated with this resource. Like labels, network tags are a
+     * type of annotations used to group GCP resources. See [Labelling GCP
+     * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * repeated string network_tags = 13; + * + * @return This builder for chaining. + */ + public Builder clearNetworkTags() { + networkTags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Network tags associated with this resource. Like labels, network tags are a
+     * type of annotations used to group GCP resources. See [Labelling GCP
+     * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+     * for more information.
+     * 
+ * + * repeated string network_tags = 13; + * + * @param value The bytes of the networkTags to add. + * @return This builder for chaining. + */ + public Builder addNetworkTagsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNetworkTagsIsMutable(); + networkTags_.add(value); + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/StandardResourceMetadataOrBuilder.java b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/StandardResourceMetadataOrBuilder.java index b2a3c040a..e198a84fc 100644 --- a/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/StandardResourceMetadataOrBuilder.java +++ b/proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/StandardResourceMetadataOrBuilder.java @@ -220,4 +220,158 @@ public interface StandardResourceMetadataOrBuilder * @return The bytes of the additionalAttributes at the given index. */ com.google.protobuf.ByteString getAdditionalAttributesBytes(int index); + + /** + * + * + *
+   * Location can be "global", regional like "us-east1", or zonal like
+   * "us-west1-b".
+   * 
+ * + * string location = 11; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * Location can be "global", regional like "us-east1", or zonal like
+   * "us-west1-b".
+   * 
+ * + * string location = 11; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Labels associated with this resource. See [Labelling and grouping GCP
+   * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * map<string, string> labels = 12; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels associated with this resource. See [Labelling and grouping GCP
+   * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * map<string, string> labels = 12; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels associated with this resource. See [Labelling and grouping GCP
+   * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * map<string, string> labels = 12; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels associated with this resource. See [Labelling and grouping GCP
+   * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * map<string, string> labels = 12; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Labels associated with this resource. See [Labelling and grouping GCP
+   * resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * map<string, string> labels = 12; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Network tags associated with this resource. Like labels, network tags are a
+   * type of annotations used to group GCP resources. See [Labelling GCP
+   * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * repeated string network_tags = 13; + * + * @return A list containing the networkTags. + */ + java.util.List getNetworkTagsList(); + /** + * + * + *
+   * Network tags associated with this resource. Like labels, network tags are a
+   * type of annotations used to group GCP resources. See [Labelling GCP
+   * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * repeated string network_tags = 13; + * + * @return The count of networkTags. + */ + int getNetworkTagsCount(); + /** + * + * + *
+   * Network tags associated with this resource. Like labels, network tags are a
+   * type of annotations used to group GCP resources. See [Labelling GCP
+   * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * repeated string network_tags = 13; + * + * @param index The index of the element to return. + * @return The networkTags at the given index. + */ + java.lang.String getNetworkTags(int index); + /** + * + * + *
+   * Network tags associated with this resource. Like labels, network tags are a
+   * type of annotations used to group GCP resources. See [Labelling GCP
+   * resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
+   * for more information.
+   * 
+ * + * repeated string network_tags = 13; + * + * @param index The index of the value to return. + * @return The bytes of the networkTags at the given index. + */ + com.google.protobuf.ByteString getNetworkTagsBytes(int index); } diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/proto/google/cloud/asset/v1p1beta1/asset_service.proto b/proto-google-cloud-asset-v1p1beta1/src/main/proto/google/cloud/asset/v1p1beta1/asset_service.proto index c75ce7adf..d5a0d8c41 100644 --- a/proto-google-cloud-asset-v1p1beta1/src/main/proto/google/cloud/asset/v1p1beta1/asset_service.proto +++ b/proto-google-cloud-asset-v1p1beta1/src/main/proto/google/cloud/asset/v1p1beta1/asset_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // 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. -// syntax = "proto3"; @@ -68,6 +67,7 @@ message SearchAllResourcesRequest { // * Organization number (such as "organizations/123") // * Folder number(such as "folders/1234") // * Project number (such as "projects/12345") + // * Project id (such as "projects/abc") string scope = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The query statement. @@ -88,6 +88,12 @@ message SearchAllResourcesRequest { // the previous response. The values of all other method parameters, must be // identical to those in the previous call. string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma separated list of fields specifying the sorting order of the + // results. The default order is ascending. Add " desc" after the field name + // to indicate descending order. Redundant space characters are ignored. For + // example, " foo , bar desc ". + string order_by = 10 [(google.api.field_behavior) = OPTIONAL]; } // Search all resources response. @@ -108,6 +114,7 @@ message SearchAllIamPoliciesRequest { // * Organization number (such as "organizations/123") // * Folder number(such as "folders/1234") // * Project number (such as "projects/12345") + // * Project id (such as "projects/abc") string scope = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The query statement. diff --git a/proto-google-cloud-asset-v1p1beta1/src/main/proto/google/cloud/asset/v1p1beta1/assets.proto b/proto-google-cloud-asset-v1p1beta1/src/main/proto/google/cloud/asset/v1p1beta1/assets.proto index ff0b927b1..549ea688b 100644 --- a/proto-google-cloud-asset-v1p1beta1/src/main/proto/google/cloud/asset/v1p1beta1/assets.proto +++ b/proto-google-cloud-asset-v1p1beta1/src/main/proto/google/cloud/asset/v1p1beta1/assets.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // 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. -// syntax = "proto3"; @@ -56,10 +55,35 @@ message StandardResourceMetadata { // Informational only. The exact set of attributes is subject to change. // For example: project id, DNS name etc. repeated string additional_attributes = 10; + + // Location can be "global", regional like "us-east1", or zonal like + // "us-west1-b". + string location = 11; + + // Labels associated with this resource. See [Labelling and grouping GCP + // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + // for more information. + map labels = 12; + + // Network tags associated with this resource. Like labels, network tags are a + // type of annotations used to group GCP resources. See [Labelling GCP + // resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + // for more information. + repeated string network_tags = 13; } // The result for a IAM Policy search. message IamPolicySearchResult { + // Explanation about the IAM policy search result. + message Explanation { + // The map from roles to their included permission matching the permission + // query (e.g. containing `policy.role.permissions:`). A sample role string: + // "roles/compute.instanceAdmin". The roles can also be found in the + // returned `policy` bindings. Note that the map is populated only if + // requesting with a permission query. + map matched_permissions = 1; + } + // The [full resource // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) // of the resource associated with this IAM policy. @@ -72,7 +96,19 @@ message IamPolicySearchResult { // orgnization, the project field will be empty. string project = 3; - // Representation of the actual Cloud IAM policy set on a cloud resource. For - // each resource, there must be at most one Cloud IAM policy set on it. + // The IAM policy directly set on the given resource. Note that the original + // IAM policy can contain multiple bindings. This only contains the bindings + // that match the given query. For queries that don't contain a constrain on + // policies (e.g. an empty query), this contains all the bindings. google.iam.v1.Policy policy = 4; + + // Explanation about the IAM policy search result. It contains additional + // information to explain why the search result matches the query. + Explanation explanation = 5; +} + +// IAM permissions +message Permissions { + // A list of permissions. A sample permission string: "compute.disk.get". + repeated string permissions = 1; } diff --git a/proto-google-cloud-asset-v1p2beta1/clirr-ignored-differences.xml b/proto-google-cloud-asset-v1p2beta1/clirr-ignored-differences.xml index c577046af..07fe0daba 100644 --- a/proto-google-cloud-asset-v1p2beta1/clirr-ignored-differences.xml +++ b/proto-google-cloud-asset-v1p2beta1/clirr-ignored-differences.xml @@ -11,98 +11,9 @@ com/google/cloud/asset/v1p2beta1/*OrBuilder boolean contains*(*) - - - 8001 - com/google/cloud/asset/v1p2beta1/BatchGetAssetsHistory* - - - 8001 - com/google/cloud/asset/v1p2beta1/BigQueryDestination* - - - 8001 - com/google/cloud/asset/v1p2beta1/ExportAssets* - - - 6011 - com/google/cloud/asset/v1p2beta1/Asset - IAM_POLICY_NAME_FIELD_NUMBER - - - 6011 - com/google/cloud/asset/v1p2beta1/ContentType - ACCESS_POLICY_VALUE - - - 6011 - com/google/cloud/asset/v1p2beta1/ContentType - IAM_POLICY_NAME_VALUE - - - 6011 - com/google/cloud/asset/v1p2beta1/ContentType - ORG_POLICY_VALUE - - - 6011 - com/google/cloud/asset/v1p2beta1/GcsDestination - URI_PREFIX_FIELD_NUMBER - - - 6011 - com/google/cloud/asset/v1p2beta1/OutputConfig - BIGQUERY_DESTINATION_FIELD_NUMBER - - - 6011 - com/google/cloud/asset/v1p2beta1/Resource - INTERNAL_DATA_FIELD_NUMBER - - - 6001 - com/google/cloud/asset/v1p2beta1/ContentType - ACCESS_POLICY - - - 6001 - com/google/cloud/asset/v1p2beta1/ContentType - IAM_POLICY_NAME - - - 6001 - com/google/cloud/asset/v1p2beta1/ContentType - ORG_POLICY - - - 6001 - com/google/cloud/asset/v1p2beta1/GcsDestination* - URI_PREFIX - - - 6001 - com/google/cloud/asset/v1p2beta1/OutputConfig* - BIGQUERY_DESTINATION - - - 7002 - com/google/cloud/asset/v1p2beta1/Asset* - * - - - 7002 - com/google/cloud/asset/v1p2beta1/GcsDestination* - * - - - 7002 - com/google/cloud/asset/v1p2beta1/OutputConfig* - * - - - 7002 - com/google/cloud/asset/v1p2beta1/Resource* - * + 7012 + com/google/cloud/asset/v1p2beta1/*OrBuilder + boolean has*(*) diff --git a/proto-google-cloud-asset-v1p4beta1/clirr-ignored-differences.xml b/proto-google-cloud-asset-v1p4beta1/clirr-ignored-differences.xml new file mode 100644 index 000000000..97f88a9ac --- /dev/null +++ b/proto-google-cloud-asset-v1p4beta1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/asset/v1p4beta1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/asset/v1p4beta1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/asset/v1p4beta1/*OrBuilder + boolean has*(*) + + diff --git a/synth.metadata b/synth.metadata index 5c604bc94..6b1afa9b0 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,54 +4,54 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-asset.git", - "sha": "3fe11ed40da8c2b541c807b543904678b51da56c" + "sha": "b2cb6b1862d36fd5e53d95270c1d7cd244f9067b" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a34f4eb96a94bfd5b3e7f8de253db28d0a3e9237", - "internalRef": "306283252" + "sha": "e0f9d9e1f9de890db765be46f45ca8490723e3eb", + "internalRef": "309824146" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a34f4eb96a94bfd5b3e7f8de253db28d0a3e9237", - "internalRef": "306283252" + "sha": "e0f9d9e1f9de890db765be46f45ca8490723e3eb", + "internalRef": "309824146" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a34f4eb96a94bfd5b3e7f8de253db28d0a3e9237", - "internalRef": "306283252" + "sha": "e0f9d9e1f9de890db765be46f45ca8490723e3eb", + "internalRef": "309824146" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a34f4eb96a94bfd5b3e7f8de253db28d0a3e9237", - "internalRef": "306283252" + "sha": "e0f9d9e1f9de890db765be46f45ca8490723e3eb", + "internalRef": "309824146" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a34f4eb96a94bfd5b3e7f8de253db28d0a3e9237", - "internalRef": "306283252" + "sha": "e0f9d9e1f9de890db765be46f45ca8490723e3eb", + "internalRef": "309824146" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "f8a9933e5e98202b04ef427f28d1d79221190fa4" + "sha": "04cb397eb7590ea1e6c10a39fca3d8fe0fb3d256" } } ],