diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java index 9c7ac8a9f..30012d98c 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java @@ -461,7 +461,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStubSettings.java index a889b6a2d..0ccd6dbcf 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStubSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStubSettings.java @@ -286,7 +286,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStubSettings.java index be2e5e9b9..5590d004d 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStubSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStubSettings.java @@ -152,7 +152,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStubSettings.java index 56758b14b..cfd644271 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStubSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStubSettings.java @@ -153,7 +153,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java index a1873eb3c..d1a76fbcf 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java @@ -187,7 +187,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStubSettings.java index 93b117b35..2d512820e 100644 --- a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStubSettings.java +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStubSettings.java @@ -136,7 +136,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetProto.java b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetProto.java index df9f30b51..4131879ca 100644 --- a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetProto.java +++ b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetProto.java @@ -63,6 +63,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_asset_v1_ResourceSearchResult_LabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_asset_v1_ResourceSearchResult_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1_ResourceSearchResult_RelationshipsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1_ResourceSearchResult_RelationshipsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_asset_v1_VersionedResource_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -71,6 +75,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_asset_v1_AttachedResource_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_asset_v1_AttachedResource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1_RelatedResources_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1_RelatedResources_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1_RelatedResource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1_RelatedResource_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_asset_v1_IamPolicySearchResult_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -188,7 +200,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "esource_type\030\002 \001(\t\022\016\n\006action\030\003 \001(\t\"j\n\014Re" + "latedAsset\0223\n\005asset\030\001 \001(\tB$\372A!\n\037cloudass" + "et.googleapis.com/Asset\022\022\n\nasset_type\030\002 " - + "\001(\t\022\021\n\tancestors\030\003 \003(\t\"\277\005\n\024ResourceSearc" + + "\001(\t\022\021\n\tancestors\030\003 \003(\t\"\365\006\n\024ResourceSearc" + "hResult\022\014\n\004name\030\001 \001(\t\022\022\n\nasset_type\030\002 \001(" + "\t\022\017\n\007project\030\003 \001(\t\022\017\n\007folders\030\021 \003(\t\022\024\n\014o" + "rganization\030\022 \001(\t\022\024\n\014display_name\030\004 \001(\t\022" @@ -204,68 +216,76 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "rsioned_resources\030\020 \003(\0132(.google.cloud.a" + "sset.v1.VersionedResource\022C\n\022attached_re" + "sources\030\024 \003(\0132\'.google.cloud.asset.v1.At" - + "tachedResource\022\031\n\021parent_asset_type\030g \001(" - + "\t\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002" - + " \001(\t:\0028\001\"O\n\021VersionedResource\022\017\n\007version" - + "\030\001 \001(\t\022)\n\010resource\030\002 \001(\0132\027.google.protob" - + "uf.Struct\"m\n\020AttachedResource\022\022\n\nasset_t" - + "ype\030\001 \001(\t\022E\n\023versioned_resources\030\003 \003(\0132(" - + ".google.cloud.asset.v1.VersionedResource" - + "\"\217\004\n\025IamPolicySearchResult\022\020\n\010resource\030\001" - + " \001(\t\022\022\n\nasset_type\030\005 \001(\t\022\017\n\007project\030\002 \001(" - + "\t\022\017\n\007folders\030\006 \003(\t\022\024\n\014organization\030\007 \001(\t" - + "\022%\n\006policy\030\003 \001(\0132\025.google.iam.v1.Policy\022" - + "M\n\013explanation\030\004 \001(\01328.google.cloud.asse" - + "t.v1.IamPolicySearchResult.Explanation\032\241" - + "\002\n\013Explanation\022m\n\023matched_permissions\030\001 " - + "\003(\0132P.google.cloud.asset.v1.IamPolicySea" - + "rchResult.Explanation.MatchedPermissions" - + "Entry\032\"\n\013Permissions\022\023\n\013permissions\030\001 \003(" - + "\t\032\177\n\027MatchedPermissionsEntry\022\013\n\003key\030\001 \001(" - + "\t\022S\n\005value\030\002 \001(\0132D.google.cloud.asset.v1" - + ".IamPolicySearchResult.Explanation.Permi" - + "ssions:\0028\001\"G\n\026IamPolicyAnalysisState\022\036\n\004" - + "code\030\001 \001(\0162\020.google.rpc.Code\022\r\n\005cause\030\002 " - + "\001(\t\"\306\001\n\023ConditionEvaluation\022T\n\020evaluatio" - + "n_value\030\001 \001(\0162:.google.cloud.asset.v1.Co" - + "nditionEvaluation.EvaluationValue\"Y\n\017Eva" - + "luationValue\022 \n\034EVALUATION_VALUE_UNSPECI" - + "FIED\020\000\022\010\n\004TRUE\020\001\022\t\n\005FALSE\020\002\022\017\n\013CONDITION" - + "AL\020\003\"\253\t\n\027IamPolicyAnalysisResult\022#\n\033atta" - + "ched_resource_full_name\030\001 \001(\t\022+\n\013iam_bin" - + "ding\030\002 \001(\0132\026.google.iam.v1.Binding\022^\n\024ac" - + "cess_control_lists\030\003 \003(\0132@.google.cloud." - + "asset.v1.IamPolicyAnalysisResult.AccessC" - + "ontrolList\022R\n\ridentity_list\030\004 \001(\0132;.goog" - + "le.cloud.asset.v1.IamPolicyAnalysisResul" - + "t.IdentityList\022\026\n\016fully_explored\030\005 \001(\010\032m" - + "\n\010Resource\022\032\n\022full_resource_name\030\001 \001(\t\022E" - + "\n\016analysis_state\030\002 \001(\0132-.google.cloud.as" - + "set.v1.IamPolicyAnalysisState\032\205\001\n\006Access" - + "\022\016\n\004role\030\001 \001(\tH\000\022\024\n\npermission\030\002 \001(\tH\000\022E" - + "\n\016analysis_state\030\003 \001(\0132-.google.cloud.as" - + "set.v1.IamPolicyAnalysisStateB\016\n\014oneof_a" - + "ccess\032_\n\010Identity\022\014\n\004name\030\001 \001(\t\022E\n\016analy" - + "sis_state\030\002 \001(\0132-.google.cloud.asset.v1." - + "IamPolicyAnalysisState\0320\n\004Edge\022\023\n\013source" - + "_node\030\001 \001(\t\022\023\n\013target_node\030\002 \001(\t\032\277\002\n\021Acc" - + "essControlList\022J\n\tresources\030\001 \003(\01327.goog" - + "le.cloud.asset.v1.IamPolicyAnalysisResul" - + "t.Resource\022G\n\010accesses\030\002 \003(\01325.google.cl" - + "oud.asset.v1.IamPolicyAnalysisResult.Acc" - + "ess\022K\n\016resource_edges\030\003 \003(\01323.google.clo" - + "ud.asset.v1.IamPolicyAnalysisResult.Edge" - + "\022H\n\024condition_evaluation\030\004 \001(\0132*.google." - + "cloud.asset.v1.ConditionEvaluation\032\245\001\n\014I" - + "dentityList\022K\n\nidentities\030\001 \003(\01327.google" - + ".cloud.asset.v1.IamPolicyAnalysisResult." - + "Identity\022H\n\013group_edges\030\002 \003(\01323.google.c" - + "loud.asset.v1.IamPolicyAnalysisResult.Ed" - + "geB\230\001\n\031com.google.cloud.asset.v1B\nAssetP" - + "rotoP\001Z:google.golang.org/genproto/googl" - + "eapis/cloud/asset/v1;asset\370\001\001\252\002\025Google.C" - + "loud.Asset.V1\312\002\025Google\\Cloud\\Asset\\V1b\006p" - + "roto3" + + "tachedResource\022U\n\rrelationships\030\025 \003(\0132>." + + "google.cloud.asset.v1.ResourceSearchResu" + + "lt.RelationshipsEntry\022\031\n\021parent_asset_ty" + + "pe\030g \001(\t\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + + "value\030\002 \001(\t:\0028\001\032]\n\022RelationshipsEntry\022\013\n" + + "\003key\030\001 \001(\t\0226\n\005value\030\002 \001(\0132\'.google.cloud" + + ".asset.v1.RelatedResources:\0028\001\"O\n\021Versio" + + "nedResource\022\017\n\007version\030\001 \001(\t\022)\n\010resource" + + "\030\002 \001(\0132\027.google.protobuf.Struct\"m\n\020Attac" + + "hedResource\022\022\n\nasset_type\030\001 \001(\t\022E\n\023versi" + + "oned_resources\030\003 \003(\0132(.google.cloud.asse" + + "t.v1.VersionedResource\"U\n\020RelatedResourc" + + "es\022A\n\021related_resources\030\001 \003(\0132&.google.c" + + "loud.asset.v1.RelatedResource\"A\n\017Related" + + "Resource\022\022\n\nasset_type\030\001 \001(\t\022\032\n\022full_res" + + "ource_name\030\002 \001(\t\"\217\004\n\025IamPolicySearchResu" + + "lt\022\020\n\010resource\030\001 \001(\t\022\022\n\nasset_type\030\005 \001(\t" + + "\022\017\n\007project\030\002 \001(\t\022\017\n\007folders\030\006 \003(\t\022\024\n\014or" + + "ganization\030\007 \001(\t\022%\n\006policy\030\003 \001(\0132\025.googl" + + "e.iam.v1.Policy\022M\n\013explanation\030\004 \001(\01328.g" + + "oogle.cloud.asset.v1.IamPolicySearchResu" + + "lt.Explanation\032\241\002\n\013Explanation\022m\n\023matche" + + "d_permissions\030\001 \003(\0132P.google.cloud.asset" + + ".v1.IamPolicySearchResult.Explanation.Ma" + + "tchedPermissionsEntry\032\"\n\013Permissions\022\023\n\013" + + "permissions\030\001 \003(\t\032\177\n\027MatchedPermissionsE" + + "ntry\022\013\n\003key\030\001 \001(\t\022S\n\005value\030\002 \001(\0132D.googl" + + "e.cloud.asset.v1.IamPolicySearchResult.E" + + "xplanation.Permissions:\0028\001\"G\n\026IamPolicyA" + + "nalysisState\022\036\n\004code\030\001 \001(\0162\020.google.rpc." + + "Code\022\r\n\005cause\030\002 \001(\t\"\306\001\n\023ConditionEvaluat" + + "ion\022T\n\020evaluation_value\030\001 \001(\0162:.google.c" + + "loud.asset.v1.ConditionEvaluation.Evalua" + + "tionValue\"Y\n\017EvaluationValue\022 \n\034EVALUATI" + + "ON_VALUE_UNSPECIFIED\020\000\022\010\n\004TRUE\020\001\022\t\n\005FALS" + + "E\020\002\022\017\n\013CONDITIONAL\020\003\"\253\t\n\027IamPolicyAnalys" + + "isResult\022#\n\033attached_resource_full_name\030" + + "\001 \001(\t\022+\n\013iam_binding\030\002 \001(\0132\026.google.iam." + + "v1.Binding\022^\n\024access_control_lists\030\003 \003(\013" + + "2@.google.cloud.asset.v1.IamPolicyAnalys" + + "isResult.AccessControlList\022R\n\ridentity_l" + + "ist\030\004 \001(\0132;.google.cloud.asset.v1.IamPol" + + "icyAnalysisResult.IdentityList\022\026\n\016fully_" + + "explored\030\005 \001(\010\032m\n\010Resource\022\032\n\022full_resou" + + "rce_name\030\001 \001(\t\022E\n\016analysis_state\030\002 \001(\0132-" + + ".google.cloud.asset.v1.IamPolicyAnalysis" + + "State\032\205\001\n\006Access\022\016\n\004role\030\001 \001(\tH\000\022\024\n\nperm" + + "ission\030\002 \001(\tH\000\022E\n\016analysis_state\030\003 \001(\0132-" + + ".google.cloud.asset.v1.IamPolicyAnalysis" + + "StateB\016\n\014oneof_access\032_\n\010Identity\022\014\n\004nam" + + "e\030\001 \001(\t\022E\n\016analysis_state\030\002 \001(\0132-.google" + + ".cloud.asset.v1.IamPolicyAnalysisState\0320" + + "\n\004Edge\022\023\n\013source_node\030\001 \001(\t\022\023\n\013target_no" + + "de\030\002 \001(\t\032\277\002\n\021AccessControlList\022J\n\tresour" + + "ces\030\001 \003(\01327.google.cloud.asset.v1.IamPol" + + "icyAnalysisResult.Resource\022G\n\010accesses\030\002" + + " \003(\01325.google.cloud.asset.v1.IamPolicyAn" + + "alysisResult.Access\022K\n\016resource_edges\030\003 " + + "\003(\01323.google.cloud.asset.v1.IamPolicyAna" + + "lysisResult.Edge\022H\n\024condition_evaluation" + + "\030\004 \001(\0132*.google.cloud.asset.v1.Condition" + + "Evaluation\032\245\001\n\014IdentityList\022K\n\nidentitie" + + "s\030\001 \003(\01327.google.cloud.asset.v1.IamPolic" + + "yAnalysisResult.Identity\022H\n\013group_edges\030" + + "\002 \003(\01323.google.cloud.asset.v1.IamPolicyA" + + "nalysisResult.EdgeB\230\001\n\031com.google.cloud." + + "asset.v1B\nAssetProtoP\001Z:google.golang.or" + + "g/genproto/googleapis/cloud/asset/v1;ass" + + "et\370\001\001\252\002\025Google.Cloud.Asset.V1\312\002\025Google\\C" + + "loud\\Asset\\V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -382,6 +402,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ParentFullResourceName", "VersionedResources", "AttachedResources", + "Relationships", "ParentAssetType", }); internal_static_google_cloud_asset_v1_ResourceSearchResult_LabelsEntry_descriptor = @@ -394,6 +415,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_asset_v1_ResourceSearchResult_RelationshipsEntry_descriptor = + internal_static_google_cloud_asset_v1_ResourceSearchResult_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_asset_v1_ResourceSearchResult_RelationshipsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1_ResourceSearchResult_RelationshipsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); internal_static_google_cloud_asset_v1_VersionedResource_descriptor = getDescriptor().getMessageTypes().get(8); internal_static_google_cloud_asset_v1_VersionedResource_fieldAccessorTable = @@ -410,8 +441,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "AssetType", "VersionedResources", }); - internal_static_google_cloud_asset_v1_IamPolicySearchResult_descriptor = + internal_static_google_cloud_asset_v1_RelatedResources_descriptor = getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_asset_v1_RelatedResources_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1_RelatedResources_descriptor, + new java.lang.String[] { + "RelatedResources", + }); + internal_static_google_cloud_asset_v1_RelatedResource_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_asset_v1_RelatedResource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1_RelatedResource_descriptor, + new java.lang.String[] { + "AssetType", "FullResourceName", + }); + internal_static_google_cloud_asset_v1_IamPolicySearchResult_descriptor = + getDescriptor().getMessageTypes().get(12); internal_static_google_cloud_asset_v1_IamPolicySearchResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_asset_v1_IamPolicySearchResult_descriptor, @@ -455,7 +502,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_asset_v1_IamPolicyAnalysisState_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(13); internal_static_google_cloud_asset_v1_IamPolicyAnalysisState_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_asset_v1_IamPolicyAnalysisState_descriptor, @@ -463,7 +510,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Code", "Cause", }); internal_static_google_cloud_asset_v1_ConditionEvaluation_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(14); internal_static_google_cloud_asset_v1_ConditionEvaluation_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_asset_v1_ConditionEvaluation_descriptor, @@ -471,7 +518,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EvaluationValue", }); internal_static_google_cloud_asset_v1_IamPolicyAnalysisResult_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(15); internal_static_google_cloud_asset_v1_IamPolicyAnalysisResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_asset_v1_IamPolicyAnalysisResult_descriptor, diff --git a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/RelatedResource.java b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/RelatedResource.java new file mode 100644 index 000000000..45b7d465c --- /dev/null +++ b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/RelatedResource.java @@ -0,0 +1,820 @@ +/* + * 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/v1/assets.proto + +package com.google.cloud.asset.v1; + +/** + * + * + *
+ * The detailed related resource.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1.RelatedResource} + */ +public final class RelatedResource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1.RelatedResource) + RelatedResourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use RelatedResource.newBuilder() to construct. + private RelatedResource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RelatedResource() { + assetType_ = ""; + fullResourceName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RelatedResource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RelatedResource( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + + assetType_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + fullResourceName_ = 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 { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1.AssetProto + .internal_static_google_cloud_asset_v1_RelatedResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1.AssetProto + .internal_static_google_cloud_asset_v1_RelatedResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1.RelatedResource.class, + com.google.cloud.asset.v1.RelatedResource.Builder.class); + } + + public static final int ASSET_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object assetType_; + /** + * + * + *
+   * The type of the asset. Example: `compute.googleapis.com/Instance`
+   * 
+ * + * string asset_type = 1; + * + * @return The assetType. + */ + @java.lang.Override + public java.lang.String getAssetType() { + java.lang.Object ref = assetType_; + 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(); + assetType_ = s; + return s; + } + } + /** + * + * + *
+   * The type of the asset. Example: `compute.googleapis.com/Instance`
+   * 
+ * + * string asset_type = 1; + * + * @return The bytes for assetType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAssetTypeBytes() { + java.lang.Object ref = assetType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assetType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FULL_RESOURCE_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object fullResourceName_; + /** + * + * + *
+   * The full resource name of the related resource. Example:
+   * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123`
+   * 
+ * + * string full_resource_name = 2; + * + * @return The fullResourceName. + */ + @java.lang.Override + public java.lang.String getFullResourceName() { + java.lang.Object ref = fullResourceName_; + 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(); + fullResourceName_ = s; + return s; + } + } + /** + * + * + *
+   * The full resource name of the related resource. Example:
+   * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123`
+   * 
+ * + * string full_resource_name = 2; + * + * @return The bytes for fullResourceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFullResourceNameBytes() { + java.lang.Object ref = fullResourceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fullResourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 { + if (!getAssetTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, assetType_); + } + if (!getFullResourceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fullResourceName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAssetTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, assetType_); + } + if (!getFullResourceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fullResourceName_); + } + 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.v1.RelatedResource)) { + return super.equals(obj); + } + com.google.cloud.asset.v1.RelatedResource other = + (com.google.cloud.asset.v1.RelatedResource) obj; + + if (!getAssetType().equals(other.getAssetType())) return false; + if (!getFullResourceName().equals(other.getFullResourceName())) 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(); + hash = (37 * hash) + ASSET_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getAssetType().hashCode(); + hash = (37 * hash) + FULL_RESOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFullResourceName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1.RelatedResource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1.RelatedResource 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.v1.RelatedResource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1.RelatedResource 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.v1.RelatedResource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1.RelatedResource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1.RelatedResource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1.RelatedResource 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.v1.RelatedResource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1.RelatedResource 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.v1.RelatedResource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1.RelatedResource 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.v1.RelatedResource 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; + } + /** + * + * + *
+   * The detailed related resource.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1.RelatedResource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1.RelatedResource) + com.google.cloud.asset.v1.RelatedResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1.AssetProto + .internal_static_google_cloud_asset_v1_RelatedResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1.AssetProto + .internal_static_google_cloud_asset_v1_RelatedResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1.RelatedResource.class, + com.google.cloud.asset.v1.RelatedResource.Builder.class); + } + + // Construct using com.google.cloud.asset.v1.RelatedResource.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(); + assetType_ = ""; + + fullResourceName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1.AssetProto + .internal_static_google_cloud_asset_v1_RelatedResource_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1.RelatedResource getDefaultInstanceForType() { + return com.google.cloud.asset.v1.RelatedResource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1.RelatedResource build() { + com.google.cloud.asset.v1.RelatedResource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1.RelatedResource buildPartial() { + com.google.cloud.asset.v1.RelatedResource result = + new com.google.cloud.asset.v1.RelatedResource(this); + result.assetType_ = assetType_; + result.fullResourceName_ = fullResourceName_; + 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.v1.RelatedResource) { + return mergeFrom((com.google.cloud.asset.v1.RelatedResource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1.RelatedResource other) { + if (other == com.google.cloud.asset.v1.RelatedResource.getDefaultInstance()) return this; + if (!other.getAssetType().isEmpty()) { + assetType_ = other.assetType_; + onChanged(); + } + if (!other.getFullResourceName().isEmpty()) { + fullResourceName_ = other.fullResourceName_; + 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.v1.RelatedResource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1.RelatedResource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object assetType_ = ""; + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Instance`
+     * 
+ * + * string asset_type = 1; + * + * @return The assetType. + */ + public java.lang.String getAssetType() { + java.lang.Object ref = assetType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + assetType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Instance`
+     * 
+ * + * string asset_type = 1; + * + * @return The bytes for assetType. + */ + public com.google.protobuf.ByteString getAssetTypeBytes() { + java.lang.Object ref = assetType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assetType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Instance`
+     * 
+ * + * string asset_type = 1; + * + * @param value The assetType to set. + * @return This builder for chaining. + */ + public Builder setAssetType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + assetType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Instance`
+     * 
+ * + * string asset_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearAssetType() { + + assetType_ = getDefaultInstance().getAssetType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Instance`
+     * 
+ * + * string asset_type = 1; + * + * @param value The bytes for assetType to set. + * @return This builder for chaining. + */ + public Builder setAssetTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + assetType_ = value; + onChanged(); + return this; + } + + private java.lang.Object fullResourceName_ = ""; + /** + * + * + *
+     * The full resource name of the related resource. Example:
+     * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123`
+     * 
+ * + * string full_resource_name = 2; + * + * @return The fullResourceName. + */ + public java.lang.String getFullResourceName() { + java.lang.Object ref = fullResourceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fullResourceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The full resource name of the related resource. Example:
+     * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123`
+     * 
+ * + * string full_resource_name = 2; + * + * @return The bytes for fullResourceName. + */ + public com.google.protobuf.ByteString getFullResourceNameBytes() { + java.lang.Object ref = fullResourceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fullResourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The full resource name of the related resource. Example:
+     * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123`
+     * 
+ * + * string full_resource_name = 2; + * + * @param value The fullResourceName to set. + * @return This builder for chaining. + */ + public Builder setFullResourceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fullResourceName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource name of the related resource. Example:
+     * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123`
+     * 
+ * + * string full_resource_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearFullResourceName() { + + fullResourceName_ = getDefaultInstance().getFullResourceName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource name of the related resource. Example:
+     * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123`
+     * 
+ * + * string full_resource_name = 2; + * + * @param value The bytes for fullResourceName to set. + * @return This builder for chaining. + */ + public Builder setFullResourceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fullResourceName_ = 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.v1.RelatedResource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1.RelatedResource) + private static final com.google.cloud.asset.v1.RelatedResource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1.RelatedResource(); + } + + public static com.google.cloud.asset.v1.RelatedResource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RelatedResource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RelatedResource(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.v1.RelatedResource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/RelatedResourceOrBuilder.java b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/RelatedResourceOrBuilder.java new file mode 100644 index 000000000..e23e9a341 --- /dev/null +++ b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/RelatedResourceOrBuilder.java @@ -0,0 +1,77 @@ +/* + * 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/v1/assets.proto + +package com.google.cloud.asset.v1; + +public interface RelatedResourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1.RelatedResource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The type of the asset. Example: `compute.googleapis.com/Instance`
+   * 
+ * + * string asset_type = 1; + * + * @return The assetType. + */ + java.lang.String getAssetType(); + /** + * + * + *
+   * The type of the asset. Example: `compute.googleapis.com/Instance`
+   * 
+ * + * string asset_type = 1; + * + * @return The bytes for assetType. + */ + com.google.protobuf.ByteString getAssetTypeBytes(); + + /** + * + * + *
+   * The full resource name of the related resource. Example:
+   * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123`
+   * 
+ * + * string full_resource_name = 2; + * + * @return The fullResourceName. + */ + java.lang.String getFullResourceName(); + /** + * + * + *
+   * The full resource name of the related resource. Example:
+   * `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123`
+   * 
+ * + * string full_resource_name = 2; + * + * @return The bytes for fullResourceName. + */ + com.google.protobuf.ByteString getFullResourceNameBytes(); +} diff --git a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/RelatedResources.java b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/RelatedResources.java new file mode 100644 index 000000000..446636a56 --- /dev/null +++ b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/RelatedResources.java @@ -0,0 +1,955 @@ +/* + * 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/v1/assets.proto + +package com.google.cloud.asset.v1; + +/** + * + * + *
+ * The related resources of the primary resource.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1.RelatedResources} + */ +public final class RelatedResources extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1.RelatedResources) + RelatedResourcesOrBuilder { + private static final long serialVersionUID = 0L; + // Use RelatedResources.newBuilder() to construct. + private RelatedResources(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RelatedResources() { + relatedResources_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RelatedResources(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RelatedResources( + 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)) { + relatedResources_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + relatedResources_.add( + input.readMessage( + com.google.cloud.asset.v1.RelatedResource.parser(), extensionRegistry)); + 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)) { + relatedResources_ = java.util.Collections.unmodifiableList(relatedResources_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1.AssetProto + .internal_static_google_cloud_asset_v1_RelatedResources_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1.AssetProto + .internal_static_google_cloud_asset_v1_RelatedResources_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1.RelatedResources.class, + com.google.cloud.asset.v1.RelatedResources.Builder.class); + } + + public static final int RELATED_RESOURCES_FIELD_NUMBER = 1; + private java.util.List relatedResources_; + /** + * + * + *
+   * The detailed related resources of the primary resource.
+   * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + @java.lang.Override + public java.util.List getRelatedResourcesList() { + return relatedResources_; + } + /** + * + * + *
+   * The detailed related resources of the primary resource.
+   * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + @java.lang.Override + public java.util.List + getRelatedResourcesOrBuilderList() { + return relatedResources_; + } + /** + * + * + *
+   * The detailed related resources of the primary resource.
+   * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + @java.lang.Override + public int getRelatedResourcesCount() { + return relatedResources_.size(); + } + /** + * + * + *
+   * The detailed related resources of the primary resource.
+   * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + @java.lang.Override + public com.google.cloud.asset.v1.RelatedResource getRelatedResources(int index) { + return relatedResources_.get(index); + } + /** + * + * + *
+   * The detailed related resources of the primary resource.
+   * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + @java.lang.Override + public com.google.cloud.asset.v1.RelatedResourceOrBuilder getRelatedResourcesOrBuilder( + int index) { + return relatedResources_.get(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 < relatedResources_.size(); i++) { + output.writeMessage(1, relatedResources_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < relatedResources_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, relatedResources_.get(i)); + } + 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.v1.RelatedResources)) { + return super.equals(obj); + } + com.google.cloud.asset.v1.RelatedResources other = + (com.google.cloud.asset.v1.RelatedResources) obj; + + if (!getRelatedResourcesList().equals(other.getRelatedResourcesList())) 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 (getRelatedResourcesCount() > 0) { + hash = (37 * hash) + RELATED_RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getRelatedResourcesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1.RelatedResources parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1.RelatedResources 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.v1.RelatedResources parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1.RelatedResources 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.v1.RelatedResources parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1.RelatedResources parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1.RelatedResources parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1.RelatedResources 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.v1.RelatedResources parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1.RelatedResources 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.v1.RelatedResources parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1.RelatedResources 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.v1.RelatedResources 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; + } + /** + * + * + *
+   * The related resources of the primary resource.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1.RelatedResources} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1.RelatedResources) + com.google.cloud.asset.v1.RelatedResourcesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1.AssetProto + .internal_static_google_cloud_asset_v1_RelatedResources_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1.AssetProto + .internal_static_google_cloud_asset_v1_RelatedResources_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1.RelatedResources.class, + com.google.cloud.asset.v1.RelatedResources.Builder.class); + } + + // Construct using com.google.cloud.asset.v1.RelatedResources.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRelatedResourcesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (relatedResourcesBuilder_ == null) { + relatedResources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + relatedResourcesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1.AssetProto + .internal_static_google_cloud_asset_v1_RelatedResources_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1.RelatedResources getDefaultInstanceForType() { + return com.google.cloud.asset.v1.RelatedResources.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1.RelatedResources build() { + com.google.cloud.asset.v1.RelatedResources result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1.RelatedResources buildPartial() { + com.google.cloud.asset.v1.RelatedResources result = + new com.google.cloud.asset.v1.RelatedResources(this); + int from_bitField0_ = bitField0_; + if (relatedResourcesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + relatedResources_ = java.util.Collections.unmodifiableList(relatedResources_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.relatedResources_ = relatedResources_; + } else { + result.relatedResources_ = relatedResourcesBuilder_.build(); + } + 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.v1.RelatedResources) { + return mergeFrom((com.google.cloud.asset.v1.RelatedResources) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1.RelatedResources other) { + if (other == com.google.cloud.asset.v1.RelatedResources.getDefaultInstance()) return this; + if (relatedResourcesBuilder_ == null) { + if (!other.relatedResources_.isEmpty()) { + if (relatedResources_.isEmpty()) { + relatedResources_ = other.relatedResources_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRelatedResourcesIsMutable(); + relatedResources_.addAll(other.relatedResources_); + } + onChanged(); + } + } else { + if (!other.relatedResources_.isEmpty()) { + if (relatedResourcesBuilder_.isEmpty()) { + relatedResourcesBuilder_.dispose(); + relatedResourcesBuilder_ = null; + relatedResources_ = other.relatedResources_; + bitField0_ = (bitField0_ & ~0x00000001); + relatedResourcesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRelatedResourcesFieldBuilder() + : null; + } else { + relatedResourcesBuilder_.addAllMessages(other.relatedResources_); + } + } + } + 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.v1.RelatedResources parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1.RelatedResources) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List relatedResources_ = + java.util.Collections.emptyList(); + + private void ensureRelatedResourcesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + relatedResources_ = + new java.util.ArrayList(relatedResources_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.asset.v1.RelatedResource, + com.google.cloud.asset.v1.RelatedResource.Builder, + com.google.cloud.asset.v1.RelatedResourceOrBuilder> + relatedResourcesBuilder_; + + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public java.util.List getRelatedResourcesList() { + if (relatedResourcesBuilder_ == null) { + return java.util.Collections.unmodifiableList(relatedResources_); + } else { + return relatedResourcesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public int getRelatedResourcesCount() { + if (relatedResourcesBuilder_ == null) { + return relatedResources_.size(); + } else { + return relatedResourcesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public com.google.cloud.asset.v1.RelatedResource getRelatedResources(int index) { + if (relatedResourcesBuilder_ == null) { + return relatedResources_.get(index); + } else { + return relatedResourcesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public Builder setRelatedResources(int index, com.google.cloud.asset.v1.RelatedResource value) { + if (relatedResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedResourcesIsMutable(); + relatedResources_.set(index, value); + onChanged(); + } else { + relatedResourcesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public Builder setRelatedResources( + int index, com.google.cloud.asset.v1.RelatedResource.Builder builderForValue) { + if (relatedResourcesBuilder_ == null) { + ensureRelatedResourcesIsMutable(); + relatedResources_.set(index, builderForValue.build()); + onChanged(); + } else { + relatedResourcesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public Builder addRelatedResources(com.google.cloud.asset.v1.RelatedResource value) { + if (relatedResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedResourcesIsMutable(); + relatedResources_.add(value); + onChanged(); + } else { + relatedResourcesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public Builder addRelatedResources(int index, com.google.cloud.asset.v1.RelatedResource value) { + if (relatedResourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedResourcesIsMutable(); + relatedResources_.add(index, value); + onChanged(); + } else { + relatedResourcesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public Builder addRelatedResources( + com.google.cloud.asset.v1.RelatedResource.Builder builderForValue) { + if (relatedResourcesBuilder_ == null) { + ensureRelatedResourcesIsMutable(); + relatedResources_.add(builderForValue.build()); + onChanged(); + } else { + relatedResourcesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public Builder addRelatedResources( + int index, com.google.cloud.asset.v1.RelatedResource.Builder builderForValue) { + if (relatedResourcesBuilder_ == null) { + ensureRelatedResourcesIsMutable(); + relatedResources_.add(index, builderForValue.build()); + onChanged(); + } else { + relatedResourcesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public Builder addAllRelatedResources( + java.lang.Iterable values) { + if (relatedResourcesBuilder_ == null) { + ensureRelatedResourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, relatedResources_); + onChanged(); + } else { + relatedResourcesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public Builder clearRelatedResources() { + if (relatedResourcesBuilder_ == null) { + relatedResources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + relatedResourcesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public Builder removeRelatedResources(int index) { + if (relatedResourcesBuilder_ == null) { + ensureRelatedResourcesIsMutable(); + relatedResources_.remove(index); + onChanged(); + } else { + relatedResourcesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public com.google.cloud.asset.v1.RelatedResource.Builder getRelatedResourcesBuilder(int index) { + return getRelatedResourcesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public com.google.cloud.asset.v1.RelatedResourceOrBuilder getRelatedResourcesOrBuilder( + int index) { + if (relatedResourcesBuilder_ == null) { + return relatedResources_.get(index); + } else { + return relatedResourcesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public java.util.List + getRelatedResourcesOrBuilderList() { + if (relatedResourcesBuilder_ != null) { + return relatedResourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(relatedResources_); + } + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public com.google.cloud.asset.v1.RelatedResource.Builder addRelatedResourcesBuilder() { + return getRelatedResourcesFieldBuilder() + .addBuilder(com.google.cloud.asset.v1.RelatedResource.getDefaultInstance()); + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public com.google.cloud.asset.v1.RelatedResource.Builder addRelatedResourcesBuilder(int index) { + return getRelatedResourcesFieldBuilder() + .addBuilder(index, com.google.cloud.asset.v1.RelatedResource.getDefaultInstance()); + } + /** + * + * + *
+     * The detailed related resources of the primary resource.
+     * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + public java.util.List + getRelatedResourcesBuilderList() { + return getRelatedResourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.asset.v1.RelatedResource, + com.google.cloud.asset.v1.RelatedResource.Builder, + com.google.cloud.asset.v1.RelatedResourceOrBuilder> + getRelatedResourcesFieldBuilder() { + if (relatedResourcesBuilder_ == null) { + relatedResourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.asset.v1.RelatedResource, + com.google.cloud.asset.v1.RelatedResource.Builder, + com.google.cloud.asset.v1.RelatedResourceOrBuilder>( + relatedResources_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + relatedResources_ = null; + } + return relatedResourcesBuilder_; + } + + @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.v1.RelatedResources) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1.RelatedResources) + private static final com.google.cloud.asset.v1.RelatedResources DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1.RelatedResources(); + } + + public static com.google.cloud.asset.v1.RelatedResources getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RelatedResources parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RelatedResources(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.v1.RelatedResources getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/RelatedResourcesOrBuilder.java b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/RelatedResourcesOrBuilder.java new file mode 100644 index 000000000..7e13b3b81 --- /dev/null +++ b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/RelatedResourcesOrBuilder.java @@ -0,0 +1,77 @@ +/* + * 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/v1/assets.proto + +package com.google.cloud.asset.v1; + +public interface RelatedResourcesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1.RelatedResources) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The detailed related resources of the primary resource.
+   * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + java.util.List getRelatedResourcesList(); + /** + * + * + *
+   * The detailed related resources of the primary resource.
+   * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + com.google.cloud.asset.v1.RelatedResource getRelatedResources(int index); + /** + * + * + *
+   * The detailed related resources of the primary resource.
+   * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + int getRelatedResourcesCount(); + /** + * + * + *
+   * The detailed related resources of the primary resource.
+   * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + java.util.List + getRelatedResourcesOrBuilderList(); + /** + * + * + *
+   * The detailed related resources of the primary resource.
+   * 
+ * + * repeated .google.cloud.asset.v1.RelatedResource related_resources = 1; + */ + com.google.cloud.asset.v1.RelatedResourceOrBuilder getRelatedResourcesOrBuilder(int index); +} diff --git a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ResourceSearchResult.java b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ResourceSearchResult.java index 24d819ade..0b542aeda 100644 --- a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ResourceSearchResult.java +++ b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ResourceSearchResult.java @@ -257,6 +257,25 @@ private ResourceSearchResult( com.google.cloud.asset.v1.AttachedResource.parser(), extensionRegistry)); break; } + case 170: + { + if (!((mutable_bitField0_ & 0x00000020) != 0)) { + relationships_ = + com.google.protobuf.MapField.newMapField( + RelationshipsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000020; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.asset.v1.RelatedResources> + relationships__ = + input.readMessage( + RelationshipsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + relationships_ + .getMutableMap() + .put(relationships__.getKey(), relationships__.getValue()); + break; + } case 826: { java.lang.String s = input.readStringRequireUtf8(); @@ -306,6 +325,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { switch (number) { case 7: return internalGetLabels(); + case 21: + return internalGetRelationships(); default: throw new RuntimeException("Invalid map field number: " + number); } @@ -1669,6 +1690,135 @@ public com.google.cloud.asset.v1.AttachedResourceOrBuilder getAttachedResourcesO return attachedResources_.get(index); } + public static final int RELATIONSHIPS_FIELD_NUMBER = 21; + + private static final class RelationshipsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.asset.v1.RelatedResources> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.asset.v1.AssetProto + .internal_static_google_cloud_asset_v1_ResourceSearchResult_RelationshipsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.asset.v1.RelatedResources.getDefaultInstance()); + } + + private com.google.protobuf.MapField + relationships_; + + private com.google.protobuf.MapField + internalGetRelationships() { + if (relationships_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RelationshipsDefaultEntryHolder.defaultEntry); + } + return relationships_; + } + + public int getRelationshipsCount() { + return internalGetRelationships().getMap().size(); + } + /** + * + * + *
+   * A map of related resources of this resource, keyed by the
+   * relationship type. A relationship type is in the format of
+   * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+   * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+   * See [supported relationship
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+   * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + @java.lang.Override + public boolean containsRelationships(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetRelationships().getMap().containsKey(key); + } + /** Use {@link #getRelationshipsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getRelationships() { + return getRelationshipsMap(); + } + /** + * + * + *
+   * A map of related resources of this resource, keyed by the
+   * relationship type. A relationship type is in the format of
+   * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+   * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+   * See [supported relationship
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+   * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + @java.lang.Override + public java.util.Map + getRelationshipsMap() { + return internalGetRelationships().getMap(); + } + /** + * + * + *
+   * A map of related resources of this resource, keyed by the
+   * relationship type. A relationship type is in the format of
+   * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+   * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+   * See [supported relationship
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+   * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + @java.lang.Override + public com.google.cloud.asset.v1.RelatedResources getRelationshipsOrDefault( + java.lang.String key, com.google.cloud.asset.v1.RelatedResources defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetRelationships().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * A map of related resources of this resource, keyed by the
+   * relationship type. A relationship type is in the format of
+   * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+   * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+   * See [supported relationship
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+   * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + @java.lang.Override + public com.google.cloud.asset.v1.RelatedResources getRelationshipsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetRelationships().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public static final int PARENT_ASSET_TYPE_FIELD_NUMBER = 103; private volatile java.lang.Object parentAssetType_; /** @@ -1795,6 +1945,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < attachedResources_.size(); i++) { output.writeMessage(20, attachedResources_.get(i)); } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetRelationships(), RelationshipsDefaultEntryHolder.defaultEntry, 21); if (!getParentAssetTypeBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 103, parentAssetType_); } @@ -1881,6 +2033,17 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, attachedResources_.get(i)); } + for (java.util.Map.Entry entry : + internalGetRelationships().getMap().entrySet()) { + com.google.protobuf.MapEntry + relationships__ = + RelationshipsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, relationships__); + } if (!getParentAssetTypeBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(103, parentAssetType_); } @@ -1927,6 +2090,7 @@ public boolean equals(final java.lang.Object obj) { if (!getParentFullResourceName().equals(other.getParentFullResourceName())) return false; if (!getVersionedResourcesList().equals(other.getVersionedResourcesList())) return false; if (!getAttachedResourcesList().equals(other.getAttachedResourcesList())) return false; + if (!internalGetRelationships().equals(other.internalGetRelationships())) return false; if (!getParentAssetType().equals(other.getParentAssetType())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -1991,6 +2155,10 @@ public int hashCode() { hash = (37 * hash) + ATTACHED_RESOURCES_FIELD_NUMBER; hash = (53 * hash) + getAttachedResourcesList().hashCode(); } + if (!internalGetRelationships().getMap().isEmpty()) { + hash = (37 * hash) + RELATIONSHIPS_FIELD_NUMBER; + hash = (53 * hash) + internalGetRelationships().hashCode(); + } hash = (37 * hash) + PARENT_ASSET_TYPE_FIELD_NUMBER; hash = (53 * hash) + getParentAssetType().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); @@ -2116,6 +2284,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { switch (number) { case 7: return internalGetLabels(); + case 21: + return internalGetRelationships(); default: throw new RuntimeException("Invalid map field number: " + number); } @@ -2126,6 +2296,8 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { switch (number) { case 7: return internalGetMutableLabels(); + case 21: + return internalGetMutableRelationships(); default: throw new RuntimeException("Invalid map field number: " + number); } @@ -2216,6 +2388,7 @@ public Builder clear() { } else { attachedResourcesBuilder_.clear(); } + internalGetMutableRelationships().clear(); parentAssetType_ = ""; return this; @@ -2301,6 +2474,8 @@ public com.google.cloud.asset.v1.ResourceSearchResult buildPartial() { } else { result.attachedResources_ = attachedResourcesBuilder_.build(); } + result.relationships_ = internalGetRelationships(); + result.relationships_.makeImmutable(); result.parentAssetType_ = parentAssetType_; onBuilt(); return result; @@ -2475,6 +2650,7 @@ public Builder mergeFrom(com.google.cloud.asset.v1.ResourceSearchResult other) { } } } + internalGetMutableRelationships().mergeFrom(other.internalGetRelationships()); if (!other.getParentAssetType().isEmpty()) { parentAssetType_ = other.parentAssetType_; onChanged(); @@ -6291,6 +6467,213 @@ public com.google.cloud.asset.v1.AttachedResource.Builder addAttachedResourcesBu return attachedResourcesBuilder_; } + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.asset.v1.RelatedResources> + relationships_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.asset.v1.RelatedResources> + internalGetRelationships() { + if (relationships_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RelationshipsDefaultEntryHolder.defaultEntry); + } + return relationships_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.asset.v1.RelatedResources> + internalGetMutableRelationships() { + onChanged(); + ; + if (relationships_ == null) { + relationships_ = + com.google.protobuf.MapField.newMapField(RelationshipsDefaultEntryHolder.defaultEntry); + } + if (!relationships_.isMutable()) { + relationships_ = relationships_.copy(); + } + return relationships_; + } + + public int getRelationshipsCount() { + return internalGetRelationships().getMap().size(); + } + /** + * + * + *
+     * A map of related resources of this resource, keyed by the
+     * relationship type. A relationship type is in the format of
+     * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+     * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+     * See [supported relationship
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+     * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + @java.lang.Override + public boolean containsRelationships(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetRelationships().getMap().containsKey(key); + } + /** Use {@link #getRelationshipsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getRelationships() { + return getRelationshipsMap(); + } + /** + * + * + *
+     * A map of related resources of this resource, keyed by the
+     * relationship type. A relationship type is in the format of
+     * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+     * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+     * See [supported relationship
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+     * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + @java.lang.Override + public java.util.Map + getRelationshipsMap() { + return internalGetRelationships().getMap(); + } + /** + * + * + *
+     * A map of related resources of this resource, keyed by the
+     * relationship type. A relationship type is in the format of
+     * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+     * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+     * See [supported relationship
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+     * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + @java.lang.Override + public com.google.cloud.asset.v1.RelatedResources getRelationshipsOrDefault( + java.lang.String key, com.google.cloud.asset.v1.RelatedResources defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetRelationships().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * A map of related resources of this resource, keyed by the
+     * relationship type. A relationship type is in the format of
+     * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+     * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+     * See [supported relationship
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+     * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + @java.lang.Override + public com.google.cloud.asset.v1.RelatedResources getRelationshipsOrThrow( + java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetRelationships().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearRelationships() { + internalGetMutableRelationships().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * A map of related resources of this resource, keyed by the
+     * relationship type. A relationship type is in the format of
+     * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+     * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+     * See [supported relationship
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+     * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + public Builder removeRelationships(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableRelationships().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableRelationships() { + return internalGetMutableRelationships().getMutableMap(); + } + /** + * + * + *
+     * A map of related resources of this resource, keyed by the
+     * relationship type. A relationship type is in the format of
+     * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+     * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+     * See [supported relationship
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+     * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + public Builder putRelationships( + java.lang.String key, com.google.cloud.asset.v1.RelatedResources value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableRelationships().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * A map of related resources of this resource, keyed by the
+     * relationship type. A relationship type is in the format of
+     * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+     * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+     * See [supported relationship
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+     * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + public Builder putAllRelationships( + java.util.Map values) { + internalGetMutableRelationships().getMutableMap().putAll(values); + return this; + } + private java.lang.Object parentAssetType_ = ""; /** * diff --git a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ResourceSearchResultOrBuilder.java b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ResourceSearchResultOrBuilder.java index 80d0550ff..3b2e5977f 100644 --- a/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ResourceSearchResultOrBuilder.java +++ b/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ResourceSearchResultOrBuilder.java @@ -1005,6 +1005,86 @@ public interface ResourceSearchResultOrBuilder */ com.google.cloud.asset.v1.AttachedResourceOrBuilder getAttachedResourcesOrBuilder(int index); + /** + * + * + *
+   * A map of related resources of this resource, keyed by the
+   * relationship type. A relationship type is in the format of
+   * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+   * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+   * See [supported relationship
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+   * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + int getRelationshipsCount(); + /** + * + * + *
+   * A map of related resources of this resource, keyed by the
+   * relationship type. A relationship type is in the format of
+   * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+   * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+   * See [supported relationship
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+   * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + boolean containsRelationships(java.lang.String key); + /** Use {@link #getRelationshipsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getRelationships(); + /** + * + * + *
+   * A map of related resources of this resource, keyed by the
+   * relationship type. A relationship type is in the format of
+   * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+   * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+   * See [supported relationship
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+   * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + java.util.Map getRelationshipsMap(); + /** + * + * + *
+   * A map of related resources of this resource, keyed by the
+   * relationship type. A relationship type is in the format of
+   * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+   * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+   * See [supported relationship
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+   * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + com.google.cloud.asset.v1.RelatedResources getRelationshipsOrDefault( + java.lang.String key, com.google.cloud.asset.v1.RelatedResources defaultValue); + /** + * + * + *
+   * A map of related resources of this resource, keyed by the
+   * relationship type. A relationship type is in the format of
+   * {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`,
+   * `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`.
+   * See [supported relationship
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types).
+   * 
+ * + * map<string, .google.cloud.asset.v1.RelatedResources> relationships = 21; + */ + com.google.cloud.asset.v1.RelatedResources getRelationshipsOrThrow(java.lang.String key); + /** * * diff --git a/proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/assets.proto b/proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/assets.proto index 97bc4872d..3d433b8f3 100644 --- a/proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/assets.proto +++ b/proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/assets.proto @@ -503,6 +503,14 @@ message ResourceSearchResult { // as to allow users to search on them. repeated AttachedResource attached_resources = 20; + // A map of related resources of this resource, keyed by the + // relationship type. A relationship type is in the format of + // {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`, + // `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`. + // See [supported relationship + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types). + map relationships = 21; + // The type of this resource's immediate parent, if there is one. // // To search against the `parent_asset_type`: @@ -558,6 +566,22 @@ message AttachedResource { repeated VersionedResource versioned_resources = 3; } +// The related resources of the primary resource. +message RelatedResources { + // The detailed related resources of the primary resource. + repeated RelatedResource related_resources = 1; +} + +// The detailed related resource. +message RelatedResource { + // The type of the asset. Example: `compute.googleapis.com/Instance` + string asset_type = 1; + + // The full resource name of the related resource. Example: + // `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123` + string full_resource_name = 2; +} + // A result of IAM Policy search, containing information of an IAM policy. message IamPolicySearchResult { // Explanation about the IAM policy search result.