From f1438e5d2077b245f2167e57fc5af104ad34283b Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:19:57 -0400 Subject: [PATCH] chore: Update generation configuration at Thu Jun 27 02:13:53 UTC 2024 (#10995) * chore: Update generation configuration at Thu Jun 27 02:13:53 UTC 2024 * chore: generate libraries at Thu Jun 27 02:17:16 UTC 2024 --- generation_config.yaml | 2 +- .../com/google/chat/v1/ChatServiceClient.java | 68 +- .../com/google/chat/v1/ChatServiceGrpc.java | 84 +- .../java/com/google/chat/v1/Membership.java | 24 - .../google/chat/v1/MembershipOrBuilder.java | 6 - .../com/google/chat/v1/SetUpSpaceRequest.java | 184 +- .../chat/v1/SetUpSpaceRequestOrBuilder.java | 40 +- .../proto/google/chat/v1/chat_service.proto | 23 +- .../proto/google/chat/v1/membership.proto | 2 - .../proto/google/chat/v1/space_setup.proto | 8 +- .../reflect-config.json | 9 + .../cloud/edgenetwork/v1/ResourcesProto.java | 260 +- .../google/cloud/edgenetwork/v1/Subnet.java | 371 +- .../cloud/edgenetwork/v1/SubnetOrBuilder.java | 37 + .../cloud/edgenetwork/v1/resources.proto | 23 + .../lifesciences/v2beta/Accelerator.java | 14 +- .../v2beta/AcceleratorOrBuilder.java | 4 +- .../cloud/lifesciences/v2beta/workflows.proto | 2 +- .../v2/SecurityCenterClient.java | 219 +- .../securitycenter/v2/gapic_metadata.json | 6 +- .../cloud/securitycenter/v2/package-info.java | 2 +- .../v2/stub/HttpJsonSecurityCenterStub.java | 17 +- .../reflect-config.json | 342 ++ .../v2/SecurityCenterClientHttpJsonTest.java | 264 +- .../v2/SecurityCenterClientTest.java | 236 +- .../securitycenter/v2/AdaptiveProtection.java | 558 +++ .../v2/AdaptiveProtectionOrBuilder.java | 43 + .../cloud/securitycenter/v2/Attack.java | 810 ++++ .../securitycenter/v2/AttackOrBuilder.java | 77 + .../securitycenter/v2/AttackPathName.java | 207 +- .../securitycenter/v2/AttackPathProto.java | 23 +- .../cloud/securitycenter/v2/AwsMetadata.java | 4024 ++++++++++++++++ .../v2/AwsMetadataOrBuilder.java | 168 + .../securitycenter/v2/AzureMetadata.java | 4033 +++++++++++++++++ .../v2/AzureMetadataOrBuilder.java | 172 + .../cloud/securitycenter/v2/CloudArmor.java | 2080 +++++++++ .../v2/CloudArmorOrBuilder.java | 251 + .../securitycenter/v2/CloudArmorProto.java | 141 + .../securitycenter/v2/CloudProvider.java | 199 + .../cloud/securitycenter/v2/Finding.java | 576 ++- .../securitycenter/v2/FindingOrBuilder.java | 70 + .../cloud/securitycenter/v2/FindingProto.java | 284 +- .../cloud/securitycenter/v2/Folder.java | 816 ++++ .../securitycenter/v2/FolderOrBuilder.java | 78 + .../cloud/securitycenter/v2/FolderProto.java | 69 + .../cloud/securitycenter/v2/GcpMetadata.java | 1938 ++++++++ .../v2/GcpMetadataOrBuilder.java | 223 + .../v2/GroupFindingsRequest.java | 56 - .../v2/GroupFindingsRequestOrBuilder.java | 16 - .../v2/ListFindingsResponse.java | 3299 +++++++++++--- .../cloud/securitycenter/v2/MitreAttack.java | 90 +- .../securitycenter/v2/MitreAttackProto.java | 89 +- .../cloud/securitycenter/v2/Notebook.java | 1275 ++++++ .../securitycenter/v2/NotebookOrBuilder.java | 136 + .../securitycenter/v2/NotebookProto.java | 75 + .../v2/OrganizationValuedResourceName.java | 270 ++ .../cloud/securitycenter/v2/Requests.java | 824 ++++ .../securitycenter/v2/RequestsOrBuilder.java | 80 + .../cloud/securitycenter/v2/Resource.java | 2941 ++++++++++-- .../securitycenter/v2/ResourceOrBuilder.java | 261 ++ .../cloud/securitycenter/v2/ResourcePath.java | 2370 ++++++++++ .../v2/ResourcePathOrBuilder.java | 85 + .../securitycenter/v2/ResourceProto.java | 242 +- .../v2/ResourceValueConfig.java | 481 +- .../v2/ResourceValueConfigName.java | 147 +- .../v2/ResourceValueConfigOrBuilder.java | 124 +- .../v2/ResourceValueConfigProto.java | 78 +- .../securitycenter/v2/SecurityPolicy.java | 925 ++++ .../v2/SecurityPolicyOrBuilder.java | 95 + .../v2/SecuritycenterServiceProto.java | 1220 ++--- .../cloud/securitycenter/v2/Simulation.java | 154 + .../securitycenter/v2/SimulationName.java | 143 +- .../v2/SimulationOrBuilder.java | 25 + .../securitycenter/v2/SimulationProto.java | 41 +- .../v2/UpdateResourceValueConfigRequest.java | 48 + ...teResourceValueConfigRequestOrBuilder.java | 12 + .../securitycenter/v2/ValuedResourceName.java | 180 +- .../v2/ValuedResourceProto.java | 24 +- .../cloud/securitycenter/v2/attack_path.proto | 1 + .../cloud/securitycenter/v2/cloud_armor.proto | 114 + .../cloud/securitycenter/v2/finding.proto | 8 + .../cloud/securitycenter/v2/folder.proto | 36 + .../securitycenter/v2/mitre_attack.proto | 14 +- .../cloud/securitycenter/v2/notebook.proto | 44 + .../cloud/securitycenter/v2/resource.proto | 217 + .../v2/resource_value_config.proto | 44 +- .../v2/securitycenter_service.proto | 81 +- .../cloud/securitycenter/v2/simulation.proto | 5 + .../securitycenter/v2/valued_resource.proto | 1 + ...eListcreateresourcevalueconfigrequest.java | 50 + .../AsyncDeleteResourceValueConfig.java | 3 +- .../SyncDeleteResourceValueConfig.java | 3 +- ...rceValueConfigResourcevalueconfigname.java | 3 +- .../SyncDeleteResourceValueConfigString.java | 4 +- .../AsyncGetResourceValueConfig.java | 3 +- .../SyncGetResourceValueConfig.java | 3 +- ...rceValueConfigResourcevalueconfigname.java | 3 +- .../SyncGetResourceValueConfigString.java | 4 +- .../getsimulation/AsyncGetSimulation.java | 4 +- .../getsimulation/SyncGetSimulation.java | 4 +- .../SyncGetSimulationSimulationname.java | 3 +- .../SyncGetSimulationString.java | 3 +- .../AsyncGetValuedResource.java | 3 +- .../SyncGetValuedResource.java | 3 +- .../SyncGetValuedResourceString.java | 4 +- ...ncGetValuedResourceValuedresourcename.java | 3 +- .../listattackpaths/AsyncListAttackPaths.java | 3 +- .../AsyncListAttackPathsPaged.java | 3 +- .../listattackpaths/SyncListAttackPaths.java | 3 +- ...ckPathsOrganizationvaluedresourcename.java | 46 + .../SyncListAttackPathsString.java | 4 +- ...SyncListAttackPathsValuedresourcename.java | 3 +- ...eValueConfigsOrganizationlocationname.java | 45 + .../AsyncListValuedResources.java | 4 +- .../AsyncListValuedResourcesPaged.java | 4 +- .../SyncListValuedResources.java | 4 +- ...SyncListValuedResourcesSimulationname.java | 3 +- .../SyncListValuedResourcesString.java | 3 +- 118 files changed, 33127 insertions(+), 2559 deletions(-) create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AdaptiveProtection.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AdaptiveProtectionOrBuilder.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Attack.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AttackOrBuilder.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AwsMetadata.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AwsMetadataOrBuilder.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AzureMetadata.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AzureMetadataOrBuilder.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudArmor.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudArmorOrBuilder.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudArmorProto.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudProvider.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Folder.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FolderOrBuilder.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FolderProto.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GcpMetadata.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GcpMetadataOrBuilder.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Notebook.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/NotebookOrBuilder.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/NotebookProto.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/OrganizationValuedResourceName.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Requests.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/RequestsOrBuilder.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourcePath.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourcePathOrBuilder.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SecurityPolicy.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SecurityPolicyOrBuilder.java create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/cloud_armor.proto create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/folder.proto create mode 100644 java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/notebook.proto create mode 100644 java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/batchcreateresourcevalueconfigs/SyncBatchCreateResourceValueConfigsOrganizationlocationnameListcreateresourcevalueconfigrequest.java create mode 100644 java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPathsOrganizationvaluedresourcename.java create mode 100644 java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listresourcevalueconfigs/SyncListResourceValueConfigsOrganizationlocationname.java diff --git a/generation_config.yaml b/generation_config.yaml index 6e71f84549aa..686b7b3b7828 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.42.0 -googleapis_commitish: 46eb6505cc4b8340d304510d7226de96bafe9314 +googleapis_commitish: efae79d0ba30034f2dd075d0213d09e93ebeccff libraries_bom_version: 26.42.0 # the libraries are ordered with respect to library name, which is diff --git a/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/ChatServiceClient.java b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/ChatServiceClient.java index 1f282a13f09c..b978972fda6f 100644 --- a/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/ChatServiceClient.java +++ b/java-chat/google-cloud-chat/src/main/java/com/google/chat/v1/ChatServiceClient.java @@ -307,6 +307,7 @@ *

SetUpSpace *

Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space with initial members](https://developers.google.com/workspace/chat/set-up-spaces). *

To specify the human members to add, add memberships with the appropriate `membership.member.name`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user{@literal @}example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user{@literal @}example.com` or `users/123456789`. + *

To specify the Google groups to add, add memberships with the appropriate `membership.group_member.name`. To add or invite a Google group, use `groups/{group}`, where `{group}` is the `id` for the group from the Cloud Identity Groups API. For example, you can use [Cloud Identity Groups lookup API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) to retrieve the ID `123456789` for group email `group{@literal @}example.com`, then you can add the group to the space by setting the `membership.group_member.name` to `groups/123456789`. Group email is not supported, and Google groups can only be added as members in named spaces. *

For a named space or group chat, if the caller blocks, or is blocked by some members, or doesn't have permission to add some members, then those members aren't added to the created space. *

To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. *

To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [Invite or add a user or app to a space](https://developers.google.com/workspace/chat/create-members). @@ -397,9 +398,10 @@ * *

CreateMembership *

Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [Invite or add a user or a Google Chat app to a space](https://developers.google.com/workspace/chat/create-members). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). - *

To specify the member to add, set the `membership.member.name` for the human or app member. + *

To specify the member to add, set the `membership.member.name` for the human or app member, or set the `membership.group_member.name` for the group member. *

- To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - *

- To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user{@literal @}example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user{@literal @}example.com` or `users/123456789`. + *

- To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user{@literal @}example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user{@literal @}example.com` or `users/123456789`. + *

- To add or invite a Google group in a named space, use `groups/{group}`, where `{group}` is the `id` for the group from the Cloud Identity Groups API. For example, you can use [Cloud Identity Groups lookup API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) to retrieve the ID `123456789` for group email `group{@literal @}example.com`, then you can add or invite the group to a named space by setting the `membership.group_member.name` to `groups/123456789`. Group email is not supported, and Google groups can only be added as members in named spaces. * *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

* *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

* @@ -989,6 +992,42 @@ public final OperationsClient getHttpJsonOperationsClient() { return httpJsonOperationsClient; } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a ResourceValueConfig for an organization. Maps user's tags to difference resource + * values for use by the attack path simulation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   List requests = new ArrayList<>();
+   *   BatchCreateResourceValueConfigsResponse response =
+   *       securityCenterClient.batchCreateResourceValueConfigs(parent, requests);
+   * }
+   * }
+ * + * @param parent Required. Resource name of the new ResourceValueConfig's parent. The parent field + * in the CreateResourceValueConfigRequest messages must either be empty or match this field. + * @param requests Required. The resource value configs to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BatchCreateResourceValueConfigsResponse batchCreateResourceValueConfigs( + OrganizationLocationName parent, List requests) { + BatchCreateResourceValueConfigsRequest request = + BatchCreateResourceValueConfigsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .addAllRequests(requests) + .build(); + return batchCreateResourceValueConfigs(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a ResourceValueConfig for an organization. Maps user's tags to difference resource @@ -2776,7 +2815,8 @@ public final void deleteNotificationConfig(DeleteNotificationConfigRequest reque * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * ResourceValueConfigName name = - * ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); + * ResourceValueConfigName.ofOrganizationResourceValueConfigName( + * "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); * securityCenterClient.deleteResourceValueConfig(name); * } * } @@ -2806,7 +2846,9 @@ public final void deleteResourceValueConfig(ResourceValueConfigName name) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * String name = - * ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]").toString(); + * ResourceValueConfigName.ofOrganizationResourceValueConfigName( + * "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + * .toString(); * securityCenterClient.deleteResourceValueConfig(name); * } * } @@ -2836,7 +2878,8 @@ public final void deleteResourceValueConfig(String name) { * DeleteResourceValueConfigRequest request = * DeleteResourceValueConfigRequest.newBuilder() * .setName( - * ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + * ResourceValueConfigName.ofOrganizationResourceValueConfigName( + * "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") * .toString()) * .build(); * securityCenterClient.deleteResourceValueConfig(request); @@ -2866,7 +2909,8 @@ public final void deleteResourceValueConfig(DeleteResourceValueConfigRequest req * DeleteResourceValueConfigRequest request = * DeleteResourceValueConfigRequest.newBuilder() * .setName( - * ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + * ResourceValueConfigName.ofOrganizationResourceValueConfigName( + * "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") * .toString()) * .build(); * ApiFuture future = @@ -3024,7 +3068,8 @@ public final UnaryCallable getBigQuery * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { - * SimulationName name = SimulationName.of("[ORGANIZATION]", "[SIMULATION]"); + * SimulationName name = + * SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]"); * Simulation response = securityCenterClient.getSimulation(name); * } * } @@ -3053,7 +3098,8 @@ public final Simulation getSimulation(SimulationName name) { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { - * String name = SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString(); + * String name = + * SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]").toString(); * Simulation response = securityCenterClient.getSimulation(name); * } * } @@ -3083,7 +3129,9 @@ public final Simulation getSimulation(String name) { * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * GetSimulationRequest request = * GetSimulationRequest.newBuilder() - * .setName(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + * .setName( + * SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + * .toString()) * .build(); * Simulation response = securityCenterClient.getSimulation(request); * } @@ -3111,7 +3159,9 @@ public final Simulation getSimulation(GetSimulationRequest request) { * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * GetSimulationRequest request = * GetSimulationRequest.newBuilder() - * .setName(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + * .setName( + * SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + * .toString()) * .build(); * ApiFuture future = * securityCenterClient.getSimulationCallable().futureCall(request); @@ -3138,7 +3188,8 @@ public final UnaryCallable getSimulationCallab * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * ValuedResourceName name = - * ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + * ValuedResourceName.ofOrganizationSimulationValuedResourceName( + * "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); * ValuedResource response = securityCenterClient.getValuedResource(name); * } * } @@ -3170,7 +3221,9 @@ public final ValuedResource getValuedResource(ValuedResourceName name) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * String name = - * ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]").toString(); + * ValuedResourceName.ofOrganizationSimulationValuedResourceName( + * "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + * .toString(); * ValuedResource response = securityCenterClient.getValuedResource(name); * } * } @@ -3201,7 +3254,8 @@ public final ValuedResource getValuedResource(String name) { * GetValuedResourceRequest request = * GetValuedResourceRequest.newBuilder() * .setName( - * ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + * ValuedResourceName.ofOrganizationSimulationValuedResourceName( + * "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") * .toString()) * .build(); * ValuedResource response = securityCenterClient.getValuedResource(request); @@ -3231,7 +3285,8 @@ public final ValuedResource getValuedResource(GetValuedResourceRequest request) * GetValuedResourceRequest request = * GetValuedResourceRequest.newBuilder() * .setName( - * ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + * ValuedResourceName.ofOrganizationSimulationValuedResourceName( + * "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") * .toString()) * .build(); * ApiFuture future = @@ -3638,7 +3693,8 @@ public final NotificationConfig getNotificationConfig(GetNotificationConfigReque * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * ResourceValueConfigName name = - * ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); + * ResourceValueConfigName.ofOrganizationResourceValueConfigName( + * "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); * ResourceValueConfig response = securityCenterClient.getResourceValueConfig(name); * } * } @@ -3669,7 +3725,9 @@ public final ResourceValueConfig getResourceValueConfig(ResourceValueConfigName * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * String name = - * ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]").toString(); + * ResourceValueConfigName.ofOrganizationResourceValueConfigName( + * "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + * .toString(); * ResourceValueConfig response = securityCenterClient.getResourceValueConfig(name); * } * } @@ -3700,7 +3758,8 @@ public final ResourceValueConfig getResourceValueConfig(String name) { * GetResourceValueConfigRequest request = * GetResourceValueConfigRequest.newBuilder() * .setName( - * ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + * ResourceValueConfigName.ofOrganizationResourceValueConfigName( + * "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") * .toString()) * .build(); * ResourceValueConfig response = securityCenterClient.getResourceValueConfig(request); @@ -3730,7 +3789,8 @@ public final ResourceValueConfig getResourceValueConfig(GetResourceValueConfigRe * GetResourceValueConfigRequest request = * GetResourceValueConfigRequest.newBuilder() * .setName( - * ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + * ResourceValueConfigName.ofOrganizationResourceValueConfigName( + * "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") * .toString()) * .build(); * ApiFuture future = @@ -3905,15 +3965,6 @@ public final UnaryCallable getSourceCallable() { * @param groupBy Required. Expression that defines what assets fields to use for grouping. The * string value should follow SQL syntax: comma separated list of fields. For example: * "parent,resource_name". - *

The following fields are supported: - *

    - *
  • resource_name - *
  • category - *
  • state - *
  • parent - *
  • severity - *
- * * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final GroupFindingsPagedResponse groupFindings(SourceName parent, String groupBy) { @@ -3975,15 +4026,6 @@ public final GroupFindingsPagedResponse groupFindings(SourceName parent, String * @param groupBy Required. Expression that defines what assets fields to use for grouping. The * string value should follow SQL syntax: comma separated list of fields. For example: * "parent,resource_name". - *

The following fields are supported: - *

    - *
  • resource_name - *
  • category - *
  • state - *
  • parent - *
  • severity - *
- * * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final GroupFindingsPagedResponse groupFindings(String parent, String groupBy) { @@ -4137,6 +4179,43 @@ public final UnaryCallable groupFin return stub.groupFindingsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the attack paths for a set of simulation results or valued resources and filter. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationValuedResourceName parent =
+   *       OrganizationValuedResourceName.of(
+   *           "[ORGANIZATION]", "[LOCATION]", "[SIMULATION]", "[VALUED_RESOURCE]");
+   *   for (AttackPath element : securityCenterClient.listAttackPaths(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Name of parent to list attack paths. + *

Valid formats: "organizations/{organization}", + * "organizations/{organization}/simulations/{simulation}" + * "organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}" + * "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAttackPathsPagedResponse listAttackPaths(OrganizationValuedResourceName parent) { + ListAttackPathsRequest request = + ListAttackPathsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAttackPaths(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists the attack paths for a set of simulation results or valued resources and filter. @@ -4151,7 +4230,8 @@ public final UnaryCallable groupFin * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * ValuedResourceName parent = - * ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + * ValuedResourceName.ofOrganizationSimulationValuedResourceName( + * "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); * for (AttackPath element : securityCenterClient.listAttackPaths(parent).iterateAll()) { * // doThingsWith(element); * } @@ -4187,7 +4267,9 @@ public final ListAttackPathsPagedResponse listAttackPaths(ValuedResourceName par * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * String parent = - * ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]").toString(); + * ValuedResourceName.ofOrganizationSimulationValuedResourceName( + * "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + * .toString(); * for (AttackPath element : securityCenterClient.listAttackPaths(parent).iterateAll()) { * // doThingsWith(element); * } @@ -4222,7 +4304,8 @@ public final ListAttackPathsPagedResponse listAttackPaths(String parent) { * ListAttackPathsRequest request = * ListAttackPathsRequest.newBuilder() * .setParent( - * ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + * ValuedResourceName.ofOrganizationSimulationValuedResourceName( + * "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") * .toString()) * .setFilter("filter-1274492040") * .setPageToken("pageToken873572522") @@ -4257,7 +4340,8 @@ public final ListAttackPathsPagedResponse listAttackPaths(ListAttackPathsRequest * ListAttackPathsRequest request = * ListAttackPathsRequest.newBuilder() * .setParent( - * ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + * ValuedResourceName.ofOrganizationSimulationValuedResourceName( + * "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") * .toString()) * .setFilter("filter-1274492040") * .setPageToken("pageToken873572522") @@ -4293,7 +4377,8 @@ public final ListAttackPathsPagedResponse listAttackPaths(ListAttackPathsRequest * ListAttackPathsRequest request = * ListAttackPathsRequest.newBuilder() * .setParent( - * ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + * ValuedResourceName.ofOrganizationSimulationValuedResourceName( + * "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") * .toString()) * .setFilter("filter-1274492040") * .setPageToken("pageToken873572522") @@ -5418,6 +5503,40 @@ public final ListNotificationConfigsPagedResponse listNotificationConfigs( return stub.listNotificationConfigsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all ResourceValueConfigs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   for (ResourceValueConfig element :
+   *       securityCenterClient.listResourceValueConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns the collection of resource value configs. Its + * format is "organizations/[organization_id]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListResourceValueConfigsPagedResponse listResourceValueConfigs( + OrganizationLocationName parent) { + ListResourceValueConfigsRequest request = + ListResourceValueConfigsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listResourceValueConfigs(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists all ResourceValueConfigs. @@ -5831,7 +5950,8 @@ public final UnaryCallable listSourcesC * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { - * SimulationName parent = SimulationName.of("[ORGANIZATION]", "[SIMULATION]"); + * SimulationName parent = + * SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]"); * for (ValuedResource element : securityCenterClient.listValuedResources(parent).iterateAll()) { * // doThingsWith(element); * } @@ -5865,7 +5985,8 @@ public final ListValuedResourcesPagedResponse listValuedResources(SimulationName * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { - * String parent = SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString(); + * String parent = + * SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]").toString(); * for (ValuedResource element : securityCenterClient.listValuedResources(parent).iterateAll()) { * // doThingsWith(element); * } @@ -5899,7 +6020,9 @@ public final ListValuedResourcesPagedResponse listValuedResources(String parent) * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * ListValuedResourcesRequest request = * ListValuedResourcesRequest.newBuilder() - * .setParent(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + * .setParent( + * SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + * .toString()) * .setFilter("filter-1274492040") * .setPageToken("pageToken873572522") * .setPageSize(883849137) @@ -5935,7 +6058,9 @@ public final ListValuedResourcesPagedResponse listValuedResources( * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * ListValuedResourcesRequest request = * ListValuedResourcesRequest.newBuilder() - * .setParent(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + * .setParent( + * SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + * .toString()) * .setFilter("filter-1274492040") * .setPageToken("pageToken873572522") * .setPageSize(883849137) @@ -5970,7 +6095,9 @@ public final ListValuedResourcesPagedResponse listValuedResources( * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { * ListValuedResourcesRequest request = * ListValuedResourcesRequest.newBuilder() - * .setParent(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + * .setParent( + * SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + * .toString()) * .setFilter("filter-1274492040") * .setPageToken("pageToken873572522") * .setPageSize(883849137) @@ -7049,6 +7176,8 @@ public final NotificationConfig updateNotificationConfig( * @param resourceValueConfig Required. The resource value config being updated. * @param updateMask The list of fields to be updated. If empty all mutable fields will be * updated. + *

To update nested fields, include the top level field in the mask For example, to update + * gcp_metadata.resource_type, include the "gcp_metadata" field mask * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ResourceValueConfig updateResourceValueConfig( diff --git a/java-securitycenter/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v2/gapic_metadata.json b/java-securitycenter/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v2/gapic_metadata.json index 2447e5139a07..e29d629e08d1 100644 --- a/java-securitycenter/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v2/gapic_metadata.json +++ b/java-securitycenter/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v2/gapic_metadata.json @@ -11,7 +11,7 @@ "libraryClient": "SecurityCenterClient", "rpcs": { "BatchCreateResourceValueConfigs": { - "methods": ["batchCreateResourceValueConfigs", "batchCreateResourceValueConfigs", "batchCreateResourceValueConfigs", "batchCreateResourceValueConfigsCallable"] + "methods": ["batchCreateResourceValueConfigs", "batchCreateResourceValueConfigs", "batchCreateResourceValueConfigs", "batchCreateResourceValueConfigs", "batchCreateResourceValueConfigsCallable"] }, "BulkMuteFindings": { "methods": ["bulkMuteFindingsAsync", "bulkMuteFindingsAsync", "bulkMuteFindingsAsync", "bulkMuteFindingsOperationCallable", "bulkMuteFindingsCallable"] @@ -71,7 +71,7 @@ "methods": ["groupFindings", "groupFindings", "groupFindings", "groupFindingsPagedCallable", "groupFindingsCallable"] }, "ListAttackPaths": { - "methods": ["listAttackPaths", "listAttackPaths", "listAttackPaths", "listAttackPathsPagedCallable", "listAttackPathsCallable"] + "methods": ["listAttackPaths", "listAttackPaths", "listAttackPaths", "listAttackPaths", "listAttackPathsPagedCallable", "listAttackPathsCallable"] }, "ListBigQueryExports": { "methods": ["listBigQueryExports", "listBigQueryExports", "listBigQueryExports", "listBigQueryExports", "listBigQueryExports", "listBigQueryExportsPagedCallable", "listBigQueryExportsCallable"] @@ -86,7 +86,7 @@ "methods": ["listNotificationConfigs", "listNotificationConfigs", "listNotificationConfigs", "listNotificationConfigs", "listNotificationConfigs", "listNotificationConfigsPagedCallable", "listNotificationConfigsCallable"] }, "ListResourceValueConfigs": { - "methods": ["listResourceValueConfigs", "listResourceValueConfigs", "listResourceValueConfigs", "listResourceValueConfigsPagedCallable", "listResourceValueConfigsCallable"] + "methods": ["listResourceValueConfigs", "listResourceValueConfigs", "listResourceValueConfigs", "listResourceValueConfigs", "listResourceValueConfigsPagedCallable", "listResourceValueConfigsCallable"] }, "ListSources": { "methods": ["listSources", "listSources", "listSources", "listSources", "listSources", "listSourcesPagedCallable", "listSourcesCallable"] diff --git a/java-securitycenter/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v2/package-info.java b/java-securitycenter/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v2/package-info.java index b56fad698cec..1b43bd06536e 100644 --- a/java-securitycenter/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v2/package-info.java +++ b/java-securitycenter/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v2/package-info.java @@ -32,7 +32,7 @@ * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { - * OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + * OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); * List requests = new ArrayList<>(); * BatchCreateResourceValueConfigsResponse response = * securityCenterClient.batchCreateResourceValueConfigs(parent, requests); diff --git a/java-securitycenter/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v2/stub/HttpJsonSecurityCenterStub.java b/java-securitycenter/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v2/stub/HttpJsonSecurityCenterStub.java index 34a36543201b..0060b6dbd4c0 100644 --- a/java-securitycenter/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v2/stub/HttpJsonSecurityCenterStub.java +++ b/java-securitycenter/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v2/stub/HttpJsonSecurityCenterStub.java @@ -153,6 +153,8 @@ public class HttpJsonSecurityCenterStub extends SecurityCenterStub { serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) + .setAdditionalPaths( + "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs:batchCreate") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); @@ -561,6 +563,8 @@ public class HttpJsonSecurityCenterStub extends SecurityCenterStub { serializer.putPathParam(fields, "name", request.getName()); return fields; }) + .setAdditionalPaths( + "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); @@ -632,6 +636,7 @@ public class HttpJsonSecurityCenterStub extends SecurityCenterStub { serializer.putPathParam(fields, "name", request.getName()); return fields; }) + .setAdditionalPaths("/v2/{name=organizations/*/locations/*/simulations/*}") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); @@ -666,6 +671,8 @@ public class HttpJsonSecurityCenterStub extends SecurityCenterStub { serializer.putPathParam(fields, "name", request.getName()); return fields; }) + .setAdditionalPaths( + "/v2/{name=organizations/*/locations/*/simulations/*/valuedResources/*}") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); @@ -816,6 +823,8 @@ public class HttpJsonSecurityCenterStub extends SecurityCenterStub { serializer.putPathParam(fields, "name", request.getName()); return fields; }) + .setAdditionalPaths( + "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); @@ -928,7 +937,9 @@ public class HttpJsonSecurityCenterStub extends SecurityCenterStub { }) .setAdditionalPaths( "/v2/{parent=organizations/*/simulations/*/valuedResources/*}/attackPaths", - "/v2/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths") + "/v2/{parent=organizations/*/locations/*/simulations/*/valuedResources/*}/attackPaths", + "/v2/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths", + "/v2/{parent=organizations/*/locations/*/simulations/*/attackExposureResults/*}/attackPaths") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); @@ -1138,6 +1149,8 @@ public class HttpJsonSecurityCenterStub extends SecurityCenterStub { serializer.putPathParam(fields, "parent", request.getParent()); return fields; }) + .setAdditionalPaths( + "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); @@ -1645,6 +1658,8 @@ public class HttpJsonSecurityCenterStub extends SecurityCenterStub { request.getResourceValueConfig().getName()); return fields; }) + .setAdditionalPaths( + "/v2/{resourceValueConfig.name=organizations/*/locations/*/resourceValueConfigs/*}") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); diff --git a/java-securitycenter/google-cloud-securitycenter/src/main/resources/META-INF/native-image/com.google.cloud.securitycenter.v2/reflect-config.json b/java-securitycenter/google-cloud-securitycenter/src/main/resources/META-INF/native-image/com.google.cloud.securitycenter.v2/reflect-config.json index e5cf2734e664..13a61a3f9002 100644 --- a/java-securitycenter/google-cloud-securitycenter/src/main/resources/META-INF/native-image/com.google.cloud.securitycenter.v2/reflect-config.json +++ b/java-securitycenter/google-cloud-securitycenter/src/main/resources/META-INF/native-image/com.google.cloud.securitycenter.v2/reflect-config.json @@ -431,6 +431,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.securitycenter.v2.AdaptiveProtection", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AdaptiveProtection$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.securitycenter.v2.Application", "queryAllDeclaredConstructors": true, @@ -449,6 +467,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.securitycenter.v2.Attack", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.Attack$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.securitycenter.v2.AttackExposure", "queryAllDeclaredConstructors": true, @@ -575,6 +611,150 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.securitycenter.v2.AwsMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AwsMetadata$AwsAccount", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AwsMetadata$AwsAccount$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AwsMetadata$AwsOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AwsMetadata$AwsOrganization$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AwsMetadata$AwsOrganizationalUnit", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AwsMetadata$AwsOrganizationalUnit$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AwsMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AzureMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AzureMetadata$AzureManagementGroup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AzureMetadata$AzureManagementGroup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AzureMetadata$AzureResourceGroup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AzureMetadata$AzureResourceGroup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AzureMetadata$AzureSubscription", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AzureMetadata$AzureSubscription$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.AzureMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.securitycenter.v2.BackupDisasterRecovery", "queryAllDeclaredConstructors": true, @@ -683,6 +863,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.securitycenter.v2.CloudArmor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.CloudArmor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.securitycenter.v2.CloudDlpDataProfile", "queryAllDeclaredConstructors": true, @@ -746,6 +944,15 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.securitycenter.v2.CloudProvider", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.securitycenter.v2.Compliance", "queryAllDeclaredConstructors": true, @@ -1331,6 +1538,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.securitycenter.v2.Folder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.Folder$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.GcpMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.GcpMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.securitycenter.v2.Geolocation", "queryAllDeclaredConstructors": true, @@ -2321,6 +2564,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.securitycenter.v2.Notebook", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.Notebook$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.securitycenter.v2.NotificationConfig", "queryAllDeclaredConstructors": true, @@ -2447,6 +2708,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.securitycenter.v2.Requests", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.Requests$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.securitycenter.v2.Resource", "queryAllDeclaredConstructors": true, @@ -2465,6 +2744,51 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.securitycenter.v2.ResourcePath", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.ResourcePath$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.ResourcePath$ResourcePathNode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.ResourcePath$ResourcePathNode$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.ResourcePath$ResourcePathNodeType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.securitycenter.v2.ResourceValue", "queryAllDeclaredConstructors": true, @@ -2564,6 +2888,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.securitycenter.v2.SecurityPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securitycenter.v2.SecurityPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.securitycenter.v2.SecurityPosture", "queryAllDeclaredConstructors": true, diff --git a/java-securitycenter/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v2/SecurityCenterClientHttpJsonTest.java b/java-securitycenter/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v2/SecurityCenterClientHttpJsonTest.java index a852bf55b2a9..f0373b2c68dc 100644 --- a/java-securitycenter/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v2/SecurityCenterClientHttpJsonTest.java +++ b/java-securitycenter/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v2/SecurityCenterClientHttpJsonTest.java @@ -106,7 +106,7 @@ public void batchCreateResourceValueConfigsTest() throws Exception { .build(); mockService.addResponse(expectedResponse); - OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); List requests = new ArrayList<>(); BatchCreateResourceValueConfigsResponse actualResponse = @@ -136,7 +136,7 @@ public void batchCreateResourceValueConfigsExceptionTest() throws Exception { mockService.addException(exception); try { - OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); List requests = new ArrayList<>(); client.batchCreateResourceValueConfigs(parent, requests); Assert.fail("No exception raised"); @@ -153,7 +153,7 @@ public void batchCreateResourceValueConfigsTest2() throws Exception { .build(); mockService.addResponse(expectedResponse); - String parent = "organizations/organization-8287"; + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); List requests = new ArrayList<>(); BatchCreateResourceValueConfigsResponse actualResponse = @@ -182,6 +182,53 @@ public void batchCreateResourceValueConfigsExceptionTest2() throws Exception { new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + List requests = new ArrayList<>(); + client.batchCreateResourceValueConfigs(parent, requests); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void batchCreateResourceValueConfigsTest3() throws Exception { + BatchCreateResourceValueConfigsResponse expectedResponse = + BatchCreateResourceValueConfigsResponse.newBuilder() + .addAllResourceValueConfigs(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "organizations/organization-8287"; + List requests = new ArrayList<>(); + + BatchCreateResourceValueConfigsResponse actualResponse = + client.batchCreateResourceValueConfigs(parent, requests); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void batchCreateResourceValueConfigsExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + try { String parent = "organizations/organization-8287"; List requests = new ArrayList<>(); @@ -568,6 +615,8 @@ public void createFindingTest() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -661,6 +710,8 @@ public void createFindingTest2() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -1669,7 +1720,8 @@ public void deleteResourceValueConfigTest() throws Exception { mockService.addResponse(expectedResponse); ResourceValueConfigName name = - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); client.deleteResourceValueConfig(name); @@ -1697,7 +1749,8 @@ public void deleteResourceValueConfigExceptionTest() throws Exception { try { ResourceValueConfigName name = - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); client.deleteResourceValueConfig(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -1863,13 +1916,17 @@ public void getBigQueryExportExceptionTest2() throws Exception { public void getSimulationTest() throws Exception { Simulation expectedResponse = Simulation.newBuilder() - .setName(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + .setName( + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + .toString()) .setCreateTime(Timestamp.newBuilder().build()) .addAllResourceValueConfigsMetadata(new ArrayList()) + .setCloudProvider(CloudProvider.forNumber(0)) .build(); mockService.addResponse(expectedResponse); - SimulationName name = SimulationName.of("[ORGANIZATION]", "[SIMULATION]"); + SimulationName name = + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]"); Simulation actualResponse = client.getSimulation(name); Assert.assertEquals(expectedResponse, actualResponse); @@ -1897,7 +1954,8 @@ public void getSimulationExceptionTest() throws Exception { mockService.addException(exception); try { - SimulationName name = SimulationName.of("[ORGANIZATION]", "[SIMULATION]"); + SimulationName name = + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]"); client.getSimulation(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -1909,9 +1967,12 @@ public void getSimulationExceptionTest() throws Exception { public void getSimulationTest2() throws Exception { Simulation expectedResponse = Simulation.newBuilder() - .setName(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + .setName( + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + .toString()) .setCreateTime(Timestamp.newBuilder().build()) .addAllResourceValueConfigsMetadata(new ArrayList()) + .setCloudProvider(CloudProvider.forNumber(0)) .build(); mockService.addResponse(expectedResponse); @@ -1956,7 +2017,8 @@ public void getValuedResourceTest() throws Exception { ValuedResource expectedResponse = ValuedResource.newBuilder() .setName( - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") .toString()) .setResource("resource-341064690") .setResourceType("resourceType-384364440") @@ -1967,7 +2029,8 @@ public void getValuedResourceTest() throws Exception { mockService.addResponse(expectedResponse); ValuedResourceName name = - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); ValuedResource actualResponse = client.getValuedResource(name); Assert.assertEquals(expectedResponse, actualResponse); @@ -1996,7 +2059,8 @@ public void getValuedResourceExceptionTest() throws Exception { try { ValuedResourceName name = - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); client.getValuedResource(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -2009,7 +2073,8 @@ public void getValuedResourceTest2() throws Exception { ValuedResource expectedResponse = ValuedResource.newBuilder() .setName( - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") .toString()) .setResource("resource-341064690") .setResourceType("resourceType-384364440") @@ -2366,7 +2431,9 @@ public void getResourceValueConfigTest() throws Exception { ResourceValueConfig expectedResponse = ResourceValueConfig.newBuilder() .setName( - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]").toString()) + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + .toString()) .setResourceValue(ResourceValue.forNumber(0)) .addAllTagValues(new ArrayList()) .setResourceType("resourceType-384364440") @@ -2375,13 +2442,15 @@ public void getResourceValueConfigTest() throws Exception { .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setCloudProvider(CloudProvider.forNumber(0)) .setSensitiveDataProtectionMapping( ResourceValueConfig.SensitiveDataProtectionMapping.newBuilder().build()) .build(); mockService.addResponse(expectedResponse); ResourceValueConfigName name = - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); ResourceValueConfig actualResponse = client.getResourceValueConfig(name); Assert.assertEquals(expectedResponse, actualResponse); @@ -2410,7 +2479,8 @@ public void getResourceValueConfigExceptionTest() throws Exception { try { ResourceValueConfigName name = - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); client.getResourceValueConfig(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -2423,7 +2493,9 @@ public void getResourceValueConfigTest2() throws Exception { ResourceValueConfig expectedResponse = ResourceValueConfig.newBuilder() .setName( - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]").toString()) + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + .toString()) .setResourceValue(ResourceValue.forNumber(0)) .addAllTagValues(new ArrayList()) .setResourceType("resourceType-384364440") @@ -2432,6 +2504,7 @@ public void getResourceValueConfigTest2() throws Exception { .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setCloudProvider(CloudProvider.forNumber(0)) .setSensitiveDataProtectionMapping( ResourceValueConfig.SensitiveDataProtectionMapping.newBuilder().build()) .build(); @@ -2681,8 +2754,9 @@ public void listAttackPathsTest() throws Exception { .build(); mockService.addResponse(expectedResponse); - ValuedResourceName parent = - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + OrganizationValuedResourceName parent = + OrganizationValuedResourceName.of( + "[ORGANIZATION]", "[LOCATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); ListAttackPathsPagedResponse pagedListResponse = client.listAttackPaths(parent); @@ -2714,8 +2788,9 @@ public void listAttackPathsExceptionTest() throws Exception { mockService.addException(exception); try { - ValuedResourceName parent = - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + OrganizationValuedResourceName parent = + OrganizationValuedResourceName.of( + "[ORGANIZATION]", "[LOCATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); client.listAttackPaths(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -2733,7 +2808,9 @@ public void listAttackPathsTest2() throws Exception { .build(); mockService.addResponse(expectedResponse); - String parent = "organizations/organization-6775/simulations/simulation-6775"; + ValuedResourceName parent = + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); ListAttackPathsPagedResponse pagedListResponse = client.listAttackPaths(parent); @@ -2764,6 +2841,58 @@ public void listAttackPathsExceptionTest2() throws Exception { new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); + try { + ValuedResourceName parent = + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + client.listAttackPaths(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAttackPathsTest3() throws Exception { + AttackPath responsesElement = AttackPath.newBuilder().build(); + ListAttackPathsResponse expectedResponse = + ListAttackPathsResponse.newBuilder() + .setNextPageToken("") + .addAllAttackPaths(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "organizations/organization-6775/simulations/simulation-6775"; + + ListAttackPathsPagedResponse pagedListResponse = client.listAttackPaths(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAttackPathsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAttackPathsExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + try { String parent = "organizations/organization-6775/simulations/simulation-6775"; client.listAttackPaths(parent); @@ -3637,7 +3766,7 @@ public void listResourceValueConfigsTest() throws Exception { .build(); mockService.addResponse(expectedResponse); - OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); ListResourceValueConfigsPagedResponse pagedListResponse = client.listResourceValueConfigs(parent); @@ -3670,7 +3799,7 @@ public void listResourceValueConfigsExceptionTest() throws Exception { mockService.addException(exception); try { - OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); client.listResourceValueConfigs(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -3688,7 +3817,7 @@ public void listResourceValueConfigsTest2() throws Exception { .build(); mockService.addResponse(expectedResponse); - String parent = "organizations/organization-8287"; + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); ListResourceValueConfigsPagedResponse pagedListResponse = client.listResourceValueConfigs(parent); @@ -3720,6 +3849,57 @@ public void listResourceValueConfigsExceptionTest2() throws Exception { new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); mockService.addException(exception); + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + client.listResourceValueConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listResourceValueConfigsTest3() throws Exception { + ResourceValueConfig responsesElement = ResourceValueConfig.newBuilder().build(); + ListResourceValueConfigsResponse expectedResponse = + ListResourceValueConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllResourceValueConfigs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "organizations/organization-8287"; + + ListResourceValueConfigsPagedResponse pagedListResponse = + client.listResourceValueConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourceValueConfigsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listResourceValueConfigsExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + try { String parent = "organizations/organization-8287"; client.listResourceValueConfigs(parent); @@ -3939,7 +4119,8 @@ public void listValuedResourcesTest() throws Exception { .build(); mockService.addResponse(expectedResponse); - SimulationName parent = SimulationName.of("[ORGANIZATION]", "[SIMULATION]"); + SimulationName parent = + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]"); ListValuedResourcesPagedResponse pagedListResponse = client.listValuedResources(parent); @@ -3971,7 +4152,8 @@ public void listValuedResourcesExceptionTest() throws Exception { mockService.addException(exception); try { - SimulationName parent = SimulationName.of("[ORGANIZATION]", "[SIMULATION]"); + SimulationName parent = + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]"); client.listValuedResources(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -4077,6 +4259,8 @@ public void setFindingStateTest() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -4170,6 +4354,8 @@ public void setFindingStateTest2() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -4359,6 +4545,8 @@ public void setMuteTest() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -4452,6 +4640,8 @@ public void setMuteTest2() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -4797,6 +4987,8 @@ public void updateFindingTest() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -4848,6 +5040,8 @@ public void updateFindingTest() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -4925,6 +5119,8 @@ public void updateFindingExceptionTest() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -5085,7 +5281,9 @@ public void updateResourceValueConfigTest() throws Exception { ResourceValueConfig expectedResponse = ResourceValueConfig.newBuilder() .setName( - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]").toString()) + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + .toString()) .setResourceValue(ResourceValue.forNumber(0)) .addAllTagValues(new ArrayList()) .setResourceType("resourceType-384364440") @@ -5094,6 +5292,7 @@ public void updateResourceValueConfigTest() throws Exception { .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setCloudProvider(CloudProvider.forNumber(0)) .setSensitiveDataProtectionMapping( ResourceValueConfig.SensitiveDataProtectionMapping.newBuilder().build()) .build(); @@ -5102,7 +5301,9 @@ public void updateResourceValueConfigTest() throws Exception { ResourceValueConfig resourceValueConfig = ResourceValueConfig.newBuilder() .setName( - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]").toString()) + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + .toString()) .setResourceValue(ResourceValue.forNumber(0)) .addAllTagValues(new ArrayList()) .setResourceType("resourceType-384364440") @@ -5111,6 +5312,7 @@ public void updateResourceValueConfigTest() throws Exception { .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setCloudProvider(CloudProvider.forNumber(0)) .setSensitiveDataProtectionMapping( ResourceValueConfig.SensitiveDataProtectionMapping.newBuilder().build()) .build(); @@ -5146,7 +5348,8 @@ public void updateResourceValueConfigExceptionTest() throws Exception { ResourceValueConfig resourceValueConfig = ResourceValueConfig.newBuilder() .setName( - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") .toString()) .setResourceValue(ResourceValue.forNumber(0)) .addAllTagValues(new ArrayList()) @@ -5156,6 +5359,7 @@ public void updateResourceValueConfigExceptionTest() throws Exception { .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setCloudProvider(CloudProvider.forNumber(0)) .setSensitiveDataProtectionMapping( ResourceValueConfig.SensitiveDataProtectionMapping.newBuilder().build()) .build(); diff --git a/java-securitycenter/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v2/SecurityCenterClientTest.java b/java-securitycenter/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v2/SecurityCenterClientTest.java index 38a58393c90d..c390fd7bcc0c 100644 --- a/java-securitycenter/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v2/SecurityCenterClientTest.java +++ b/java-securitycenter/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v2/SecurityCenterClientTest.java @@ -113,7 +113,7 @@ public void batchCreateResourceValueConfigsTest() throws Exception { .build(); mockSecurityCenter.addResponse(expectedResponse); - OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); List requests = new ArrayList<>(); BatchCreateResourceValueConfigsResponse actualResponse = @@ -139,7 +139,7 @@ public void batchCreateResourceValueConfigsExceptionTest() throws Exception { mockSecurityCenter.addException(exception); try { - OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); List requests = new ArrayList<>(); client.batchCreateResourceValueConfigs(parent, requests); Assert.fail("No exception raised"); @@ -156,6 +156,49 @@ public void batchCreateResourceValueConfigsTest2() throws Exception { .build(); mockSecurityCenter.addResponse(expectedResponse); + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + List requests = new ArrayList<>(); + + BatchCreateResourceValueConfigsResponse actualResponse = + client.batchCreateResourceValueConfigs(parent, requests); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchCreateResourceValueConfigsRequest actualRequest = + ((BatchCreateResourceValueConfigsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(requests, actualRequest.getRequestsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void batchCreateResourceValueConfigsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + List requests = new ArrayList<>(); + client.batchCreateResourceValueConfigs(parent, requests); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void batchCreateResourceValueConfigsTest3() throws Exception { + BatchCreateResourceValueConfigsResponse expectedResponse = + BatchCreateResourceValueConfigsResponse.newBuilder() + .addAllResourceValueConfigs(new ArrayList()) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + String parent = "parent-995424086"; List requests = new ArrayList<>(); @@ -177,7 +220,7 @@ public void batchCreateResourceValueConfigsTest2() throws Exception { } @Test - public void batchCreateResourceValueConfigsExceptionTest2() throws Exception { + public void batchCreateResourceValueConfigsExceptionTest3() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSecurityCenter.addException(exception); @@ -549,6 +592,8 @@ public void createFindingTest() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -638,6 +683,8 @@ public void createFindingTest2() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -1556,7 +1603,8 @@ public void deleteResourceValueConfigTest() throws Exception { mockSecurityCenter.addResponse(expectedResponse); ResourceValueConfigName name = - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); client.deleteResourceValueConfig(name); @@ -1579,7 +1627,8 @@ public void deleteResourceValueConfigExceptionTest() throws Exception { try { ResourceValueConfigName name = - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); client.deleteResourceValueConfig(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -1726,13 +1775,17 @@ public void getBigQueryExportExceptionTest2() throws Exception { public void getSimulationTest() throws Exception { Simulation expectedResponse = Simulation.newBuilder() - .setName(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + .setName( + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + .toString()) .setCreateTime(Timestamp.newBuilder().build()) .addAllResourceValueConfigsMetadata(new ArrayList()) + .setCloudProvider(CloudProvider.forNumber(0)) .build(); mockSecurityCenter.addResponse(expectedResponse); - SimulationName name = SimulationName.of("[ORGANIZATION]", "[SIMULATION]"); + SimulationName name = + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]"); Simulation actualResponse = client.getSimulation(name); Assert.assertEquals(expectedResponse, actualResponse); @@ -1754,7 +1807,8 @@ public void getSimulationExceptionTest() throws Exception { mockSecurityCenter.addException(exception); try { - SimulationName name = SimulationName.of("[ORGANIZATION]", "[SIMULATION]"); + SimulationName name = + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]"); client.getSimulation(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -1766,9 +1820,12 @@ public void getSimulationExceptionTest() throws Exception { public void getSimulationTest2() throws Exception { Simulation expectedResponse = Simulation.newBuilder() - .setName(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + .setName( + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + .toString()) .setCreateTime(Timestamp.newBuilder().build()) .addAllResourceValueConfigsMetadata(new ArrayList()) + .setCloudProvider(CloudProvider.forNumber(0)) .build(); mockSecurityCenter.addResponse(expectedResponse); @@ -1807,7 +1864,8 @@ public void getValuedResourceTest() throws Exception { ValuedResource expectedResponse = ValuedResource.newBuilder() .setName( - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") .toString()) .setResource("resource-341064690") .setResourceType("resourceType-384364440") @@ -1818,7 +1876,8 @@ public void getValuedResourceTest() throws Exception { mockSecurityCenter.addResponse(expectedResponse); ValuedResourceName name = - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); ValuedResource actualResponse = client.getValuedResource(name); Assert.assertEquals(expectedResponse, actualResponse); @@ -1841,7 +1900,8 @@ public void getValuedResourceExceptionTest() throws Exception { try { ValuedResourceName name = - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); client.getValuedResource(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -1854,7 +1914,8 @@ public void getValuedResourceTest2() throws Exception { ValuedResource expectedResponse = ValuedResource.newBuilder() .setName( - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") .toString()) .setResource("resource-341064690") .setResourceType("resourceType-384364440") @@ -2167,7 +2228,9 @@ public void getResourceValueConfigTest() throws Exception { ResourceValueConfig expectedResponse = ResourceValueConfig.newBuilder() .setName( - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]").toString()) + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + .toString()) .setResourceValue(ResourceValue.forNumber(0)) .addAllTagValues(new ArrayList()) .setResourceType("resourceType-384364440") @@ -2176,13 +2239,15 @@ public void getResourceValueConfigTest() throws Exception { .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setCloudProvider(CloudProvider.forNumber(0)) .setSensitiveDataProtectionMapping( ResourceValueConfig.SensitiveDataProtectionMapping.newBuilder().build()) .build(); mockSecurityCenter.addResponse(expectedResponse); ResourceValueConfigName name = - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); ResourceValueConfig actualResponse = client.getResourceValueConfig(name); Assert.assertEquals(expectedResponse, actualResponse); @@ -2206,7 +2271,8 @@ public void getResourceValueConfigExceptionTest() throws Exception { try { ResourceValueConfigName name = - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); client.getResourceValueConfig(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -2219,7 +2285,9 @@ public void getResourceValueConfigTest2() throws Exception { ResourceValueConfig expectedResponse = ResourceValueConfig.newBuilder() .setName( - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]").toString()) + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + .toString()) .setResourceValue(ResourceValue.forNumber(0)) .addAllTagValues(new ArrayList()) .setResourceType("resourceType-384364440") @@ -2228,6 +2296,7 @@ public void getResourceValueConfigTest2() throws Exception { .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setCloudProvider(CloudProvider.forNumber(0)) .setSensitiveDataProtectionMapping( ResourceValueConfig.SensitiveDataProtectionMapping.newBuilder().build()) .build(); @@ -2450,8 +2519,9 @@ public void listAttackPathsTest() throws Exception { .build(); mockSecurityCenter.addResponse(expectedResponse); - ValuedResourceName parent = - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + OrganizationValuedResourceName parent = + OrganizationValuedResourceName.of( + "[ORGANIZATION]", "[LOCATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); ListAttackPathsPagedResponse pagedListResponse = client.listAttackPaths(parent); @@ -2477,8 +2547,9 @@ public void listAttackPathsExceptionTest() throws Exception { mockSecurityCenter.addException(exception); try { - ValuedResourceName parent = - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + OrganizationValuedResourceName parent = + OrganizationValuedResourceName.of( + "[ORGANIZATION]", "[LOCATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); client.listAttackPaths(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -2496,6 +2567,54 @@ public void listAttackPathsTest2() throws Exception { .build(); mockSecurityCenter.addResponse(expectedResponse); + ValuedResourceName parent = + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + + ListAttackPathsPagedResponse pagedListResponse = client.listAttackPaths(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAttackPathsList().get(0), resources.get(0)); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAttackPathsRequest actualRequest = ((ListAttackPathsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAttackPathsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + ValuedResourceName parent = + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + client.listAttackPaths(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAttackPathsTest3() throws Exception { + AttackPath responsesElement = AttackPath.newBuilder().build(); + ListAttackPathsResponse expectedResponse = + ListAttackPathsResponse.newBuilder() + .setNextPageToken("") + .addAllAttackPaths(Arrays.asList(responsesElement)) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + String parent = "parent-995424086"; ListAttackPathsPagedResponse pagedListResponse = client.listAttackPaths(parent); @@ -2517,7 +2636,7 @@ public void listAttackPathsTest2() throws Exception { } @Test - public void listAttackPathsExceptionTest2() throws Exception { + public void listAttackPathsExceptionTest3() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSecurityCenter.addException(exception); @@ -3296,7 +3415,7 @@ public void listResourceValueConfigsTest() throws Exception { .build(); mockSecurityCenter.addResponse(expectedResponse); - OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); ListResourceValueConfigsPagedResponse pagedListResponse = client.listResourceValueConfigs(parent); @@ -3324,7 +3443,7 @@ public void listResourceValueConfigsExceptionTest() throws Exception { mockSecurityCenter.addException(exception); try { - OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); client.listResourceValueConfigs(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -3342,6 +3461,52 @@ public void listResourceValueConfigsTest2() throws Exception { .build(); mockSecurityCenter.addResponse(expectedResponse); + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + ListResourceValueConfigsPagedResponse pagedListResponse = + client.listResourceValueConfigs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourceValueConfigsList().get(0), resources.get(0)); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListResourceValueConfigsRequest actualRequest = + ((ListResourceValueConfigsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listResourceValueConfigsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + client.listResourceValueConfigs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listResourceValueConfigsTest3() throws Exception { + ResourceValueConfig responsesElement = ResourceValueConfig.newBuilder().build(); + ListResourceValueConfigsResponse expectedResponse = + ListResourceValueConfigsResponse.newBuilder() + .setNextPageToken("") + .addAllResourceValueConfigs(Arrays.asList(responsesElement)) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + String parent = "parent-995424086"; ListResourceValueConfigsPagedResponse pagedListResponse = @@ -3365,7 +3530,7 @@ public void listResourceValueConfigsTest2() throws Exception { } @Test - public void listResourceValueConfigsExceptionTest2() throws Exception { + public void listResourceValueConfigsExceptionTest3() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSecurityCenter.addException(exception); @@ -3564,7 +3729,8 @@ public void listValuedResourcesTest() throws Exception { .build(); mockSecurityCenter.addResponse(expectedResponse); - SimulationName parent = SimulationName.of("[ORGANIZATION]", "[SIMULATION]"); + SimulationName parent = + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]"); ListValuedResourcesPagedResponse pagedListResponse = client.listValuedResources(parent); @@ -3590,7 +3756,8 @@ public void listValuedResourcesExceptionTest() throws Exception { mockSecurityCenter.addException(exception); try { - SimulationName parent = SimulationName.of("[ORGANIZATION]", "[SIMULATION]"); + SimulationName parent = + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]"); client.listValuedResources(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -3690,6 +3857,8 @@ public void setFindingStateTest() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -3778,6 +3947,8 @@ public void setFindingStateTest2() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -3952,6 +4123,8 @@ public void setMuteTest() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -4040,6 +4213,8 @@ public void setMuteTest2() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -4308,6 +4483,8 @@ public void updateFindingTest() throws Exception { .setSecurityPosture(SecurityPosture.newBuilder().build()) .addAllLogEntries(new ArrayList()) .addAllLoadBalancers(new ArrayList()) + .setCloudArmor(CloudArmor.newBuilder().build()) + .setNotebook(Notebook.newBuilder().build()) .setToxicCombination(ToxicCombination.newBuilder().build()) .addAllGroupMemberships(new ArrayList()) .build(); @@ -4448,7 +4625,9 @@ public void updateResourceValueConfigTest() throws Exception { ResourceValueConfig expectedResponse = ResourceValueConfig.newBuilder() .setName( - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]").toString()) + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + .toString()) .setResourceValue(ResourceValue.forNumber(0)) .addAllTagValues(new ArrayList()) .setResourceType("resourceType-384364440") @@ -4457,6 +4636,7 @@ public void updateResourceValueConfigTest() throws Exception { .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setCloudProvider(CloudProvider.forNumber(0)) .setSensitiveDataProtectionMapping( ResourceValueConfig.SensitiveDataProtectionMapping.newBuilder().build()) .build(); diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AdaptiveProtection.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AdaptiveProtection.java new file mode 100644 index 000000000000..3533277df76f --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AdaptiveProtection.java @@ -0,0 +1,558 @@ +/* + * Copyright 2024 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/securitycenter/v2/cloud_armor.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +/** + * + * + *

+ * Information about [Google Cloud Armor Adaptive
+ * Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection).
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AdaptiveProtection} + */ +public final class AdaptiveProtection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.AdaptiveProtection) + AdaptiveProtectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use AdaptiveProtection.newBuilder() to construct. + private AdaptiveProtection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AdaptiveProtection() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AdaptiveProtection(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_AdaptiveProtection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_AdaptiveProtection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AdaptiveProtection.class, + com.google.cloud.securitycenter.v2.AdaptiveProtection.Builder.class); + } + + public static final int CONFIDENCE_FIELD_NUMBER = 1; + private double confidence_ = 0D; + /** + * + * + *
+   * A score of 0 means that there is low confidence that the detected event is
+   * an actual attack. A score of 1 means that there is high confidence that the
+   * detected event is an attack. See the [Adaptive Protection
+   * documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning)
+   * for further explanation.
+   * 
+ * + * double confidence = 1; + * + * @return The confidence. + */ + @java.lang.Override + public double getConfidence() { + return confidence_; + } + + 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 (java.lang.Double.doubleToRawLongBits(confidence_) != 0) { + output.writeDouble(1, confidence_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(confidence_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, confidence_); + } + size += getUnknownFields().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.securitycenter.v2.AdaptiveProtection)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.AdaptiveProtection other = + (com.google.cloud.securitycenter.v2.AdaptiveProtection) obj; + + if (java.lang.Double.doubleToLongBits(getConfidence()) + != java.lang.Double.doubleToLongBits(other.getConfidence())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CONFIDENCE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getConfidence())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.AdaptiveProtection parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AdaptiveProtection 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.securitycenter.v2.AdaptiveProtection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AdaptiveProtection 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.securitycenter.v2.AdaptiveProtection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AdaptiveProtection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.AdaptiveProtection parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AdaptiveProtection 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.securitycenter.v2.AdaptiveProtection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AdaptiveProtection 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.securitycenter.v2.AdaptiveProtection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AdaptiveProtection 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.securitycenter.v2.AdaptiveProtection 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; + } + /** + * + * + *
+   * Information about [Google Cloud Armor Adaptive
+   * Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection).
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AdaptiveProtection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.AdaptiveProtection) + com.google.cloud.securitycenter.v2.AdaptiveProtectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_AdaptiveProtection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_AdaptiveProtection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AdaptiveProtection.class, + com.google.cloud.securitycenter.v2.AdaptiveProtection.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.AdaptiveProtection.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + confidence_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_AdaptiveProtection_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AdaptiveProtection getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.AdaptiveProtection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AdaptiveProtection build() { + com.google.cloud.securitycenter.v2.AdaptiveProtection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AdaptiveProtection buildPartial() { + com.google.cloud.securitycenter.v2.AdaptiveProtection result = + new com.google.cloud.securitycenter.v2.AdaptiveProtection(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.AdaptiveProtection result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.confidence_ = confidence_; + } + } + + @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.securitycenter.v2.AdaptiveProtection) { + return mergeFrom((com.google.cloud.securitycenter.v2.AdaptiveProtection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.AdaptiveProtection other) { + if (other == com.google.cloud.securitycenter.v2.AdaptiveProtection.getDefaultInstance()) + return this; + if (other.getConfidence() != 0D) { + setConfidence(other.getConfidence()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + confidence_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private double confidence_; + /** + * + * + *
+     * A score of 0 means that there is low confidence that the detected event is
+     * an actual attack. A score of 1 means that there is high confidence that the
+     * detected event is an attack. See the [Adaptive Protection
+     * documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning)
+     * for further explanation.
+     * 
+ * + * double confidence = 1; + * + * @return The confidence. + */ + @java.lang.Override + public double getConfidence() { + return confidence_; + } + /** + * + * + *
+     * A score of 0 means that there is low confidence that the detected event is
+     * an actual attack. A score of 1 means that there is high confidence that the
+     * detected event is an attack. See the [Adaptive Protection
+     * documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning)
+     * for further explanation.
+     * 
+ * + * double confidence = 1; + * + * @param value The confidence to set. + * @return This builder for chaining. + */ + public Builder setConfidence(double value) { + + confidence_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * A score of 0 means that there is low confidence that the detected event is
+     * an actual attack. A score of 1 means that there is high confidence that the
+     * detected event is an attack. See the [Adaptive Protection
+     * documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning)
+     * for further explanation.
+     * 
+ * + * double confidence = 1; + * + * @return This builder for chaining. + */ + public Builder clearConfidence() { + bitField0_ = (bitField0_ & ~0x00000001); + confidence_ = 0D; + 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.securitycenter.v2.AdaptiveProtection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.AdaptiveProtection) + private static final com.google.cloud.securitycenter.v2.AdaptiveProtection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.AdaptiveProtection(); + } + + public static com.google.cloud.securitycenter.v2.AdaptiveProtection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AdaptiveProtection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.AdaptiveProtection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AdaptiveProtectionOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AdaptiveProtectionOrBuilder.java new file mode 100644 index 000000000000..cce7f2bfe21a --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AdaptiveProtectionOrBuilder.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 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/securitycenter/v2/cloud_armor.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public interface AdaptiveProtectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.AdaptiveProtection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A score of 0 means that there is low confidence that the detected event is
+   * an actual attack. A score of 1 means that there is high confidence that the
+   * detected event is an attack. See the [Adaptive Protection
+   * documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning)
+   * for further explanation.
+   * 
+ * + * double confidence = 1; + * + * @return The confidence. + */ + double getConfidence(); +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Attack.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Attack.java new file mode 100644 index 000000000000..1ee47d089276 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Attack.java @@ -0,0 +1,810 @@ +/* + * Copyright 2024 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/securitycenter/v2/cloud_armor.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +/** + * + * + *
+ * Information about DDoS attack volume and classification.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.Attack} + */ +public final class Attack extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.Attack) + AttackOrBuilder { + private static final long serialVersionUID = 0L; + // Use Attack.newBuilder() to construct. + private Attack(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Attack() { + classification_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Attack(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_Attack_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_Attack_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.Attack.class, + com.google.cloud.securitycenter.v2.Attack.Builder.class); + } + + public static final int VOLUME_PPS_FIELD_NUMBER = 1; + private int volumePps_ = 0; + /** + * + * + *
+   * Total PPS (packets per second) volume of attack.
+   * 
+ * + * int32 volume_pps = 1; + * + * @return The volumePps. + */ + @java.lang.Override + public int getVolumePps() { + return volumePps_; + } + + public static final int VOLUME_BPS_FIELD_NUMBER = 2; + private int volumeBps_ = 0; + /** + * + * + *
+   * Total BPS (bytes per second) volume of attack.
+   * 
+ * + * int32 volume_bps = 2; + * + * @return The volumeBps. + */ + @java.lang.Override + public int getVolumeBps() { + return volumeBps_; + } + + public static final int CLASSIFICATION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object classification_ = ""; + /** + * + * + *
+   * Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
+   * 
+ * + * string classification = 3; + * + * @return The classification. + */ + @java.lang.Override + public java.lang.String getClassification() { + java.lang.Object ref = classification_; + 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(); + classification_ = s; + return s; + } + } + /** + * + * + *
+   * Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
+   * 
+ * + * string classification = 3; + * + * @return The bytes for classification. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClassificationBytes() { + java.lang.Object ref = classification_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + classification_ = 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 (volumePps_ != 0) { + output.writeInt32(1, volumePps_); + } + if (volumeBps_ != 0) { + output.writeInt32(2, volumeBps_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(classification_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, classification_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (volumePps_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, volumePps_); + } + if (volumeBps_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, volumeBps_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(classification_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, classification_); + } + size += getUnknownFields().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.securitycenter.v2.Attack)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.Attack other = + (com.google.cloud.securitycenter.v2.Attack) obj; + + if (getVolumePps() != other.getVolumePps()) return false; + if (getVolumeBps() != other.getVolumeBps()) return false; + if (!getClassification().equals(other.getClassification())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VOLUME_PPS_FIELD_NUMBER; + hash = (53 * hash) + getVolumePps(); + hash = (37 * hash) + VOLUME_BPS_FIELD_NUMBER; + hash = (53 * hash) + getVolumeBps(); + hash = (37 * hash) + CLASSIFICATION_FIELD_NUMBER; + hash = (53 * hash) + getClassification().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.Attack parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Attack 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.securitycenter.v2.Attack parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Attack 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.securitycenter.v2.Attack parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Attack parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.Attack parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Attack 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.securitycenter.v2.Attack parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Attack 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.securitycenter.v2.Attack parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Attack 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.securitycenter.v2.Attack 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; + } + /** + * + * + *
+   * Information about DDoS attack volume and classification.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.Attack} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.Attack) + com.google.cloud.securitycenter.v2.AttackOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_Attack_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_Attack_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.Attack.class, + com.google.cloud.securitycenter.v2.Attack.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.Attack.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + volumePps_ = 0; + volumeBps_ = 0; + classification_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_Attack_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Attack getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.Attack.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Attack build() { + com.google.cloud.securitycenter.v2.Attack result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Attack buildPartial() { + com.google.cloud.securitycenter.v2.Attack result = + new com.google.cloud.securitycenter.v2.Attack(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.Attack result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.volumePps_ = volumePps_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.volumeBps_ = volumeBps_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.classification_ = classification_; + } + } + + @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.securitycenter.v2.Attack) { + return mergeFrom((com.google.cloud.securitycenter.v2.Attack) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.Attack other) { + if (other == com.google.cloud.securitycenter.v2.Attack.getDefaultInstance()) return this; + if (other.getVolumePps() != 0) { + setVolumePps(other.getVolumePps()); + } + if (other.getVolumeBps() != 0) { + setVolumeBps(other.getVolumeBps()); + } + if (!other.getClassification().isEmpty()) { + classification_ = other.classification_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + volumePps_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + volumeBps_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + classification_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int volumePps_; + /** + * + * + *
+     * Total PPS (packets per second) volume of attack.
+     * 
+ * + * int32 volume_pps = 1; + * + * @return The volumePps. + */ + @java.lang.Override + public int getVolumePps() { + return volumePps_; + } + /** + * + * + *
+     * Total PPS (packets per second) volume of attack.
+     * 
+ * + * int32 volume_pps = 1; + * + * @param value The volumePps to set. + * @return This builder for chaining. + */ + public Builder setVolumePps(int value) { + + volumePps_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Total PPS (packets per second) volume of attack.
+     * 
+ * + * int32 volume_pps = 1; + * + * @return This builder for chaining. + */ + public Builder clearVolumePps() { + bitField0_ = (bitField0_ & ~0x00000001); + volumePps_ = 0; + onChanged(); + return this; + } + + private int volumeBps_; + /** + * + * + *
+     * Total BPS (bytes per second) volume of attack.
+     * 
+ * + * int32 volume_bps = 2; + * + * @return The volumeBps. + */ + @java.lang.Override + public int getVolumeBps() { + return volumeBps_; + } + /** + * + * + *
+     * Total BPS (bytes per second) volume of attack.
+     * 
+ * + * int32 volume_bps = 2; + * + * @param value The volumeBps to set. + * @return This builder for chaining. + */ + public Builder setVolumeBps(int value) { + + volumeBps_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Total BPS (bytes per second) volume of attack.
+     * 
+ * + * int32 volume_bps = 2; + * + * @return This builder for chaining. + */ + public Builder clearVolumeBps() { + bitField0_ = (bitField0_ & ~0x00000002); + volumeBps_ = 0; + onChanged(); + return this; + } + + private java.lang.Object classification_ = ""; + /** + * + * + *
+     * Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
+     * 
+ * + * string classification = 3; + * + * @return The classification. + */ + public java.lang.String getClassification() { + java.lang.Object ref = classification_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + classification_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
+     * 
+ * + * string classification = 3; + * + * @return The bytes for classification. + */ + public com.google.protobuf.ByteString getClassificationBytes() { + java.lang.Object ref = classification_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + classification_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
+     * 
+ * + * string classification = 3; + * + * @param value The classification to set. + * @return This builder for chaining. + */ + public Builder setClassification(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + classification_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
+     * 
+ * + * string classification = 3; + * + * @return This builder for chaining. + */ + public Builder clearClassification() { + classification_ = getDefaultInstance().getClassification(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
+     * 
+ * + * string classification = 3; + * + * @param value The bytes for classification to set. + * @return This builder for chaining. + */ + public Builder setClassificationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + classification_ = value; + bitField0_ |= 0x00000004; + 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.securitycenter.v2.Attack) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.Attack) + private static final com.google.cloud.securitycenter.v2.Attack DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.Attack(); + } + + public static com.google.cloud.securitycenter.v2.Attack getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attack parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.Attack getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AttackOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AttackOrBuilder.java new file mode 100644 index 000000000000..f03aaf49d38e --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AttackOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2024 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/securitycenter/v2/cloud_armor.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public interface AttackOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.Attack) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Total PPS (packets per second) volume of attack.
+   * 
+ * + * int32 volume_pps = 1; + * + * @return The volumePps. + */ + int getVolumePps(); + + /** + * + * + *
+   * Total BPS (bytes per second) volume of attack.
+   * 
+ * + * int32 volume_bps = 2; + * + * @return The volumeBps. + */ + int getVolumeBps(); + + /** + * + * + *
+   * Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
+   * 
+ * + * string classification = 3; + * + * @return The classification. + */ + java.lang.String getClassification(); + /** + * + * + *
+   * Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
+   * 
+ * + * string classification = 3; + * + * @return The bytes for classification. + */ + com.google.protobuf.ByteString getClassificationBytes(); +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AttackPathName.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AttackPathName.java index 342d1ad5c70f..79f178399ad3 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AttackPathName.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AttackPathName.java @@ -17,6 +17,7 @@ package com.google.cloud.securitycenter.v2; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,11 +33,17 @@ public class AttackPathName implements ResourceName { private static final PathTemplate ORGANIZATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH = PathTemplate.createWithoutUrlEncoding( "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}"); + private static final PathTemplate ORGANIZATION_LOCATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; private final String organization; private final String simulation; private final String valuedResource; private final String attackPath; + private final String location; @Deprecated protected AttackPathName() { @@ -44,6 +51,7 @@ protected AttackPathName() { simulation = null; valuedResource = null; attackPath = null; + location = null; } private AttackPathName(Builder builder) { @@ -51,6 +59,17 @@ private AttackPathName(Builder builder) { simulation = Preconditions.checkNotNull(builder.getSimulation()); valuedResource = Preconditions.checkNotNull(builder.getValuedResource()); attackPath = Preconditions.checkNotNull(builder.getAttackPath()); + location = null; + pathTemplate = ORGANIZATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH; + } + + private AttackPathName(OrganizationLocationSimulationValuedResourceAttackPathBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + simulation = Preconditions.checkNotNull(builder.getSimulation()); + valuedResource = Preconditions.checkNotNull(builder.getValuedResource()); + attackPath = Preconditions.checkNotNull(builder.getAttackPath()); + pathTemplate = ORGANIZATION_LOCATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH; } public String getOrganization() { @@ -69,10 +88,23 @@ public String getAttackPath() { return attackPath; } + public String getLocation() { + return location; + } + public static Builder newBuilder() { return new Builder(); } + public static Builder newOrganizationSimulationValuedResourceAttackPathBuilder() { + return new Builder(); + } + + public static OrganizationLocationSimulationValuedResourceAttackPathBuilder + newOrganizationLocationSimulationValuedResourceAttackPathBuilder() { + return new OrganizationLocationSimulationValuedResourceAttackPathBuilder(); + } + public Builder toBuilder() { return new Builder(this); } @@ -87,6 +119,31 @@ public static AttackPathName of( .build(); } + public static AttackPathName ofOrganizationSimulationValuedResourceAttackPathName( + String organization, String simulation, String valuedResource, String attackPath) { + return newBuilder() + .setOrganization(organization) + .setSimulation(simulation) + .setValuedResource(valuedResource) + .setAttackPath(attackPath) + .build(); + } + + public static AttackPathName ofOrganizationLocationSimulationValuedResourceAttackPathName( + String organization, + String location, + String simulation, + String valuedResource, + String attackPath) { + return newOrganizationLocationSimulationValuedResourceAttackPathBuilder() + .setOrganization(organization) + .setLocation(location) + .setSimulation(simulation) + .setValuedResource(valuedResource) + .setAttackPath(attackPath) + .build(); + } + public static String format( String organization, String simulation, String valuedResource, String attackPath) { return newBuilder() @@ -98,18 +155,57 @@ public static String format( .toString(); } + public static String formatOrganizationSimulationValuedResourceAttackPathName( + String organization, String simulation, String valuedResource, String attackPath) { + return newBuilder() + .setOrganization(organization) + .setSimulation(simulation) + .setValuedResource(valuedResource) + .setAttackPath(attackPath) + .build() + .toString(); + } + + public static String formatOrganizationLocationSimulationValuedResourceAttackPathName( + String organization, + String location, + String simulation, + String valuedResource, + String attackPath) { + return newOrganizationLocationSimulationValuedResourceAttackPathBuilder() + .setOrganization(organization) + .setLocation(location) + .setSimulation(simulation) + .setValuedResource(valuedResource) + .setAttackPath(attackPath) + .build() + .toString(); + } + public static AttackPathName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - ORGANIZATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH.validatedMatch( - formattedString, "AttackPathName.parse: formattedString not in valid format"); - return of( - matchMap.get("organization"), - matchMap.get("simulation"), - matchMap.get("valued_resource"), - matchMap.get("attack_path")); + if (ORGANIZATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH.matches(formattedString)) { + Map matchMap = + ORGANIZATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH.match(formattedString); + return ofOrganizationSimulationValuedResourceAttackPathName( + matchMap.get("organization"), + matchMap.get("simulation"), + matchMap.get("valued_resource"), + matchMap.get("attack_path")); + } else if (ORGANIZATION_LOCATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH.matches( + formattedString)) { + Map matchMap = + ORGANIZATION_LOCATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH.match(formattedString); + return ofOrganizationLocationSimulationValuedResourceAttackPathName( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("simulation"), + matchMap.get("valued_resource"), + matchMap.get("attack_path")); + } + throw new ValidationException("AttackPathName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -133,7 +229,8 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return ORGANIZATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH.matches(formattedString); + return ORGANIZATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH.matches(formattedString) + || ORGANIZATION_LOCATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH.matches(formattedString); } @Override @@ -154,6 +251,9 @@ public Map getFieldValuesMap() { if (attackPath != null) { fieldMapBuilder.put("attack_path", attackPath); } + if (location != null) { + fieldMapBuilder.put("location", location); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -167,15 +267,7 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return ORGANIZATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH.instantiate( - "organization", - organization, - "simulation", - simulation, - "valued_resource", - valuedResource, - "attack_path", - attackPath); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } @Override @@ -188,7 +280,8 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.organization, that.organization) && Objects.equals(this.simulation, that.simulation) && Objects.equals(this.valuedResource, that.valuedResource) - && Objects.equals(this.attackPath, that.attackPath); + && Objects.equals(this.attackPath, that.attackPath) + && Objects.equals(this.location, that.location); } return false; } @@ -197,6 +290,8 @@ public boolean equals(java.lang.Object o) { public int hashCode() { int h = 1; h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; h ^= Objects.hashCode(organization); h *= 1000003; h ^= Objects.hashCode(simulation); @@ -204,6 +299,8 @@ public int hashCode() { h ^= Objects.hashCode(valuedResource); h *= 1000003; h ^= Objects.hashCode(attackPath); + h *= 1000003; + h ^= Objects.hashCode(location); return h; } @@ -256,6 +353,10 @@ public Builder setAttackPath(String attackPath) { } private Builder(AttackPathName attackPathName) { + Preconditions.checkArgument( + Objects.equals( + attackPathName.pathTemplate, ORGANIZATION_SIMULATION_VALUED_RESOURCE_ATTACK_PATH), + "toBuilder is only supported when AttackPathName has the pattern of organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}"); this.organization = attackPathName.organization; this.simulation = attackPathName.simulation; this.valuedResource = attackPathName.valuedResource; @@ -266,4 +367,72 @@ public AttackPathName build() { return new AttackPathName(this); } } + + /** + * Builder for + * organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}. + */ + public static class OrganizationLocationSimulationValuedResourceAttackPathBuilder { + private String organization; + private String location; + private String simulation; + private String valuedResource; + private String attackPath; + + protected OrganizationLocationSimulationValuedResourceAttackPathBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getSimulation() { + return simulation; + } + + public String getValuedResource() { + return valuedResource; + } + + public String getAttackPath() { + return attackPath; + } + + public OrganizationLocationSimulationValuedResourceAttackPathBuilder setOrganization( + String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationSimulationValuedResourceAttackPathBuilder setLocation( + String location) { + this.location = location; + return this; + } + + public OrganizationLocationSimulationValuedResourceAttackPathBuilder setSimulation( + String simulation) { + this.simulation = simulation; + return this; + } + + public OrganizationLocationSimulationValuedResourceAttackPathBuilder setValuedResource( + String valuedResource) { + this.valuedResource = valuedResource; + return this; + } + + public OrganizationLocationSimulationValuedResourceAttackPathBuilder setAttackPath( + String attackPath) { + this.attackPath = attackPath; + return this; + } + + public AttackPathName build() { + return new AttackPathName(this); + } + } } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AttackPathProto.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AttackPathProto.java index 7f780a0f3071..268627823ecd 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AttackPathProto.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AttackPathProto.java @@ -63,7 +63,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n0google/cloud/securitycenter/v2/attack_" + "path.proto\022\036google.cloud.securitycenter." - + "v2\032\031google/api/resource.proto\"\347\t\n\nAttack" + + "v2\032\031google/api/resource.proto\"\360\n\n\nAttack" + "Path\022\014\n\004name\030\001 \001(\t\022M\n\npath_nodes\030\002 \003(\01329" + ".google.cloud.securitycenter.v2.AttackPa" + "th.AttackPathNode\022H\n\005edges\030\003 \003(\01329.googl" @@ -90,18 +90,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\021\n\rNODE_TYPE_AND\020\001\022\020\n\014NODE_TYPE_OR\020\002\022\025\n\021" + "NODE_TYPE_DEFENSE\020\003\022\026\n\022NODE_TYPE_ATTACKE" + "R\020\004\0325\n\016AttackPathEdge\022\016\n\006source\030\001 \001(\t\022\023\n" - + "\013destination\030\002 \001(\t:\272\001\352A\266\001\n(securitycente" + + "\013destination\030\002 \001(\t:\303\002\352A\277\002\n(securitycente" + "r.googleapis.com/AttackPath\022qorganizatio" + "ns/{organization}/simulations/{simulatio" + "n}/valuedResources/{valued_resource}/att" - + "ackPaths/{attack_path}*\013attackPaths2\natt" - + "ackPathB\351\001\n\"com.google.cloud.securitycen" - + "ter.v2B\017AttackPathProtoP\001ZJcloud.google." - + "com/go/securitycenter/apiv2/securitycent" - + "erpb;securitycenterpb\252\002\036Google.Cloud.Sec" - + "urityCenter.V2\312\002\036Google\\Cloud\\SecurityCe" - + "nter\\V2\352\002!Google::Cloud::SecurityCenter:" - + ":V2b\006proto3" + + "ackPaths/{attack_path}\022\206\001organizations/{" + + "organization}/locations/{location}/simul" + + "ations/{simulation}/valuedResources/{val" + + "ued_resource}/attackPaths/{attack_path}*" + + "\013attackPaths2\nattackPathB\351\001\n\"com.google." + + "cloud.securitycenter.v2B\017AttackPathProto" + + "P\001ZJcloud.google.com/go/securitycenter/a" + + "piv2/securitycenterpb;securitycenterpb\252\002" + + "\036Google.Cloud.SecurityCenter.V2\312\002\036Google" + + "\\Cloud\\SecurityCenter\\V2\352\002!Google::Cloud" + + "::SecurityCenter::V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AwsMetadata.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AwsMetadata.java new file mode 100644 index 000000000000..d4ad6e0462b4 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AwsMetadata.java @@ -0,0 +1,4024 @@ +/* + * Copyright 2024 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/securitycenter/v2/resource.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +/** + * + * + *
+ * AWS metadata associated with the resource, only applicable if the finding's
+ * cloud provider is Amazon Web Services.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AwsMetadata} + */ +public final class AwsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.AwsMetadata) + AwsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use AwsMetadata.newBuilder() to construct. + private AwsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AwsMetadata() { + organizationalUnits_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AwsMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AwsMetadata.class, + com.google.cloud.securitycenter.v2.AwsMetadata.Builder.class); + } + + public interface AwsOrganizationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The unique identifier (ID) for the organization. The regex pattern for an
+     * organization ID string requires "o-" followed by from 10 to 32 lowercase
+     * letters or digits.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * The unique identifier (ID) for the organization. The regex pattern for an
+     * organization ID string requires "o-" followed by from 10 to 32 lowercase
+     * letters or digits.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + } + /** + * + * + *
+   * An organization is a collection of accounts that are centrally managed
+   * together using consolidated billing, organized hierarchically with
+   * organizational units (OUs), and controlled with policies.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization} + */ + public static final class AwsOrganization extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization) + AwsOrganizationOrBuilder { + private static final long serialVersionUID = 0L; + // Use AwsOrganization.newBuilder() to construct. + private AwsOrganization(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AwsOrganization() { + id_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AwsOrganization(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganization_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganization_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.class, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * The unique identifier (ID) for the organization. The regex pattern for an
+     * organization ID string requires "o-" followed by from 10 to 32 lowercase
+     * letters or digits.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * The unique identifier (ID) for the organization. The regex pattern for an
+     * organization ID string requires "o-" followed by from 10 to 32 lowercase
+     * letters or digits.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + size += getUnknownFields().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.securitycenter.v2.AwsMetadata.AwsOrganization)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization other = + (com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization) obj; + + if (!getId().equals(other.getId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization 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.securitycenter.v2.AwsMetadata.AwsOrganization parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization 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.securitycenter.v2.AwsMetadata.AwsOrganization parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization 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.securitycenter.v2.AwsMetadata.AwsOrganization parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization 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.securitycenter.v2.AwsMetadata.AwsOrganization parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization 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.securitycenter.v2.AwsMetadata.AwsOrganization 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; + } + /** + * + * + *
+     * An organization is a collection of accounts that are centrally managed
+     * together using consolidated billing, organized hierarchically with
+     * organizational units (OUs), and controlled with policies.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization) + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganization_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganization_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.class, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganization_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization build() { + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization buildPartial() { + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization result = + new com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + } + + @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.securitycenter.v2.AwsMetadata.AwsOrganization) { + return mergeFrom((com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization other) { + if (other + == com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * The unique identifier (ID) for the organization. The regex pattern for an
+       * organization ID string requires "o-" followed by from 10 to 32 lowercase
+       * letters or digits.
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The unique identifier (ID) for the organization. The regex pattern for an
+       * organization ID string requires "o-" followed by from 10 to 32 lowercase
+       * letters or digits.
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The unique identifier (ID) for the organization. The regex pattern for an
+       * organization ID string requires "o-" followed by from 10 to 32 lowercase
+       * letters or digits.
+       * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The unique identifier (ID) for the organization. The regex pattern for an
+       * organization ID string requires "o-" followed by from 10 to 32 lowercase
+       * letters or digits.
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The unique identifier (ID) for the organization. The regex pattern for an
+       * organization ID string requires "o-" followed by from 10 to 32 lowercase
+       * letters or digits.
+       * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + 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.securitycenter.v2.AwsMetadata.AwsOrganization) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization) + private static final com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization(); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AwsOrganization parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.AwsMetadata.AwsOrganization + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AwsOrganizationalUnitOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The unique identifier (ID) associated with this OU. The regex pattern for
+     * an organizational unit ID string requires "ou-" followed by from 4 to 32
+     * lowercase letters or digits (the ID of the root that contains the OU).
+     * This string is followed by a second "-" dash and from 8 to 32 additional
+     * lowercase letters or digits. For example, "ou-ab12-cd34ef56".
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * The unique identifier (ID) associated with this OU. The regex pattern for
+     * an organizational unit ID string requires "ou-" followed by from 4 to 32
+     * lowercase letters or digits (the ID of the root that contains the OU).
+     * This string is followed by a second "-" dash and from 8 to 32 additional
+     * lowercase letters or digits. For example, "ou-ab12-cd34ef56".
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * The friendly name of the OU.
+     * 
+ * + * string name = 2; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * The friendly name of the OU.
+     * 
+ * + * string name = 2; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + } + /** + * + * + *
+   * An Organizational Unit (OU) is a container of AWS accounts within a root of
+   * an organization. Policies that are attached to an OU apply to all accounts
+   * contained in that OU and in any child OUs.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit} + */ + public static final class AwsOrganizationalUnit extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit) + AwsOrganizationalUnitOrBuilder { + private static final long serialVersionUID = 0L; + // Use AwsOrganizationalUnit.newBuilder() to construct. + private AwsOrganizationalUnit(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AwsOrganizationalUnit() { + id_ = ""; + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AwsOrganizationalUnit(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganizationalUnit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganizationalUnit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.class, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * The unique identifier (ID) associated with this OU. The regex pattern for
+     * an organizational unit ID string requires "ou-" followed by from 4 to 32
+     * lowercase letters or digits (the ID of the root that contains the OU).
+     * This string is followed by a second "-" dash and from 8 to 32 additional
+     * lowercase letters or digits. For example, "ou-ab12-cd34ef56".
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * The unique identifier (ID) associated with this OU. The regex pattern for
+     * an organizational unit ID string requires "ou-" followed by from 4 to 32
+     * lowercase letters or digits (the ID of the root that contains the OU).
+     * This string is followed by a second "-" dash and from 8 to 32 additional
+     * lowercase letters or digits. For example, "ou-ab12-cd34ef56".
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+     * The friendly name of the OU.
+     * 
+ * + * string name = 2; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+     * The friendly name of the OU.
+     * 
+ * + * string name = 2; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + size += getUnknownFields().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.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit other = + (com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit) obj; + + if (!getId().equals(other.getId())) return false; + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit 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.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit 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.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit 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.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + 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.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit 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.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit 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; + } + /** + * + * + *
+     * An Organizational Unit (OU) is a container of AWS accounts within a root of
+     * an organization. Policies that are attached to an OU apply to all accounts
+     * contained in that OU and in any child OUs.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit) + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnitOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganizationalUnit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganizationalUnit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.class, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganizationalUnit_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit build() { + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit buildPartial() { + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit result = + new com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + } + + @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.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit) { + return mergeFrom( + (com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit other) { + if (other + == com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + .getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * The unique identifier (ID) associated with this OU. The regex pattern for
+       * an organizational unit ID string requires "ou-" followed by from 4 to 32
+       * lowercase letters or digits (the ID of the root that contains the OU).
+       * This string is followed by a second "-" dash and from 8 to 32 additional
+       * lowercase letters or digits. For example, "ou-ab12-cd34ef56".
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The unique identifier (ID) associated with this OU. The regex pattern for
+       * an organizational unit ID string requires "ou-" followed by from 4 to 32
+       * lowercase letters or digits (the ID of the root that contains the OU).
+       * This string is followed by a second "-" dash and from 8 to 32 additional
+       * lowercase letters or digits. For example, "ou-ab12-cd34ef56".
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The unique identifier (ID) associated with this OU. The regex pattern for
+       * an organizational unit ID string requires "ou-" followed by from 4 to 32
+       * lowercase letters or digits (the ID of the root that contains the OU).
+       * This string is followed by a second "-" dash and from 8 to 32 additional
+       * lowercase letters or digits. For example, "ou-ab12-cd34ef56".
+       * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The unique identifier (ID) associated with this OU. The regex pattern for
+       * an organizational unit ID string requires "ou-" followed by from 4 to 32
+       * lowercase letters or digits (the ID of the root that contains the OU).
+       * This string is followed by a second "-" dash and from 8 to 32 additional
+       * lowercase letters or digits. For example, "ou-ab12-cd34ef56".
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The unique identifier (ID) associated with this OU. The regex pattern for
+       * an organizational unit ID string requires "ou-" followed by from 4 to 32
+       * lowercase letters or digits (the ID of the root that contains the OU).
+       * This string is followed by a second "-" dash and from 8 to 32 additional
+       * lowercase letters or digits. For example, "ou-ab12-cd34ef56".
+       * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * The friendly name of the OU.
+       * 
+ * + * string name = 2; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The friendly name of the OU.
+       * 
+ * + * string name = 2; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The friendly name of the OU.
+       * 
+ * + * string name = 2; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The friendly name of the OU.
+       * 
+ * + * string name = 2; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The friendly name of the OU.
+       * 
+ * + * string name = 2; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + 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.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit) + private static final com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit(); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AwsOrganizationalUnit parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AwsAccountOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.AwsMetadata.AwsAccount) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The unique identifier (ID) of the account, containing exactly 12 digits.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * The unique identifier (ID) of the account, containing exactly 12 digits.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * The friendly name of this account.
+     * 
+ * + * string name = 2; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * The friendly name of this account.
+     * 
+ * + * string name = 2; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + } + /** + * + * + *
+   * An AWS account that is a member of an organization.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AwsMetadata.AwsAccount} + */ + public static final class AwsAccount extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.AwsMetadata.AwsAccount) + AwsAccountOrBuilder { + private static final long serialVersionUID = 0L; + // Use AwsAccount.newBuilder() to construct. + private AwsAccount(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AwsAccount() { + id_ = ""; + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AwsAccount(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsAccount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsAccount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.class, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * The unique identifier (ID) of the account, containing exactly 12 digits.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * The unique identifier (ID) of the account, containing exactly 12 digits.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+     * The friendly name of this account.
+     * 
+ * + * string name = 2; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+     * The friendly name of this account.
+     * 
+ * + * string name = 2; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + size += getUnknownFields().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.securitycenter.v2.AwsMetadata.AwsAccount)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount other = + (com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount) obj; + + if (!getId().equals(other.getId())) return false; + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount 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.securitycenter.v2.AwsMetadata.AwsAccount parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount 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.securitycenter.v2.AwsMetadata.AwsAccount parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount 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.securitycenter.v2.AwsMetadata.AwsAccount parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount 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.securitycenter.v2.AwsMetadata.AwsAccount parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount 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.securitycenter.v2.AwsMetadata.AwsAccount 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; + } + /** + * + * + *
+     * An AWS account that is a member of an organization.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AwsMetadata.AwsAccount} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.AwsMetadata.AwsAccount) + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccountOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsAccount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsAccount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.class, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsAccount_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount build() { + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount buildPartial() { + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount result = + new com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + } + + @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.securitycenter.v2.AwsMetadata.AwsAccount) { + return mergeFrom((com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount other) { + if (other == com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * The unique identifier (ID) of the account, containing exactly 12 digits.
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The unique identifier (ID) of the account, containing exactly 12 digits.
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The unique identifier (ID) of the account, containing exactly 12 digits.
+       * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The unique identifier (ID) of the account, containing exactly 12 digits.
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The unique identifier (ID) of the account, containing exactly 12 digits.
+       * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * The friendly name of this account.
+       * 
+ * + * string name = 2; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The friendly name of this account.
+       * 
+ * + * string name = 2; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The friendly name of this account.
+       * 
+ * + * string name = 2; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The friendly name of this account.
+       * 
+ * + * string name = 2; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The friendly name of this account.
+       * 
+ * + * string name = 2; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000002; + 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.securitycenter.v2.AwsMetadata.AwsAccount) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.AwsMetadata.AwsAccount) + private static final com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount(); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AwsAccount parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.AwsMetadata.AwsAccount getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ORGANIZATION_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization_; + /** + * + * + *
+   * The AWS organization associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + * + * @return Whether the organization field is set. + */ + @java.lang.Override + public boolean hasOrganization() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The AWS organization associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + * + * @return The organization. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization getOrganization() { + return organization_ == null + ? com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.getDefaultInstance() + : organization_; + } + /** + * + * + *
+   * The AWS organization associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationOrBuilder + getOrganizationOrBuilder() { + return organization_ == null + ? com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.getDefaultInstance() + : organization_; + } + + public static final int ORGANIZATIONAL_UNITS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List + organizationalUnits_; + /** + * + * + *
+   * A list of AWS organizational units associated with the resource, ordered
+   * from lowest level (closest to the account) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + @java.lang.Override + public java.util.List + getOrganizationalUnitsList() { + return organizationalUnits_; + } + /** + * + * + *
+   * A list of AWS organizational units associated with the resource, ordered
+   * from lowest level (closest to the account) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnitOrBuilder> + getOrganizationalUnitsOrBuilderList() { + return organizationalUnits_; + } + /** + * + * + *
+   * A list of AWS organizational units associated with the resource, ordered
+   * from lowest level (closest to the account) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + @java.lang.Override + public int getOrganizationalUnitsCount() { + return organizationalUnits_.size(); + } + /** + * + * + *
+   * A list of AWS organizational units associated with the resource, ordered
+   * from lowest level (closest to the account) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + getOrganizationalUnits(int index) { + return organizationalUnits_.get(index); + } + /** + * + * + *
+   * A list of AWS organizational units associated with the resource, ordered
+   * from lowest level (closest to the account) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnitOrBuilder + getOrganizationalUnitsOrBuilder(int index) { + return organizationalUnits_.get(index); + } + + public static final int ACCOUNT_FIELD_NUMBER = 3; + private com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account_; + /** + * + * + *
+   * The AWS account associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + * + * @return Whether the account field is set. + */ + @java.lang.Override + public boolean hasAccount() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The AWS account associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + * + * @return The account. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount getAccount() { + return account_ == null + ? com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.getDefaultInstance() + : account_; + } + /** + * + * + *
+   * The AWS account associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccountOrBuilder getAccountOrBuilder() { + return account_ == null + ? com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.getDefaultInstance() + : account_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getOrganization()); + } + for (int i = 0; i < organizationalUnits_.size(); i++) { + output.writeMessage(2, organizationalUnits_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getAccount()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOrganization()); + } + for (int i = 0; i < organizationalUnits_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, organizationalUnits_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAccount()); + } + size += getUnknownFields().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.securitycenter.v2.AwsMetadata)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.AwsMetadata other = + (com.google.cloud.securitycenter.v2.AwsMetadata) obj; + + if (hasOrganization() != other.hasOrganization()) return false; + if (hasOrganization()) { + if (!getOrganization().equals(other.getOrganization())) return false; + } + if (!getOrganizationalUnitsList().equals(other.getOrganizationalUnitsList())) return false; + if (hasAccount() != other.hasAccount()) return false; + if (hasAccount()) { + if (!getAccount().equals(other.getAccount())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOrganization()) { + hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; + hash = (53 * hash) + getOrganization().hashCode(); + } + if (getOrganizationalUnitsCount() > 0) { + hash = (37 * hash) + ORGANIZATIONAL_UNITS_FIELD_NUMBER; + hash = (53 * hash) + getOrganizationalUnitsList().hashCode(); + } + if (hasAccount()) { + hash = (37 * hash) + ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getAccount().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata 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.securitycenter.v2.AwsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata 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.securitycenter.v2.AwsMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata 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.securitycenter.v2.AwsMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata 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.securitycenter.v2.AwsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata 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.securitycenter.v2.AwsMetadata 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; + } + /** + * + * + *
+   * AWS metadata associated with the resource, only applicable if the finding's
+   * cloud provider is Amazon Web Services.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AwsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.AwsMetadata) + com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AwsMetadata.class, + com.google.cloud.securitycenter.v2.AwsMetadata.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.AwsMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOrganizationFieldBuilder(); + getOrganizationalUnitsFieldBuilder(); + getAccountFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + organization_ = null; + if (organizationBuilder_ != null) { + organizationBuilder_.dispose(); + organizationBuilder_ = null; + } + if (organizationalUnitsBuilder_ == null) { + organizationalUnits_ = java.util.Collections.emptyList(); + } else { + organizationalUnits_ = null; + organizationalUnitsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + account_ = null; + if (accountBuilder_ != null) { + accountBuilder_.dispose(); + accountBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AwsMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata build() { + com.google.cloud.securitycenter.v2.AwsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata buildPartial() { + com.google.cloud.securitycenter.v2.AwsMetadata result = + new com.google.cloud.securitycenter.v2.AwsMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.securitycenter.v2.AwsMetadata result) { + if (organizationalUnitsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + organizationalUnits_ = java.util.Collections.unmodifiableList(organizationalUnits_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.organizationalUnits_ = organizationalUnits_; + } else { + result.organizationalUnits_ = organizationalUnitsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.AwsMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.organization_ = + organizationBuilder_ == null ? organization_ : organizationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.account_ = accountBuilder_ == null ? account_ : accountBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.securitycenter.v2.AwsMetadata) { + return mergeFrom((com.google.cloud.securitycenter.v2.AwsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.AwsMetadata other) { + if (other == com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance()) return this; + if (other.hasOrganization()) { + mergeOrganization(other.getOrganization()); + } + if (organizationalUnitsBuilder_ == null) { + if (!other.organizationalUnits_.isEmpty()) { + if (organizationalUnits_.isEmpty()) { + organizationalUnits_ = other.organizationalUnits_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureOrganizationalUnitsIsMutable(); + organizationalUnits_.addAll(other.organizationalUnits_); + } + onChanged(); + } + } else { + if (!other.organizationalUnits_.isEmpty()) { + if (organizationalUnitsBuilder_.isEmpty()) { + organizationalUnitsBuilder_.dispose(); + organizationalUnitsBuilder_ = null; + organizationalUnits_ = other.organizationalUnits_; + bitField0_ = (bitField0_ & ~0x00000002); + organizationalUnitsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOrganizationalUnitsFieldBuilder() + : null; + } else { + organizationalUnitsBuilder_.addAllMessages(other.organizationalUnits_); + } + } + } + if (other.hasAccount()) { + mergeAccount(other.getAccount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getOrganizationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit m = + input.readMessage( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + .parser(), + extensionRegistry); + if (organizationalUnitsBuilder_ == null) { + ensureOrganizationalUnitsIsMutable(); + organizationalUnits_.add(m); + } else { + organizationalUnitsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + input.readMessage(getAccountFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.Builder, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationOrBuilder> + organizationBuilder_; + /** + * + * + *
+     * The AWS organization associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + * + * @return Whether the organization field is set. + */ + public boolean hasOrganization() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The AWS organization associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + * + * @return The organization. + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization getOrganization() { + if (organizationBuilder_ == null) { + return organization_ == null + ? com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.getDefaultInstance() + : organization_; + } else { + return organizationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The AWS organization associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + */ + public Builder setOrganization( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization value) { + if (organizationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + organization_ = value; + } else { + organizationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The AWS organization associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + */ + public Builder setOrganization( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.Builder builderForValue) { + if (organizationBuilder_ == null) { + organization_ = builderForValue.build(); + } else { + organizationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The AWS organization associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + */ + public Builder mergeOrganization( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization value) { + if (organizationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && organization_ != null + && organization_ + != com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization + .getDefaultInstance()) { + getOrganizationBuilder().mergeFrom(value); + } else { + organization_ = value; + } + } else { + organizationBuilder_.mergeFrom(value); + } + if (organization_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The AWS organization associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + */ + public Builder clearOrganization() { + bitField0_ = (bitField0_ & ~0x00000001); + organization_ = null; + if (organizationBuilder_ != null) { + organizationBuilder_.dispose(); + organizationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The AWS organization associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.Builder + getOrganizationBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getOrganizationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The AWS organization associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationOrBuilder + getOrganizationOrBuilder() { + if (organizationBuilder_ != null) { + return organizationBuilder_.getMessageOrBuilder(); + } else { + return organization_ == null + ? com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.getDefaultInstance() + : organization_; + } + } + /** + * + * + *
+     * The AWS organization associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.Builder, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationOrBuilder> + getOrganizationFieldBuilder() { + if (organizationBuilder_ == null) { + organizationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization.Builder, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationOrBuilder>( + getOrganization(), getParentForChildren(), isClean()); + organization_ = null; + } + return organizationBuilder_; + } + + private java.util.List + organizationalUnits_ = java.util.Collections.emptyList(); + + private void ensureOrganizationalUnitsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + organizationalUnits_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit>( + organizationalUnits_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.Builder, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnitOrBuilder> + organizationalUnitsBuilder_; + + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public java.util.List + getOrganizationalUnitsList() { + if (organizationalUnitsBuilder_ == null) { + return java.util.Collections.unmodifiableList(organizationalUnits_); + } else { + return organizationalUnitsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public int getOrganizationalUnitsCount() { + if (organizationalUnitsBuilder_ == null) { + return organizationalUnits_.size(); + } else { + return organizationalUnitsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + getOrganizationalUnits(int index) { + if (organizationalUnitsBuilder_ == null) { + return organizationalUnits_.get(index); + } else { + return organizationalUnitsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public Builder setOrganizationalUnits( + int index, com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit value) { + if (organizationalUnitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrganizationalUnitsIsMutable(); + organizationalUnits_.set(index, value); + onChanged(); + } else { + organizationalUnitsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public Builder setOrganizationalUnits( + int index, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.Builder + builderForValue) { + if (organizationalUnitsBuilder_ == null) { + ensureOrganizationalUnitsIsMutable(); + organizationalUnits_.set(index, builderForValue.build()); + onChanged(); + } else { + organizationalUnitsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public Builder addOrganizationalUnits( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit value) { + if (organizationalUnitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrganizationalUnitsIsMutable(); + organizationalUnits_.add(value); + onChanged(); + } else { + organizationalUnitsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public Builder addOrganizationalUnits( + int index, com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit value) { + if (organizationalUnitsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrganizationalUnitsIsMutable(); + organizationalUnits_.add(index, value); + onChanged(); + } else { + organizationalUnitsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public Builder addOrganizationalUnits( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.Builder + builderForValue) { + if (organizationalUnitsBuilder_ == null) { + ensureOrganizationalUnitsIsMutable(); + organizationalUnits_.add(builderForValue.build()); + onChanged(); + } else { + organizationalUnitsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public Builder addOrganizationalUnits( + int index, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.Builder + builderForValue) { + if (organizationalUnitsBuilder_ == null) { + ensureOrganizationalUnitsIsMutable(); + organizationalUnits_.add(index, builderForValue.build()); + onChanged(); + } else { + organizationalUnitsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public Builder addAllOrganizationalUnits( + java.lang.Iterable< + ? extends com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit> + values) { + if (organizationalUnitsBuilder_ == null) { + ensureOrganizationalUnitsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, organizationalUnits_); + onChanged(); + } else { + organizationalUnitsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public Builder clearOrganizationalUnits() { + if (organizationalUnitsBuilder_ == null) { + organizationalUnits_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + organizationalUnitsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public Builder removeOrganizationalUnits(int index) { + if (organizationalUnitsBuilder_ == null) { + ensureOrganizationalUnitsIsMutable(); + organizationalUnits_.remove(index); + onChanged(); + } else { + organizationalUnitsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.Builder + getOrganizationalUnitsBuilder(int index) { + return getOrganizationalUnitsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnitOrBuilder + getOrganizationalUnitsOrBuilder(int index) { + if (organizationalUnitsBuilder_ == null) { + return organizationalUnits_.get(index); + } else { + return organizationalUnitsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnitOrBuilder> + getOrganizationalUnitsOrBuilderList() { + if (organizationalUnitsBuilder_ != null) { + return organizationalUnitsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(organizationalUnits_); + } + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.Builder + addOrganizationalUnitsBuilder() { + return getOrganizationalUnitsFieldBuilder() + .addBuilder( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.Builder + addOrganizationalUnitsBuilder(int index) { + return getOrganizationalUnitsFieldBuilder() + .addBuilder( + index, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of AWS organizational units associated with the resource, ordered
+     * from lowest level (closest to the account) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + public java.util.List< + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.Builder> + getOrganizationalUnitsBuilderList() { + return getOrganizationalUnitsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.Builder, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnitOrBuilder> + getOrganizationalUnitsFieldBuilder() { + if (organizationalUnitsBuilder_ == null) { + organizationalUnitsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit.Builder, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnitOrBuilder>( + organizationalUnits_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + organizationalUnits_ = null; + } + return organizationalUnitsBuilder_; + } + + private com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.Builder, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccountOrBuilder> + accountBuilder_; + /** + * + * + *
+     * The AWS account associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + * + * @return Whether the account field is set. + */ + public boolean hasAccount() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The AWS account associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + * + * @return The account. + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount getAccount() { + if (accountBuilder_ == null) { + return account_ == null + ? com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.getDefaultInstance() + : account_; + } else { + return accountBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The AWS account associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + */ + public Builder setAccount(com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount value) { + if (accountBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + account_ = value; + } else { + accountBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The AWS account associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + */ + public Builder setAccount( + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.Builder builderForValue) { + if (accountBuilder_ == null) { + account_ = builderForValue.build(); + } else { + accountBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The AWS account associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + */ + public Builder mergeAccount(com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount value) { + if (accountBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && account_ != null + && account_ + != com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.getDefaultInstance()) { + getAccountBuilder().mergeFrom(value); + } else { + account_ = value; + } + } else { + accountBuilder_.mergeFrom(value); + } + if (account_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The AWS account associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + */ + public Builder clearAccount() { + bitField0_ = (bitField0_ & ~0x00000004); + account_ = null; + if (accountBuilder_ != null) { + accountBuilder_.dispose(); + accountBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The AWS account associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.Builder getAccountBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getAccountFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The AWS account associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccountOrBuilder + getAccountOrBuilder() { + if (accountBuilder_ != null) { + return accountBuilder_.getMessageOrBuilder(); + } else { + return account_ == null + ? com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.getDefaultInstance() + : account_; + } + } + /** + * + * + *
+     * The AWS account associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.Builder, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccountOrBuilder> + getAccountFieldBuilder() { + if (accountBuilder_ == null) { + accountBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount.Builder, + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccountOrBuilder>( + getAccount(), getParentForChildren(), isClean()); + account_ = null; + } + return accountBuilder_; + } + + @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.securitycenter.v2.AwsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.AwsMetadata) + private static final com.google.cloud.securitycenter.v2.AwsMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.AwsMetadata(); + } + + public static com.google.cloud.securitycenter.v2.AwsMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AwsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.AwsMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AwsMetadataOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AwsMetadataOrBuilder.java new file mode 100644 index 000000000000..38f0c502e1fa --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AwsMetadataOrBuilder.java @@ -0,0 +1,168 @@ +/* + * Copyright 2024 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/securitycenter/v2/resource.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public interface AwsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.AwsMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The AWS organization associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + * + * @return Whether the organization field is set. + */ + boolean hasOrganization(); + /** + * + * + *
+   * The AWS organization associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + * + * @return The organization. + */ + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization getOrganization(); + /** + * + * + *
+   * The AWS organization associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization organization = 1; + */ + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationOrBuilder + getOrganizationOrBuilder(); + + /** + * + * + *
+   * A list of AWS organizational units associated with the resource, ordered
+   * from lowest level (closest to the account) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + java.util.List + getOrganizationalUnitsList(); + /** + * + * + *
+   * A list of AWS organizational units associated with the resource, ordered
+   * from lowest level (closest to the account) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit getOrganizationalUnits( + int index); + /** + * + * + *
+   * A list of AWS organizational units associated with the resource, ordered
+   * from lowest level (closest to the account) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + int getOrganizationalUnitsCount(); + /** + * + * + *
+   * A list of AWS organizational units associated with the resource, ordered
+   * from lowest level (closest to the account) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + java.util.List< + ? extends com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnitOrBuilder> + getOrganizationalUnitsOrBuilderList(); + /** + * + * + *
+   * A list of AWS organizational units associated with the resource, ordered
+   * from lowest level (closest to the account) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit organizational_units = 2; + * + */ + com.google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnitOrBuilder + getOrganizationalUnitsOrBuilder(int index); + + /** + * + * + *
+   * The AWS account associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + * + * @return Whether the account field is set. + */ + boolean hasAccount(); + /** + * + * + *
+   * The AWS account associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + * + * @return The account. + */ + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccount getAccount(); + /** + * + * + *
+   * The AWS account associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata.AwsAccount account = 3; + */ + com.google.cloud.securitycenter.v2.AwsMetadata.AwsAccountOrBuilder getAccountOrBuilder(); +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AzureMetadata.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AzureMetadata.java new file mode 100644 index 000000000000..bbc9d41a9d19 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AzureMetadata.java @@ -0,0 +1,4033 @@ +/* + * Copyright 2024 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/securitycenter/v2/resource.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +/** + * + * + *
+ * Azure metadata associated with the resource, only applicable if the finding's
+ * cloud provider is Microsoft Azure.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AzureMetadata} + */ +public final class AzureMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.AzureMetadata) + AzureMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use AzureMetadata.newBuilder() to construct. + private AzureMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AzureMetadata() { + managementGroups_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AzureMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AzureMetadata.class, + com.google.cloud.securitycenter.v2.AzureMetadata.Builder.class); + } + + public interface AzureManagementGroupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The UUID of the Azure management group, for example,
+     * "20000000-0001-0000-0000-000000000000".
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * The UUID of the Azure management group, for example,
+     * "20000000-0001-0000-0000-000000000000".
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * The display name of the Azure management group.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+     * The display name of the Azure management group.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + } + /** + * + * + *
+   * Represents an Azure management group.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup} + */ + public static final class AzureManagementGroup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup) + AzureManagementGroupOrBuilder { + private static final long serialVersionUID = 0L; + // Use AzureManagementGroup.newBuilder() to construct. + private AzureManagementGroup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AzureManagementGroup() { + id_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AzureManagementGroup(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureManagementGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureManagementGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.class, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * The UUID of the Azure management group, for example,
+     * "20000000-0001-0000-0000-000000000000".
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * The UUID of the Azure management group, for example,
+     * "20000000-0001-0000-0000-000000000000".
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The display name of the Azure management group.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+     * The display name of the Azure management group.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + size += getUnknownFields().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.securitycenter.v2.AzureMetadata.AzureManagementGroup)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup other = + (com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup) obj; + + if (!getId().equals(other.getId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup 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.securitycenter.v2.AzureMetadata.AzureManagementGroup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup 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.securitycenter.v2.AzureMetadata.AzureManagementGroup parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup 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.securitycenter.v2.AzureMetadata.AzureManagementGroup + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + 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.securitycenter.v2.AzureMetadata.AzureManagementGroup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup 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.securitycenter.v2.AzureMetadata.AzureManagementGroup 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; + } + /** + * + * + *
+     * Represents an Azure management group.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup) + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureManagementGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureManagementGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.class, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + displayName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureManagementGroup_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup build() { + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup buildPartial() { + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup result = + new com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + } + + @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.securitycenter.v2.AzureMetadata.AzureManagementGroup) { + return mergeFrom( + (com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup other) { + if (other + == com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + .getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * The UUID of the Azure management group, for example,
+       * "20000000-0001-0000-0000-000000000000".
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The UUID of the Azure management group, for example,
+       * "20000000-0001-0000-0000-000000000000".
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The UUID of the Azure management group, for example,
+       * "20000000-0001-0000-0000-000000000000".
+       * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The UUID of the Azure management group, for example,
+       * "20000000-0001-0000-0000-000000000000".
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The UUID of the Azure management group, for example,
+       * "20000000-0001-0000-0000-000000000000".
+       * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+       * The display name of the Azure management group.
+       * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The display name of the Azure management group.
+       * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The display name of the Azure management group.
+       * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The display name of the Azure management group.
+       * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The display name of the Azure management group.
+       * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + 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.securitycenter.v2.AzureMetadata.AzureManagementGroup) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup) + private static final com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup(); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AzureManagementGroup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.AzureMetadata.AzureManagementGroup + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AzureSubscriptionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The UUID of the Azure subscription, for example,
+     * "291bba3f-e0a5-47bc-a099-3bdcb2a50a05".
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * The UUID of the Azure subscription, for example,
+     * "291bba3f-e0a5-47bc-a099-3bdcb2a50a05".
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * The display name of the Azure subscription.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+     * The display name of the Azure subscription.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + } + /** + * + * + *
+   * Represents an Azure subscription.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription} + */ + public static final class AzureSubscription extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription) + AzureSubscriptionOrBuilder { + private static final long serialVersionUID = 0L; + // Use AzureSubscription.newBuilder() to construct. + private AzureSubscription(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AzureSubscription() { + id_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AzureSubscription(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureSubscription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureSubscription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.class, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * The UUID of the Azure subscription, for example,
+     * "291bba3f-e0a5-47bc-a099-3bdcb2a50a05".
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * The UUID of the Azure subscription, for example,
+     * "291bba3f-e0a5-47bc-a099-3bdcb2a50a05".
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The display name of the Azure subscription.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+     * The display name of the Azure subscription.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + size += getUnknownFields().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.securitycenter.v2.AzureMetadata.AzureSubscription)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription other = + (com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription) obj; + + if (!getId().equals(other.getId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription 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.securitycenter.v2.AzureMetadata.AzureSubscription parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription 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.securitycenter.v2.AzureMetadata.AzureSubscription parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription 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.securitycenter.v2.AzureMetadata.AzureSubscription + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + 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.securitycenter.v2.AzureMetadata.AzureSubscription parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription 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.securitycenter.v2.AzureMetadata.AzureSubscription 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; + } + /** + * + * + *
+     * Represents an Azure subscription.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription) + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscriptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureSubscription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureSubscription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.class, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + displayName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureSubscription_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription build() { + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription buildPartial() { + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription result = + new com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + } + + @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.securitycenter.v2.AzureMetadata.AzureSubscription) { + return mergeFrom( + (com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription other) { + if (other + == com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + .getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * The UUID of the Azure subscription, for example,
+       * "291bba3f-e0a5-47bc-a099-3bdcb2a50a05".
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The UUID of the Azure subscription, for example,
+       * "291bba3f-e0a5-47bc-a099-3bdcb2a50a05".
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The UUID of the Azure subscription, for example,
+       * "291bba3f-e0a5-47bc-a099-3bdcb2a50a05".
+       * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The UUID of the Azure subscription, for example,
+       * "291bba3f-e0a5-47bc-a099-3bdcb2a50a05".
+       * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The UUID of the Azure subscription, for example,
+       * "291bba3f-e0a5-47bc-a099-3bdcb2a50a05".
+       * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+       * The display name of the Azure subscription.
+       * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The display name of the Azure subscription.
+       * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The display name of the Azure subscription.
+       * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The display name of the Azure subscription.
+       * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The display name of the Azure subscription.
+       * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + 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.securitycenter.v2.AzureMetadata.AzureSubscription) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription) + private static final com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription(); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AzureSubscription parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.AzureMetadata.AzureSubscription + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AzureResourceGroupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the Azure resource group. This is not a UUID.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * The name of the Azure resource group. This is not a UUID.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + } + /** + * + * + *
+   * Represents an Azure resource group.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup} + */ + public static final class AzureResourceGroup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup) + AzureResourceGroupOrBuilder { + private static final long serialVersionUID = 0L; + // Use AzureResourceGroup.newBuilder() to construct. + private AzureResourceGroup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AzureResourceGroup() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AzureResourceGroup(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureResourceGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureResourceGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.class, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the Azure resource group. This is not a UUID.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the Azure resource group. This is not a UUID.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.securitycenter.v2.AzureMetadata.AzureResourceGroup)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup other = + (com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup 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.securitycenter.v2.AzureMetadata.AzureResourceGroup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup 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.securitycenter.v2.AzureMetadata.AzureResourceGroup parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup 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.securitycenter.v2.AzureMetadata.AzureResourceGroup + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + 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.securitycenter.v2.AzureMetadata.AzureResourceGroup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup 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.securitycenter.v2.AzureMetadata.AzureResourceGroup 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; + } + /** + * + * + *
+     * Represents an Azure resource group.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup) + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureResourceGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureResourceGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.class, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureResourceGroup_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup build() { + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup buildPartial() { + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup result = + new com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.securitycenter.v2.AzureMetadata.AzureResourceGroup) { + return mergeFrom( + (com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup other) { + if (other + == com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * The name of the Azure resource group. This is not a UUID.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the Azure resource group. This is not a UUID.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the Azure resource group. This is not a UUID.
+       * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the Azure resource group. This is not a UUID.
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the Azure resource group. This is not a UUID.
+       * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + 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.securitycenter.v2.AzureMetadata.AzureResourceGroup) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup) + private static final com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup(); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AzureResourceGroup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.AzureMetadata.AzureResourceGroup + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int MANAGEMENT_GROUPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + managementGroups_; + /** + * + * + *
+   * A list of Azure management groups associated with the resource, ordered
+   * from lowest level (closest to the subscription) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + @java.lang.Override + public java.util.List + getManagementGroupsList() { + return managementGroups_; + } + /** + * + * + *
+   * A list of Azure management groups associated with the resource, ordered
+   * from lowest level (closest to the subscription) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroupOrBuilder> + getManagementGroupsOrBuilderList() { + return managementGroups_; + } + /** + * + * + *
+   * A list of Azure management groups associated with the resource, ordered
+   * from lowest level (closest to the subscription) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + @java.lang.Override + public int getManagementGroupsCount() { + return managementGroups_.size(); + } + /** + * + * + *
+   * A list of Azure management groups associated with the resource, ordered
+   * from lowest level (closest to the subscription) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup getManagementGroups( + int index) { + return managementGroups_.get(index); + } + /** + * + * + *
+   * A list of Azure management groups associated with the resource, ordered
+   * from lowest level (closest to the subscription) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroupOrBuilder + getManagementGroupsOrBuilder(int index) { + return managementGroups_.get(index); + } + + public static final int SUBSCRIPTION_FIELD_NUMBER = 2; + private com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription_; + /** + * + * + *
+   * The Azure subscription associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + * @return Whether the subscription field is set. + */ + @java.lang.Override + public boolean hasSubscription() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The Azure subscription associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + * @return The subscription. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription getSubscription() { + return subscription_ == null + ? com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.getDefaultInstance() + : subscription_; + } + /** + * + * + *
+   * The Azure subscription associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscriptionOrBuilder + getSubscriptionOrBuilder() { + return subscription_ == null + ? com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.getDefaultInstance() + : subscription_; + } + + public static final int RESOURCE_GROUP_FIELD_NUMBER = 3; + private com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resourceGroup_; + /** + * + * + *
+   * The Azure resource group associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + * + * @return Whether the resourceGroup field is set. + */ + @java.lang.Override + public boolean hasResourceGroup() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The Azure resource group associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + * + * @return The resourceGroup. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup getResourceGroup() { + return resourceGroup_ == null + ? com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.getDefaultInstance() + : resourceGroup_; + } + /** + * + * + *
+   * The Azure resource group associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroupOrBuilder + getResourceGroupOrBuilder() { + return resourceGroup_ == null + ? com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.getDefaultInstance() + : resourceGroup_; + } + + 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 < managementGroups_.size(); i++) { + output.writeMessage(1, managementGroups_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSubscription()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getResourceGroup()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < managementGroups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, managementGroups_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSubscription()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getResourceGroup()); + } + size += getUnknownFields().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.securitycenter.v2.AzureMetadata)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.AzureMetadata other = + (com.google.cloud.securitycenter.v2.AzureMetadata) obj; + + if (!getManagementGroupsList().equals(other.getManagementGroupsList())) return false; + if (hasSubscription() != other.hasSubscription()) return false; + if (hasSubscription()) { + if (!getSubscription().equals(other.getSubscription())) return false; + } + if (hasResourceGroup() != other.hasResourceGroup()) return false; + if (hasResourceGroup()) { + if (!getResourceGroup().equals(other.getResourceGroup())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getManagementGroupsCount() > 0) { + hash = (37 * hash) + MANAGEMENT_GROUPS_FIELD_NUMBER; + hash = (53 * hash) + getManagementGroupsList().hashCode(); + } + if (hasSubscription()) { + hash = (37 * hash) + SUBSCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getSubscription().hashCode(); + } + if (hasResourceGroup()) { + hash = (37 * hash) + RESOURCE_GROUP_FIELD_NUMBER; + hash = (53 * hash) + getResourceGroup().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata 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.securitycenter.v2.AzureMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata 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.securitycenter.v2.AzureMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata 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.securitycenter.v2.AzureMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata 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.securitycenter.v2.AzureMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata 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.securitycenter.v2.AzureMetadata 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; + } + /** + * + * + *
+   * Azure metadata associated with the resource, only applicable if the finding's
+   * cloud provider is Microsoft Azure.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.AzureMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.AzureMetadata) + com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.AzureMetadata.class, + com.google.cloud.securitycenter.v2.AzureMetadata.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.AzureMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getManagementGroupsFieldBuilder(); + getSubscriptionFieldBuilder(); + getResourceGroupFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (managementGroupsBuilder_ == null) { + managementGroups_ = java.util.Collections.emptyList(); + } else { + managementGroups_ = null; + managementGroupsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + subscription_ = null; + if (subscriptionBuilder_ != null) { + subscriptionBuilder_.dispose(); + subscriptionBuilder_ = null; + } + resourceGroup_ = null; + if (resourceGroupBuilder_ != null) { + resourceGroupBuilder_.dispose(); + resourceGroupBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_AzureMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata build() { + com.google.cloud.securitycenter.v2.AzureMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata buildPartial() { + com.google.cloud.securitycenter.v2.AzureMetadata result = + new com.google.cloud.securitycenter.v2.AzureMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.securitycenter.v2.AzureMetadata result) { + if (managementGroupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + managementGroups_ = java.util.Collections.unmodifiableList(managementGroups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.managementGroups_ = managementGroups_; + } else { + result.managementGroups_ = managementGroupsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.AzureMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.subscription_ = + subscriptionBuilder_ == null ? subscription_ : subscriptionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resourceGroup_ = + resourceGroupBuilder_ == null ? resourceGroup_ : resourceGroupBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.securitycenter.v2.AzureMetadata) { + return mergeFrom((com.google.cloud.securitycenter.v2.AzureMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.AzureMetadata other) { + if (other == com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance()) + return this; + if (managementGroupsBuilder_ == null) { + if (!other.managementGroups_.isEmpty()) { + if (managementGroups_.isEmpty()) { + managementGroups_ = other.managementGroups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureManagementGroupsIsMutable(); + managementGroups_.addAll(other.managementGroups_); + } + onChanged(); + } + } else { + if (!other.managementGroups_.isEmpty()) { + if (managementGroupsBuilder_.isEmpty()) { + managementGroupsBuilder_.dispose(); + managementGroupsBuilder_ = null; + managementGroups_ = other.managementGroups_; + bitField0_ = (bitField0_ & ~0x00000001); + managementGroupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getManagementGroupsFieldBuilder() + : null; + } else { + managementGroupsBuilder_.addAllMessages(other.managementGroups_); + } + } + } + if (other.hasSubscription()) { + mergeSubscription(other.getSubscription()); + } + if (other.hasResourceGroup()) { + mergeResourceGroup(other.getResourceGroup()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup m = + input.readMessage( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + .parser(), + extensionRegistry); + if (managementGroupsBuilder_ == null) { + ensureManagementGroupsIsMutable(); + managementGroups_.add(m); + } else { + managementGroupsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + input.readMessage(getSubscriptionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getResourceGroupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + managementGroups_ = java.util.Collections.emptyList(); + + private void ensureManagementGroupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + managementGroups_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup>( + managementGroups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.Builder, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroupOrBuilder> + managementGroupsBuilder_; + + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public java.util.List + getManagementGroupsList() { + if (managementGroupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(managementGroups_); + } else { + return managementGroupsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public int getManagementGroupsCount() { + if (managementGroupsBuilder_ == null) { + return managementGroups_.size(); + } else { + return managementGroupsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + getManagementGroups(int index) { + if (managementGroupsBuilder_ == null) { + return managementGroups_.get(index); + } else { + return managementGroupsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public Builder setManagementGroups( + int index, com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup value) { + if (managementGroupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureManagementGroupsIsMutable(); + managementGroups_.set(index, value); + onChanged(); + } else { + managementGroupsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public Builder setManagementGroups( + int index, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.Builder + builderForValue) { + if (managementGroupsBuilder_ == null) { + ensureManagementGroupsIsMutable(); + managementGroups_.set(index, builderForValue.build()); + onChanged(); + } else { + managementGroupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public Builder addManagementGroups( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup value) { + if (managementGroupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureManagementGroupsIsMutable(); + managementGroups_.add(value); + onChanged(); + } else { + managementGroupsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public Builder addManagementGroups( + int index, com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup value) { + if (managementGroupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureManagementGroupsIsMutable(); + managementGroups_.add(index, value); + onChanged(); + } else { + managementGroupsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public Builder addManagementGroups( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.Builder + builderForValue) { + if (managementGroupsBuilder_ == null) { + ensureManagementGroupsIsMutable(); + managementGroups_.add(builderForValue.build()); + onChanged(); + } else { + managementGroupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public Builder addManagementGroups( + int index, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.Builder + builderForValue) { + if (managementGroupsBuilder_ == null) { + ensureManagementGroupsIsMutable(); + managementGroups_.add(index, builderForValue.build()); + onChanged(); + } else { + managementGroupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public Builder addAllManagementGroups( + java.lang.Iterable< + ? extends com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup> + values) { + if (managementGroupsBuilder_ == null) { + ensureManagementGroupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, managementGroups_); + onChanged(); + } else { + managementGroupsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public Builder clearManagementGroups() { + if (managementGroupsBuilder_ == null) { + managementGroups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + managementGroupsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public Builder removeManagementGroups(int index) { + if (managementGroupsBuilder_ == null) { + ensureManagementGroupsIsMutable(); + managementGroups_.remove(index); + onChanged(); + } else { + managementGroupsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.Builder + getManagementGroupsBuilder(int index) { + return getManagementGroupsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroupOrBuilder + getManagementGroupsOrBuilder(int index) { + if (managementGroupsBuilder_ == null) { + return managementGroups_.get(index); + } else { + return managementGroupsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroupOrBuilder> + getManagementGroupsOrBuilderList() { + if (managementGroupsBuilder_ != null) { + return managementGroupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(managementGroups_); + } + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.Builder + addManagementGroupsBuilder() { + return getManagementGroupsFieldBuilder() + .addBuilder( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.Builder + addManagementGroupsBuilder(int index) { + return getManagementGroupsFieldBuilder() + .addBuilder( + index, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup + .getDefaultInstance()); + } + /** + * + * + *
+     * A list of Azure management groups associated with the resource, ordered
+     * from lowest level (closest to the subscription) to highest level.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + public java.util.List< + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.Builder> + getManagementGroupsBuilderList() { + return getManagementGroupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.Builder, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroupOrBuilder> + getManagementGroupsFieldBuilder() { + if (managementGroupsBuilder_ == null) { + managementGroupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup.Builder, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroupOrBuilder>( + managementGroups_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + managementGroups_ = null; + } + return managementGroupsBuilder_; + } + + private com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.Builder, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscriptionOrBuilder> + subscriptionBuilder_; + /** + * + * + *
+     * The Azure subscription associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + * + * @return Whether the subscription field is set. + */ + public boolean hasSubscription() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The Azure subscription associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + * + * @return The subscription. + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription getSubscription() { + if (subscriptionBuilder_ == null) { + return subscription_ == null + ? com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + .getDefaultInstance() + : subscription_; + } else { + return subscriptionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The Azure subscription associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + */ + public Builder setSubscription( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription value) { + if (subscriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subscription_ = value; + } else { + subscriptionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The Azure subscription associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + */ + public Builder setSubscription( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.Builder + builderForValue) { + if (subscriptionBuilder_ == null) { + subscription_ = builderForValue.build(); + } else { + subscriptionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The Azure subscription associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + */ + public Builder mergeSubscription( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription value) { + if (subscriptionBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && subscription_ != null + && subscription_ + != com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + .getDefaultInstance()) { + getSubscriptionBuilder().mergeFrom(value); + } else { + subscription_ = value; + } + } else { + subscriptionBuilder_.mergeFrom(value); + } + if (subscription_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The Azure subscription associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + */ + public Builder clearSubscription() { + bitField0_ = (bitField0_ & ~0x00000002); + subscription_ = null; + if (subscriptionBuilder_ != null) { + subscriptionBuilder_.dispose(); + subscriptionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The Azure subscription associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.Builder + getSubscriptionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSubscriptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Azure subscription associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscriptionOrBuilder + getSubscriptionOrBuilder() { + if (subscriptionBuilder_ != null) { + return subscriptionBuilder_.getMessageOrBuilder(); + } else { + return subscription_ == null + ? com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription + .getDefaultInstance() + : subscription_; + } + } + /** + * + * + *
+     * The Azure subscription associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.Builder, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscriptionOrBuilder> + getSubscriptionFieldBuilder() { + if (subscriptionBuilder_ == null) { + subscriptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription.Builder, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscriptionOrBuilder>( + getSubscription(), getParentForChildren(), isClean()); + subscription_ = null; + } + return subscriptionBuilder_; + } + + private com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resourceGroup_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.Builder, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroupOrBuilder> + resourceGroupBuilder_; + /** + * + * + *
+     * The Azure resource group associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + * + * @return Whether the resourceGroup field is set. + */ + public boolean hasResourceGroup() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The Azure resource group associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + * + * @return The resourceGroup. + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup getResourceGroup() { + if (resourceGroupBuilder_ == null) { + return resourceGroup_ == null + ? com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + .getDefaultInstance() + : resourceGroup_; + } else { + return resourceGroupBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The Azure resource group associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + */ + public Builder setResourceGroup( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup value) { + if (resourceGroupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resourceGroup_ = value; + } else { + resourceGroupBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The Azure resource group associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + */ + public Builder setResourceGroup( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.Builder + builderForValue) { + if (resourceGroupBuilder_ == null) { + resourceGroup_ = builderForValue.build(); + } else { + resourceGroupBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The Azure resource group associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + */ + public Builder mergeResourceGroup( + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup value) { + if (resourceGroupBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && resourceGroup_ != null + && resourceGroup_ + != com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + .getDefaultInstance()) { + getResourceGroupBuilder().mergeFrom(value); + } else { + resourceGroup_ = value; + } + } else { + resourceGroupBuilder_.mergeFrom(value); + } + if (resourceGroup_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The Azure resource group associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + */ + public Builder clearResourceGroup() { + bitField0_ = (bitField0_ & ~0x00000004); + resourceGroup_ = null; + if (resourceGroupBuilder_ != null) { + resourceGroupBuilder_.dispose(); + resourceGroupBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The Azure resource group associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.Builder + getResourceGroupBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getResourceGroupFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Azure resource group associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroupOrBuilder + getResourceGroupOrBuilder() { + if (resourceGroupBuilder_ != null) { + return resourceGroupBuilder_.getMessageOrBuilder(); + } else { + return resourceGroup_ == null + ? com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup + .getDefaultInstance() + : resourceGroup_; + } + } + /** + * + * + *
+     * The Azure resource group associated with the resource.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.Builder, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroupOrBuilder> + getResourceGroupFieldBuilder() { + if (resourceGroupBuilder_ == null) { + resourceGroupBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup.Builder, + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroupOrBuilder>( + getResourceGroup(), getParentForChildren(), isClean()); + resourceGroup_ = null; + } + return resourceGroupBuilder_; + } + + @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.securitycenter.v2.AzureMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.AzureMetadata) + private static final com.google.cloud.securitycenter.v2.AzureMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.AzureMetadata(); + } + + public static com.google.cloud.securitycenter.v2.AzureMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AzureMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.AzureMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AzureMetadataOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AzureMetadataOrBuilder.java new file mode 100644 index 000000000000..552c88b4454a --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/AzureMetadataOrBuilder.java @@ -0,0 +1,172 @@ +/* + * Copyright 2024 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/securitycenter/v2/resource.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public interface AzureMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.AzureMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of Azure management groups associated with the resource, ordered
+   * from lowest level (closest to the subscription) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + java.util.List + getManagementGroupsList(); + /** + * + * + *
+   * A list of Azure management groups associated with the resource, ordered
+   * from lowest level (closest to the subscription) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup getManagementGroups( + int index); + /** + * + * + *
+   * A list of Azure management groups associated with the resource, ordered
+   * from lowest level (closest to the subscription) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + int getManagementGroupsCount(); + /** + * + * + *
+   * A list of Azure management groups associated with the resource, ordered
+   * from lowest level (closest to the subscription) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + java.util.List< + ? extends com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroupOrBuilder> + getManagementGroupsOrBuilderList(); + /** + * + * + *
+   * A list of Azure management groups associated with the resource, ordered
+   * from lowest level (closest to the subscription) to highest level.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup management_groups = 1; + * + */ + com.google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroupOrBuilder + getManagementGroupsOrBuilder(int index); + + /** + * + * + *
+   * The Azure subscription associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + * @return Whether the subscription field is set. + */ + boolean hasSubscription(); + /** + * + * + *
+   * The Azure subscription associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + * + * @return The subscription. + */ + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription getSubscription(); + /** + * + * + *
+   * The Azure subscription associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription subscription = 2; + */ + com.google.cloud.securitycenter.v2.AzureMetadata.AzureSubscriptionOrBuilder + getSubscriptionOrBuilder(); + + /** + * + * + *
+   * The Azure resource group associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + * + * @return Whether the resourceGroup field is set. + */ + boolean hasResourceGroup(); + /** + * + * + *
+   * The Azure resource group associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + * + * @return The resourceGroup. + */ + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup getResourceGroup(); + /** + * + * + *
+   * The Azure resource group associated with the resource.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup resource_group = 3; + * + */ + com.google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroupOrBuilder + getResourceGroupOrBuilder(); +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudArmor.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudArmor.java new file mode 100644 index 000000000000..d23d2a142483 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudArmor.java @@ -0,0 +1,2080 @@ +/* + * Copyright 2024 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/securitycenter/v2/cloud_armor.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +/** + * + * + *
+ * Fields related to Google Cloud Armor findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.CloudArmor} + */ +public final class CloudArmor extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.CloudArmor) + CloudArmorOrBuilder { + private static final long serialVersionUID = 0L; + // Use CloudArmor.newBuilder() to construct. + private CloudArmor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloudArmor() { + threatVector_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloudArmor(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_CloudArmor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_CloudArmor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.CloudArmor.class, + com.google.cloud.securitycenter.v2.CloudArmor.Builder.class); + } + + private int bitField0_; + public static final int SECURITY_POLICY_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v2.SecurityPolicy securityPolicy_; + /** + * + * + *
+   * Information about the [Google Cloud Armor security
+   * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+   * relevant to the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + * + * @return Whether the securityPolicy field is set. + */ + @java.lang.Override + public boolean hasSecurityPolicy() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Information about the [Google Cloud Armor security
+   * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+   * relevant to the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + * + * @return The securityPolicy. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.SecurityPolicy getSecurityPolicy() { + return securityPolicy_ == null + ? com.google.cloud.securitycenter.v2.SecurityPolicy.getDefaultInstance() + : securityPolicy_; + } + /** + * + * + *
+   * Information about the [Google Cloud Armor security
+   * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+   * relevant to the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.SecurityPolicyOrBuilder getSecurityPolicyOrBuilder() { + return securityPolicy_ == null + ? com.google.cloud.securitycenter.v2.SecurityPolicy.getDefaultInstance() + : securityPolicy_; + } + + public static final int REQUESTS_FIELD_NUMBER = 2; + private com.google.cloud.securitycenter.v2.Requests requests_; + /** + * + * + *
+   * Information about incoming requests evaluated by [Google Cloud Armor
+   * security
+   * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+   * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + * + * @return Whether the requests field is set. + */ + @java.lang.Override + public boolean hasRequests() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Information about incoming requests evaluated by [Google Cloud Armor
+   * security
+   * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+   * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + * + * @return The requests. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.Requests getRequests() { + return requests_ == null + ? com.google.cloud.securitycenter.v2.Requests.getDefaultInstance() + : requests_; + } + /** + * + * + *
+   * Information about incoming requests evaluated by [Google Cloud Armor
+   * security
+   * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+   * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.RequestsOrBuilder getRequestsOrBuilder() { + return requests_ == null + ? com.google.cloud.securitycenter.v2.Requests.getDefaultInstance() + : requests_; + } + + public static final int ADAPTIVE_PROTECTION_FIELD_NUMBER = 3; + private com.google.cloud.securitycenter.v2.AdaptiveProtection adaptiveProtection_; + /** + * + * + *
+   * Information about potential Layer 7 DDoS attacks identified by [Google
+   * Cloud Armor Adaptive
+   * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+   * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + * + * @return Whether the adaptiveProtection field is set. + */ + @java.lang.Override + public boolean hasAdaptiveProtection() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Information about potential Layer 7 DDoS attacks identified by [Google
+   * Cloud Armor Adaptive
+   * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+   * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + * + * @return The adaptiveProtection. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AdaptiveProtection getAdaptiveProtection() { + return adaptiveProtection_ == null + ? com.google.cloud.securitycenter.v2.AdaptiveProtection.getDefaultInstance() + : adaptiveProtection_; + } + /** + * + * + *
+   * Information about potential Layer 7 DDoS attacks identified by [Google
+   * Cloud Armor Adaptive
+   * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+   * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AdaptiveProtectionOrBuilder + getAdaptiveProtectionOrBuilder() { + return adaptiveProtection_ == null + ? com.google.cloud.securitycenter.v2.AdaptiveProtection.getDefaultInstance() + : adaptiveProtection_; + } + + public static final int ATTACK_FIELD_NUMBER = 4; + private com.google.cloud.securitycenter.v2.Attack attack_; + /** + * + * + *
+   * Information about DDoS attack volume and classification.
+   * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + * + * @return Whether the attack field is set. + */ + @java.lang.Override + public boolean hasAttack() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Information about DDoS attack volume and classification.
+   * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + * + * @return The attack. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.Attack getAttack() { + return attack_ == null + ? com.google.cloud.securitycenter.v2.Attack.getDefaultInstance() + : attack_; + } + /** + * + * + *
+   * Information about DDoS attack volume and classification.
+   * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AttackOrBuilder getAttackOrBuilder() { + return attack_ == null + ? com.google.cloud.securitycenter.v2.Attack.getDefaultInstance() + : attack_; + } + + public static final int THREAT_VECTOR_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object threatVector_ = ""; + /** + * + * + *
+   * Distinguish between volumetric & protocol DDoS attack and
+   * application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
+   * attacks, or "L_7" for Layer 7 DDoS attacks.
+   * 
+ * + * string threat_vector = 5; + * + * @return The threatVector. + */ + @java.lang.Override + public java.lang.String getThreatVector() { + java.lang.Object ref = threatVector_; + 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(); + threatVector_ = s; + return s; + } + } + /** + * + * + *
+   * Distinguish between volumetric & protocol DDoS attack and
+   * application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
+   * attacks, or "L_7" for Layer 7 DDoS attacks.
+   * 
+ * + * string threat_vector = 5; + * + * @return The bytes for threatVector. + */ + @java.lang.Override + public com.google.protobuf.ByteString getThreatVectorBytes() { + java.lang.Object ref = threatVector_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + threatVector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DURATION_FIELD_NUMBER = 6; + private com.google.protobuf.Duration duration_; + /** + * + * + *
+   * Duration of attack from the start until the current moment (updated every 5
+   * minutes).
+   * 
+ * + * .google.protobuf.Duration duration = 6; + * + * @return Whether the duration field is set. + */ + @java.lang.Override + public boolean hasDuration() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Duration of attack from the start until the current moment (updated every 5
+   * minutes).
+   * 
+ * + * .google.protobuf.Duration duration = 6; + * + * @return The duration. + */ + @java.lang.Override + public com.google.protobuf.Duration getDuration() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + /** + * + * + *
+   * Duration of attack from the start until the current moment (updated every 5
+   * minutes).
+   * 
+ * + * .google.protobuf.Duration duration = 6; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getSecurityPolicy()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getRequests()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getAdaptiveProtection()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(4, getAttack()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(threatVector_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, threatVector_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(6, getDuration()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSecurityPolicy()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequests()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAdaptiveProtection()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAttack()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(threatVector_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, threatVector_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDuration()); + } + size += getUnknownFields().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.securitycenter.v2.CloudArmor)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.CloudArmor other = + (com.google.cloud.securitycenter.v2.CloudArmor) obj; + + if (hasSecurityPolicy() != other.hasSecurityPolicy()) return false; + if (hasSecurityPolicy()) { + if (!getSecurityPolicy().equals(other.getSecurityPolicy())) return false; + } + if (hasRequests() != other.hasRequests()) return false; + if (hasRequests()) { + if (!getRequests().equals(other.getRequests())) return false; + } + if (hasAdaptiveProtection() != other.hasAdaptiveProtection()) return false; + if (hasAdaptiveProtection()) { + if (!getAdaptiveProtection().equals(other.getAdaptiveProtection())) return false; + } + if (hasAttack() != other.hasAttack()) return false; + if (hasAttack()) { + if (!getAttack().equals(other.getAttack())) return false; + } + if (!getThreatVector().equals(other.getThreatVector())) return false; + if (hasDuration() != other.hasDuration()) return false; + if (hasDuration()) { + if (!getDuration().equals(other.getDuration())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSecurityPolicy()) { + hash = (37 * hash) + SECURITY_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getSecurityPolicy().hashCode(); + } + if (hasRequests()) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequests().hashCode(); + } + if (hasAdaptiveProtection()) { + hash = (37 * hash) + ADAPTIVE_PROTECTION_FIELD_NUMBER; + hash = (53 * hash) + getAdaptiveProtection().hashCode(); + } + if (hasAttack()) { + hash = (37 * hash) + ATTACK_FIELD_NUMBER; + hash = (53 * hash) + getAttack().hashCode(); + } + hash = (37 * hash) + THREAT_VECTOR_FIELD_NUMBER; + hash = (53 * hash) + getThreatVector().hashCode(); + if (hasDuration()) { + hash = (37 * hash) + DURATION_FIELD_NUMBER; + hash = (53 * hash) + getDuration().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.CloudArmor parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.CloudArmor 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.securitycenter.v2.CloudArmor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.CloudArmor 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.securitycenter.v2.CloudArmor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.CloudArmor parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.CloudArmor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.CloudArmor 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.securitycenter.v2.CloudArmor parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.CloudArmor 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.securitycenter.v2.CloudArmor parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.CloudArmor 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.securitycenter.v2.CloudArmor 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; + } + /** + * + * + *
+   * Fields related to Google Cloud Armor findings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.CloudArmor} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.CloudArmor) + com.google.cloud.securitycenter.v2.CloudArmorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_CloudArmor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_CloudArmor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.CloudArmor.class, + com.google.cloud.securitycenter.v2.CloudArmor.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.CloudArmor.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSecurityPolicyFieldBuilder(); + getRequestsFieldBuilder(); + getAdaptiveProtectionFieldBuilder(); + getAttackFieldBuilder(); + getDurationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + securityPolicy_ = null; + if (securityPolicyBuilder_ != null) { + securityPolicyBuilder_.dispose(); + securityPolicyBuilder_ = null; + } + requests_ = null; + if (requestsBuilder_ != null) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + } + adaptiveProtection_ = null; + if (adaptiveProtectionBuilder_ != null) { + adaptiveProtectionBuilder_.dispose(); + adaptiveProtectionBuilder_ = null; + } + attack_ = null; + if (attackBuilder_ != null) { + attackBuilder_.dispose(); + attackBuilder_ = null; + } + threatVector_ = ""; + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_CloudArmor_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.CloudArmor getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.CloudArmor.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.CloudArmor build() { + com.google.cloud.securitycenter.v2.CloudArmor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.CloudArmor buildPartial() { + com.google.cloud.securitycenter.v2.CloudArmor result = + new com.google.cloud.securitycenter.v2.CloudArmor(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.CloudArmor result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.securityPolicy_ = + securityPolicyBuilder_ == null ? securityPolicy_ : securityPolicyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requests_ = requestsBuilder_ == null ? requests_ : requestsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.adaptiveProtection_ = + adaptiveProtectionBuilder_ == null + ? adaptiveProtection_ + : adaptiveProtectionBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.attack_ = attackBuilder_ == null ? attack_ : attackBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.threatVector_ = threatVector_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.duration_ = durationBuilder_ == null ? duration_ : durationBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + result.bitField0_ |= to_bitField0_; + } + + @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.securitycenter.v2.CloudArmor) { + return mergeFrom((com.google.cloud.securitycenter.v2.CloudArmor) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.CloudArmor other) { + if (other == com.google.cloud.securitycenter.v2.CloudArmor.getDefaultInstance()) return this; + if (other.hasSecurityPolicy()) { + mergeSecurityPolicy(other.getSecurityPolicy()); + } + if (other.hasRequests()) { + mergeRequests(other.getRequests()); + } + if (other.hasAdaptiveProtection()) { + mergeAdaptiveProtection(other.getAdaptiveProtection()); + } + if (other.hasAttack()) { + mergeAttack(other.getAttack()); + } + if (!other.getThreatVector().isEmpty()) { + threatVector_ = other.threatVector_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasDuration()) { + mergeDuration(other.getDuration()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getSecurityPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getRequestsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getAdaptiveProtectionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getAttackFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + threatVector_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getDurationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.securitycenter.v2.SecurityPolicy securityPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.SecurityPolicy, + com.google.cloud.securitycenter.v2.SecurityPolicy.Builder, + com.google.cloud.securitycenter.v2.SecurityPolicyOrBuilder> + securityPolicyBuilder_; + /** + * + * + *
+     * Information about the [Google Cloud Armor security
+     * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+     * relevant to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + * + * @return Whether the securityPolicy field is set. + */ + public boolean hasSecurityPolicy() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Information about the [Google Cloud Armor security
+     * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+     * relevant to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + * + * @return The securityPolicy. + */ + public com.google.cloud.securitycenter.v2.SecurityPolicy getSecurityPolicy() { + if (securityPolicyBuilder_ == null) { + return securityPolicy_ == null + ? com.google.cloud.securitycenter.v2.SecurityPolicy.getDefaultInstance() + : securityPolicy_; + } else { + return securityPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about the [Google Cloud Armor security
+     * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+     * relevant to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + */ + public Builder setSecurityPolicy(com.google.cloud.securitycenter.v2.SecurityPolicy value) { + if (securityPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + securityPolicy_ = value; + } else { + securityPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the [Google Cloud Armor security
+     * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+     * relevant to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + */ + public Builder setSecurityPolicy( + com.google.cloud.securitycenter.v2.SecurityPolicy.Builder builderForValue) { + if (securityPolicyBuilder_ == null) { + securityPolicy_ = builderForValue.build(); + } else { + securityPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the [Google Cloud Armor security
+     * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+     * relevant to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + */ + public Builder mergeSecurityPolicy(com.google.cloud.securitycenter.v2.SecurityPolicy value) { + if (securityPolicyBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && securityPolicy_ != null + && securityPolicy_ + != com.google.cloud.securitycenter.v2.SecurityPolicy.getDefaultInstance()) { + getSecurityPolicyBuilder().mergeFrom(value); + } else { + securityPolicy_ = value; + } + } else { + securityPolicyBuilder_.mergeFrom(value); + } + if (securityPolicy_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Information about the [Google Cloud Armor security
+     * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+     * relevant to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + */ + public Builder clearSecurityPolicy() { + bitField0_ = (bitField0_ & ~0x00000001); + securityPolicy_ = null; + if (securityPolicyBuilder_ != null) { + securityPolicyBuilder_.dispose(); + securityPolicyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Information about the [Google Cloud Armor security
+     * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+     * relevant to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + */ + public com.google.cloud.securitycenter.v2.SecurityPolicy.Builder getSecurityPolicyBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSecurityPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about the [Google Cloud Armor security
+     * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+     * relevant to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + */ + public com.google.cloud.securitycenter.v2.SecurityPolicyOrBuilder getSecurityPolicyOrBuilder() { + if (securityPolicyBuilder_ != null) { + return securityPolicyBuilder_.getMessageOrBuilder(); + } else { + return securityPolicy_ == null + ? com.google.cloud.securitycenter.v2.SecurityPolicy.getDefaultInstance() + : securityPolicy_; + } + } + /** + * + * + *
+     * Information about the [Google Cloud Armor security
+     * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+     * relevant to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.SecurityPolicy, + com.google.cloud.securitycenter.v2.SecurityPolicy.Builder, + com.google.cloud.securitycenter.v2.SecurityPolicyOrBuilder> + getSecurityPolicyFieldBuilder() { + if (securityPolicyBuilder_ == null) { + securityPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.SecurityPolicy, + com.google.cloud.securitycenter.v2.SecurityPolicy.Builder, + com.google.cloud.securitycenter.v2.SecurityPolicyOrBuilder>( + getSecurityPolicy(), getParentForChildren(), isClean()); + securityPolicy_ = null; + } + return securityPolicyBuilder_; + } + + private com.google.cloud.securitycenter.v2.Requests requests_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.Requests, + com.google.cloud.securitycenter.v2.Requests.Builder, + com.google.cloud.securitycenter.v2.RequestsOrBuilder> + requestsBuilder_; + /** + * + * + *
+     * Information about incoming requests evaluated by [Google Cloud Armor
+     * security
+     * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + * + * @return Whether the requests field is set. + */ + public boolean hasRequests() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Information about incoming requests evaluated by [Google Cloud Armor
+     * security
+     * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + * + * @return The requests. + */ + public com.google.cloud.securitycenter.v2.Requests getRequests() { + if (requestsBuilder_ == null) { + return requests_ == null + ? com.google.cloud.securitycenter.v2.Requests.getDefaultInstance() + : requests_; + } else { + return requestsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about incoming requests evaluated by [Google Cloud Armor
+     * security
+     * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + */ + public Builder setRequests(com.google.cloud.securitycenter.v2.Requests value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requests_ = value; + } else { + requestsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about incoming requests evaluated by [Google Cloud Armor
+     * security
+     * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + */ + public Builder setRequests( + com.google.cloud.securitycenter.v2.Requests.Builder builderForValue) { + if (requestsBuilder_ == null) { + requests_ = builderForValue.build(); + } else { + requestsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about incoming requests evaluated by [Google Cloud Armor
+     * security
+     * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + */ + public Builder mergeRequests(com.google.cloud.securitycenter.v2.Requests value) { + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requests_ != null + && requests_ != com.google.cloud.securitycenter.v2.Requests.getDefaultInstance()) { + getRequestsBuilder().mergeFrom(value); + } else { + requests_ = value; + } + } else { + requestsBuilder_.mergeFrom(value); + } + if (requests_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Information about incoming requests evaluated by [Google Cloud Armor
+     * security
+     * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + */ + public Builder clearRequests() { + bitField0_ = (bitField0_ & ~0x00000002); + requests_ = null; + if (requestsBuilder_ != null) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Information about incoming requests evaluated by [Google Cloud Armor
+     * security
+     * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + */ + public com.google.cloud.securitycenter.v2.Requests.Builder getRequestsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRequestsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about incoming requests evaluated by [Google Cloud Armor
+     * security
+     * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + */ + public com.google.cloud.securitycenter.v2.RequestsOrBuilder getRequestsOrBuilder() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilder(); + } else { + return requests_ == null + ? com.google.cloud.securitycenter.v2.Requests.getDefaultInstance() + : requests_; + } + } + /** + * + * + *
+     * Information about incoming requests evaluated by [Google Cloud Armor
+     * security
+     * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.Requests, + com.google.cloud.securitycenter.v2.Requests.Builder, + com.google.cloud.securitycenter.v2.RequestsOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.Requests, + com.google.cloud.securitycenter.v2.Requests.Builder, + com.google.cloud.securitycenter.v2.RequestsOrBuilder>( + getRequests(), getParentForChildren(), isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + private com.google.cloud.securitycenter.v2.AdaptiveProtection adaptiveProtection_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AdaptiveProtection, + com.google.cloud.securitycenter.v2.AdaptiveProtection.Builder, + com.google.cloud.securitycenter.v2.AdaptiveProtectionOrBuilder> + adaptiveProtectionBuilder_; + /** + * + * + *
+     * Information about potential Layer 7 DDoS attacks identified by [Google
+     * Cloud Armor Adaptive
+     * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + * + * @return Whether the adaptiveProtection field is set. + */ + public boolean hasAdaptiveProtection() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Information about potential Layer 7 DDoS attacks identified by [Google
+     * Cloud Armor Adaptive
+     * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + * + * @return The adaptiveProtection. + */ + public com.google.cloud.securitycenter.v2.AdaptiveProtection getAdaptiveProtection() { + if (adaptiveProtectionBuilder_ == null) { + return adaptiveProtection_ == null + ? com.google.cloud.securitycenter.v2.AdaptiveProtection.getDefaultInstance() + : adaptiveProtection_; + } else { + return adaptiveProtectionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about potential Layer 7 DDoS attacks identified by [Google
+     * Cloud Armor Adaptive
+     * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + */ + public Builder setAdaptiveProtection( + com.google.cloud.securitycenter.v2.AdaptiveProtection value) { + if (adaptiveProtectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + adaptiveProtection_ = value; + } else { + adaptiveProtectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about potential Layer 7 DDoS attacks identified by [Google
+     * Cloud Armor Adaptive
+     * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + */ + public Builder setAdaptiveProtection( + com.google.cloud.securitycenter.v2.AdaptiveProtection.Builder builderForValue) { + if (adaptiveProtectionBuilder_ == null) { + adaptiveProtection_ = builderForValue.build(); + } else { + adaptiveProtectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about potential Layer 7 DDoS attacks identified by [Google
+     * Cloud Armor Adaptive
+     * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + */ + public Builder mergeAdaptiveProtection( + com.google.cloud.securitycenter.v2.AdaptiveProtection value) { + if (adaptiveProtectionBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && adaptiveProtection_ != null + && adaptiveProtection_ + != com.google.cloud.securitycenter.v2.AdaptiveProtection.getDefaultInstance()) { + getAdaptiveProtectionBuilder().mergeFrom(value); + } else { + adaptiveProtection_ = value; + } + } else { + adaptiveProtectionBuilder_.mergeFrom(value); + } + if (adaptiveProtection_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Information about potential Layer 7 DDoS attacks identified by [Google
+     * Cloud Armor Adaptive
+     * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + */ + public Builder clearAdaptiveProtection() { + bitField0_ = (bitField0_ & ~0x00000004); + adaptiveProtection_ = null; + if (adaptiveProtectionBuilder_ != null) { + adaptiveProtectionBuilder_.dispose(); + adaptiveProtectionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Information about potential Layer 7 DDoS attacks identified by [Google
+     * Cloud Armor Adaptive
+     * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + */ + public com.google.cloud.securitycenter.v2.AdaptiveProtection.Builder + getAdaptiveProtectionBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getAdaptiveProtectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about potential Layer 7 DDoS attacks identified by [Google
+     * Cloud Armor Adaptive
+     * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + */ + public com.google.cloud.securitycenter.v2.AdaptiveProtectionOrBuilder + getAdaptiveProtectionOrBuilder() { + if (adaptiveProtectionBuilder_ != null) { + return adaptiveProtectionBuilder_.getMessageOrBuilder(); + } else { + return adaptiveProtection_ == null + ? com.google.cloud.securitycenter.v2.AdaptiveProtection.getDefaultInstance() + : adaptiveProtection_; + } + } + /** + * + * + *
+     * Information about potential Layer 7 DDoS attacks identified by [Google
+     * Cloud Armor Adaptive
+     * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+     * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AdaptiveProtection, + com.google.cloud.securitycenter.v2.AdaptiveProtection.Builder, + com.google.cloud.securitycenter.v2.AdaptiveProtectionOrBuilder> + getAdaptiveProtectionFieldBuilder() { + if (adaptiveProtectionBuilder_ == null) { + adaptiveProtectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AdaptiveProtection, + com.google.cloud.securitycenter.v2.AdaptiveProtection.Builder, + com.google.cloud.securitycenter.v2.AdaptiveProtectionOrBuilder>( + getAdaptiveProtection(), getParentForChildren(), isClean()); + adaptiveProtection_ = null; + } + return adaptiveProtectionBuilder_; + } + + private com.google.cloud.securitycenter.v2.Attack attack_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.Attack, + com.google.cloud.securitycenter.v2.Attack.Builder, + com.google.cloud.securitycenter.v2.AttackOrBuilder> + attackBuilder_; + /** + * + * + *
+     * Information about DDoS attack volume and classification.
+     * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + * + * @return Whether the attack field is set. + */ + public boolean hasAttack() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Information about DDoS attack volume and classification.
+     * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + * + * @return The attack. + */ + public com.google.cloud.securitycenter.v2.Attack getAttack() { + if (attackBuilder_ == null) { + return attack_ == null + ? com.google.cloud.securitycenter.v2.Attack.getDefaultInstance() + : attack_; + } else { + return attackBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Information about DDoS attack volume and classification.
+     * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + */ + public Builder setAttack(com.google.cloud.securitycenter.v2.Attack value) { + if (attackBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attack_ = value; + } else { + attackBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about DDoS attack volume and classification.
+     * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + */ + public Builder setAttack(com.google.cloud.securitycenter.v2.Attack.Builder builderForValue) { + if (attackBuilder_ == null) { + attack_ = builderForValue.build(); + } else { + attackBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Information about DDoS attack volume and classification.
+     * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + */ + public Builder mergeAttack(com.google.cloud.securitycenter.v2.Attack value) { + if (attackBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && attack_ != null + && attack_ != com.google.cloud.securitycenter.v2.Attack.getDefaultInstance()) { + getAttackBuilder().mergeFrom(value); + } else { + attack_ = value; + } + } else { + attackBuilder_.mergeFrom(value); + } + if (attack_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Information about DDoS attack volume and classification.
+     * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + */ + public Builder clearAttack() { + bitField0_ = (bitField0_ & ~0x00000008); + attack_ = null; + if (attackBuilder_ != null) { + attackBuilder_.dispose(); + attackBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Information about DDoS attack volume and classification.
+     * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + */ + public com.google.cloud.securitycenter.v2.Attack.Builder getAttackBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getAttackFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Information about DDoS attack volume and classification.
+     * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + */ + public com.google.cloud.securitycenter.v2.AttackOrBuilder getAttackOrBuilder() { + if (attackBuilder_ != null) { + return attackBuilder_.getMessageOrBuilder(); + } else { + return attack_ == null + ? com.google.cloud.securitycenter.v2.Attack.getDefaultInstance() + : attack_; + } + } + /** + * + * + *
+     * Information about DDoS attack volume and classification.
+     * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.Attack, + com.google.cloud.securitycenter.v2.Attack.Builder, + com.google.cloud.securitycenter.v2.AttackOrBuilder> + getAttackFieldBuilder() { + if (attackBuilder_ == null) { + attackBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.Attack, + com.google.cloud.securitycenter.v2.Attack.Builder, + com.google.cloud.securitycenter.v2.AttackOrBuilder>( + getAttack(), getParentForChildren(), isClean()); + attack_ = null; + } + return attackBuilder_; + } + + private java.lang.Object threatVector_ = ""; + /** + * + * + *
+     * Distinguish between volumetric & protocol DDoS attack and
+     * application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
+     * attacks, or "L_7" for Layer 7 DDoS attacks.
+     * 
+ * + * string threat_vector = 5; + * + * @return The threatVector. + */ + public java.lang.String getThreatVector() { + java.lang.Object ref = threatVector_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + threatVector_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Distinguish between volumetric & protocol DDoS attack and
+     * application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
+     * attacks, or "L_7" for Layer 7 DDoS attacks.
+     * 
+ * + * string threat_vector = 5; + * + * @return The bytes for threatVector. + */ + public com.google.protobuf.ByteString getThreatVectorBytes() { + java.lang.Object ref = threatVector_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + threatVector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Distinguish between volumetric & protocol DDoS attack and
+     * application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
+     * attacks, or "L_7" for Layer 7 DDoS attacks.
+     * 
+ * + * string threat_vector = 5; + * + * @param value The threatVector to set. + * @return This builder for chaining. + */ + public Builder setThreatVector(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + threatVector_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Distinguish between volumetric & protocol DDoS attack and
+     * application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
+     * attacks, or "L_7" for Layer 7 DDoS attacks.
+     * 
+ * + * string threat_vector = 5; + * + * @return This builder for chaining. + */ + public Builder clearThreatVector() { + threatVector_ = getDefaultInstance().getThreatVector(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Distinguish between volumetric & protocol DDoS attack and
+     * application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
+     * attacks, or "L_7" for Layer 7 DDoS attacks.
+     * 
+ * + * string threat_vector = 5; + * + * @param value The bytes for threatVector to set. + * @return This builder for chaining. + */ + public Builder setThreatVectorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + threatVector_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.Duration duration_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + durationBuilder_; + /** + * + * + *
+     * Duration of attack from the start until the current moment (updated every 5
+     * minutes).
+     * 
+ * + * .google.protobuf.Duration duration = 6; + * + * @return Whether the duration field is set. + */ + public boolean hasDuration() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Duration of attack from the start until the current moment (updated every 5
+     * minutes).
+     * 
+ * + * .google.protobuf.Duration duration = 6; + * + * @return The duration. + */ + public com.google.protobuf.Duration getDuration() { + if (durationBuilder_ == null) { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } else { + return durationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Duration of attack from the start until the current moment (updated every 5
+     * minutes).
+     * 
+ * + * .google.protobuf.Duration duration = 6; + */ + public Builder setDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + duration_ = value; + } else { + durationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Duration of attack from the start until the current moment (updated every 5
+     * minutes).
+     * 
+ * + * .google.protobuf.Duration duration = 6; + */ + public Builder setDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (durationBuilder_ == null) { + duration_ = builderForValue.build(); + } else { + durationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Duration of attack from the start until the current moment (updated every 5
+     * minutes).
+     * 
+ * + * .google.protobuf.Duration duration = 6; + */ + public Builder mergeDuration(com.google.protobuf.Duration value) { + if (durationBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && duration_ != null + && duration_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDurationBuilder().mergeFrom(value); + } else { + duration_ = value; + } + } else { + durationBuilder_.mergeFrom(value); + } + if (duration_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Duration of attack from the start until the current moment (updated every 5
+     * minutes).
+     * 
+ * + * .google.protobuf.Duration duration = 6; + */ + public Builder clearDuration() { + bitField0_ = (bitField0_ & ~0x00000020); + duration_ = null; + if (durationBuilder_ != null) { + durationBuilder_.dispose(); + durationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Duration of attack from the start until the current moment (updated every 5
+     * minutes).
+     * 
+ * + * .google.protobuf.Duration duration = 6; + */ + public com.google.protobuf.Duration.Builder getDurationBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Duration of attack from the start until the current moment (updated every 5
+     * minutes).
+     * 
+ * + * .google.protobuf.Duration duration = 6; + */ + public com.google.protobuf.DurationOrBuilder getDurationOrBuilder() { + if (durationBuilder_ != null) { + return durationBuilder_.getMessageOrBuilder(); + } else { + return duration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : duration_; + } + } + /** + * + * + *
+     * Duration of attack from the start until the current moment (updated every 5
+     * minutes).
+     * 
+ * + * .google.protobuf.Duration duration = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDurationFieldBuilder() { + if (durationBuilder_ == null) { + durationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDuration(), getParentForChildren(), isClean()); + duration_ = null; + } + return durationBuilder_; + } + + @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.securitycenter.v2.CloudArmor) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.CloudArmor) + private static final com.google.cloud.securitycenter.v2.CloudArmor DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.CloudArmor(); + } + + public static com.google.cloud.securitycenter.v2.CloudArmor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudArmor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.CloudArmor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudArmorOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudArmorOrBuilder.java new file mode 100644 index 000000000000..a0f2ad9a5943 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudArmorOrBuilder.java @@ -0,0 +1,251 @@ +/* + * Copyright 2024 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/securitycenter/v2/cloud_armor.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public interface CloudArmorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.CloudArmor) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Information about the [Google Cloud Armor security
+   * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+   * relevant to the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + * + * @return Whether the securityPolicy field is set. + */ + boolean hasSecurityPolicy(); + /** + * + * + *
+   * Information about the [Google Cloud Armor security
+   * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+   * relevant to the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + * + * @return The securityPolicy. + */ + com.google.cloud.securitycenter.v2.SecurityPolicy getSecurityPolicy(); + /** + * + * + *
+   * Information about the [Google Cloud Armor security
+   * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+   * relevant to the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.SecurityPolicy security_policy = 1; + */ + com.google.cloud.securitycenter.v2.SecurityPolicyOrBuilder getSecurityPolicyOrBuilder(); + + /** + * + * + *
+   * Information about incoming requests evaluated by [Google Cloud Armor
+   * security
+   * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+   * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + * + * @return Whether the requests field is set. + */ + boolean hasRequests(); + /** + * + * + *
+   * Information about incoming requests evaluated by [Google Cloud Armor
+   * security
+   * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+   * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + * + * @return The requests. + */ + com.google.cloud.securitycenter.v2.Requests getRequests(); + /** + * + * + *
+   * Information about incoming requests evaluated by [Google Cloud Armor
+   * security
+   * policies](https://cloud.google.com/armor/docs/security-policy-overview).
+   * 
+ * + * .google.cloud.securitycenter.v2.Requests requests = 2; + */ + com.google.cloud.securitycenter.v2.RequestsOrBuilder getRequestsOrBuilder(); + + /** + * + * + *
+   * Information about potential Layer 7 DDoS attacks identified by [Google
+   * Cloud Armor Adaptive
+   * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+   * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + * + * @return Whether the adaptiveProtection field is set. + */ + boolean hasAdaptiveProtection(); + /** + * + * + *
+   * Information about potential Layer 7 DDoS attacks identified by [Google
+   * Cloud Armor Adaptive
+   * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+   * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + * + * @return The adaptiveProtection. + */ + com.google.cloud.securitycenter.v2.AdaptiveProtection getAdaptiveProtection(); + /** + * + * + *
+   * Information about potential Layer 7 DDoS attacks identified by [Google
+   * Cloud Armor Adaptive
+   * Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
+   * 
+ * + * .google.cloud.securitycenter.v2.AdaptiveProtection adaptive_protection = 3; + */ + com.google.cloud.securitycenter.v2.AdaptiveProtectionOrBuilder getAdaptiveProtectionOrBuilder(); + + /** + * + * + *
+   * Information about DDoS attack volume and classification.
+   * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + * + * @return Whether the attack field is set. + */ + boolean hasAttack(); + /** + * + * + *
+   * Information about DDoS attack volume and classification.
+   * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + * + * @return The attack. + */ + com.google.cloud.securitycenter.v2.Attack getAttack(); + /** + * + * + *
+   * Information about DDoS attack volume and classification.
+   * 
+ * + * .google.cloud.securitycenter.v2.Attack attack = 4; + */ + com.google.cloud.securitycenter.v2.AttackOrBuilder getAttackOrBuilder(); + + /** + * + * + *
+   * Distinguish between volumetric & protocol DDoS attack and
+   * application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
+   * attacks, or "L_7" for Layer 7 DDoS attacks.
+   * 
+ * + * string threat_vector = 5; + * + * @return The threatVector. + */ + java.lang.String getThreatVector(); + /** + * + * + *
+   * Distinguish between volumetric & protocol DDoS attack and
+   * application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
+   * attacks, or "L_7" for Layer 7 DDoS attacks.
+   * 
+ * + * string threat_vector = 5; + * + * @return The bytes for threatVector. + */ + com.google.protobuf.ByteString getThreatVectorBytes(); + + /** + * + * + *
+   * Duration of attack from the start until the current moment (updated every 5
+   * minutes).
+   * 
+ * + * .google.protobuf.Duration duration = 6; + * + * @return Whether the duration field is set. + */ + boolean hasDuration(); + /** + * + * + *
+   * Duration of attack from the start until the current moment (updated every 5
+   * minutes).
+   * 
+ * + * .google.protobuf.Duration duration = 6; + * + * @return The duration. + */ + com.google.protobuf.Duration getDuration(); + /** + * + * + *
+   * Duration of attack from the start until the current moment (updated every 5
+   * minutes).
+   * 
+ * + * .google.protobuf.Duration duration = 6; + */ + com.google.protobuf.DurationOrBuilder getDurationOrBuilder(); +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudArmorProto.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudArmorProto.java new file mode 100644 index 000000000000..765130a8e839 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudArmorProto.java @@ -0,0 +1,141 @@ +/* + * Copyright 2024 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/securitycenter/v2/cloud_armor.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public final class CloudArmorProto { + private CloudArmorProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_CloudArmor_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_CloudArmor_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_SecurityPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_SecurityPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_Requests_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_Requests_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_AdaptiveProtection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_AdaptiveProtection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_Attack_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_Attack_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/securitycenter/v2/cloud_a" + + "rmor.proto\022\036google.cloud.securitycenter." + + "v2\032\036google/protobuf/duration.proto\"\336\002\n\nC" + + "loudArmor\022G\n\017security_policy\030\001 \001(\0132..goo" + + "gle.cloud.securitycenter.v2.SecurityPoli" + + "cy\022:\n\010requests\030\002 \001(\0132(.google.cloud.secu" + + "ritycenter.v2.Requests\022O\n\023adaptive_prote" + + "ction\030\003 \001(\01322.google.cloud.securitycente" + + "r.v2.AdaptiveProtection\0226\n\006attack\030\004 \001(\0132" + + "&.google.cloud.securitycenter.v2.Attack\022" + + "\025\n\rthreat_vector\030\005 \001(\t\022+\n\010duration\030\006 \001(\013" + + "2\031.google.protobuf.Duration\"=\n\016SecurityP" + + "olicy\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022\017\n\007pre" + + "view\030\003 \001(\010\"j\n\010Requests\022\r\n\005ratio\030\001 \001(\001\022\032\n" + + "\022short_term_allowed\030\002 \001(\005\022\031\n\021long_term_a" + + "llowed\030\003 \001(\005\022\030\n\020long_term_denied\030\004 \001(\005\"(" + + "\n\022AdaptiveProtection\022\022\n\nconfidence\030\001 \001(\001" + + "\"H\n\006Attack\022\022\n\nvolume_pps\030\001 \001(\005\022\022\n\nvolume" + + "_bps\030\002 \001(\005\022\026\n\016classification\030\003 \001(\tB\351\001\n\"c" + + "om.google.cloud.securitycenter.v2B\017Cloud" + + "ArmorProtoP\001ZJcloud.google.com/go/securi" + + "tycenter/apiv2/securitycenterpb;security" + + "centerpb\252\002\036Google.Cloud.SecurityCenter.V" + + "2\312\002\036Google\\Cloud\\SecurityCenter\\V2\352\002!Goo" + + "gle::Cloud::SecurityCenter::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DurationProto.getDescriptor(), + }); + internal_static_google_cloud_securitycenter_v2_CloudArmor_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v2_CloudArmor_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_CloudArmor_descriptor, + new java.lang.String[] { + "SecurityPolicy", + "Requests", + "AdaptiveProtection", + "Attack", + "ThreatVector", + "Duration", + }); + internal_static_google_cloud_securitycenter_v2_SecurityPolicy_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_securitycenter_v2_SecurityPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_SecurityPolicy_descriptor, + new java.lang.String[] { + "Name", "Type", "Preview", + }); + internal_static_google_cloud_securitycenter_v2_Requests_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_securitycenter_v2_Requests_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_Requests_descriptor, + new java.lang.String[] { + "Ratio", "ShortTermAllowed", "LongTermAllowed", "LongTermDenied", + }); + internal_static_google_cloud_securitycenter_v2_AdaptiveProtection_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_securitycenter_v2_AdaptiveProtection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_AdaptiveProtection_descriptor, + new java.lang.String[] { + "Confidence", + }); + internal_static_google_cloud_securitycenter_v2_Attack_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_securitycenter_v2_Attack_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_Attack_descriptor, + new java.lang.String[] { + "VolumePps", "VolumeBps", "Classification", + }); + com.google.protobuf.DurationProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudProvider.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudProvider.java new file mode 100644 index 000000000000..4abe42fb3010 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/CloudProvider.java @@ -0,0 +1,199 @@ +/* + * Copyright 2024 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/securitycenter/v2/resource.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +/** + * + * + *
+ * The cloud provider the finding pertains to.
+ * 
+ * + * Protobuf enum {@code google.cloud.securitycenter.v2.CloudProvider} + */ +public enum CloudProvider implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The cloud provider is unspecified.
+   * 
+ * + * CLOUD_PROVIDER_UNSPECIFIED = 0; + */ + CLOUD_PROVIDER_UNSPECIFIED(0), + /** + * + * + *
+   * The cloud provider is Google Cloud Platform.
+   * 
+ * + * GOOGLE_CLOUD_PLATFORM = 1; + */ + GOOGLE_CLOUD_PLATFORM(1), + /** + * + * + *
+   * The cloud provider is Amazon Web Services.
+   * 
+ * + * AMAZON_WEB_SERVICES = 2; + */ + AMAZON_WEB_SERVICES(2), + /** + * + * + *
+   * The cloud provider is Microsoft Azure.
+   * 
+ * + * MICROSOFT_AZURE = 3; + */ + MICROSOFT_AZURE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The cloud provider is unspecified.
+   * 
+ * + * CLOUD_PROVIDER_UNSPECIFIED = 0; + */ + public static final int CLOUD_PROVIDER_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The cloud provider is Google Cloud Platform.
+   * 
+ * + * GOOGLE_CLOUD_PLATFORM = 1; + */ + public static final int GOOGLE_CLOUD_PLATFORM_VALUE = 1; + /** + * + * + *
+   * The cloud provider is Amazon Web Services.
+   * 
+ * + * AMAZON_WEB_SERVICES = 2; + */ + public static final int AMAZON_WEB_SERVICES_VALUE = 2; + /** + * + * + *
+   * The cloud provider is Microsoft Azure.
+   * 
+ * + * MICROSOFT_AZURE = 3; + */ + public static final int MICROSOFT_AZURE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CloudProvider valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static CloudProvider forNumber(int value) { + switch (value) { + case 0: + return CLOUD_PROVIDER_UNSPECIFIED; + case 1: + return GOOGLE_CLOUD_PLATFORM; + case 2: + return AMAZON_WEB_SERVICES; + case 3: + return MICROSOFT_AZURE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CloudProvider findValueByNumber(int number) { + return CloudProvider.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto.getDescriptor().getEnumTypes().get(0); + } + + private static final CloudProvider[] VALUES = values(); + + public static CloudProvider valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private CloudProvider(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securitycenter.v2.CloudProvider) +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Finding.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Finding.java index e6259e56fb5c..1c2ad465fcb2 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Finding.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Finding.java @@ -3883,6 +3883,106 @@ public com.google.cloud.securitycenter.v2.LoadBalancerOrBuilder getLoadBalancers return loadBalancers_.get(index); } + public static final int CLOUD_ARMOR_FIELD_NUMBER = 51; + private com.google.cloud.securitycenter.v2.CloudArmor cloudArmor_; + /** + * + * + *
+   * Fields related to Cloud Armor findings.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + * + * @return Whether the cloudArmor field is set. + */ + @java.lang.Override + public boolean hasCloudArmor() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * + * + *
+   * Fields related to Cloud Armor findings.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + * + * @return The cloudArmor. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.CloudArmor getCloudArmor() { + return cloudArmor_ == null + ? com.google.cloud.securitycenter.v2.CloudArmor.getDefaultInstance() + : cloudArmor_; + } + /** + * + * + *
+   * Fields related to Cloud Armor findings.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.CloudArmorOrBuilder getCloudArmorOrBuilder() { + return cloudArmor_ == null + ? com.google.cloud.securitycenter.v2.CloudArmor.getDefaultInstance() + : cloudArmor_; + } + + public static final int NOTEBOOK_FIELD_NUMBER = 55; + private com.google.cloud.securitycenter.v2.Notebook notebook_; + /** + * + * + *
+   * Notebook associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + * + * @return Whether the notebook field is set. + */ + @java.lang.Override + public boolean hasNotebook() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * + * + *
+   * Notebook associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + * + * @return The notebook. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.Notebook getNotebook() { + return notebook_ == null + ? com.google.cloud.securitycenter.v2.Notebook.getDefaultInstance() + : notebook_; + } + /** + * + * + *
+   * Notebook associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.NotebookOrBuilder getNotebookOrBuilder() { + return notebook_ == null + ? com.google.cloud.securitycenter.v2.Notebook.getDefaultInstance() + : notebook_; + } + public static final int TOXIC_COMBINATION_FIELD_NUMBER = 56; private com.google.cloud.securitycenter.v2.ToxicCombination toxicCombination_; /** @@ -3902,7 +4002,7 @@ public com.google.cloud.securitycenter.v2.LoadBalancerOrBuilder getLoadBalancers */ @java.lang.Override public boolean hasToxicCombination() { - return ((bitField0_ & 0x00040000) != 0); + return ((bitField0_ & 0x00100000) != 0); } /** * @@ -4179,6 +4279,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeMessage(50, loadBalancers_.get(i)); } if (((bitField0_ & 0x00040000) != 0)) { + output.writeMessage(51, getCloudArmor()); + } + if (((bitField0_ & 0x00080000) != 0)) { + output.writeMessage(55, getNotebook()); + } + if (((bitField0_ & 0x00100000) != 0)) { output.writeMessage(56, getToxicCombination()); } for (int i = 0; i < groupMemberships_.size(); i++) { @@ -4359,6 +4465,12 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(50, loadBalancers_.get(i)); } if (((bitField0_ & 0x00040000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(51, getCloudArmor()); + } + if (((bitField0_ & 0x00080000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(55, getNotebook()); + } + if (((bitField0_ & 0x00100000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(56, getToxicCombination()); } for (int i = 0; i < groupMemberships_.size(); i++) { @@ -4480,6 +4592,14 @@ public boolean equals(final java.lang.Object obj) { } if (!getLogEntriesList().equals(other.getLogEntriesList())) return false; if (!getLoadBalancersList().equals(other.getLoadBalancersList())) return false; + if (hasCloudArmor() != other.hasCloudArmor()) return false; + if (hasCloudArmor()) { + if (!getCloudArmor().equals(other.getCloudArmor())) return false; + } + if (hasNotebook() != other.hasNotebook()) return false; + if (hasNotebook()) { + if (!getNotebook().equals(other.getNotebook())) return false; + } if (hasToxicCombination() != other.hasToxicCombination()) return false; if (hasToxicCombination()) { if (!getToxicCombination().equals(other.getToxicCombination())) return false; @@ -4646,6 +4766,14 @@ public int hashCode() { hash = (37 * hash) + LOAD_BALANCERS_FIELD_NUMBER; hash = (53 * hash) + getLoadBalancersList().hashCode(); } + if (hasCloudArmor()) { + hash = (37 * hash) + CLOUD_ARMOR_FIELD_NUMBER; + hash = (53 * hash) + getCloudArmor().hashCode(); + } + if (hasNotebook()) { + hash = (37 * hash) + NOTEBOOK_FIELD_NUMBER; + hash = (53 * hash) + getNotebook().hashCode(); + } if (hasToxicCombination()) { hash = (37 * hash) + TOXIC_COMBINATION_FIELD_NUMBER; hash = (53 * hash) + getToxicCombination().hashCode(); @@ -4857,6 +4985,8 @@ private void maybeForceBuilderInitialization() { getSecurityPostureFieldBuilder(); getLogEntriesFieldBuilder(); getLoadBalancersFieldBuilder(); + getCloudArmorFieldBuilder(); + getNotebookFieldBuilder(); getToxicCombinationFieldBuilder(); getGroupMembershipsFieldBuilder(); } @@ -5038,6 +5168,16 @@ public Builder clear() { loadBalancersBuilder_.clear(); } bitField1_ = (bitField1_ & ~0x00001000); + cloudArmor_ = null; + if (cloudArmorBuilder_ != null) { + cloudArmorBuilder_.dispose(); + cloudArmorBuilder_ = null; + } + notebook_ = null; + if (notebookBuilder_ != null) { + notebookBuilder_.dispose(); + notebookBuilder_ = null; + } toxicCombination_ = null; if (toxicCombinationBuilder_ != null) { toxicCombinationBuilder_.dispose(); @@ -5049,7 +5189,7 @@ public Builder clear() { groupMemberships_ = null; groupMembershipsBuilder_.clear(); } - bitField1_ = (bitField1_ & ~0x00004000); + bitField1_ = (bitField1_ & ~0x00010000); return this; } @@ -5171,9 +5311,9 @@ private void buildPartialRepeatedFields(com.google.cloud.securitycenter.v2.Findi result.loadBalancers_ = loadBalancersBuilder_.build(); } if (groupMembershipsBuilder_ == null) { - if (((bitField1_ & 0x00004000) != 0)) { + if (((bitField1_ & 0x00010000) != 0)) { groupMemberships_ = java.util.Collections.unmodifiableList(groupMemberships_); - bitField1_ = (bitField1_ & ~0x00004000); + bitField1_ = (bitField1_ & ~0x00010000); } result.groupMemberships_ = groupMemberships_; } else { @@ -5337,9 +5477,17 @@ private void buildPartial1(com.google.cloud.securitycenter.v2.Finding result) { to_bitField0_ |= 0x00020000; } if (((from_bitField1_ & 0x00002000) != 0)) { + result.cloudArmor_ = cloudArmorBuilder_ == null ? cloudArmor_ : cloudArmorBuilder_.build(); + to_bitField0_ |= 0x00040000; + } + if (((from_bitField1_ & 0x00004000) != 0)) { + result.notebook_ = notebookBuilder_ == null ? notebook_ : notebookBuilder_.build(); + to_bitField0_ |= 0x00080000; + } + if (((from_bitField1_ & 0x00008000) != 0)) { result.toxicCombination_ = toxicCombinationBuilder_ == null ? toxicCombination_ : toxicCombinationBuilder_.build(); - to_bitField0_ |= 0x00040000; + to_bitField0_ |= 0x00100000; } result.bitField0_ |= to_bitField0_; } @@ -5759,6 +5907,12 @@ public Builder mergeFrom(com.google.cloud.securitycenter.v2.Finding other) { } } } + if (other.hasCloudArmor()) { + mergeCloudArmor(other.getCloudArmor()); + } + if (other.hasNotebook()) { + mergeNotebook(other.getNotebook()); + } if (other.hasToxicCombination()) { mergeToxicCombination(other.getToxicCombination()); } @@ -5766,7 +5920,7 @@ public Builder mergeFrom(com.google.cloud.securitycenter.v2.Finding other) { if (!other.groupMemberships_.isEmpty()) { if (groupMemberships_.isEmpty()) { groupMemberships_ = other.groupMemberships_; - bitField1_ = (bitField1_ & ~0x00004000); + bitField1_ = (bitField1_ & ~0x00010000); } else { ensureGroupMembershipsIsMutable(); groupMemberships_.addAll(other.groupMemberships_); @@ -5779,7 +5933,7 @@ public Builder mergeFrom(com.google.cloud.securitycenter.v2.Finding other) { groupMembershipsBuilder_.dispose(); groupMembershipsBuilder_ = null; groupMemberships_ = other.groupMemberships_; - bitField1_ = (bitField1_ & ~0x00004000); + bitField1_ = (bitField1_ & ~0x00010000); groupMembershipsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getGroupMembershipsFieldBuilder() @@ -6175,11 +6329,23 @@ public Builder mergeFrom( } break; } // case 402 + case 410: + { + input.readMessage(getCloudArmorFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00002000; + break; + } // case 410 + case 442: + { + input.readMessage(getNotebookFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00004000; + break; + } // case 442 case 450: { input.readMessage( getToxicCombinationFieldBuilder().getBuilder(), extensionRegistry); - bitField1_ |= 0x00002000; + bitField1_ |= 0x00008000; break; } // case 450 case 458: @@ -15725,6 +15891,378 @@ public com.google.cloud.securitycenter.v2.LoadBalancer.Builder addLoadBalancersB return loadBalancersBuilder_; } + private com.google.cloud.securitycenter.v2.CloudArmor cloudArmor_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.CloudArmor, + com.google.cloud.securitycenter.v2.CloudArmor.Builder, + com.google.cloud.securitycenter.v2.CloudArmorOrBuilder> + cloudArmorBuilder_; + /** + * + * + *
+     * Fields related to Cloud Armor findings.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + * + * @return Whether the cloudArmor field is set. + */ + public boolean hasCloudArmor() { + return ((bitField1_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Fields related to Cloud Armor findings.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + * + * @return The cloudArmor. + */ + public com.google.cloud.securitycenter.v2.CloudArmor getCloudArmor() { + if (cloudArmorBuilder_ == null) { + return cloudArmor_ == null + ? com.google.cloud.securitycenter.v2.CloudArmor.getDefaultInstance() + : cloudArmor_; + } else { + return cloudArmorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Fields related to Cloud Armor findings.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + */ + public Builder setCloudArmor(com.google.cloud.securitycenter.v2.CloudArmor value) { + if (cloudArmorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cloudArmor_ = value; + } else { + cloudArmorBuilder_.setMessage(value); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Fields related to Cloud Armor findings.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + */ + public Builder setCloudArmor( + com.google.cloud.securitycenter.v2.CloudArmor.Builder builderForValue) { + if (cloudArmorBuilder_ == null) { + cloudArmor_ = builderForValue.build(); + } else { + cloudArmorBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Fields related to Cloud Armor findings.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + */ + public Builder mergeCloudArmor(com.google.cloud.securitycenter.v2.CloudArmor value) { + if (cloudArmorBuilder_ == null) { + if (((bitField1_ & 0x00002000) != 0) + && cloudArmor_ != null + && cloudArmor_ != com.google.cloud.securitycenter.v2.CloudArmor.getDefaultInstance()) { + getCloudArmorBuilder().mergeFrom(value); + } else { + cloudArmor_ = value; + } + } else { + cloudArmorBuilder_.mergeFrom(value); + } + if (cloudArmor_ != null) { + bitField1_ |= 0x00002000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Fields related to Cloud Armor findings.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + */ + public Builder clearCloudArmor() { + bitField1_ = (bitField1_ & ~0x00002000); + cloudArmor_ = null; + if (cloudArmorBuilder_ != null) { + cloudArmorBuilder_.dispose(); + cloudArmorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Fields related to Cloud Armor findings.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + */ + public com.google.cloud.securitycenter.v2.CloudArmor.Builder getCloudArmorBuilder() { + bitField1_ |= 0x00002000; + onChanged(); + return getCloudArmorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Fields related to Cloud Armor findings.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + */ + public com.google.cloud.securitycenter.v2.CloudArmorOrBuilder getCloudArmorOrBuilder() { + if (cloudArmorBuilder_ != null) { + return cloudArmorBuilder_.getMessageOrBuilder(); + } else { + return cloudArmor_ == null + ? com.google.cloud.securitycenter.v2.CloudArmor.getDefaultInstance() + : cloudArmor_; + } + } + /** + * + * + *
+     * Fields related to Cloud Armor findings.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.CloudArmor, + com.google.cloud.securitycenter.v2.CloudArmor.Builder, + com.google.cloud.securitycenter.v2.CloudArmorOrBuilder> + getCloudArmorFieldBuilder() { + if (cloudArmorBuilder_ == null) { + cloudArmorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.CloudArmor, + com.google.cloud.securitycenter.v2.CloudArmor.Builder, + com.google.cloud.securitycenter.v2.CloudArmorOrBuilder>( + getCloudArmor(), getParentForChildren(), isClean()); + cloudArmor_ = null; + } + return cloudArmorBuilder_; + } + + private com.google.cloud.securitycenter.v2.Notebook notebook_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.Notebook, + com.google.cloud.securitycenter.v2.Notebook.Builder, + com.google.cloud.securitycenter.v2.NotebookOrBuilder> + notebookBuilder_; + /** + * + * + *
+     * Notebook associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + * + * @return Whether the notebook field is set. + */ + public boolean hasNotebook() { + return ((bitField1_ & 0x00004000) != 0); + } + /** + * + * + *
+     * Notebook associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + * + * @return The notebook. + */ + public com.google.cloud.securitycenter.v2.Notebook getNotebook() { + if (notebookBuilder_ == null) { + return notebook_ == null + ? com.google.cloud.securitycenter.v2.Notebook.getDefaultInstance() + : notebook_; + } else { + return notebookBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Notebook associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + */ + public Builder setNotebook(com.google.cloud.securitycenter.v2.Notebook value) { + if (notebookBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + notebook_ = value; + } else { + notebookBuilder_.setMessage(value); + } + bitField1_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Notebook associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + */ + public Builder setNotebook( + com.google.cloud.securitycenter.v2.Notebook.Builder builderForValue) { + if (notebookBuilder_ == null) { + notebook_ = builderForValue.build(); + } else { + notebookBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Notebook associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + */ + public Builder mergeNotebook(com.google.cloud.securitycenter.v2.Notebook value) { + if (notebookBuilder_ == null) { + if (((bitField1_ & 0x00004000) != 0) + && notebook_ != null + && notebook_ != com.google.cloud.securitycenter.v2.Notebook.getDefaultInstance()) { + getNotebookBuilder().mergeFrom(value); + } else { + notebook_ = value; + } + } else { + notebookBuilder_.mergeFrom(value); + } + if (notebook_ != null) { + bitField1_ |= 0x00004000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Notebook associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + */ + public Builder clearNotebook() { + bitField1_ = (bitField1_ & ~0x00004000); + notebook_ = null; + if (notebookBuilder_ != null) { + notebookBuilder_.dispose(); + notebookBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Notebook associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + */ + public com.google.cloud.securitycenter.v2.Notebook.Builder getNotebookBuilder() { + bitField1_ |= 0x00004000; + onChanged(); + return getNotebookFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Notebook associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + */ + public com.google.cloud.securitycenter.v2.NotebookOrBuilder getNotebookOrBuilder() { + if (notebookBuilder_ != null) { + return notebookBuilder_.getMessageOrBuilder(); + } else { + return notebook_ == null + ? com.google.cloud.securitycenter.v2.Notebook.getDefaultInstance() + : notebook_; + } + } + /** + * + * + *
+     * Notebook associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.Notebook, + com.google.cloud.securitycenter.v2.Notebook.Builder, + com.google.cloud.securitycenter.v2.NotebookOrBuilder> + getNotebookFieldBuilder() { + if (notebookBuilder_ == null) { + notebookBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.Notebook, + com.google.cloud.securitycenter.v2.Notebook.Builder, + com.google.cloud.securitycenter.v2.NotebookOrBuilder>( + getNotebook(), getParentForChildren(), isClean()); + notebook_ = null; + } + return notebookBuilder_; + } + private com.google.cloud.securitycenter.v2.ToxicCombination toxicCombination_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.securitycenter.v2.ToxicCombination, @@ -15747,7 +16285,7 @@ public com.google.cloud.securitycenter.v2.LoadBalancer.Builder addLoadBalancersB * @return Whether the toxicCombination field is set. */ public boolean hasToxicCombination() { - return ((bitField1_ & 0x00002000) != 0); + return ((bitField1_ & 0x00008000) != 0); } /** * @@ -15795,7 +16333,7 @@ public Builder setToxicCombination(com.google.cloud.securitycenter.v2.ToxicCombi } else { toxicCombinationBuilder_.setMessage(value); } - bitField1_ |= 0x00002000; + bitField1_ |= 0x00008000; onChanged(); return this; } @@ -15819,7 +16357,7 @@ public Builder setToxicCombination( } else { toxicCombinationBuilder_.setMessage(builderForValue.build()); } - bitField1_ |= 0x00002000; + bitField1_ |= 0x00008000; onChanged(); return this; } @@ -15839,7 +16377,7 @@ public Builder setToxicCombination( public Builder mergeToxicCombination( com.google.cloud.securitycenter.v2.ToxicCombination value) { if (toxicCombinationBuilder_ == null) { - if (((bitField1_ & 0x00002000) != 0) + if (((bitField1_ & 0x00008000) != 0) && toxicCombination_ != null && toxicCombination_ != com.google.cloud.securitycenter.v2.ToxicCombination.getDefaultInstance()) { @@ -15851,7 +16389,7 @@ public Builder mergeToxicCombination( toxicCombinationBuilder_.mergeFrom(value); } if (toxicCombination_ != null) { - bitField1_ |= 0x00002000; + bitField1_ |= 0x00008000; onChanged(); } return this; @@ -15870,7 +16408,7 @@ public Builder mergeToxicCombination( * .google.cloud.securitycenter.v2.ToxicCombination toxic_combination = 56; */ public Builder clearToxicCombination() { - bitField1_ = (bitField1_ & ~0x00002000); + bitField1_ = (bitField1_ & ~0x00008000); toxicCombination_ = null; if (toxicCombinationBuilder_ != null) { toxicCombinationBuilder_.dispose(); @@ -15894,7 +16432,7 @@ public Builder clearToxicCombination() { */ public com.google.cloud.securitycenter.v2.ToxicCombination.Builder getToxicCombinationBuilder() { - bitField1_ |= 0x00002000; + bitField1_ |= 0x00008000; onChanged(); return getToxicCombinationFieldBuilder().getBuilder(); } @@ -15955,11 +16493,11 @@ public Builder clearToxicCombination() { java.util.Collections.emptyList(); private void ensureGroupMembershipsIsMutable() { - if (!((bitField1_ & 0x00004000) != 0)) { + if (!((bitField1_ & 0x00010000) != 0)) { groupMemberships_ = new java.util.ArrayList( groupMemberships_); - bitField1_ |= 0x00004000; + bitField1_ |= 0x00010000; } } @@ -16200,7 +16738,7 @@ public Builder addAllGroupMemberships( public Builder clearGroupMemberships() { if (groupMembershipsBuilder_ == null) { groupMemberships_ = java.util.Collections.emptyList(); - bitField1_ = (bitField1_ & ~0x00004000); + bitField1_ = (bitField1_ & ~0x00010000); onChanged(); } else { groupMembershipsBuilder_.clear(); @@ -16341,7 +16879,7 @@ public com.google.cloud.securitycenter.v2.GroupMembership.Builder addGroupMember com.google.cloud.securitycenter.v2.GroupMembership.Builder, com.google.cloud.securitycenter.v2.GroupMembershipOrBuilder>( groupMemberships_, - ((bitField1_ & 0x00004000) != 0), + ((bitField1_ & 0x00010000) != 0), getParentForChildren(), isClean()); groupMemberships_ = null; diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FindingOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FindingOrBuilder.java index 1825e046a5ff..002accf42449 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FindingOrBuilder.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FindingOrBuilder.java @@ -1993,6 +1993,76 @@ com.google.cloud.securitycenter.v2.ContactDetails getContactsOrDefault( */ com.google.cloud.securitycenter.v2.LoadBalancerOrBuilder getLoadBalancersOrBuilder(int index); + /** + * + * + *
+   * Fields related to Cloud Armor findings.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + * + * @return Whether the cloudArmor field is set. + */ + boolean hasCloudArmor(); + /** + * + * + *
+   * Fields related to Cloud Armor findings.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + * + * @return The cloudArmor. + */ + com.google.cloud.securitycenter.v2.CloudArmor getCloudArmor(); + /** + * + * + *
+   * Fields related to Cloud Armor findings.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudArmor cloud_armor = 51; + */ + com.google.cloud.securitycenter.v2.CloudArmorOrBuilder getCloudArmorOrBuilder(); + + /** + * + * + *
+   * Notebook associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + * + * @return Whether the notebook field is set. + */ + boolean hasNotebook(); + /** + * + * + *
+   * Notebook associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + * + * @return The notebook. + */ + com.google.cloud.securitycenter.v2.Notebook getNotebook(); + /** + * + * + *
+   * Notebook associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.Notebook notebook = 55; + */ + com.google.cloud.securitycenter.v2.NotebookOrBuilder getNotebookOrBuilder(); + /** * * diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FindingProto.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FindingProto.java index 7927d66a93d6..22c4c0ae0fc5 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FindingProto.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FindingProto.java @@ -61,143 +61,149 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "curitycenter/v2/application.proto\0324googl" + "e/cloud/securitycenter/v2/attack_exposur" + "e.proto\032=google/cloud/securitycenter/v2/" - + "backup_disaster_recovery.proto\032;google/c" - + "loud/securitycenter/v2/cloud_dlp_data_pr" - + "ofile.proto\0329google/cloud/securitycenter" - + "/v2/cloud_dlp_inspection.proto\032/google/c" - + "loud/securitycenter/v2/compliance.proto\032" - + "/google/cloud/securitycenter/v2/connecti" - + "on.proto\0324google/cloud/securitycenter/v2" - + "/contact_details.proto\032.google/cloud/sec" - + "uritycenter/v2/container.proto\032-google/c" - + "loud/securitycenter/v2/database.proto\0321g" - + "oogle/cloud/securitycenter/v2/exfiltrati" - + "on.proto\0324google/cloud/securitycenter/v2" - + "/external_system.proto\032)google/cloud/sec" - + "uritycenter/v2/file.proto\0325google/cloud/" - + "securitycenter/v2/group_membership.proto" - + "\0320google/cloud/securitycenter/v2/iam_bin" - + "ding.proto\032.google/cloud/securitycenter/" - + "v2/indicator.proto\0323google/cloud/securit" - + "ycenter/v2/kernel_rootkit.proto\032/google/" - + "cloud/securitycenter/v2/kubernetes.proto" - + "\0322google/cloud/securitycenter/v2/load_ba" - + "lancer.proto\032.google/cloud/securitycente" - + "r/v2/log_entry.proto\0321google/cloud/secur" - + "itycenter/v2/mitre_attack.proto\032/google/" - + "cloud/securitycenter/v2/org_policy.proto" - + "\032,google/cloud/securitycenter/v2/process" - + ".proto\0323google/cloud/securitycenter/v2/s" - + "ecurity_marks.proto\0325google/cloud/securi" - + "tycenter/v2/security_posture.proto\0326goog" - + "le/cloud/securitycenter/v2/toxic_combina" - + "tion.proto\0322google/cloud/securitycenter/" - + "v2/vulnerability.proto\032\034google/protobuf/" - + "struct.proto\032\037google/protobuf/timestamp." - + "proto\"\266\036\n\007Finding\022\014\n\004name\030\001 \001(\t\022\033\n\016canon" - + "ical_name\030\002 \001(\tB\003\340A\003\022\016\n\006parent\030\003 \001(\t\022\032\n\r" - + "resource_name\030\004 \001(\tB\003\340A\005\022A\n\005state\030\006 \001(\0162" - + "-.google.cloud.securitycenter.v2.Finding" - + ".StateB\003\340A\003\022\025\n\010category\030\007 \001(\tB\003\340A\005\022\024\n\014ex" - + "ternal_uri\030\010 \001(\t\022X\n\021source_properties\030\t " - + "\003(\0132=.google.cloud.securitycenter.v2.Fin" - + "ding.SourcePropertiesEntry\022J\n\016security_m" - + "arks\030\n \001(\0132-.google.cloud.securitycenter" - + ".v2.SecurityMarksB\003\340A\003\022.\n\nevent_time\030\013 \001" - + "(\0132\032.google.protobuf.Timestamp\0224\n\013create" - + "_time\030\014 \001(\0132\032.google.protobuf.TimestampB" - + "\003\340A\003\022B\n\010severity\030\016 \001(\01620.google.cloud.se" - + "curitycenter.v2.Finding.Severity\022:\n\004mute" - + "\030\017 \001(\0162,.google.cloud.securitycenter.v2." - + "Finding.Mute\022K\n\rfinding_class\030\020 \001(\01624.go" - + "ogle.cloud.securitycenter.v2.Finding.Fin" - + "dingClass\022<\n\tindicator\030\021 \001(\0132).google.cl" - + "oud.securitycenter.v2.Indicator\022D\n\rvulne" - + "rability\030\022 \001(\0132-.google.cloud.securityce" - + "nter.v2.Vulnerability\0229\n\020mute_update_tim" - + "e\030\023 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" - + "\022[\n\020external_systems\030\024 \003(\0132<.google.clou" - + "d.securitycenter.v2.Finding.ExternalSyst" - + "emsEntryB\003\340A\003\022A\n\014mitre_attack\030\025 \001(\0132+.go" - + "ogle.cloud.securitycenter.v2.MitreAttack" - + "\0226\n\006access\030\026 \001(\0132&.google.cloud.security" - + "center.v2.Access\022?\n\013connections\030\027 \003(\0132*." - + "google.cloud.securitycenter.v2.Connectio" - + "n\022\026\n\016mute_initiator\030\030 \001(\t\022:\n\tprocesses\030\031" - + " \003(\0132\'.google.cloud.securitycenter.v2.Pr" - + "ocess\022L\n\010contacts\030\032 \003(\01325.google.cloud.s" - + "ecuritycenter.v2.Finding.ContactsEntryB\003" - + "\340A\003\022?\n\013compliances\030\033 \003(\0132*.google.cloud." - + "securitycenter.v2.Compliance\022 \n\023parent_d" - + "isplay_name\030\035 \001(\tB\003\340A\003\022\023\n\013description\030\036 " - + "\001(\t\022B\n\014exfiltration\030\037 \001(\0132,.google.cloud" - + ".securitycenter.v2.Exfiltration\022@\n\014iam_b" - + "indings\030 \003(\0132*.google.cloud.securitycen" - + "ter.v2.IamBinding\022\022\n\nnext_steps\030! \001(\t\022\023\n" - + "\013module_name\030\" \001(\t\022=\n\ncontainers\030# \003(\0132)" - + ".google.cloud.securitycenter.v2.Containe" - + "r\022>\n\nkubernetes\030$ \001(\0132*.google.cloud.sec" - + "uritycenter.v2.Kubernetes\022:\n\010database\030% " - + "\001(\0132(.google.cloud.securitycenter.v2.Dat" - + "abase\022G\n\017attack_exposure\030& \001(\0132..google." - + "cloud.securitycenter.v2.AttackExposure\0223" - + "\n\005files\030\' \003(\0132$.google.cloud.securitycen" - + "ter.v2.File\022P\n\024cloud_dlp_inspection\030( \001(" - + "\01322.google.cloud.securitycenter.v2.Cloud" - + "DlpInspection\022S\n\026cloud_dlp_data_profile\030" - + ") \001(\01323.google.cloud.securitycenter.v2.C" - + "loudDlpDataProfile\022E\n\016kernel_rootkit\030* \001" - + "(\0132-.google.cloud.securitycenter.v2.Kern" - + "elRootkit\022?\n\014org_policies\030+ \003(\0132).google" - + ".cloud.securitycenter.v2.OrgPolicy\022@\n\013ap" - + "plication\030- \001(\0132+.google.cloud.securityc" - + "enter.v2.Application\022X\n\030backup_disaster_" - + "recovery\030/ \001(\01326.google.cloud.securityce" - + "nter.v2.BackupDisasterRecovery\022I\n\020securi" - + "ty_posture\0300 \001(\0132/.google.cloud.security" - + "center.v2.SecurityPosture\022=\n\013log_entries" - + "\0301 \003(\0132(.google.cloud.securitycenter.v2." - + "LogEntry\022D\n\016load_balancers\0302 \003(\0132,.googl" - + "e.cloud.securitycenter.v2.LoadBalancer\022K" - + "\n\021toxic_combination\0308 \001(\01320.google.cloud" - + ".securitycenter.v2.ToxicCombination\022J\n\021g" - + "roup_memberships\0309 \003(\0132/.google.cloud.se" - + "curitycenter.v2.GroupMembership\032O\n\025Sourc" - + "ePropertiesEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002" - + " \001(\0132\026.google.protobuf.Value:\0028\001\032f\n\024Exte" - + "rnalSystemsEntry\022\013\n\003key\030\001 \001(\t\022=\n\005value\030\002" - + " \001(\0132..google.cloud.securitycenter.v2.Ex" - + "ternalSystem:\0028\001\032_\n\rContactsEntry\022\013\n\003key" - + "\030\001 \001(\t\022=\n\005value\030\002 \001(\0132..google.cloud.sec" - + "uritycenter.v2.ContactDetails:\0028\001\"8\n\005Sta" - + "te\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022\014\n" - + "\010INACTIVE\020\002\"Q\n\010Severity\022\030\n\024SEVERITY_UNSP" - + "ECIFIED\020\000\022\014\n\010CRITICAL\020\001\022\010\n\004HIGH\020\002\022\n\n\006MED" - + "IUM\020\003\022\007\n\003LOW\020\004\"C\n\004Mute\022\024\n\020MUTE_UNSPECIFI" - + "ED\020\000\022\t\n\005MUTED\020\001\022\013\n\007UNMUTED\020\002\022\r\n\tUNDEFINE" - + "D\020\003\"\260\001\n\014FindingClass\022\035\n\031FINDING_CLASS_UN" - + "SPECIFIED\020\000\022\n\n\006THREAT\020\001\022\021\n\rVULNERABILITY" - + "\020\002\022\024\n\020MISCONFIGURATION\020\003\022\017\n\013OBSERVATION\020" - + "\004\022\r\n\tSCC_ERROR\020\005\022\025\n\021POSTURE_VIOLATION\020\006\022" - + "\025\n\021TOXIC_COMBINATION\020\007:\335\003\352A\331\003\n%securityc" - + "enter.googleapis.com/Finding\022@organizati" - + "ons/{organization}/sources/{source}/find" - + "ings/{finding}\022Uorganizations/{organizat" - + "ion}/sources/{source}/locations/{locatio" - + "n}/findings/{finding}\0224folders/{folder}/" - + "sources/{source}/findings/{finding}\022Ifol" - + "ders/{folder}/sources/{source}/locations" - + "/{location}/findings/{finding}\0226projects" - + "/{project}/sources/{source}/findings/{fi" - + "nding}\022Kprojects/{project}/sources/{sour" + + "backup_disaster_recovery.proto\0320google/c" + + "loud/securitycenter/v2/cloud_armor.proto" + + "\032;google/cloud/securitycenter/v2/cloud_d" + + "lp_data_profile.proto\0329google/cloud/secu" + + "ritycenter/v2/cloud_dlp_inspection.proto" + + "\032/google/cloud/securitycenter/v2/complia" + + "nce.proto\032/google/cloud/securitycenter/v" + + "2/connection.proto\0324google/cloud/securit" + + "ycenter/v2/contact_details.proto\032.google" + + "/cloud/securitycenter/v2/container.proto" + + "\032-google/cloud/securitycenter/v2/databas" + + "e.proto\0321google/cloud/securitycenter/v2/" + + "exfiltration.proto\0324google/cloud/securit" + + "ycenter/v2/external_system.proto\032)google" + + "/cloud/securitycenter/v2/file.proto\0325goo" + + "gle/cloud/securitycenter/v2/group_member" + + "ship.proto\0320google/cloud/securitycenter/" + + "v2/iam_binding.proto\032.google/cloud/secur" + + "itycenter/v2/indicator.proto\0323google/clo" + + "ud/securitycenter/v2/kernel_rootkit.prot" + + "o\032/google/cloud/securitycenter/v2/kubern" + + "etes.proto\0322google/cloud/securitycenter/" + + "v2/load_balancer.proto\032.google/cloud/sec" + + "uritycenter/v2/log_entry.proto\0321google/c" + + "loud/securitycenter/v2/mitre_attack.prot" + + "o\032-google/cloud/securitycenter/v2/notebo" + + "ok.proto\032/google/cloud/securitycenter/v2" + + "/org_policy.proto\032,google/cloud/security" + + "center/v2/process.proto\0323google/cloud/se" + + "curitycenter/v2/security_marks.proto\0325go" + + "ogle/cloud/securitycenter/v2/security_po" + + "sture.proto\0326google/cloud/securitycenter" + + "/v2/toxic_combination.proto\0322google/clou" + + "d/securitycenter/v2/vulnerability.proto\032" + + "\034google/protobuf/struct.proto\032\037google/pr" + + "otobuf/timestamp.proto\"\263\037\n\007Finding\022\014\n\004na" + + "me\030\001 \001(\t\022\033\n\016canonical_name\030\002 \001(\tB\003\340A\003\022\016\n" + + "\006parent\030\003 \001(\t\022\032\n\rresource_name\030\004 \001(\tB\003\340A" + + "\005\022A\n\005state\030\006 \001(\0162-.google.cloud.security" + + "center.v2.Finding.StateB\003\340A\003\022\025\n\010category" + + "\030\007 \001(\tB\003\340A\005\022\024\n\014external_uri\030\010 \001(\t\022X\n\021sou" + + "rce_properties\030\t \003(\0132=.google.cloud.secu" + + "ritycenter.v2.Finding.SourcePropertiesEn" + + "try\022J\n\016security_marks\030\n \001(\0132-.google.clo" + + "ud.securitycenter.v2.SecurityMarksB\003\340A\003\022" + + ".\n\nevent_time\030\013 \001(\0132\032.google.protobuf.Ti" + + "mestamp\0224\n\013create_time\030\014 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\022B\n\010severity\030\016 \001(\0162" + + "0.google.cloud.securitycenter.v2.Finding" + + ".Severity\022:\n\004mute\030\017 \001(\0162,.google.cloud.s" + + "ecuritycenter.v2.Finding.Mute\022K\n\rfinding" + + "_class\030\020 \001(\01624.google.cloud.securitycent" + + "er.v2.Finding.FindingClass\022<\n\tindicator\030" + + "\021 \001(\0132).google.cloud.securitycenter.v2.I" + + "ndicator\022D\n\rvulnerability\030\022 \001(\0132-.google" + + ".cloud.securitycenter.v2.Vulnerability\0229" + + "\n\020mute_update_time\030\023 \001(\0132\032.google.protob" + + "uf.TimestampB\003\340A\003\022[\n\020external_systems\030\024 " + + "\003(\0132<.google.cloud.securitycenter.v2.Fin" + + "ding.ExternalSystemsEntryB\003\340A\003\022A\n\014mitre_" + + "attack\030\025 \001(\0132+.google.cloud.securitycent" + + "er.v2.MitreAttack\0226\n\006access\030\026 \001(\0132&.goog" + + "le.cloud.securitycenter.v2.Access\022?\n\013con" + + "nections\030\027 \003(\0132*.google.cloud.securityce" + + "nter.v2.Connection\022\026\n\016mute_initiator\030\030 \001" + + "(\t\022:\n\tprocesses\030\031 \003(\0132\'.google.cloud.sec" + + "uritycenter.v2.Process\022L\n\010contacts\030\032 \003(\013" + + "25.google.cloud.securitycenter.v2.Findin" + + "g.ContactsEntryB\003\340A\003\022?\n\013compliances\030\033 \003(" + + "\0132*.google.cloud.securitycenter.v2.Compl" + + "iance\022 \n\023parent_display_name\030\035 \001(\tB\003\340A\003\022" + + "\023\n\013description\030\036 \001(\t\022B\n\014exfiltration\030\037 \001" + + "(\0132,.google.cloud.securitycenter.v2.Exfi" + + "ltration\022@\n\014iam_bindings\030 \003(\0132*.google." + + "cloud.securitycenter.v2.IamBinding\022\022\n\nne" + + "xt_steps\030! \001(\t\022\023\n\013module_name\030\" \001(\t\022=\n\nc" + + "ontainers\030# \003(\0132).google.cloud.securityc" + + "enter.v2.Container\022>\n\nkubernetes\030$ \001(\0132*" + + ".google.cloud.securitycenter.v2.Kubernet" + + "es\022:\n\010database\030% \001(\0132(.google.cloud.secu" + + "ritycenter.v2.Database\022G\n\017attack_exposur" + + "e\030& \001(\0132..google.cloud.securitycenter.v2" + + ".AttackExposure\0223\n\005files\030\' \003(\0132$.google." + + "cloud.securitycenter.v2.File\022P\n\024cloud_dl" + + "p_inspection\030( \001(\01322.google.cloud.securi" + + "tycenter.v2.CloudDlpInspection\022S\n\026cloud_" + + "dlp_data_profile\030) \001(\01323.google.cloud.se" + + "curitycenter.v2.CloudDlpDataProfile\022E\n\016k" + + "ernel_rootkit\030* \001(\0132-.google.cloud.secur" + + "itycenter.v2.KernelRootkit\022?\n\014org_polici" + + "es\030+ \003(\0132).google.cloud.securitycenter.v" + + "2.OrgPolicy\022@\n\013application\030- \001(\0132+.googl" + + "e.cloud.securitycenter.v2.Application\022X\n" + + "\030backup_disaster_recovery\030/ \001(\01326.google" + + ".cloud.securitycenter.v2.BackupDisasterR" + + "ecovery\022I\n\020security_posture\0300 \001(\0132/.goog" + + "le.cloud.securitycenter.v2.SecurityPostu" + + "re\022=\n\013log_entries\0301 \003(\0132(.google.cloud.s" + + "ecuritycenter.v2.LogEntry\022D\n\016load_balanc" + + "ers\0302 \003(\0132,.google.cloud.securitycenter." + + "v2.LoadBalancer\022?\n\013cloud_armor\0303 \001(\0132*.g" + + "oogle.cloud.securitycenter.v2.CloudArmor" + + "\022:\n\010notebook\0307 \001(\0132(.google.cloud.securi" + + "tycenter.v2.Notebook\022K\n\021toxic_combinatio" + + "n\0308 \001(\01320.google.cloud.securitycenter.v2" + + ".ToxicCombination\022J\n\021group_memberships\0309" + + " \003(\0132/.google.cloud.securitycenter.v2.Gr" + + "oupMembership\032O\n\025SourcePropertiesEntry\022\013" + + "\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.google.prot" + + "obuf.Value:\0028\001\032f\n\024ExternalSystemsEntry\022\013" + + "\n\003key\030\001 \001(\t\022=\n\005value\030\002 \001(\0132..google.clou" + + "d.securitycenter.v2.ExternalSystem:\0028\001\032_" + + "\n\rContactsEntry\022\013\n\003key\030\001 \001(\t\022=\n\005value\030\002 " + + "\001(\0132..google.cloud.securitycenter.v2.Con" + + "tactDetails:\0028\001\"8\n\005State\022\025\n\021STATE_UNSPEC" + + "IFIED\020\000\022\n\n\006ACTIVE\020\001\022\014\n\010INACTIVE\020\002\"Q\n\010Sev" + + "erity\022\030\n\024SEVERITY_UNSPECIFIED\020\000\022\014\n\010CRITI" + + "CAL\020\001\022\010\n\004HIGH\020\002\022\n\n\006MEDIUM\020\003\022\007\n\003LOW\020\004\"C\n\004" + + "Mute\022\024\n\020MUTE_UNSPECIFIED\020\000\022\t\n\005MUTED\020\001\022\013\n" + + "\007UNMUTED\020\002\022\r\n\tUNDEFINED\020\003\"\260\001\n\014FindingCla" + + "ss\022\035\n\031FINDING_CLASS_UNSPECIFIED\020\000\022\n\n\006THR" + + "EAT\020\001\022\021\n\rVULNERABILITY\020\002\022\024\n\020MISCONFIGURA" + + "TION\020\003\022\017\n\013OBSERVATION\020\004\022\r\n\tSCC_ERROR\020\005\022\025" + + "\n\021POSTURE_VIOLATION\020\006\022\025\n\021TOXIC_COMBINATI" + + "ON\020\007:\335\003\352A\331\003\n%securitycenter.googleapis.c" + + "om/Finding\022@organizations/{organization}" + + "/sources/{source}/findings/{finding}\022Uor" + + "ganizations/{organization}/sources/{sour" + "ce}/locations/{location}/findings/{findi" - + "ng}*\010findings2\007findingB\346\001\n\"com.google.cl" - + "oud.securitycenter.v2B\014FindingProtoP\001ZJc" - + "loud.google.com/go/securitycenter/apiv2/" - + "securitycenterpb;securitycenterpb\252\002\036Goog" - + "le.Cloud.SecurityCenter.V2\312\002\036Google\\Clou" - + "d\\SecurityCenter\\V2\352\002!Google::Cloud::Sec" - + "urityCenter::V2b\006proto3" + + "ng}\0224folders/{folder}/sources/{source}/f" + + "indings/{finding}\022Ifolders/{folder}/sour" + + "ces/{source}/locations/{location}/findin" + + "gs/{finding}\0226projects/{project}/sources" + + "/{source}/findings/{finding}\022Kprojects/{" + + "project}/sources/{source}/locations/{loc" + + "ation}/findings/{finding}*\010findings2\007fin" + + "dingB\346\001\n\"com.google.cloud.securitycenter" + + ".v2B\014FindingProtoP\001ZJcloud.google.com/go" + + "/securitycenter/apiv2/securitycenterpb;s" + + "ecuritycenterpb\252\002\036Google.Cloud.SecurityC" + + "enter.V2\312\002\036Google\\Cloud\\SecurityCenter\\V" + + "2\352\002!Google::Cloud::SecurityCenter::V2b\006p" + + "roto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -209,6 +215,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.securitycenter.v2.ApplicationProto.getDescriptor(), com.google.cloud.securitycenter.v2.AttackExposureProto.getDescriptor(), com.google.cloud.securitycenter.v2.BackupDisasterRecoveryProto.getDescriptor(), + com.google.cloud.securitycenter.v2.CloudArmorProto.getDescriptor(), com.google.cloud.securitycenter.v2.CloudDlpDataProfileProto.getDescriptor(), com.google.cloud.securitycenter.v2.CloudDlpInspectionProto.getDescriptor(), com.google.cloud.securitycenter.v2.ComplianceProto.getDescriptor(), @@ -227,6 +234,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.securitycenter.v2.LoadBalancerProto.getDescriptor(), com.google.cloud.securitycenter.v2.LogEntryProto.getDescriptor(), com.google.cloud.securitycenter.v2.MitreAttackProto.getDescriptor(), + com.google.cloud.securitycenter.v2.NotebookProto.getDescriptor(), com.google.cloud.securitycenter.v2.OrgPolicyProto.getDescriptor(), com.google.cloud.securitycenter.v2.ProcessProto.getDescriptor(), com.google.cloud.securitycenter.v2.SecurityMarksProto.getDescriptor(), @@ -287,6 +295,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SecurityPosture", "LogEntries", "LoadBalancers", + "CloudArmor", + "Notebook", "ToxicCombination", "GroupMemberships", }); @@ -326,6 +336,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.securitycenter.v2.ApplicationProto.getDescriptor(); com.google.cloud.securitycenter.v2.AttackExposureProto.getDescriptor(); com.google.cloud.securitycenter.v2.BackupDisasterRecoveryProto.getDescriptor(); + com.google.cloud.securitycenter.v2.CloudArmorProto.getDescriptor(); com.google.cloud.securitycenter.v2.CloudDlpDataProfileProto.getDescriptor(); com.google.cloud.securitycenter.v2.CloudDlpInspectionProto.getDescriptor(); com.google.cloud.securitycenter.v2.ComplianceProto.getDescriptor(); @@ -344,6 +355,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.securitycenter.v2.LoadBalancerProto.getDescriptor(); com.google.cloud.securitycenter.v2.LogEntryProto.getDescriptor(); com.google.cloud.securitycenter.v2.MitreAttackProto.getDescriptor(); + com.google.cloud.securitycenter.v2.NotebookProto.getDescriptor(); com.google.cloud.securitycenter.v2.OrgPolicyProto.getDescriptor(); com.google.cloud.securitycenter.v2.ProcessProto.getDescriptor(); com.google.cloud.securitycenter.v2.SecurityMarksProto.getDescriptor(); diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Folder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Folder.java new file mode 100644 index 000000000000..146b0d6c9909 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Folder.java @@ -0,0 +1,816 @@ +/* + * Copyright 2024 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/securitycenter/v2/folder.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +/** + * + * + *
+ * Message that contains the resource name and display name of a folder
+ * resource.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.Folder} + */ +public final class Folder extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.Folder) + FolderOrBuilder { + private static final long serialVersionUID = 0L; + // Use Folder.newBuilder() to construct. + private Folder(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Folder() { + resourceFolder_ = ""; + resourceFolderDisplayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Folder(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.FolderProto + .internal_static_google_cloud_securitycenter_v2_Folder_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.FolderProto + .internal_static_google_cloud_securitycenter_v2_Folder_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.Folder.class, + com.google.cloud.securitycenter.v2.Folder.Builder.class); + } + + public static final int RESOURCE_FOLDER_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourceFolder_ = ""; + /** + * + * + *
+   * Full resource name of this folder. See:
+   * https://cloud.google.com/apis/design/resource_names#full_resource_name
+   * 
+ * + * string resource_folder = 1; + * + * @return The resourceFolder. + */ + @java.lang.Override + public java.lang.String getResourceFolder() { + java.lang.Object ref = resourceFolder_; + 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(); + resourceFolder_ = s; + return s; + } + } + /** + * + * + *
+   * Full resource name of this folder. See:
+   * https://cloud.google.com/apis/design/resource_names#full_resource_name
+   * 
+ * + * string resource_folder = 1; + * + * @return The bytes for resourceFolder. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceFolderBytes() { + java.lang.Object ref = resourceFolder_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceFolder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FOLDER_DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourceFolderDisplayName_ = ""; + /** + * + * + *
+   * The user defined display name for this folder.
+   * 
+ * + * string resource_folder_display_name = 2; + * + * @return The resourceFolderDisplayName. + */ + @java.lang.Override + public java.lang.String getResourceFolderDisplayName() { + java.lang.Object ref = resourceFolderDisplayName_; + 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(); + resourceFolderDisplayName_ = s; + return s; + } + } + /** + * + * + *
+   * The user defined display name for this folder.
+   * 
+ * + * string resource_folder_display_name = 2; + * + * @return The bytes for resourceFolderDisplayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceFolderDisplayNameBytes() { + java.lang.Object ref = resourceFolderDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceFolderDisplayName_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceFolder_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceFolder_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceFolderDisplayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceFolderDisplayName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceFolder_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceFolder_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceFolderDisplayName_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceFolderDisplayName_); + } + size += getUnknownFields().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.securitycenter.v2.Folder)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.Folder other = + (com.google.cloud.securitycenter.v2.Folder) obj; + + if (!getResourceFolder().equals(other.getResourceFolder())) return false; + if (!getResourceFolderDisplayName().equals(other.getResourceFolderDisplayName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RESOURCE_FOLDER_FIELD_NUMBER; + hash = (53 * hash) + getResourceFolder().hashCode(); + hash = (37 * hash) + RESOURCE_FOLDER_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getResourceFolderDisplayName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.Folder parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Folder 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.securitycenter.v2.Folder parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Folder 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.securitycenter.v2.Folder parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Folder parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.Folder parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Folder 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.securitycenter.v2.Folder parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Folder 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.securitycenter.v2.Folder parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Folder 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.securitycenter.v2.Folder 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; + } + /** + * + * + *
+   * Message that contains the resource name and display name of a folder
+   * resource.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.Folder} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.Folder) + com.google.cloud.securitycenter.v2.FolderOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.FolderProto + .internal_static_google_cloud_securitycenter_v2_Folder_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.FolderProto + .internal_static_google_cloud_securitycenter_v2_Folder_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.Folder.class, + com.google.cloud.securitycenter.v2.Folder.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.Folder.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + resourceFolder_ = ""; + resourceFolderDisplayName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.FolderProto + .internal_static_google_cloud_securitycenter_v2_Folder_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Folder getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.Folder.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Folder build() { + com.google.cloud.securitycenter.v2.Folder result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Folder buildPartial() { + com.google.cloud.securitycenter.v2.Folder result = + new com.google.cloud.securitycenter.v2.Folder(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.Folder result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.resourceFolder_ = resourceFolder_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.resourceFolderDisplayName_ = resourceFolderDisplayName_; + } + } + + @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.securitycenter.v2.Folder) { + return mergeFrom((com.google.cloud.securitycenter.v2.Folder) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.Folder other) { + if (other == com.google.cloud.securitycenter.v2.Folder.getDefaultInstance()) return this; + if (!other.getResourceFolder().isEmpty()) { + resourceFolder_ = other.resourceFolder_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getResourceFolderDisplayName().isEmpty()) { + resourceFolderDisplayName_ = other.resourceFolderDisplayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + resourceFolder_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + resourceFolderDisplayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object resourceFolder_ = ""; + /** + * + * + *
+     * Full resource name of this folder. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_folder = 1; + * + * @return The resourceFolder. + */ + public java.lang.String getResourceFolder() { + java.lang.Object ref = resourceFolder_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceFolder_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Full resource name of this folder. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_folder = 1; + * + * @return The bytes for resourceFolder. + */ + public com.google.protobuf.ByteString getResourceFolderBytes() { + java.lang.Object ref = resourceFolder_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceFolder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Full resource name of this folder. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_folder = 1; + * + * @param value The resourceFolder to set. + * @return This builder for chaining. + */ + public Builder setResourceFolder(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + resourceFolder_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of this folder. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_folder = 1; + * + * @return This builder for chaining. + */ + public Builder clearResourceFolder() { + resourceFolder_ = getDefaultInstance().getResourceFolder(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Full resource name of this folder. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_folder = 1; + * + * @param value The bytes for resourceFolder to set. + * @return This builder for chaining. + */ + public Builder setResourceFolderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + resourceFolder_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object resourceFolderDisplayName_ = ""; + /** + * + * + *
+     * The user defined display name for this folder.
+     * 
+ * + * string resource_folder_display_name = 2; + * + * @return The resourceFolderDisplayName. + */ + public java.lang.String getResourceFolderDisplayName() { + java.lang.Object ref = resourceFolderDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceFolderDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The user defined display name for this folder.
+     * 
+ * + * string resource_folder_display_name = 2; + * + * @return The bytes for resourceFolderDisplayName. + */ + public com.google.protobuf.ByteString getResourceFolderDisplayNameBytes() { + java.lang.Object ref = resourceFolderDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceFolderDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The user defined display name for this folder.
+     * 
+ * + * string resource_folder_display_name = 2; + * + * @param value The resourceFolderDisplayName to set. + * @return This builder for chaining. + */ + public Builder setResourceFolderDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + resourceFolderDisplayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The user defined display name for this folder.
+     * 
+ * + * string resource_folder_display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearResourceFolderDisplayName() { + resourceFolderDisplayName_ = getDefaultInstance().getResourceFolderDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The user defined display name for this folder.
+     * 
+ * + * string resource_folder_display_name = 2; + * + * @param value The bytes for resourceFolderDisplayName to set. + * @return This builder for chaining. + */ + public Builder setResourceFolderDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + resourceFolderDisplayName_ = value; + bitField0_ |= 0x00000002; + 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.securitycenter.v2.Folder) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.Folder) + private static final com.google.cloud.securitycenter.v2.Folder DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.Folder(); + } + + public static com.google.cloud.securitycenter.v2.Folder getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Folder parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.Folder getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FolderOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FolderOrBuilder.java new file mode 100644 index 000000000000..bf9b49cc04ac --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FolderOrBuilder.java @@ -0,0 +1,78 @@ +/* + * Copyright 2024 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/securitycenter/v2/folder.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public interface FolderOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.Folder) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Full resource name of this folder. See:
+   * https://cloud.google.com/apis/design/resource_names#full_resource_name
+   * 
+ * + * string resource_folder = 1; + * + * @return The resourceFolder. + */ + java.lang.String getResourceFolder(); + /** + * + * + *
+   * Full resource name of this folder. See:
+   * https://cloud.google.com/apis/design/resource_names#full_resource_name
+   * 
+ * + * string resource_folder = 1; + * + * @return The bytes for resourceFolder. + */ + com.google.protobuf.ByteString getResourceFolderBytes(); + + /** + * + * + *
+   * The user defined display name for this folder.
+   * 
+ * + * string resource_folder_display_name = 2; + * + * @return The resourceFolderDisplayName. + */ + java.lang.String getResourceFolderDisplayName(); + /** + * + * + *
+   * The user defined display name for this folder.
+   * 
+ * + * string resource_folder_display_name = 2; + * + * @return The bytes for resourceFolderDisplayName. + */ + com.google.protobuf.ByteString getResourceFolderDisplayNameBytes(); +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FolderProto.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FolderProto.java new file mode 100644 index 000000000000..588209d89302 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/FolderProto.java @@ -0,0 +1,69 @@ +/* + * Copyright 2024 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/securitycenter/v2/folder.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public final class FolderProto { + private FolderProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_Folder_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_Folder_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n+google/cloud/securitycenter/v2/folder." + + "proto\022\036google.cloud.securitycenter.v2\"G\n" + + "\006Folder\022\027\n\017resource_folder\030\001 \001(\t\022$\n\034reso" + + "urce_folder_display_name\030\002 \001(\tB\345\001\n\"com.g" + + "oogle.cloud.securitycenter.v2B\013FolderPro" + + "toP\001ZJcloud.google.com/go/securitycenter" + + "/apiv2/securitycenterpb;securitycenterpb" + + "\252\002\036Google.Cloud.SecurityCenter.V2\312\002\036Goog" + + "le\\Cloud\\SecurityCenter\\V2\352\002!Google::Clo" + + "ud::SecurityCenter::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_securitycenter_v2_Folder_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v2_Folder_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_Folder_descriptor, + new java.lang.String[] { + "ResourceFolder", "ResourceFolderDisplayName", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GcpMetadata.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GcpMetadata.java new file mode 100644 index 000000000000..ed1424610e38 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GcpMetadata.java @@ -0,0 +1,1938 @@ +/* + * Copyright 2024 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/securitycenter/v2/resource.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +/** + * + * + *
+ * GCP metadata associated with the resource, only applicable if the finding's
+ * cloud provider is Google Cloud Platform.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.GcpMetadata} + */ +public final class GcpMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.GcpMetadata) + GcpMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcpMetadata.newBuilder() to construct. + private GcpMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcpMetadata() { + project_ = ""; + projectDisplayName_ = ""; + parent_ = ""; + parentDisplayName_ = ""; + folders_ = java.util.Collections.emptyList(); + organization_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcpMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_GcpMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_GcpMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.GcpMetadata.class, + com.google.cloud.securitycenter.v2.GcpMetadata.Builder.class); + } + + public static final int PROJECT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object project_ = ""; + /** + * + * + *
+   * The full resource name of project that the resource belongs to.
+   * 
+ * + * string project = 1; + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + 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(); + project_ = s; + return s; + } + } + /** + * + * + *
+   * The full resource name of project that the resource belongs to.
+   * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object projectDisplayName_ = ""; + /** + * + * + *
+   * The project ID that the resource belongs to.
+   * 
+ * + * string project_display_name = 2; + * + * @return The projectDisplayName. + */ + @java.lang.Override + public java.lang.String getProjectDisplayName() { + java.lang.Object ref = projectDisplayName_; + 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(); + projectDisplayName_ = s; + return s; + } + } + /** + * + * + *
+   * The project ID that the resource belongs to.
+   * 
+ * + * string project_display_name = 2; + * + * @return The bytes for projectDisplayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectDisplayNameBytes() { + java.lang.Object ref = projectDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * The full resource name of resource's parent.
+   * 
+ * + * string parent = 3; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * The full resource name of resource's parent.
+   * 
+ * + * string parent = 3; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_DISPLAY_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object parentDisplayName_ = ""; + /** + * + * + *
+   * The human readable name of resource's parent.
+   * 
+ * + * string parent_display_name = 4; + * + * @return The parentDisplayName. + */ + @java.lang.Override + public java.lang.String getParentDisplayName() { + java.lang.Object ref = parentDisplayName_; + 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(); + parentDisplayName_ = s; + return s; + } + } + /** + * + * + *
+   * The human readable name of resource's parent.
+   * 
+ * + * string parent_display_name = 4; + * + * @return The bytes for parentDisplayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentDisplayNameBytes() { + java.lang.Object ref = parentDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parentDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FOLDERS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List folders_; + /** + * + * + *
+   * Output only. Contains a Folder message for each folder in the assets
+   * ancestry. The first folder is the deepest nested folder, and the last
+   * folder is the folder directly under the Organization.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getFoldersList() { + return folders_; + } + /** + * + * + *
+   * Output only. Contains a Folder message for each folder in the assets
+   * ancestry. The first folder is the deepest nested folder, and the last
+   * folder is the folder directly under the Organization.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getFoldersOrBuilderList() { + return folders_; + } + /** + * + * + *
+   * Output only. Contains a Folder message for each folder in the assets
+   * ancestry. The first folder is the deepest nested folder, and the last
+   * folder is the folder directly under the Organization.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getFoldersCount() { + return folders_.size(); + } + /** + * + * + *
+   * Output only. Contains a Folder message for each folder in the assets
+   * ancestry. The first folder is the deepest nested folder, and the last
+   * folder is the folder directly under the Organization.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.Folder getFolders(int index) { + return folders_.get(index); + } + /** + * + * + *
+   * Output only. Contains a Folder message for each folder in the assets
+   * ancestry. The first folder is the deepest nested folder, and the last
+   * folder is the folder directly under the Organization.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.FolderOrBuilder getFoldersOrBuilder(int index) { + return folders_.get(index); + } + + public static final int ORGANIZATION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object organization_ = ""; + /** + * + * + *
+   * The name of the organization that the resource belongs to.
+   * 
+ * + * string organization = 6; + * + * @return The organization. + */ + @java.lang.Override + public java.lang.String getOrganization() { + java.lang.Object ref = organization_; + 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(); + organization_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the organization that the resource belongs to.
+   * 
+ * + * string organization = 6; + * + * @return The bytes for organization. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrganizationBytes() { + java.lang.Object ref = organization_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + organization_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, project_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectDisplayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectDisplayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parentDisplayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, parentDisplayName_); + } + for (int i = 0; i < folders_.size(); i++) { + output.writeMessage(5, folders_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(organization_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, organization_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, project_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectDisplayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, projectDisplayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parentDisplayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, parentDisplayName_); + } + for (int i = 0; i < folders_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, folders_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(organization_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, organization_); + } + size += getUnknownFields().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.securitycenter.v2.GcpMetadata)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.GcpMetadata other = + (com.google.cloud.securitycenter.v2.GcpMetadata) obj; + + if (!getProject().equals(other.getProject())) return false; + if (!getProjectDisplayName().equals(other.getProjectDisplayName())) return false; + if (!getParent().equals(other.getParent())) return false; + if (!getParentDisplayName().equals(other.getParentDisplayName())) return false; + if (!getFoldersList().equals(other.getFoldersList())) return false; + if (!getOrganization().equals(other.getOrganization())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + PROJECT_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getProjectDisplayName().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PARENT_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getParentDisplayName().hashCode(); + if (getFoldersCount() > 0) { + hash = (37 * hash) + FOLDERS_FIELD_NUMBER; + hash = (53 * hash) + getFoldersList().hashCode(); + } + hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; + hash = (53 * hash) + getOrganization().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.GcpMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.GcpMetadata 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.securitycenter.v2.GcpMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.GcpMetadata 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.securitycenter.v2.GcpMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.GcpMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.GcpMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.GcpMetadata 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.securitycenter.v2.GcpMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.GcpMetadata 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.securitycenter.v2.GcpMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.GcpMetadata 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.securitycenter.v2.GcpMetadata 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; + } + /** + * + * + *
+   * GCP metadata associated with the resource, only applicable if the finding's
+   * cloud provider is Google Cloud Platform.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.GcpMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.GcpMetadata) + com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_GcpMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_GcpMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.GcpMetadata.class, + com.google.cloud.securitycenter.v2.GcpMetadata.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.GcpMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + project_ = ""; + projectDisplayName_ = ""; + parent_ = ""; + parentDisplayName_ = ""; + if (foldersBuilder_ == null) { + folders_ = java.util.Collections.emptyList(); + } else { + folders_ = null; + foldersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + organization_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_GcpMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.GcpMetadata getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.GcpMetadata build() { + com.google.cloud.securitycenter.v2.GcpMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.GcpMetadata buildPartial() { + com.google.cloud.securitycenter.v2.GcpMetadata result = + new com.google.cloud.securitycenter.v2.GcpMetadata(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.securitycenter.v2.GcpMetadata result) { + if (foldersBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + folders_ = java.util.Collections.unmodifiableList(folders_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.folders_ = folders_; + } else { + result.folders_ = foldersBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.GcpMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.project_ = project_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.projectDisplayName_ = projectDisplayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.parentDisplayName_ = parentDisplayName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.organization_ = organization_; + } + } + + @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.securitycenter.v2.GcpMetadata) { + return mergeFrom((com.google.cloud.securitycenter.v2.GcpMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.GcpMetadata other) { + if (other == com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance()) return this; + if (!other.getProject().isEmpty()) { + project_ = other.project_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProjectDisplayName().isEmpty()) { + projectDisplayName_ = other.projectDisplayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getParentDisplayName().isEmpty()) { + parentDisplayName_ = other.parentDisplayName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (foldersBuilder_ == null) { + if (!other.folders_.isEmpty()) { + if (folders_.isEmpty()) { + folders_ = other.folders_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureFoldersIsMutable(); + folders_.addAll(other.folders_); + } + onChanged(); + } + } else { + if (!other.folders_.isEmpty()) { + if (foldersBuilder_.isEmpty()) { + foldersBuilder_.dispose(); + foldersBuilder_ = null; + folders_ = other.folders_; + bitField0_ = (bitField0_ & ~0x00000010); + foldersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFoldersFieldBuilder() + : null; + } else { + foldersBuilder_.addAllMessages(other.folders_); + } + } + } + if (!other.getOrganization().isEmpty()) { + organization_ = other.organization_; + bitField0_ |= 0x00000020; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + project_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + projectDisplayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + parentDisplayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + com.google.cloud.securitycenter.v2.Folder m = + input.readMessage( + com.google.cloud.securitycenter.v2.Folder.parser(), extensionRegistry); + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.add(m); + } else { + foldersBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: + { + organization_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object project_ = ""; + /** + * + * + *
+     * The full resource name of project that the resource belongs to.
+     * 
+ * + * string project = 1; + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The full resource name of project that the resource belongs to.
+     * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The full resource name of project that the resource belongs to.
+     * 
+ * + * string project = 1; + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource name of project that the resource belongs to.
+     * 
+ * + * string project = 1; + * + * @return This builder for chaining. + */ + public Builder clearProject() { + project_ = getDefaultInstance().getProject(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource name of project that the resource belongs to.
+     * 
+ * + * string project = 1; + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + project_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object projectDisplayName_ = ""; + /** + * + * + *
+     * The project ID that the resource belongs to.
+     * 
+ * + * string project_display_name = 2; + * + * @return The projectDisplayName. + */ + public java.lang.String getProjectDisplayName() { + java.lang.Object ref = projectDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The project ID that the resource belongs to.
+     * 
+ * + * string project_display_name = 2; + * + * @return The bytes for projectDisplayName. + */ + public com.google.protobuf.ByteString getProjectDisplayNameBytes() { + java.lang.Object ref = projectDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The project ID that the resource belongs to.
+     * 
+ * + * string project_display_name = 2; + * + * @param value The projectDisplayName to set. + * @return This builder for chaining. + */ + public Builder setProjectDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + projectDisplayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The project ID that the resource belongs to.
+     * 
+ * + * string project_display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearProjectDisplayName() { + projectDisplayName_ = getDefaultInstance().getProjectDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The project ID that the resource belongs to.
+     * 
+ * + * string project_display_name = 2; + * + * @param value The bytes for projectDisplayName to set. + * @return This builder for chaining. + */ + public Builder setProjectDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + projectDisplayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The full resource name of resource's parent.
+     * 
+ * + * string parent = 3; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The full resource name of resource's parent.
+     * 
+ * + * string parent = 3; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The full resource name of resource's parent.
+     * 
+ * + * string parent = 3; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource name of resource's parent.
+     * 
+ * + * string parent = 3; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource name of resource's parent.
+     * 
+ * + * string parent = 3; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object parentDisplayName_ = ""; + /** + * + * + *
+     * The human readable name of resource's parent.
+     * 
+ * + * string parent_display_name = 4; + * + * @return The parentDisplayName. + */ + public java.lang.String getParentDisplayName() { + java.lang.Object ref = parentDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parentDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The human readable name of resource's parent.
+     * 
+ * + * string parent_display_name = 4; + * + * @return The bytes for parentDisplayName. + */ + public com.google.protobuf.ByteString getParentDisplayNameBytes() { + java.lang.Object ref = parentDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parentDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The human readable name of resource's parent.
+     * 
+ * + * string parent_display_name = 4; + * + * @param value The parentDisplayName to set. + * @return This builder for chaining. + */ + public Builder setParentDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parentDisplayName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The human readable name of resource's parent.
+     * 
+ * + * string parent_display_name = 4; + * + * @return This builder for chaining. + */ + public Builder clearParentDisplayName() { + parentDisplayName_ = getDefaultInstance().getParentDisplayName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The human readable name of resource's parent.
+     * 
+ * + * string parent_display_name = 4; + * + * @param value The bytes for parentDisplayName to set. + * @return This builder for chaining. + */ + public Builder setParentDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parentDisplayName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.util.List folders_ = + java.util.Collections.emptyList(); + + private void ensureFoldersIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + folders_ = new java.util.ArrayList(folders_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v2.Folder, + com.google.cloud.securitycenter.v2.Folder.Builder, + com.google.cloud.securitycenter.v2.FolderOrBuilder> + foldersBuilder_; + + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getFoldersList() { + if (foldersBuilder_ == null) { + return java.util.Collections.unmodifiableList(folders_); + } else { + return foldersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getFoldersCount() { + if (foldersBuilder_ == null) { + return folders_.size(); + } else { + return foldersBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securitycenter.v2.Folder getFolders(int index) { + if (foldersBuilder_ == null) { + return folders_.get(index); + } else { + return foldersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setFolders(int index, com.google.cloud.securitycenter.v2.Folder value) { + if (foldersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.set(index, value); + onChanged(); + } else { + foldersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setFolders( + int index, com.google.cloud.securitycenter.v2.Folder.Builder builderForValue) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.set(index, builderForValue.build()); + onChanged(); + } else { + foldersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addFolders(com.google.cloud.securitycenter.v2.Folder value) { + if (foldersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.add(value); + onChanged(); + } else { + foldersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addFolders(int index, com.google.cloud.securitycenter.v2.Folder value) { + if (foldersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.add(index, value); + onChanged(); + } else { + foldersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addFolders(com.google.cloud.securitycenter.v2.Folder.Builder builderForValue) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.add(builderForValue.build()); + onChanged(); + } else { + foldersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addFolders( + int index, com.google.cloud.securitycenter.v2.Folder.Builder builderForValue) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.add(index, builderForValue.build()); + onChanged(); + } else { + foldersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllFolders( + java.lang.Iterable values) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, folders_); + onChanged(); + } else { + foldersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearFolders() { + if (foldersBuilder_ == null) { + folders_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + foldersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeFolders(int index) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.remove(index); + onChanged(); + } else { + foldersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securitycenter.v2.Folder.Builder getFoldersBuilder(int index) { + return getFoldersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securitycenter.v2.FolderOrBuilder getFoldersOrBuilder(int index) { + if (foldersBuilder_ == null) { + return folders_.get(index); + } else { + return foldersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getFoldersOrBuilderList() { + if (foldersBuilder_ != null) { + return foldersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(folders_); + } + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securitycenter.v2.Folder.Builder addFoldersBuilder() { + return getFoldersFieldBuilder() + .addBuilder(com.google.cloud.securitycenter.v2.Folder.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securitycenter.v2.Folder.Builder addFoldersBuilder(int index) { + return getFoldersFieldBuilder() + .addBuilder(index, com.google.cloud.securitycenter.v2.Folder.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Contains a Folder message for each folder in the assets
+     * ancestry. The first folder is the deepest nested folder, and the last
+     * folder is the folder directly under the Organization.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getFoldersBuilderList() { + return getFoldersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v2.Folder, + com.google.cloud.securitycenter.v2.Folder.Builder, + com.google.cloud.securitycenter.v2.FolderOrBuilder> + getFoldersFieldBuilder() { + if (foldersBuilder_ == null) { + foldersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v2.Folder, + com.google.cloud.securitycenter.v2.Folder.Builder, + com.google.cloud.securitycenter.v2.FolderOrBuilder>( + folders_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + folders_ = null; + } + return foldersBuilder_; + } + + private java.lang.Object organization_ = ""; + /** + * + * + *
+     * The name of the organization that the resource belongs to.
+     * 
+ * + * string organization = 6; + * + * @return The organization. + */ + public java.lang.String getOrganization() { + java.lang.Object ref = organization_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + organization_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the organization that the resource belongs to.
+     * 
+ * + * string organization = 6; + * + * @return The bytes for organization. + */ + public com.google.protobuf.ByteString getOrganizationBytes() { + java.lang.Object ref = organization_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + organization_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the organization that the resource belongs to.
+     * 
+ * + * string organization = 6; + * + * @param value The organization to set. + * @return This builder for chaining. + */ + public Builder setOrganization(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + organization_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the organization that the resource belongs to.
+     * 
+ * + * string organization = 6; + * + * @return This builder for chaining. + */ + public Builder clearOrganization() { + organization_ = getDefaultInstance().getOrganization(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the organization that the resource belongs to.
+     * 
+ * + * string organization = 6; + * + * @param value The bytes for organization to set. + * @return This builder for chaining. + */ + public Builder setOrganizationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + organization_ = value; + bitField0_ |= 0x00000020; + 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.securitycenter.v2.GcpMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.GcpMetadata) + private static final com.google.cloud.securitycenter.v2.GcpMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.GcpMetadata(); + } + + public static com.google.cloud.securitycenter.v2.GcpMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcpMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.GcpMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GcpMetadataOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GcpMetadataOrBuilder.java new file mode 100644 index 000000000000..3f7e2dc4a471 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GcpMetadataOrBuilder.java @@ -0,0 +1,223 @@ +/* + * Copyright 2024 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/securitycenter/v2/resource.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public interface GcpMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.GcpMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The full resource name of project that the resource belongs to.
+   * 
+ * + * string project = 1; + * + * @return The project. + */ + java.lang.String getProject(); + /** + * + * + *
+   * The full resource name of project that the resource belongs to.
+   * 
+ * + * string project = 1; + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * The project ID that the resource belongs to.
+   * 
+ * + * string project_display_name = 2; + * + * @return The projectDisplayName. + */ + java.lang.String getProjectDisplayName(); + /** + * + * + *
+   * The project ID that the resource belongs to.
+   * 
+ * + * string project_display_name = 2; + * + * @return The bytes for projectDisplayName. + */ + com.google.protobuf.ByteString getProjectDisplayNameBytes(); + + /** + * + * + *
+   * The full resource name of resource's parent.
+   * 
+ * + * string parent = 3; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * The full resource name of resource's parent.
+   * 
+ * + * string parent = 3; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The human readable name of resource's parent.
+   * 
+ * + * string parent_display_name = 4; + * + * @return The parentDisplayName. + */ + java.lang.String getParentDisplayName(); + /** + * + * + *
+   * The human readable name of resource's parent.
+   * 
+ * + * string parent_display_name = 4; + * + * @return The bytes for parentDisplayName. + */ + com.google.protobuf.ByteString getParentDisplayNameBytes(); + + /** + * + * + *
+   * Output only. Contains a Folder message for each folder in the assets
+   * ancestry. The first folder is the deepest nested folder, and the last
+   * folder is the folder directly under the Organization.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getFoldersList(); + /** + * + * + *
+   * Output only. Contains a Folder message for each folder in the assets
+   * ancestry. The first folder is the deepest nested folder, and the last
+   * folder is the folder directly under the Organization.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.securitycenter.v2.Folder getFolders(int index); + /** + * + * + *
+   * Output only. Contains a Folder message for each folder in the assets
+   * ancestry. The first folder is the deepest nested folder, and the last
+   * folder is the folder directly under the Organization.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getFoldersCount(); + /** + * + * + *
+   * Output only. Contains a Folder message for each folder in the assets
+   * ancestry. The first folder is the deepest nested folder, and the last
+   * folder is the folder directly under the Organization.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getFoldersOrBuilderList(); + /** + * + * + *
+   * Output only. Contains a Folder message for each folder in the assets
+   * ancestry. The first folder is the deepest nested folder, and the last
+   * folder is the folder directly under the Organization.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v2.Folder folders = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.securitycenter.v2.FolderOrBuilder getFoldersOrBuilder(int index); + + /** + * + * + *
+   * The name of the organization that the resource belongs to.
+   * 
+ * + * string organization = 6; + * + * @return The organization. + */ + java.lang.String getOrganization(); + /** + * + * + *
+   * The name of the organization that the resource belongs to.
+   * 
+ * + * string organization = 6; + * + * @return The bytes for organization. + */ + com.google.protobuf.ByteString getOrganizationBytes(); +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GroupFindingsRequest.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GroupFindingsRequest.java index 2c367f46fe93..5b5b984262d3 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GroupFindingsRequest.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GroupFindingsRequest.java @@ -315,14 +315,6 @@ public com.google.protobuf.ByteString getFilterBytes() { * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. * For example: "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * * severity * * * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -348,14 +340,6 @@ public java.lang.String getGroupBy() { * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. * For example: "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * * severity * * * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -1446,14 +1430,6 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. * For example: "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * * severity * * * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -1478,14 +1454,6 @@ public java.lang.String getGroupBy() { * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. * For example: "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * * severity * * * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -1510,14 +1478,6 @@ public com.google.protobuf.ByteString getGroupByBytes() { * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. * For example: "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * * severity * * * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -1541,14 +1501,6 @@ public Builder setGroupBy(java.lang.String value) { * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. * For example: "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * * severity * * * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -1568,14 +1520,6 @@ public Builder clearGroupBy() { * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. * For example: "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * * severity * * * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GroupFindingsRequestOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GroupFindingsRequestOrBuilder.java index 76ec93d5e197..5ad22597672c 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GroupFindingsRequestOrBuilder.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/GroupFindingsRequestOrBuilder.java @@ -217,14 +217,6 @@ public interface GroupFindingsRequestOrBuilder * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. * For example: "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * * severity * * * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -239,14 +231,6 @@ public interface GroupFindingsRequestOrBuilder * Required. Expression that defines what assets fields to use for grouping. * The string value should follow SQL syntax: comma separated list of fields. * For example: "parent,resource_name". - * - * The following fields are supported: - * - * * resource_name - * * category - * * state - * * parent - * * severity * * * string group_by = 3 [(.google.api.field_behavior) = REQUIRED]; diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ListFindingsResponse.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ListFindingsResponse.java index c4cd60a1c542..36f3f21e7fe4 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ListFindingsResponse.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ListFindingsResponse.java @@ -271,6 +271,268 @@ public interface ResourceOrBuilder * @return The bytes for type. */ com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+       * Indicates which cloud provider the finding is from.
+       * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The enum numeric value on the wire for cloudProvider. + */ + int getCloudProviderValue(); + /** + * + * + *
+       * Indicates which cloud provider the finding is from.
+       * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The cloudProvider. + */ + com.google.cloud.securitycenter.v2.CloudProvider getCloudProvider(); + + /** + * + * + *
+       * The service or resource provider associated with the resource.
+       * 
+ * + * string service = 5; + * + * @return The service. + */ + java.lang.String getService(); + /** + * + * + *
+       * The service or resource provider associated with the resource.
+       * 
+ * + * string service = 5; + * + * @return The bytes for service. + */ + com.google.protobuf.ByteString getServiceBytes(); + + /** + * + * + *
+       * The region or location of the service (if applicable).
+       * 
+ * + * string location = 6; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+       * The region or location of the service (if applicable).
+       * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+       * The GCP metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + * + * @return Whether the gcpMetadata field is set. + */ + boolean hasGcpMetadata(); + /** + * + * + *
+       * The GCP metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + * + * @return The gcpMetadata. + */ + com.google.cloud.securitycenter.v2.GcpMetadata getGcpMetadata(); + /** + * + * + *
+       * The GCP metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder getGcpMetadataOrBuilder(); + + /** + * + * + *
+       * The AWS metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + * + * @return Whether the awsMetadata field is set. + */ + boolean hasAwsMetadata(); + /** + * + * + *
+       * The AWS metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + * + * @return The awsMetadata. + */ + com.google.cloud.securitycenter.v2.AwsMetadata getAwsMetadata(); + /** + * + * + *
+       * The AWS metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder getAwsMetadataOrBuilder(); + + /** + * + * + *
+       * The Azure metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + * + * @return Whether the azureMetadata field is set. + */ + boolean hasAzureMetadata(); + /** + * + * + *
+       * The Azure metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + * + * @return The azureMetadata. + */ + com.google.cloud.securitycenter.v2.AzureMetadata getAzureMetadata(); + /** + * + * + *
+       * The Azure metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + */ + com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder getAzureMetadataOrBuilder(); + + /** + * + * + *
+       * Provides the path to the resource within the resource hierarchy.
+       * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + * + * @return Whether the resourcePath field is set. + */ + boolean hasResourcePath(); + /** + * + * + *
+       * Provides the path to the resource within the resource hierarchy.
+       * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + * + * @return The resourcePath. + */ + com.google.cloud.securitycenter.v2.ResourcePath getResourcePath(); + /** + * + * + *
+       * Provides the path to the resource within the resource hierarchy.
+       * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + */ + com.google.cloud.securitycenter.v2.ResourcePathOrBuilder getResourcePathOrBuilder(); + + /** + * + * + *
+       * A string representation of the resource path.
+       * For Google Cloud, it has the format of
+       * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+       * where there can be any number of folders.
+       * For AWS, it has the format of
+       * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+       * where there can be any number of organizational units.
+       * For Azure, it has the format of
+       * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+       * where there can be any number of management groups.
+       * 
+ * + * string resource_path_string = 11; + * + * @return The resourcePathString. + */ + java.lang.String getResourcePathString(); + /** + * + * + *
+       * A string representation of the resource path.
+       * For Google Cloud, it has the format of
+       * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+       * where there can be any number of folders.
+       * For AWS, it has the format of
+       * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+       * where there can be any number of organizational units.
+       * For Azure, it has the format of
+       * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+       * where there can be any number of management groups.
+       * 
+ * + * string resource_path_string = 11; + * + * @return The bytes for resourcePathString. + */ + com.google.protobuf.ByteString getResourcePathStringBytes(); + + com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + .CloudProviderMetadataCase + getCloudProviderMetadataCase(); } /** * @@ -297,6 +559,10 @@ private Resource() { name_ = ""; displayName_ = ""; type_ = ""; + cloudProvider_ = 0; + service_ = ""; + location_ = ""; + resourcePathString_ = ""; } @java.lang.Override @@ -322,6 +588,59 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .Builder.class); } + private int bitField0_; + private int cloudProviderMetadataCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object cloudProviderMetadata_; + + public enum CloudProviderMetadataCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCP_METADATA(7), + AWS_METADATA(8), + AZURE_METADATA(9), + CLOUDPROVIDERMETADATA_NOT_SET(0); + private final int value; + + private CloudProviderMetadataCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CloudProviderMetadataCase valueOf(int value) { + return forNumber(value); + } + + public static CloudProviderMetadataCase forNumber(int value) { + switch (value) { + case 7: + return GCP_METADATA; + case 8: + return AWS_METADATA; + case 9: + return AZURE_METADATA; + case 0: + return CLOUDPROVIDERMETADATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public CloudProviderMetadataCase getCloudProviderMetadataCase() { + return CloudProviderMetadataCase.forNumber(cloudProviderMetadataCase_); + } + public static final int NAME_FIELD_NUMBER = 1; @SuppressWarnings("serial") @@ -477,622 +796,2529 @@ public com.google.protobuf.ByteString getTypeBytes() { } } - private byte memoizedIsInitialized = -1; - + public static final int CLOUD_PROVIDER_FIELD_NUMBER = 4; + private int cloudProvider_ = 0; + /** + * + * + *
+       * Indicates which cloud provider the finding is from.
+       * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The enum numeric value on the wire for cloudProvider. + */ @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + public int getCloudProviderValue() { + return cloudProvider_; } - + /** + * + * + *
+       * Indicates which cloud provider the finding is from.
+       * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The cloudProvider. + */ @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); - } - getUnknownFields().writeTo(output); + public com.google.cloud.securitycenter.v2.CloudProvider getCloudProvider() { + com.google.cloud.securitycenter.v2.CloudProvider result = + com.google.cloud.securitycenter.v2.CloudProvider.forNumber(cloudProvider_); + return result == null + ? com.google.cloud.securitycenter.v2.CloudProvider.UNRECOGNIZED + : result; } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + public static final int SERVICE_FIELD_NUMBER = 5; - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); + @SuppressWarnings("serial") + private volatile java.lang.Object service_ = ""; + /** + * + * + *
+       * The service or resource provider associated with the resource.
+       * 
+ * + * string service = 5; + * + * @return The service. + */ + @java.lang.Override + public java.lang.String getService() { + java.lang.Object ref = service_; + 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(); + service_ = s; + return s; } - size += getUnknownFields().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.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource)) { - return super.equals(obj); - } - com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource other = - (com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource) - obj; - - if (!getName().equals(other.getName())) return false; - if (!getDisplayName().equals(other.getDisplayName())) return false; - if (!getType().equals(other.getType())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - + /** + * + * + *
+       * The service or resource provider associated with the resource.
+       * 
+ * + * string service = 5; + * + * @return The bytes for service. + */ @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; - hash = (53 * hash) + getDisplayName().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource - 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.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource - 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.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource - 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 final int LOCATION_FIELD_NUMBER = 6; - public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** + * + * + *
+       * The region or location of the service (if applicable).
+       * 
+ * + * string location = 6; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } } - - public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource - parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); + /** + * + * + *
+       * The region or location of the service (if applicable).
+       * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + public static final int GCP_METADATA_FIELD_NUMBER = 7; + /** + * + * + *
+       * The GCP metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + * + * @return Whether the gcpMetadata field is set. + */ + @java.lang.Override + public boolean hasGcpMetadata() { + return cloudProviderMetadataCase_ == 7; } - - public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); + /** + * + * + *
+       * The GCP metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + * + * @return The gcpMetadata. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.GcpMetadata getGcpMetadata() { + if (cloudProviderMetadataCase_ == 7) { + return (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); } - + /** + * + * + *
+       * The GCP metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); + public com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder getGcpMetadataOrBuilder() { + if (cloudProviderMetadataCase_ == 7) { + return (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); + public static final int AWS_METADATA_FIELD_NUMBER = 8; + /** + * + * + *
+       * The AWS metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + * + * @return Whether the awsMetadata field is set. + */ + @java.lang.Override + public boolean hasAwsMetadata() { + return cloudProviderMetadataCase_ == 8; } - - public static Builder newBuilder( - com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + /** + * + * + *
+       * The AWS metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + * + * @return The awsMetadata. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata getAwsMetadata() { + if (cloudProviderMetadataCase_ == 8) { + return (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); } - + /** + * + * + *
+       * The AWS metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + public com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder getAwsMetadataOrBuilder() { + if (cloudProviderMetadataCase_ == 8) { + return (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); } + public static final int AZURE_METADATA_FIELD_NUMBER = 9; + /** + * + * + *
+       * The Azure metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + * + * @return Whether the azureMetadata field is set. + */ @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; + public boolean hasAzureMetadata() { + return cloudProviderMetadataCase_ == 9; } /** * * *
-       * Information related to the Google Cloud resource that is
-       * associated with this finding.
+       * The Azure metadata associated with the finding.
        * 
* - * Protobuf type {@code - * google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource} + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + * + * @return The azureMetadata. */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource) - com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .ResourceOrBuilder { + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata getAzureMetadata() { + if (cloudProviderMetadataCase_ == 9) { + return (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); + } + /** + * + * + *
+       * The Azure metadata associated with the finding.
+       * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder getAzureMetadataOrBuilder() { + if (cloudProviderMetadataCase_ == 9) { + return (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); + } + + public static final int RESOURCE_PATH_FIELD_NUMBER = 10; + private com.google.cloud.securitycenter.v2.ResourcePath resourcePath_; + /** + * + * + *
+       * Provides the path to the resource within the resource hierarchy.
+       * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + * + * @return Whether the resourcePath field is set. + */ + @java.lang.Override + public boolean hasResourcePath() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Provides the path to the resource within the resource hierarchy.
+       * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + * + * @return The resourcePath. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePath getResourcePath() { + return resourcePath_ == null + ? com.google.cloud.securitycenter.v2.ResourcePath.getDefaultInstance() + : resourcePath_; + } + /** + * + * + *
+       * Provides the path to the resource within the resource hierarchy.
+       * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePathOrBuilder getResourcePathOrBuilder() { + return resourcePath_ == null + ? com.google.cloud.securitycenter.v2.ResourcePath.getDefaultInstance() + : resourcePath_; + } + + public static final int RESOURCE_PATH_STRING_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourcePathString_ = ""; + /** + * + * + *
+       * A string representation of the resource path.
+       * For Google Cloud, it has the format of
+       * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+       * where there can be any number of folders.
+       * For AWS, it has the format of
+       * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+       * where there can be any number of organizational units.
+       * For Azure, it has the format of
+       * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+       * where there can be any number of management groups.
+       * 
+ * + * string resource_path_string = 11; + * + * @return The resourcePathString. + */ + @java.lang.Override + public java.lang.String getResourcePathString() { + java.lang.Object ref = resourcePathString_; + 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(); + resourcePathString_ = s; + return s; + } + } + /** + * + * + *
+       * A string representation of the resource path.
+       * For Google Cloud, it has the format of
+       * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+       * where there can be any number of folders.
+       * For AWS, it has the format of
+       * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+       * where there can be any number of organizational units.
+       * For Azure, it has the format of
+       * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+       * where there can be any number of management groups.
+       * 
+ * + * string resource_path_string = 11; + * + * @return The bytes for resourcePathString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourcePathStringBytes() { + java.lang.Object ref = resourcePathString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourcePathString_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); + } + if (cloudProvider_ + != com.google.cloud.securitycenter.v2.CloudProvider.CLOUD_PROVIDER_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, cloudProvider_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, service_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, location_); + } + if (cloudProviderMetadataCase_ == 7) { + output.writeMessage( + 7, (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_); + } + if (cloudProviderMetadataCase_ == 8) { + output.writeMessage( + 8, (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_); + } + if (cloudProviderMetadataCase_ == 9) { + output.writeMessage( + 9, (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(10, getResourcePath()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourcePathString_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, resourcePathString_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); + } + if (cloudProvider_ + != com.google.cloud.securitycenter.v2.CloudProvider.CLOUD_PROVIDER_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, cloudProvider_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, service_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, location_); + } + if (cloudProviderMetadataCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_); + } + if (cloudProviderMetadataCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_); + } + if (cloudProviderMetadataCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getResourcePath()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourcePathString_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, resourcePathString_); + } + size += getUnknownFields().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.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource other = + (com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource) + obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getType().equals(other.getType())) return false; + if (cloudProvider_ != other.cloudProvider_) return false; + if (!getService().equals(other.getService())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (hasResourcePath() != other.hasResourcePath()) return false; + if (hasResourcePath()) { + if (!getResourcePath().equals(other.getResourcePath())) return false; + } + if (!getResourcePathString().equals(other.getResourcePathString())) return false; + if (!getCloudProviderMetadataCase().equals(other.getCloudProviderMetadataCase())) + return false; + switch (cloudProviderMetadataCase_) { + case 7: + if (!getGcpMetadata().equals(other.getGcpMetadata())) return false; + break; + case 8: + if (!getAwsMetadata().equals(other.getAwsMetadata())) return false; + break; + case 9: + if (!getAzureMetadata().equals(other.getAzureMetadata())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + CLOUD_PROVIDER_FIELD_NUMBER; + hash = (53 * hash) + cloudProvider_; + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + if (hasResourcePath()) { + hash = (37 * hash) + RESOURCE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getResourcePath().hashCode(); + } + hash = (37 * hash) + RESOURCE_PATH_STRING_FIELD_NUMBER; + hash = (53 * hash) + getResourcePathString().hashCode(); + switch (cloudProviderMetadataCase_) { + case 7: + hash = (37 * hash) + GCP_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getGcpMetadata().hashCode(); + break; + case 8: + hash = (37 * hash) + AWS_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getAwsMetadata().hashCode(); + break; + case 9: + hash = (37 * hash) + AZURE_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getAzureMetadata().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource + 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.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource + 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.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource + 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.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource + 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.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource + 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.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + 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; + } + /** + * + * + *
+       * Information related to the Google Cloud resource that is
+       * associated with this finding.
+       * 
+ * + * Protobuf type {@code + * google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource) + com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .ResourceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.securitycenter.v2.SecuritycenterServiceProto .internal_static_google_cloud_securitycenter_v2_ListFindingsResponse_ListFindingsResult_Resource_descriptor; } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.securitycenter.v2.SecuritycenterServiceProto - .internal_static_google_cloud_securitycenter_v2_ListFindingsResponse_ListFindingsResult_Resource_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource.class, - com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource.Builder.class); + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.SecuritycenterServiceProto + .internal_static_google_cloud_securitycenter_v2_ListFindingsResponse_ListFindingsResult_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource.class, + com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResourcePathFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + type_ = ""; + cloudProvider_ = 0; + service_ = ""; + location_ = ""; + if (gcpMetadataBuilder_ != null) { + gcpMetadataBuilder_.clear(); + } + if (awsMetadataBuilder_ != null) { + awsMetadataBuilder_.clear(); + } + if (azureMetadataBuilder_ != null) { + azureMetadataBuilder_.clear(); + } + resourcePath_ = null; + if (resourcePathBuilder_ != null) { + resourcePathBuilder_.dispose(); + resourcePathBuilder_ = null; + } + resourcePathString_ = ""; + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.SecuritycenterServiceProto + .internal_static_google_cloud_securitycenter_v2_ListFindingsResponse_ListFindingsResult_Resource_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + build() { + com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + buildPartial() { + com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + result = + new com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cloudProvider_ = cloudProvider_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.service_ = service_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.location_ = location_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000200) != 0)) { + result.resourcePath_ = + resourcePathBuilder_ == null ? resourcePath_ : resourcePathBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.resourcePathString_ = resourcePathString_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs( + com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + result) { + result.cloudProviderMetadataCase_ = cloudProviderMetadataCase_; + result.cloudProviderMetadata_ = this.cloudProviderMetadata_; + if (cloudProviderMetadataCase_ == 7 && gcpMetadataBuilder_ != null) { + result.cloudProviderMetadata_ = gcpMetadataBuilder_.build(); + } + if (cloudProviderMetadataCase_ == 8 && awsMetadataBuilder_ != null) { + result.cloudProviderMetadata_ = awsMetadataBuilder_.build(); + } + if (cloudProviderMetadataCase_ == 9 && azureMetadataBuilder_ != null) { + result.cloudProviderMetadata_ = azureMetadataBuilder_.build(); + } + } + + @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.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource) { + return mergeFrom( + (com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult + .Resource) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + other) { + if (other + == com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.cloudProvider_ != 0) { + setCloudProviderValue(other.getCloudProviderValue()); + } + if (!other.getService().isEmpty()) { + service_ = other.service_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasResourcePath()) { + mergeResourcePath(other.getResourcePath()); + } + if (!other.getResourcePathString().isEmpty()) { + resourcePathString_ = other.resourcePathString_; + bitField0_ |= 0x00000400; + onChanged(); + } + switch (other.getCloudProviderMetadataCase()) { + case GCP_METADATA: + { + mergeGcpMetadata(other.getGcpMetadata()); + break; + } + case AWS_METADATA: + { + mergeAwsMetadata(other.getAwsMetadata()); + break; + } + case AZURE_METADATA: + { + mergeAzureMetadata(other.getAzureMetadata()); + break; + } + case CLOUDPROVIDERMETADATA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + cloudProvider_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + service_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(getGcpMetadataFieldBuilder().getBuilder(), extensionRegistry); + cloudProviderMetadataCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage(getAwsMetadataFieldBuilder().getBuilder(), extensionRegistry); + cloudProviderMetadataCase_ = 8; + break; + } // case 66 + case 74: + { + input.readMessage( + getAzureMetadataFieldBuilder().getBuilder(), extensionRegistry); + cloudProviderMetadataCase_ = 9; + break; + } // case 74 + case 82: + { + input.readMessage( + getResourcePathFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + resourcePathString_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int cloudProviderMetadataCase_ = 0; + private java.lang.Object cloudProviderMetadata_; + + public CloudProviderMetadataCase getCloudProviderMetadataCase() { + return CloudProviderMetadataCase.forNumber(cloudProviderMetadataCase_); + } + + public Builder clearCloudProviderMetadata() { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+         * The full resource name of the resource. See:
+         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The full resource name of the resource. See:
+         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The full resource name of the resource. See:
+         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The full resource name of the resource. See:
+         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * The full resource name of the resource. See:
+         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+         * The human readable name of the resource.
+         * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The human readable name of the resource.
+         * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The human readable name of the resource.
+         * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * The human readable name of the resource.
+         * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+         * The human readable name of the resource.
+         * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+         * The full resource type of the resource.
+         * 
+ * + * string type = 3; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The full resource type of the resource.
+         * 
+ * + * string type = 3; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The full resource type of the resource.
+         * 
+ * + * string type = 3; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+         * The full resource type of the resource.
+         * 
+ * + * string type = 3; + * + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+         * The full resource type of the resource.
+         * 
+ * + * string type = 3; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + type_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int cloudProvider_ = 0; + /** + * + * + *
+         * Indicates which cloud provider the finding is from.
+         * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The enum numeric value on the wire for cloudProvider. + */ + @java.lang.Override + public int getCloudProviderValue() { + return cloudProvider_; + } + /** + * + * + *
+         * Indicates which cloud provider the finding is from.
+         * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @param value The enum numeric value on the wire for cloudProvider to set. + * @return This builder for chaining. + */ + public Builder setCloudProviderValue(int value) { + cloudProvider_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+         * Indicates which cloud provider the finding is from.
+         * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The cloudProvider. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.CloudProvider getCloudProvider() { + com.google.cloud.securitycenter.v2.CloudProvider result = + com.google.cloud.securitycenter.v2.CloudProvider.forNumber(cloudProvider_); + return result == null + ? com.google.cloud.securitycenter.v2.CloudProvider.UNRECOGNIZED + : result; + } + /** + * + * + *
+         * Indicates which cloud provider the finding is from.
+         * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @param value The cloudProvider to set. + * @return This builder for chaining. + */ + public Builder setCloudProvider(com.google.cloud.securitycenter.v2.CloudProvider value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + cloudProvider_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+         * Indicates which cloud provider the finding is from.
+         * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return This builder for chaining. + */ + public Builder clearCloudProvider() { + bitField0_ = (bitField0_ & ~0x00000008); + cloudProvider_ = 0; + onChanged(); + return this; } - // Construct using - // com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource.newBuilder() - private Builder() {} + private java.lang.Object service_ = ""; + /** + * + * + *
+         * The service or resource provider associated with the resource.
+         * 
+ * + * string service = 5; + * + * @return The service. + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The service or resource provider associated with the resource.
+         * 
+ * + * string service = 5; + * + * @return The bytes for service. + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The service or resource provider associated with the resource.
+         * 
+ * + * string service = 5; + * + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+         * The service or resource provider associated with the resource.
+         * 
+ * + * string service = 5; + * + * @return This builder for chaining. + */ + public Builder clearService() { + service_ = getDefaultInstance().getService(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+         * The service or resource provider associated with the resource.
+         * 
+ * + * string service = 5; + * + * @param value The bytes for service to set. + * @return This builder for chaining. + */ + public Builder setServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + service_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); + private java.lang.Object location_ = ""; + /** + * + * + *
+         * The region or location of the service (if applicable).
+         * 
+ * + * string location = 6; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The region or location of the service (if applicable).
+         * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The region or location of the service (if applicable).
+         * 
+ * + * string location = 6; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+         * The region or location of the service (if applicable).
+         * 
+ * + * string location = 6; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+         * The region or location of the service (if applicable).
+         * 
+ * + * string location = 6; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.GcpMetadata, + com.google.cloud.securitycenter.v2.GcpMetadata.Builder, + com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder> + gcpMetadataBuilder_; + /** + * + * + *
+         * The GCP metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + * + * @return Whether the gcpMetadata field is set. + */ @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - displayName_ = ""; - type_ = ""; + public boolean hasGcpMetadata() { + return cloudProviderMetadataCase_ == 7; + } + /** + * + * + *
+         * The GCP metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + * + * @return The gcpMetadata. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.GcpMetadata getGcpMetadata() { + if (gcpMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 7) { + return (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); + } else { + if (cloudProviderMetadataCase_ == 7) { + return gcpMetadataBuilder_.getMessage(); + } + return com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+         * The GCP metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + public Builder setGcpMetadata(com.google.cloud.securitycenter.v2.GcpMetadata value) { + if (gcpMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cloudProviderMetadata_ = value; + onChanged(); + } else { + gcpMetadataBuilder_.setMessage(value); + } + cloudProviderMetadataCase_ = 7; + return this; + } + /** + * + * + *
+         * The GCP metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + public Builder setGcpMetadata( + com.google.cloud.securitycenter.v2.GcpMetadata.Builder builderForValue) { + if (gcpMetadataBuilder_ == null) { + cloudProviderMetadata_ = builderForValue.build(); + onChanged(); + } else { + gcpMetadataBuilder_.setMessage(builderForValue.build()); + } + cloudProviderMetadataCase_ = 7; + return this; + } + /** + * + * + *
+         * The GCP metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + public Builder mergeGcpMetadata(com.google.cloud.securitycenter.v2.GcpMetadata value) { + if (gcpMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 7 + && cloudProviderMetadata_ + != com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance()) { + cloudProviderMetadata_ = + com.google.cloud.securitycenter.v2.GcpMetadata.newBuilder( + (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + cloudProviderMetadata_ = value; + } + onChanged(); + } else { + if (cloudProviderMetadataCase_ == 7) { + gcpMetadataBuilder_.mergeFrom(value); + } else { + gcpMetadataBuilder_.setMessage(value); + } + } + cloudProviderMetadataCase_ = 7; + return this; + } + /** + * + * + *
+         * The GCP metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + public Builder clearGcpMetadata() { + if (gcpMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 7) { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + onChanged(); + } + } else { + if (cloudProviderMetadataCase_ == 7) { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + } + gcpMetadataBuilder_.clear(); + } return this; } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.securitycenter.v2.SecuritycenterServiceProto - .internal_static_google_cloud_securitycenter_v2_ListFindingsResponse_ListFindingsResult_Resource_descriptor; + /** + * + * + *
+         * The GCP metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + public com.google.cloud.securitycenter.v2.GcpMetadata.Builder getGcpMetadataBuilder() { + return getGcpMetadataFieldBuilder().getBuilder(); } - + /** + * + * + *
+         * The GCP metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ @java.lang.Override - public com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - getDefaultInstanceForType() { - return com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - .getDefaultInstance(); + public com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder getGcpMetadataOrBuilder() { + if ((cloudProviderMetadataCase_ == 7) && (gcpMetadataBuilder_ != null)) { + return gcpMetadataBuilder_.getMessageOrBuilder(); + } else { + if (cloudProviderMetadataCase_ == 7) { + return (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); + } } - - @java.lang.Override - public com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - build() { - com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + /** + * + * + *
+         * The GCP metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.GcpMetadata, + com.google.cloud.securitycenter.v2.GcpMetadata.Builder, + com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder> + getGcpMetadataFieldBuilder() { + if (gcpMetadataBuilder_ == null) { + if (!(cloudProviderMetadataCase_ == 7)) { + cloudProviderMetadata_ = + com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); + } + gcpMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.GcpMetadata, + com.google.cloud.securitycenter.v2.GcpMetadata.Builder, + com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder>( + (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_, + getParentForChildren(), + isClean()); + cloudProviderMetadata_ = null; } - return result; + cloudProviderMetadataCase_ = 7; + onChanged(); + return gcpMetadataBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata, + com.google.cloud.securitycenter.v2.AwsMetadata.Builder, + com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder> + awsMetadataBuilder_; + /** + * + * + *
+         * The AWS metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + * + * @return Whether the awsMetadata field is set. + */ @java.lang.Override - public com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - buildPartial() { - com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - result = - new com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; + public boolean hasAwsMetadata() { + return cloudProviderMetadataCase_ == 8; } - - private void buildPartial0( - com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; + /** + * + * + *
+         * The AWS metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + * + * @return The awsMetadata. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata getAwsMetadata() { + if (awsMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 8) { + return (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); + } else { + if (cloudProviderMetadataCase_ == 8) { + return awsMetadataBuilder_.getMessage(); + } + return com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.displayName_ = displayName_; + } + /** + * + * + *
+         * The AWS metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + public Builder setAwsMetadata(com.google.cloud.securitycenter.v2.AwsMetadata value) { + if (awsMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cloudProviderMetadata_ = value; + onChanged(); + } else { + awsMetadataBuilder_.setMessage(value); } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.type_ = type_; + cloudProviderMetadataCase_ = 8; + return this; + } + /** + * + * + *
+         * The AWS metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + public Builder setAwsMetadata( + com.google.cloud.securitycenter.v2.AwsMetadata.Builder builderForValue) { + if (awsMetadataBuilder_ == null) { + cloudProviderMetadata_ = builderForValue.build(); + onChanged(); + } else { + awsMetadataBuilder_.setMessage(builderForValue.build()); } + cloudProviderMetadataCase_ = 8; + return this; } - - @java.lang.Override - public Builder clone() { - return super.clone(); + /** + * + * + *
+         * The AWS metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + public Builder mergeAwsMetadata(com.google.cloud.securitycenter.v2.AwsMetadata value) { + if (awsMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 8 + && cloudProviderMetadata_ + != com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance()) { + cloudProviderMetadata_ = + com.google.cloud.securitycenter.v2.AwsMetadata.newBuilder( + (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + cloudProviderMetadata_ = value; + } + onChanged(); + } else { + if (cloudProviderMetadataCase_ == 8) { + awsMetadataBuilder_.mergeFrom(value); + } else { + awsMetadataBuilder_.setMessage(value); + } + } + cloudProviderMetadataCase_ = 8; + return this; } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + /** + * + * + *
+         * The AWS metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + public Builder clearAwsMetadata() { + if (awsMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 8) { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + onChanged(); + } + } else { + if (cloudProviderMetadataCase_ == 8) { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + } + awsMetadataBuilder_.clear(); + } + return this; } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + /** + * + * + *
+         * The AWS metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.Builder getAwsMetadataBuilder() { + return getAwsMetadataFieldBuilder().getBuilder(); } - + /** + * + * + *
+         * The AWS metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + public com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder getAwsMetadataOrBuilder() { + if ((cloudProviderMetadataCase_ == 8) && (awsMetadataBuilder_ != null)) { + return awsMetadataBuilder_.getMessageOrBuilder(); + } else { + if (cloudProviderMetadataCase_ == 8) { + return (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); + } } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); + /** + * + * + *
+         * The AWS metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata, + com.google.cloud.securitycenter.v2.AwsMetadata.Builder, + com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder> + getAwsMetadataFieldBuilder() { + if (awsMetadataBuilder_ == null) { + if (!(cloudProviderMetadataCase_ == 8)) { + cloudProviderMetadata_ = + com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); + } + awsMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata, + com.google.cloud.securitycenter.v2.AwsMetadata.Builder, + com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder>( + (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_, + getParentForChildren(), + isClean()); + cloudProviderMetadata_ = null; + } + cloudProviderMetadataCase_ = 8; + onChanged(); + return awsMetadataBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata, + com.google.cloud.securitycenter.v2.AzureMetadata.Builder, + com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder> + azureMetadataBuilder_; + /** + * + * + *
+         * The Azure metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + * + * @return Whether the azureMetadata field is set. + */ @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + public boolean hasAzureMetadata() { + return cloudProviderMetadataCase_ == 9; } - + /** + * + * + *
+         * The Azure metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + * + * @return The azureMetadata. + */ @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource) { - return mergeFrom( - (com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult - .Resource) - other); + public com.google.cloud.securitycenter.v2.AzureMetadata getAzureMetadata() { + if (azureMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 9) { + return (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); } else { - super.mergeFrom(other); - return this; + if (cloudProviderMetadataCase_ == 9) { + return azureMetadataBuilder_.getMessage(); + } + return com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); } } - - public Builder mergeFrom( - com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - other) { - if (other - == com.google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource - .getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getDisplayName().isEmpty()) { - displayName_ = other.displayName_; - bitField0_ |= 0x00000002; + /** + * + * + *
+         * The Azure metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + */ + public Builder setAzureMetadata(com.google.cloud.securitycenter.v2.AzureMetadata value) { + if (azureMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cloudProviderMetadata_ = value; onChanged(); + } else { + azureMetadataBuilder_.setMessage(value); } - if (!other.getType().isEmpty()) { - type_ = other.type_; - bitField0_ |= 0x00000004; + cloudProviderMetadataCase_ = 9; + return this; + } + /** + * + * + *
+         * The Azure metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + */ + public Builder setAzureMetadata( + com.google.cloud.securitycenter.v2.AzureMetadata.Builder builderForValue) { + if (azureMetadataBuilder_ == null) { + cloudProviderMetadata_ = builderForValue.build(); onChanged(); + } else { + azureMetadataBuilder_.setMessage(builderForValue.build()); } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); + cloudProviderMetadataCase_ = 9; 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - displayName_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - type_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { + /** + * + * + *
+         * The Azure metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + */ + public Builder mergeAzureMetadata(com.google.cloud.securitycenter.v2.AzureMetadata value) { + if (azureMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 9 + && cloudProviderMetadata_ + != com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance()) { + cloudProviderMetadata_ = + com.google.cloud.securitycenter.v2.AzureMetadata.newBuilder( + (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + cloudProviderMetadata_ = value; + } onChanged(); - } // finally + } else { + if (cloudProviderMetadataCase_ == 9) { + azureMetadataBuilder_.mergeFrom(value); + } else { + azureMetadataBuilder_.setMessage(value); + } + } + cloudProviderMetadataCase_ = 9; return this; } - - private int bitField0_; - - private java.lang.Object name_ = ""; /** * * *
-         * The full resource name of the resource. See:
-         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * The Azure metadata associated with the finding.
          * 
* - * string name = 1; - * - * @return The name. + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; + public Builder clearAzureMetadata() { + if (azureMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 9) { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + onChanged(); + } } else { - return (java.lang.String) ref; + if (cloudProviderMetadataCase_ == 9) { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + } + azureMetadataBuilder_.clear(); } + return this; } /** * * *
-         * The full resource name of the resource. See:
-         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * The Azure metadata associated with the finding.
          * 
* - * string name = 1; + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.Builder getAzureMetadataBuilder() { + return getAzureMetadataFieldBuilder().getBuilder(); + } + /** * - * @return The bytes for name. + * + *
+         * The Azure metadata associated with the finding.
+         * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder + getAzureMetadataOrBuilder() { + if ((cloudProviderMetadataCase_ == 9) && (azureMetadataBuilder_ != null)) { + return azureMetadataBuilder_.getMessageOrBuilder(); } else { - return (com.google.protobuf.ByteString) ref; + if (cloudProviderMetadataCase_ == 9) { + return (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); } } /** * * *
-         * The full resource name of the resource. See:
-         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * The Azure metadata associated with the finding.
          * 
* - * string name = 1; - * - * @param value The name to set. - * @return This builder for chaining. + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata, + com.google.cloud.securitycenter.v2.AzureMetadata.Builder, + com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder> + getAzureMetadataFieldBuilder() { + if (azureMetadataBuilder_ == null) { + if (!(cloudProviderMetadataCase_ == 9)) { + cloudProviderMetadata_ = + com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); + } + azureMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata, + com.google.cloud.securitycenter.v2.AzureMetadata.Builder, + com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder>( + (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_, + getParentForChildren(), + isClean()); + cloudProviderMetadata_ = null; } - name_ = value; - bitField0_ |= 0x00000001; + cloudProviderMetadataCase_ = 9; onChanged(); - return this; + return azureMetadataBuilder_; } + + private com.google.cloud.securitycenter.v2.ResourcePath resourcePath_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.ResourcePath, + com.google.cloud.securitycenter.v2.ResourcePath.Builder, + com.google.cloud.securitycenter.v2.ResourcePathOrBuilder> + resourcePathBuilder_; /** * * *
-         * The full resource name of the resource. See:
-         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * Provides the path to the resource within the resource hierarchy.
          * 
* - * string name = 1; + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; * - * @return This builder for chaining. + * @return Whether the resourcePath field is set. */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; + public boolean hasResourcePath() { + return ((bitField0_ & 0x00000200) != 0); } /** * * *
-         * The full resource name of the resource. See:
-         * https://cloud.google.com/apis/design/resource_names#full_resource_name
+         * Provides the path to the resource within the resource hierarchy.
          * 
* - * string name = 1; + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; * - * @param value The bytes for name to set. - * @return This builder for chaining. + * @return The resourcePath. */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public com.google.cloud.securitycenter.v2.ResourcePath getResourcePath() { + if (resourcePathBuilder_ == null) { + return resourcePath_ == null + ? com.google.cloud.securitycenter.v2.ResourcePath.getDefaultInstance() + : resourcePath_; + } else { + return resourcePathBuilder_.getMessage(); } - checkByteStringIsUtf8(value); - name_ = value; - bitField0_ |= 0x00000001; + } + /** + * + * + *
+         * Provides the path to the resource within the resource hierarchy.
+         * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + */ + public Builder setResourcePath(com.google.cloud.securitycenter.v2.ResourcePath value) { + if (resourcePathBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resourcePath_ = value; + } else { + resourcePathBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; onChanged(); return this; } - - private java.lang.Object displayName_ = ""; /** * * *
-         * The human readable name of the resource.
+         * Provides the path to the resource within the resource hierarchy.
          * 
* - * string display_name = 2; - * - * @return The displayName. + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; + public Builder setResourcePath( + com.google.cloud.securitycenter.v2.ResourcePath.Builder builderForValue) { + if (resourcePathBuilder_ == null) { + resourcePath_ = builderForValue.build(); } else { - return (java.lang.String) ref; + resourcePathBuilder_.setMessage(builderForValue.build()); } + bitField0_ |= 0x00000200; + onChanged(); + return this; } /** * * *
-         * The human readable name of the resource.
+         * Provides the path to the resource within the resource hierarchy.
          * 
* - * string display_name = 2; - * - * @return The bytes for displayName. + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; */ - public com.google.protobuf.ByteString getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - displayName_ = b; - return b; + public Builder mergeResourcePath(com.google.cloud.securitycenter.v2.ResourcePath value) { + if (resourcePathBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && resourcePath_ != null + && resourcePath_ + != com.google.cloud.securitycenter.v2.ResourcePath.getDefaultInstance()) { + getResourcePathBuilder().mergeFrom(value); + } else { + resourcePath_ = value; + } } else { - return (com.google.protobuf.ByteString) ref; + resourcePathBuilder_.mergeFrom(value); } + if (resourcePath_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; } /** * * *
-         * The human readable name of the resource.
+         * Provides the path to the resource within the resource hierarchy.
          * 
* - * string display_name = 2; - * - * @param value The displayName to set. - * @return This builder for chaining. + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; */ - public Builder setDisplayName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder clearResourcePath() { + bitField0_ = (bitField0_ & ~0x00000200); + resourcePath_ = null; + if (resourcePathBuilder_ != null) { + resourcePathBuilder_.dispose(); + resourcePathBuilder_ = null; } - displayName_ = value; - bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1100,60 +3326,87 @@ public Builder setDisplayName(java.lang.String value) { * * *
-         * The human readable name of the resource.
+         * Provides the path to the resource within the resource hierarchy.
          * 
* - * string display_name = 2; - * - * @return This builder for chaining. + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; */ - public Builder clearDisplayName() { - displayName_ = getDefaultInstance().getDisplayName(); - bitField0_ = (bitField0_ & ~0x00000002); + public com.google.cloud.securitycenter.v2.ResourcePath.Builder getResourcePathBuilder() { + bitField0_ |= 0x00000200; onChanged(); - return this; + return getResourcePathFieldBuilder().getBuilder(); } /** * * *
-         * The human readable name of the resource.
+         * Provides the path to the resource within the resource hierarchy.
          * 
* - * string display_name = 2; + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + */ + public com.google.cloud.securitycenter.v2.ResourcePathOrBuilder getResourcePathOrBuilder() { + if (resourcePathBuilder_ != null) { + return resourcePathBuilder_.getMessageOrBuilder(); + } else { + return resourcePath_ == null + ? com.google.cloud.securitycenter.v2.ResourcePath.getDefaultInstance() + : resourcePath_; + } + } + /** * - * @param value The bytes for displayName to set. - * @return This builder for chaining. + * + *
+         * Provides the path to the resource within the resource hierarchy.
+         * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; */ - public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.ResourcePath, + com.google.cloud.securitycenter.v2.ResourcePath.Builder, + com.google.cloud.securitycenter.v2.ResourcePathOrBuilder> + getResourcePathFieldBuilder() { + if (resourcePathBuilder_ == null) { + resourcePathBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.ResourcePath, + com.google.cloud.securitycenter.v2.ResourcePath.Builder, + com.google.cloud.securitycenter.v2.ResourcePathOrBuilder>( + getResourcePath(), getParentForChildren(), isClean()); + resourcePath_ = null; } - checkByteStringIsUtf8(value); - displayName_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; + return resourcePathBuilder_; } - private java.lang.Object type_ = ""; + private java.lang.Object resourcePathString_ = ""; /** * * *
-         * The full resource type of the resource.
+         * A string representation of the resource path.
+         * For Google Cloud, it has the format of
+         * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+         * where there can be any number of folders.
+         * For AWS, it has the format of
+         * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+         * where there can be any number of organizational units.
+         * For Azure, it has the format of
+         * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+         * where there can be any number of management groups.
          * 
* - * string type = 3; + * string resource_path_string = 11; * - * @return The type. + * @return The resourcePathString. */ - public java.lang.String getType() { - java.lang.Object ref = type_; + public java.lang.String getResourcePathString() { + java.lang.Object ref = resourcePathString_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - type_ = s; + resourcePathString_ = s; return s; } else { return (java.lang.String) ref; @@ -1163,19 +3416,28 @@ public java.lang.String getType() { * * *
-         * The full resource type of the resource.
+         * A string representation of the resource path.
+         * For Google Cloud, it has the format of
+         * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+         * where there can be any number of folders.
+         * For AWS, it has the format of
+         * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+         * where there can be any number of organizational units.
+         * For Azure, it has the format of
+         * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+         * where there can be any number of management groups.
          * 
* - * string type = 3; + * string resource_path_string = 11; * - * @return The bytes for type. + * @return The bytes for resourcePathString. */ - public com.google.protobuf.ByteString getTypeBytes() { - java.lang.Object ref = type_; + public com.google.protobuf.ByteString getResourcePathStringBytes() { + java.lang.Object ref = resourcePathString_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - type_ = b; + resourcePathString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -1185,20 +3447,29 @@ public com.google.protobuf.ByteString getTypeBytes() { * * *
-         * The full resource type of the resource.
+         * A string representation of the resource path.
+         * For Google Cloud, it has the format of
+         * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+         * where there can be any number of folders.
+         * For AWS, it has the format of
+         * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+         * where there can be any number of organizational units.
+         * For Azure, it has the format of
+         * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+         * where there can be any number of management groups.
          * 
* - * string type = 3; + * string resource_path_string = 11; * - * @param value The type to set. + * @param value The resourcePathString to set. * @return This builder for chaining. */ - public Builder setType(java.lang.String value) { + public Builder setResourcePathString(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - type_ = value; - bitField0_ |= 0x00000004; + resourcePathString_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -1206,16 +3477,25 @@ public Builder setType(java.lang.String value) { * * *
-         * The full resource type of the resource.
+         * A string representation of the resource path.
+         * For Google Cloud, it has the format of
+         * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+         * where there can be any number of folders.
+         * For AWS, it has the format of
+         * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+         * where there can be any number of organizational units.
+         * For Azure, it has the format of
+         * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+         * where there can be any number of management groups.
          * 
* - * string type = 3; + * string resource_path_string = 11; * * @return This builder for chaining. */ - public Builder clearType() { - type_ = getDefaultInstance().getType(); - bitField0_ = (bitField0_ & ~0x00000004); + public Builder clearResourcePathString() { + resourcePathString_ = getDefaultInstance().getResourcePathString(); + bitField0_ = (bitField0_ & ~0x00000400); onChanged(); return this; } @@ -1223,21 +3503,30 @@ public Builder clearType() { * * *
-         * The full resource type of the resource.
+         * A string representation of the resource path.
+         * For Google Cloud, it has the format of
+         * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+         * where there can be any number of folders.
+         * For AWS, it has the format of
+         * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+         * where there can be any number of organizational units.
+         * For Azure, it has the format of
+         * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+         * where there can be any number of management groups.
          * 
* - * string type = 3; + * string resource_path_string = 11; * - * @param value The bytes for type to set. + * @param value The bytes for resourcePathString to set. * @return This builder for chaining. */ - public Builder setTypeBytes(com.google.protobuf.ByteString value) { + public Builder setResourcePathStringBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - type_ = value; - bitField0_ |= 0x00000004; + resourcePathString_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/MitreAttack.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/MitreAttack.java index 6889cf26a04a..f3ade9dd99cf 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/MitreAttack.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/MitreAttack.java @@ -496,7 +496,7 @@ private Tactic(int value) { *
    * MITRE ATT&CK techniques that can be referenced by SCC findings.
    * See: https://attack.mitre.org/techniques/enterprise/
-   * Next ID: 59
+   * Next ID: 63
    * 
* * Protobuf enum {@code google.cloud.securitycenter.v2.MitreAttack.Technique} @@ -592,6 +592,16 @@ public enum Technique implements com.google.protobuf.ProtocolMessageEnum { * UNIX_SHELL = 7; */ UNIX_SHELL(7), + /** + * + * + *
+     * T1059.006
+     * 
+ * + * PYTHON = 59; + */ + PYTHON(59), /** * * @@ -1082,6 +1092,26 @@ public enum Technique implements com.google.protobuf.ProtocolMessageEnum { * SCANNING_IP_BLOCKS = 2; */ SCANNING_IP_BLOCKS(2), + /** + * + * + *
+     * T1613
+     * 
+ * + * CONTAINER_ADMINISTRATION_COMMAND = 60; + */ + CONTAINER_ADMINISTRATION_COMMAND(60), + /** + * + * + *
+     * T1611
+     * 
+ * + * ESCAPE_TO_HOST = 61; + */ + ESCAPE_TO_HOST(61), /** * * @@ -1092,6 +1122,16 @@ public enum Technique implements com.google.protobuf.ProtocolMessageEnum { * CONTAINER_AND_RESOURCE_DISCOVERY = 57; */ CONTAINER_AND_RESOURCE_DISCOVERY(57), + /** + * + * + *
+     * T1649
+     * 
+ * + * STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62; + */ + STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES(62), UNRECOGNIZED(-1), ; @@ -1185,6 +1225,16 @@ public enum Technique implements com.google.protobuf.ProtocolMessageEnum { * UNIX_SHELL = 7; */ public static final int UNIX_SHELL_VALUE = 7; + /** + * + * + *
+     * T1059.006
+     * 
+ * + * PYTHON = 59; + */ + public static final int PYTHON_VALUE = 59; /** * * @@ -1675,6 +1725,26 @@ public enum Technique implements com.google.protobuf.ProtocolMessageEnum { * SCANNING_IP_BLOCKS = 2; */ public static final int SCANNING_IP_BLOCKS_VALUE = 2; + /** + * + * + *
+     * T1613
+     * 
+ * + * CONTAINER_ADMINISTRATION_COMMAND = 60; + */ + public static final int CONTAINER_ADMINISTRATION_COMMAND_VALUE = 60; + /** + * + * + *
+     * T1611
+     * 
+ * + * ESCAPE_TO_HOST = 61; + */ + public static final int ESCAPE_TO_HOST_VALUE = 61; /** * * @@ -1685,6 +1755,16 @@ public enum Technique implements com.google.protobuf.ProtocolMessageEnum { * CONTAINER_AND_RESOURCE_DISCOVERY = 57; */ public static final int CONTAINER_AND_RESOURCE_DISCOVERY_VALUE = 57; + /** + * + * + *
+     * T1649
+     * 
+ * + * STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62; + */ + public static final int STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES_VALUE = 62; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -1728,6 +1808,8 @@ public static Technique forNumber(int value) { return COMMAND_AND_SCRIPTING_INTERPRETER; case 7: return UNIX_SHELL; + case 59: + return PYTHON; case 18: return PERMISSION_GROUPS_DISCOVERY; case 19: @@ -1826,8 +1908,14 @@ public static Technique forNumber(int value) { return ACTIVE_SCANNING; case 2: return SCANNING_IP_BLOCKS; + case 60: + return CONTAINER_ADMINISTRATION_COMMAND; + case 61: + return ESCAPE_TO_HOST; case 57: return CONTAINER_AND_RESOURCE_DISCOVERY; + case 62: + return STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES; default: return null; } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/MitreAttackProto.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/MitreAttackProto.java index 6e4ee673b58e..94ae81f4be1a 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/MitreAttackProto.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/MitreAttackProto.java @@ -43,7 +43,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n1google/cloud/securitycenter/v2/mitre_a" + "ttack.proto\022\036google.cloud.securitycenter" - + ".v2\"\366\021\n\013MitreAttack\022J\n\016primary_tactic\030\001 " + + ".v2\"\354\022\n\013MitreAttack\022J\n\016primary_tactic\030\001 " + "\001(\01622.google.cloud.securitycenter.v2.Mit" + "reAttack.Tactic\022Q\n\022primary_techniques\030\002 " + "\003(\01625.google.cloud.securitycenter.v2.Mit" @@ -59,54 +59,57 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\022\023\n\017DEFENSE_EVASION\020\007\022\025\n\021CREDENTIAL_ACCE" + "SS\020\t\022\r\n\tDISCOVERY\020\n\022\024\n\020LATERAL_MOVEMENT\020" + "\013\022\016\n\nCOLLECTION\020\014\022\027\n\023COMMAND_AND_CONTROL" - + "\020\004\022\020\n\014EXFILTRATION\020\r\022\n\n\006IMPACT\020\016\"\331\014\n\tTec" + + "\020\004\022\020\n\014EXFILTRATION\020\r\022\n\n\006IMPACT\020\016\"\317\r\n\tTec" + "hnique\022\031\n\025TECHNIQUE_UNSPECIFIED\020\000\022\020\n\014MAS" + "QUERADING\0201\022%\n!MATCH_LEGITIMATE_NAME_OR_" + "LOCATION\0202\022(\n$BOOT_OR_LOGON_INITIALIZATI" + "ON_SCRIPTS\020%\022\021\n\rSTARTUP_ITEMS\020&\022\035\n\031NETWO" + "RK_SERVICE_DISCOVERY\020 \022\025\n\021PROCESS_DISCOV" + "ERY\0208\022%\n!COMMAND_AND_SCRIPTING_INTERPRET" - + "ER\020\006\022\016\n\nUNIX_SHELL\020\007\022\037\n\033PERMISSION_GROUP" - + "S_DISCOVERY\020\022\022\020\n\014CLOUD_GROUPS\020\023\022\036\n\032APPLI" - + "CATION_LAYER_PROTOCOL\020-\022\007\n\003DNS\020.\022\035\n\031SOFT" - + "WARE_DEPLOYMENT_TOOLS\020/\022\022\n\016VALID_ACCOUNT" - + "S\020\016\022\024\n\020DEFAULT_ACCOUNTS\020#\022\022\n\016LOCAL_ACCOU" - + "NTS\020\017\022\022\n\016CLOUD_ACCOUNTS\020\020\022\t\n\005PROXY\020\t\022\022\n\016" - + "EXTERNAL_PROXY\020\n\022\023\n\017MULTI_HOP_PROXY\020\013\022\030\n" - + "\024ACCOUNT_MANIPULATION\020\026\022 \n\034ADDITIONAL_CL" - + "OUD_CREDENTIALS\020(\022\027\n\023SSH_AUTHORIZED_KEYS" - + "\020\027\022&\n\"ADDITIONAL_CONTAINER_CLUSTER_ROLES" - + "\020:\022\031\n\025INGRESS_TOOL_TRANSFER\020\003\022\016\n\nNATIVE_" - + "API\020\004\022\017\n\013BRUTE_FORCE\020,\022\022\n\016SHARED_MODULES" - + "\020\005\022\035\n\031ACCESS_TOKEN_MANIPULATION\020!\022 \n\034TOK" - + "EN_IMPERSONATION_OR_THEFT\020\'\022%\n!EXPLOIT_P" - + "UBLIC_FACING_APPLICATION\020\033\022\036\n\032DOMAIN_POL" - + "ICY_MODIFICATION\020\036\022\024\n\020DATA_DESTRUCTION\020\035" - + "\022\020\n\014SERVICE_STOP\0204\022\033\n\027INHIBIT_SYSTEM_REC" - + "OVERY\020$\022\026\n\022RESOURCE_HIJACKING\020\010\022\035\n\031NETWO" - + "RK_DENIAL_OF_SERVICE\020\021\022\033\n\027CLOUD_SERVICE_" - + "DISCOVERY\0200\022\"\n\036STEAL_APPLICATION_ACCESS_" - + "TOKEN\020*\022\032\n\026ACCOUNT_ACCESS_REMOVAL\0203\022\034\n\030S" - + "TEAL_WEB_SESSION_COOKIE\020\031\022#\n\037CREATE_OR_M" - + "ODIFY_SYSTEM_PROCESS\020\030\022%\n!ABUSE_ELEVATIO" - + "N_CONTROL_MECHANISM\020\"\022\031\n\025UNSECURED_CREDE" - + "NTIALS\020\r\022!\n\035MODIFY_AUTHENTICATION_PROCES" - + "S\020\034\022\023\n\017IMPAIR_DEFENSES\020\037\022\033\n\027DISABLE_OR_M" - + "ODIFY_TOOLS\0207\022!\n\035EXFILTRATION_OVER_WEB_S" - + "ERVICE\020\024\022!\n\035EXFILTRATION_TO_CLOUD_STORAG" - + "E\020\025\022\026\n\022DYNAMIC_RESOLUTION\020\014\022\031\n\025LATERAL_T" - + "OOL_TRANSFER\020)\022\'\n#MODIFY_CLOUD_COMPUTE_I" - + "NFRASTRUCTURE\020\032\022\023\n\017CREATE_SNAPSHOT\0206\022\"\n\036" - + "CLOUD_INFRASTRUCTURE_DISCOVERY\0205\022\027\n\023OBTA" - + "IN_CAPABILITIES\020+\022\023\n\017ACTIVE_SCANNING\020\001\022\026" - + "\n\022SCANNING_IP_BLOCKS\020\002\022$\n CONTAINER_AND_" - + "RESOURCE_DISCOVERY\0209B\352\001\n\"com.google.clou" - + "d.securitycenter.v2B\020MitreAttackProtoP\001Z" - + "Jcloud.google.com/go/securitycenter/apiv" - + "2/securitycenterpb;securitycenterpb\252\002\036Go" - + "ogle.Cloud.SecurityCenter.V2\312\002\036Google\\Cl" - + "oud\\SecurityCenter\\V2\352\002!Google::Cloud::S" - + "ecurityCenter::V2b\006proto3" + + "ER\020\006\022\016\n\nUNIX_SHELL\020\007\022\n\n\006PYTHON\020;\022\037\n\033PERM" + + "ISSION_GROUPS_DISCOVERY\020\022\022\020\n\014CLOUD_GROUP" + + "S\020\023\022\036\n\032APPLICATION_LAYER_PROTOCOL\020-\022\007\n\003D" + + "NS\020.\022\035\n\031SOFTWARE_DEPLOYMENT_TOOLS\020/\022\022\n\016V" + + "ALID_ACCOUNTS\020\016\022\024\n\020DEFAULT_ACCOUNTS\020#\022\022\n" + + "\016LOCAL_ACCOUNTS\020\017\022\022\n\016CLOUD_ACCOUNTS\020\020\022\t\n" + + "\005PROXY\020\t\022\022\n\016EXTERNAL_PROXY\020\n\022\023\n\017MULTI_HO" + + "P_PROXY\020\013\022\030\n\024ACCOUNT_MANIPULATION\020\026\022 \n\034A" + + "DDITIONAL_CLOUD_CREDENTIALS\020(\022\027\n\023SSH_AUT" + + "HORIZED_KEYS\020\027\022&\n\"ADDITIONAL_CONTAINER_C" + + "LUSTER_ROLES\020:\022\031\n\025INGRESS_TOOL_TRANSFER\020" + + "\003\022\016\n\nNATIVE_API\020\004\022\017\n\013BRUTE_FORCE\020,\022\022\n\016SH" + + "ARED_MODULES\020\005\022\035\n\031ACCESS_TOKEN_MANIPULAT" + + "ION\020!\022 \n\034TOKEN_IMPERSONATION_OR_THEFT\020\'\022" + + "%\n!EXPLOIT_PUBLIC_FACING_APPLICATION\020\033\022\036" + + "\n\032DOMAIN_POLICY_MODIFICATION\020\036\022\024\n\020DATA_D" + + "ESTRUCTION\020\035\022\020\n\014SERVICE_STOP\0204\022\033\n\027INHIBI" + + "T_SYSTEM_RECOVERY\020$\022\026\n\022RESOURCE_HIJACKIN" + + "G\020\010\022\035\n\031NETWORK_DENIAL_OF_SERVICE\020\021\022\033\n\027CL" + + "OUD_SERVICE_DISCOVERY\0200\022\"\n\036STEAL_APPLICA" + + "TION_ACCESS_TOKEN\020*\022\032\n\026ACCOUNT_ACCESS_RE" + + "MOVAL\0203\022\034\n\030STEAL_WEB_SESSION_COOKIE\020\031\022#\n" + + "\037CREATE_OR_MODIFY_SYSTEM_PROCESS\020\030\022%\n!AB" + + "USE_ELEVATION_CONTROL_MECHANISM\020\"\022\031\n\025UNS" + + "ECURED_CREDENTIALS\020\r\022!\n\035MODIFY_AUTHENTIC" + + "ATION_PROCESS\020\034\022\023\n\017IMPAIR_DEFENSES\020\037\022\033\n\027" + + "DISABLE_OR_MODIFY_TOOLS\0207\022!\n\035EXFILTRATIO" + + "N_OVER_WEB_SERVICE\020\024\022!\n\035EXFILTRATION_TO_" + + "CLOUD_STORAGE\020\025\022\026\n\022DYNAMIC_RESOLUTION\020\014\022" + + "\031\n\025LATERAL_TOOL_TRANSFER\020)\022\'\n#MODIFY_CLO" + + "UD_COMPUTE_INFRASTRUCTURE\020\032\022\023\n\017CREATE_SN" + + "APSHOT\0206\022\"\n\036CLOUD_INFRASTRUCTURE_DISCOVE" + + "RY\0205\022\027\n\023OBTAIN_CAPABILITIES\020+\022\023\n\017ACTIVE_" + + "SCANNING\020\001\022\026\n\022SCANNING_IP_BLOCKS\020\002\022$\n CO" + + "NTAINER_ADMINISTRATION_COMMAND\020<\022\022\n\016ESCA" + + "PE_TO_HOST\020=\022$\n CONTAINER_AND_RESOURCE_D" + + "ISCOVERY\0209\022.\n*STEAL_OR_FORGE_AUTHENTICAT" + + "ION_CERTIFICATES\020>B\352\001\n\"com.google.cloud." + + "securitycenter.v2B\020MitreAttackProtoP\001ZJc" + + "loud.google.com/go/securitycenter/apiv2/" + + "securitycenterpb;securitycenterpb\252\002\036Goog" + + "le.Cloud.SecurityCenter.V2\312\002\036Google\\Clou" + + "d\\SecurityCenter\\V2\352\002!Google::Cloud::Sec" + + "urityCenter::V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Notebook.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Notebook.java new file mode 100644 index 000000000000..55a8b438efc9 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Notebook.java @@ -0,0 +1,1275 @@ +/* + * Copyright 2024 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/securitycenter/v2/notebook.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +/** + * + * + *
+ * Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise
+ * notebook](https://cloud.google.com/colab/docs/introduction) file, that is
+ * associated with a finding.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.Notebook} + */ +public final class Notebook extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.Notebook) + NotebookOrBuilder { + private static final long serialVersionUID = 0L; + // Use Notebook.newBuilder() to construct. + private Notebook(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Notebook() { + name_ = ""; + service_ = ""; + lastAuthor_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Notebook(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.NotebookProto + .internal_static_google_cloud_securitycenter_v2_Notebook_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.NotebookProto + .internal_static_google_cloud_securitycenter_v2_Notebook_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.Notebook.class, + com.google.cloud.securitycenter.v2.Notebook.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The name of the notebook.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the notebook.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object service_ = ""; + /** + * + * + *
+   * The source notebook service, for example, "Colab Enterprise".
+   * 
+ * + * string service = 2; + * + * @return The service. + */ + @java.lang.Override + public java.lang.String getService() { + java.lang.Object ref = service_; + 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(); + service_ = s; + return s; + } + } + /** + * + * + *
+   * The source notebook service, for example, "Colab Enterprise".
+   * 
+ * + * string service = 2; + * + * @return The bytes for service. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LAST_AUTHOR_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object lastAuthor_ = ""; + /** + * + * + *
+   * The user ID of the latest author to modify the notebook.
+   * 
+ * + * string last_author = 3; + * + * @return The lastAuthor. + */ + @java.lang.Override + public java.lang.String getLastAuthor() { + java.lang.Object ref = lastAuthor_; + 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(); + lastAuthor_ = s; + return s; + } + } + /** + * + * + *
+   * The user ID of the latest author to modify the notebook.
+   * 
+ * + * string last_author = 3; + * + * @return The bytes for lastAuthor. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLastAuthorBytes() { + java.lang.Object ref = lastAuthor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastAuthor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTEBOOK_UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp notebookUpdateTime_; + /** + * + * + *
+   * The most recent time the notebook was updated.
+   * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + * + * @return Whether the notebookUpdateTime field is set. + */ + @java.lang.Override + public boolean hasNotebookUpdateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The most recent time the notebook was updated.
+   * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + * + * @return The notebookUpdateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getNotebookUpdateTime() { + return notebookUpdateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : notebookUpdateTime_; + } + /** + * + * + *
+   * The most recent time the notebook was updated.
+   * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getNotebookUpdateTimeOrBuilder() { + return notebookUpdateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : notebookUpdateTime_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, service_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastAuthor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, lastAuthor_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getNotebookUpdateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, service_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lastAuthor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, lastAuthor_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getNotebookUpdateTime()); + } + size += getUnknownFields().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.securitycenter.v2.Notebook)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.Notebook other = + (com.google.cloud.securitycenter.v2.Notebook) obj; + + if (!getName().equals(other.getName())) return false; + if (!getService().equals(other.getService())) return false; + if (!getLastAuthor().equals(other.getLastAuthor())) return false; + if (hasNotebookUpdateTime() != other.hasNotebookUpdateTime()) return false; + if (hasNotebookUpdateTime()) { + if (!getNotebookUpdateTime().equals(other.getNotebookUpdateTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (37 * hash) + LAST_AUTHOR_FIELD_NUMBER; + hash = (53 * hash) + getLastAuthor().hashCode(); + if (hasNotebookUpdateTime()) { + hash = (37 * hash) + NOTEBOOK_UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getNotebookUpdateTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.Notebook parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Notebook 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.securitycenter.v2.Notebook parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Notebook 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.securitycenter.v2.Notebook parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Notebook parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.Notebook parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Notebook 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.securitycenter.v2.Notebook parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Notebook 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.securitycenter.v2.Notebook parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Notebook 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.securitycenter.v2.Notebook 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; + } + /** + * + * + *
+   * Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise
+   * notebook](https://cloud.google.com/colab/docs/introduction) file, that is
+   * associated with a finding.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.Notebook} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.Notebook) + com.google.cloud.securitycenter.v2.NotebookOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.NotebookProto + .internal_static_google_cloud_securitycenter_v2_Notebook_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.NotebookProto + .internal_static_google_cloud_securitycenter_v2_Notebook_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.Notebook.class, + com.google.cloud.securitycenter.v2.Notebook.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.Notebook.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getNotebookUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + service_ = ""; + lastAuthor_ = ""; + notebookUpdateTime_ = null; + if (notebookUpdateTimeBuilder_ != null) { + notebookUpdateTimeBuilder_.dispose(); + notebookUpdateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.NotebookProto + .internal_static_google_cloud_securitycenter_v2_Notebook_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Notebook getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.Notebook.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Notebook build() { + com.google.cloud.securitycenter.v2.Notebook result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Notebook buildPartial() { + com.google.cloud.securitycenter.v2.Notebook result = + new com.google.cloud.securitycenter.v2.Notebook(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.Notebook result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.service_ = service_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.lastAuthor_ = lastAuthor_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.notebookUpdateTime_ = + notebookUpdateTimeBuilder_ == null + ? notebookUpdateTime_ + : notebookUpdateTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.securitycenter.v2.Notebook) { + return mergeFrom((com.google.cloud.securitycenter.v2.Notebook) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.Notebook other) { + if (other == com.google.cloud.securitycenter.v2.Notebook.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getService().isEmpty()) { + service_ = other.service_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getLastAuthor().isEmpty()) { + lastAuthor_ = other.lastAuthor_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasNotebookUpdateTime()) { + mergeNotebookUpdateTime(other.getNotebookUpdateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + service_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + lastAuthor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + getNotebookUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the notebook.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the notebook.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the notebook.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the notebook.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the notebook.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object service_ = ""; + /** + * + * + *
+     * The source notebook service, for example, "Colab Enterprise".
+     * 
+ * + * string service = 2; + * + * @return The service. + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The source notebook service, for example, "Colab Enterprise".
+     * 
+ * + * string service = 2; + * + * @return The bytes for service. + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The source notebook service, for example, "Colab Enterprise".
+     * 
+ * + * string service = 2; + * + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The source notebook service, for example, "Colab Enterprise".
+     * 
+ * + * string service = 2; + * + * @return This builder for chaining. + */ + public Builder clearService() { + service_ = getDefaultInstance().getService(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The source notebook service, for example, "Colab Enterprise".
+     * 
+ * + * string service = 2; + * + * @param value The bytes for service to set. + * @return This builder for chaining. + */ + public Builder setServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + service_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object lastAuthor_ = ""; + /** + * + * + *
+     * The user ID of the latest author to modify the notebook.
+     * 
+ * + * string last_author = 3; + * + * @return The lastAuthor. + */ + public java.lang.String getLastAuthor() { + java.lang.Object ref = lastAuthor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lastAuthor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The user ID of the latest author to modify the notebook.
+     * 
+ * + * string last_author = 3; + * + * @return The bytes for lastAuthor. + */ + public com.google.protobuf.ByteString getLastAuthorBytes() { + java.lang.Object ref = lastAuthor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lastAuthor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The user ID of the latest author to modify the notebook.
+     * 
+ * + * string last_author = 3; + * + * @param value The lastAuthor to set. + * @return This builder for chaining. + */ + public Builder setLastAuthor(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + lastAuthor_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The user ID of the latest author to modify the notebook.
+     * 
+ * + * string last_author = 3; + * + * @return This builder for chaining. + */ + public Builder clearLastAuthor() { + lastAuthor_ = getDefaultInstance().getLastAuthor(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The user ID of the latest author to modify the notebook.
+     * 
+ * + * string last_author = 3; + * + * @param value The bytes for lastAuthor to set. + * @return This builder for chaining. + */ + public Builder setLastAuthorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + lastAuthor_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp notebookUpdateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + notebookUpdateTimeBuilder_; + /** + * + * + *
+     * The most recent time the notebook was updated.
+     * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + * + * @return Whether the notebookUpdateTime field is set. + */ + public boolean hasNotebookUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The most recent time the notebook was updated.
+     * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + * + * @return The notebookUpdateTime. + */ + public com.google.protobuf.Timestamp getNotebookUpdateTime() { + if (notebookUpdateTimeBuilder_ == null) { + return notebookUpdateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : notebookUpdateTime_; + } else { + return notebookUpdateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The most recent time the notebook was updated.
+     * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + */ + public Builder setNotebookUpdateTime(com.google.protobuf.Timestamp value) { + if (notebookUpdateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + notebookUpdateTime_ = value; + } else { + notebookUpdateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The most recent time the notebook was updated.
+     * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + */ + public Builder setNotebookUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (notebookUpdateTimeBuilder_ == null) { + notebookUpdateTime_ = builderForValue.build(); + } else { + notebookUpdateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The most recent time the notebook was updated.
+     * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + */ + public Builder mergeNotebookUpdateTime(com.google.protobuf.Timestamp value) { + if (notebookUpdateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && notebookUpdateTime_ != null + && notebookUpdateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getNotebookUpdateTimeBuilder().mergeFrom(value); + } else { + notebookUpdateTime_ = value; + } + } else { + notebookUpdateTimeBuilder_.mergeFrom(value); + } + if (notebookUpdateTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The most recent time the notebook was updated.
+     * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + */ + public Builder clearNotebookUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + notebookUpdateTime_ = null; + if (notebookUpdateTimeBuilder_ != null) { + notebookUpdateTimeBuilder_.dispose(); + notebookUpdateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The most recent time the notebook was updated.
+     * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getNotebookUpdateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getNotebookUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The most recent time the notebook was updated.
+     * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getNotebookUpdateTimeOrBuilder() { + if (notebookUpdateTimeBuilder_ != null) { + return notebookUpdateTimeBuilder_.getMessageOrBuilder(); + } else { + return notebookUpdateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : notebookUpdateTime_; + } + } + /** + * + * + *
+     * The most recent time the notebook was updated.
+     * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getNotebookUpdateTimeFieldBuilder() { + if (notebookUpdateTimeBuilder_ == null) { + notebookUpdateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getNotebookUpdateTime(), getParentForChildren(), isClean()); + notebookUpdateTime_ = null; + } + return notebookUpdateTimeBuilder_; + } + + @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.securitycenter.v2.Notebook) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.Notebook) + private static final com.google.cloud.securitycenter.v2.Notebook DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.Notebook(); + } + + public static com.google.cloud.securitycenter.v2.Notebook getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Notebook parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.Notebook getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/NotebookOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/NotebookOrBuilder.java new file mode 100644 index 000000000000..e2fd4911aa0b --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/NotebookOrBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2024 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/securitycenter/v2/notebook.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public interface NotebookOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.Notebook) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the notebook.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the notebook.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The source notebook service, for example, "Colab Enterprise".
+   * 
+ * + * string service = 2; + * + * @return The service. + */ + java.lang.String getService(); + /** + * + * + *
+   * The source notebook service, for example, "Colab Enterprise".
+   * 
+ * + * string service = 2; + * + * @return The bytes for service. + */ + com.google.protobuf.ByteString getServiceBytes(); + + /** + * + * + *
+   * The user ID of the latest author to modify the notebook.
+   * 
+ * + * string last_author = 3; + * + * @return The lastAuthor. + */ + java.lang.String getLastAuthor(); + /** + * + * + *
+   * The user ID of the latest author to modify the notebook.
+   * 
+ * + * string last_author = 3; + * + * @return The bytes for lastAuthor. + */ + com.google.protobuf.ByteString getLastAuthorBytes(); + + /** + * + * + *
+   * The most recent time the notebook was updated.
+   * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + * + * @return Whether the notebookUpdateTime field is set. + */ + boolean hasNotebookUpdateTime(); + /** + * + * + *
+   * The most recent time the notebook was updated.
+   * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + * + * @return The notebookUpdateTime. + */ + com.google.protobuf.Timestamp getNotebookUpdateTime(); + /** + * + * + *
+   * The most recent time the notebook was updated.
+   * 
+ * + * .google.protobuf.Timestamp notebook_update_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getNotebookUpdateTimeOrBuilder(); +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/NotebookProto.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/NotebookProto.java new file mode 100644 index 000000000000..c068cb477013 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/NotebookProto.java @@ -0,0 +1,75 @@ +/* + * Copyright 2024 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/securitycenter/v2/notebook.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public final class NotebookProto { + private NotebookProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_Notebook_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_Notebook_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n-google/cloud/securitycenter/v2/noteboo" + + "k.proto\022\036google.cloud.securitycenter.v2\032" + + "\037google/protobuf/timestamp.proto\"x\n\010Note" + + "book\022\014\n\004name\030\001 \001(\t\022\017\n\007service\030\002 \001(\t\022\023\n\013l" + + "ast_author\030\003 \001(\t\0228\n\024notebook_update_time" + + "\030\004 \001(\0132\032.google.protobuf.TimestampB\347\001\n\"c" + + "om.google.cloud.securitycenter.v2B\rNoteb" + + "ookProtoP\001ZJcloud.google.com/go/security" + + "center/apiv2/securitycenterpb;securityce" + + "nterpb\252\002\036Google.Cloud.SecurityCenter.V2\312" + + "\002\036Google\\Cloud\\SecurityCenter\\V2\352\002!Googl" + + "e::Cloud::SecurityCenter::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_securitycenter_v2_Notebook_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v2_Notebook_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_Notebook_descriptor, + new java.lang.String[] { + "Name", "Service", "LastAuthor", "NotebookUpdateTime", + }); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/OrganizationValuedResourceName.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/OrganizationValuedResourceName.java new file mode 100644 index 000000000000..97697ea41069 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/OrganizationValuedResourceName.java @@ -0,0 +1,270 @@ +/* + * Copyright 2024 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. + */ + +package com.google.cloud.securitycenter.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class OrganizationValuedResourceName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_SIMULATION_VALUED_RESOURCE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String simulation; + private final String valuedResource; + + @Deprecated + protected OrganizationValuedResourceName() { + organization = null; + location = null; + simulation = null; + valuedResource = null; + } + + private OrganizationValuedResourceName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + simulation = Preconditions.checkNotNull(builder.getSimulation()); + valuedResource = Preconditions.checkNotNull(builder.getValuedResource()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getSimulation() { + return simulation; + } + + public String getValuedResource() { + return valuedResource; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static OrganizationValuedResourceName of( + String organization, String location, String simulation, String valuedResource) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setSimulation(simulation) + .setValuedResource(valuedResource) + .build(); + } + + public static String format( + String organization, String location, String simulation, String valuedResource) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setSimulation(simulation) + .setValuedResource(valuedResource) + .build() + .toString(); + } + + public static OrganizationValuedResourceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_SIMULATION_VALUED_RESOURCE.validatedMatch( + formattedString, + "OrganizationValuedResourceName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("simulation"), + matchMap.get("valued_resource")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (OrganizationValuedResourceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_SIMULATION_VALUED_RESOURCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (simulation != null) { + fieldMapBuilder.put("simulation", simulation); + } + if (valuedResource != null) { + fieldMapBuilder.put("valued_resource", valuedResource); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_SIMULATION_VALUED_RESOURCE.instantiate( + "organization", + organization, + "location", + location, + "simulation", + simulation, + "valued_resource", + valuedResource); + } + + @Override + public boolean equals(java.lang.Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + OrganizationValuedResourceName that = ((OrganizationValuedResourceName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.simulation, that.simulation) + && Objects.equals(this.valuedResource, that.valuedResource); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(simulation); + h *= 1000003; + h ^= Objects.hashCode(valuedResource); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}. + */ + public static class Builder { + private String organization; + private String location; + private String simulation; + private String valuedResource; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getSimulation() { + return simulation; + } + + public String getValuedResource() { + return valuedResource; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setSimulation(String simulation) { + this.simulation = simulation; + return this; + } + + public Builder setValuedResource(String valuedResource) { + this.valuedResource = valuedResource; + return this; + } + + private Builder(OrganizationValuedResourceName organizationValuedResourceName) { + this.organization = organizationValuedResourceName.organization; + this.location = organizationValuedResourceName.location; + this.simulation = organizationValuedResourceName.simulation; + this.valuedResource = organizationValuedResourceName.valuedResource; + } + + public OrganizationValuedResourceName build() { + return new OrganizationValuedResourceName(this); + } + } +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Requests.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Requests.java new file mode 100644 index 000000000000..da762f93eb6e --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Requests.java @@ -0,0 +1,824 @@ +/* + * Copyright 2024 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/securitycenter/v2/cloud_armor.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +/** + * + * + *
+ * Information about the requests relevant to the finding.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.Requests} + */ +public final class Requests extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.Requests) + RequestsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Requests.newBuilder() to construct. + private Requests(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Requests() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Requests(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_Requests_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_Requests_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.Requests.class, + com.google.cloud.securitycenter.v2.Requests.Builder.class); + } + + public static final int RATIO_FIELD_NUMBER = 1; + private double ratio_ = 0D; + /** + * + * + *
+   * For 'Increasing deny ratio', the ratio is the denied traffic divided by the
+   * allowed traffic. For 'Allowed traffic spike', the ratio is the allowed
+   * traffic in the short term divided by allowed traffic in the long term.
+   * 
+ * + * double ratio = 1; + * + * @return The ratio. + */ + @java.lang.Override + public double getRatio() { + return ratio_; + } + + public static final int SHORT_TERM_ALLOWED_FIELD_NUMBER = 2; + private int shortTermAllowed_ = 0; + /** + * + * + *
+   * Allowed RPS (requests per second) in the short term.
+   * 
+ * + * int32 short_term_allowed = 2; + * + * @return The shortTermAllowed. + */ + @java.lang.Override + public int getShortTermAllowed() { + return shortTermAllowed_; + } + + public static final int LONG_TERM_ALLOWED_FIELD_NUMBER = 3; + private int longTermAllowed_ = 0; + /** + * + * + *
+   * Allowed RPS (requests per second) over the long term.
+   * 
+ * + * int32 long_term_allowed = 3; + * + * @return The longTermAllowed. + */ + @java.lang.Override + public int getLongTermAllowed() { + return longTermAllowed_; + } + + public static final int LONG_TERM_DENIED_FIELD_NUMBER = 4; + private int longTermDenied_ = 0; + /** + * + * + *
+   * Denied RPS (requests per second) over the long term.
+   * 
+ * + * int32 long_term_denied = 4; + * + * @return The longTermDenied. + */ + @java.lang.Override + public int getLongTermDenied() { + return longTermDenied_; + } + + 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 (java.lang.Double.doubleToRawLongBits(ratio_) != 0) { + output.writeDouble(1, ratio_); + } + if (shortTermAllowed_ != 0) { + output.writeInt32(2, shortTermAllowed_); + } + if (longTermAllowed_ != 0) { + output.writeInt32(3, longTermAllowed_); + } + if (longTermDenied_ != 0) { + output.writeInt32(4, longTermDenied_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(ratio_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, ratio_); + } + if (shortTermAllowed_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, shortTermAllowed_); + } + if (longTermAllowed_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, longTermAllowed_); + } + if (longTermDenied_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, longTermDenied_); + } + size += getUnknownFields().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.securitycenter.v2.Requests)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.Requests other = + (com.google.cloud.securitycenter.v2.Requests) obj; + + if (java.lang.Double.doubleToLongBits(getRatio()) + != java.lang.Double.doubleToLongBits(other.getRatio())) return false; + if (getShortTermAllowed() != other.getShortTermAllowed()) return false; + if (getLongTermAllowed() != other.getLongTermAllowed()) return false; + if (getLongTermDenied() != other.getLongTermDenied()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + RATIO_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getRatio())); + hash = (37 * hash) + SHORT_TERM_ALLOWED_FIELD_NUMBER; + hash = (53 * hash) + getShortTermAllowed(); + hash = (37 * hash) + LONG_TERM_ALLOWED_FIELD_NUMBER; + hash = (53 * hash) + getLongTermAllowed(); + hash = (37 * hash) + LONG_TERM_DENIED_FIELD_NUMBER; + hash = (53 * hash) + getLongTermDenied(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.Requests parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Requests 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.securitycenter.v2.Requests parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Requests 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.securitycenter.v2.Requests parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Requests parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.Requests parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Requests 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.securitycenter.v2.Requests parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Requests 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.securitycenter.v2.Requests parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Requests 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.securitycenter.v2.Requests 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; + } + /** + * + * + *
+   * Information about the requests relevant to the finding.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.Requests} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.Requests) + com.google.cloud.securitycenter.v2.RequestsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_Requests_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_Requests_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.Requests.class, + com.google.cloud.securitycenter.v2.Requests.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.Requests.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ratio_ = 0D; + shortTermAllowed_ = 0; + longTermAllowed_ = 0; + longTermDenied_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_Requests_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Requests getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.Requests.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Requests build() { + com.google.cloud.securitycenter.v2.Requests result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Requests buildPartial() { + com.google.cloud.securitycenter.v2.Requests result = + new com.google.cloud.securitycenter.v2.Requests(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.Requests result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ratio_ = ratio_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.shortTermAllowed_ = shortTermAllowed_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.longTermAllowed_ = longTermAllowed_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.longTermDenied_ = longTermDenied_; + } + } + + @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.securitycenter.v2.Requests) { + return mergeFrom((com.google.cloud.securitycenter.v2.Requests) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.Requests other) { + if (other == com.google.cloud.securitycenter.v2.Requests.getDefaultInstance()) return this; + if (other.getRatio() != 0D) { + setRatio(other.getRatio()); + } + if (other.getShortTermAllowed() != 0) { + setShortTermAllowed(other.getShortTermAllowed()); + } + if (other.getLongTermAllowed() != 0) { + setLongTermAllowed(other.getLongTermAllowed()); + } + if (other.getLongTermDenied() != 0) { + setLongTermDenied(other.getLongTermDenied()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + ratio_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 16: + { + shortTermAllowed_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + longTermAllowed_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + longTermDenied_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private double ratio_; + /** + * + * + *
+     * For 'Increasing deny ratio', the ratio is the denied traffic divided by the
+     * allowed traffic. For 'Allowed traffic spike', the ratio is the allowed
+     * traffic in the short term divided by allowed traffic in the long term.
+     * 
+ * + * double ratio = 1; + * + * @return The ratio. + */ + @java.lang.Override + public double getRatio() { + return ratio_; + } + /** + * + * + *
+     * For 'Increasing deny ratio', the ratio is the denied traffic divided by the
+     * allowed traffic. For 'Allowed traffic spike', the ratio is the allowed
+     * traffic in the short term divided by allowed traffic in the long term.
+     * 
+ * + * double ratio = 1; + * + * @param value The ratio to set. + * @return This builder for chaining. + */ + public Builder setRatio(double value) { + + ratio_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * For 'Increasing deny ratio', the ratio is the denied traffic divided by the
+     * allowed traffic. For 'Allowed traffic spike', the ratio is the allowed
+     * traffic in the short term divided by allowed traffic in the long term.
+     * 
+ * + * double ratio = 1; + * + * @return This builder for chaining. + */ + public Builder clearRatio() { + bitField0_ = (bitField0_ & ~0x00000001); + ratio_ = 0D; + onChanged(); + return this; + } + + private int shortTermAllowed_; + /** + * + * + *
+     * Allowed RPS (requests per second) in the short term.
+     * 
+ * + * int32 short_term_allowed = 2; + * + * @return The shortTermAllowed. + */ + @java.lang.Override + public int getShortTermAllowed() { + return shortTermAllowed_; + } + /** + * + * + *
+     * Allowed RPS (requests per second) in the short term.
+     * 
+ * + * int32 short_term_allowed = 2; + * + * @param value The shortTermAllowed to set. + * @return This builder for chaining. + */ + public Builder setShortTermAllowed(int value) { + + shortTermAllowed_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed RPS (requests per second) in the short term.
+     * 
+ * + * int32 short_term_allowed = 2; + * + * @return This builder for chaining. + */ + public Builder clearShortTermAllowed() { + bitField0_ = (bitField0_ & ~0x00000002); + shortTermAllowed_ = 0; + onChanged(); + return this; + } + + private int longTermAllowed_; + /** + * + * + *
+     * Allowed RPS (requests per second) over the long term.
+     * 
+ * + * int32 long_term_allowed = 3; + * + * @return The longTermAllowed. + */ + @java.lang.Override + public int getLongTermAllowed() { + return longTermAllowed_; + } + /** + * + * + *
+     * Allowed RPS (requests per second) over the long term.
+     * 
+ * + * int32 long_term_allowed = 3; + * + * @param value The longTermAllowed to set. + * @return This builder for chaining. + */ + public Builder setLongTermAllowed(int value) { + + longTermAllowed_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Allowed RPS (requests per second) over the long term.
+     * 
+ * + * int32 long_term_allowed = 3; + * + * @return This builder for chaining. + */ + public Builder clearLongTermAllowed() { + bitField0_ = (bitField0_ & ~0x00000004); + longTermAllowed_ = 0; + onChanged(); + return this; + } + + private int longTermDenied_; + /** + * + * + *
+     * Denied RPS (requests per second) over the long term.
+     * 
+ * + * int32 long_term_denied = 4; + * + * @return The longTermDenied. + */ + @java.lang.Override + public int getLongTermDenied() { + return longTermDenied_; + } + /** + * + * + *
+     * Denied RPS (requests per second) over the long term.
+     * 
+ * + * int32 long_term_denied = 4; + * + * @param value The longTermDenied to set. + * @return This builder for chaining. + */ + public Builder setLongTermDenied(int value) { + + longTermDenied_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Denied RPS (requests per second) over the long term.
+     * 
+ * + * int32 long_term_denied = 4; + * + * @return This builder for chaining. + */ + public Builder clearLongTermDenied() { + bitField0_ = (bitField0_ & ~0x00000008); + longTermDenied_ = 0; + 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.securitycenter.v2.Requests) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.Requests) + private static final com.google.cloud.securitycenter.v2.Requests DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.Requests(); + } + + public static com.google.cloud.securitycenter.v2.Requests getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Requests parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.Requests getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/RequestsOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/RequestsOrBuilder.java new file mode 100644 index 000000000000..a683372f8d52 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/RequestsOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2024 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/securitycenter/v2/cloud_armor.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public interface RequestsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.Requests) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * For 'Increasing deny ratio', the ratio is the denied traffic divided by the
+   * allowed traffic. For 'Allowed traffic spike', the ratio is the allowed
+   * traffic in the short term divided by allowed traffic in the long term.
+   * 
+ * + * double ratio = 1; + * + * @return The ratio. + */ + double getRatio(); + + /** + * + * + *
+   * Allowed RPS (requests per second) in the short term.
+   * 
+ * + * int32 short_term_allowed = 2; + * + * @return The shortTermAllowed. + */ + int getShortTermAllowed(); + + /** + * + * + *
+   * Allowed RPS (requests per second) over the long term.
+   * 
+ * + * int32 long_term_allowed = 3; + * + * @return The longTermAllowed. + */ + int getLongTermAllowed(); + + /** + * + * + *
+   * Denied RPS (requests per second) over the long term.
+   * 
+ * + * int32 long_term_denied = 4; + * + * @return The longTermDenied. + */ + int getLongTermDenied(); +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Resource.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Resource.java index 14e7d3d3c448..edaf3f6bc776 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Resource.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Resource.java @@ -42,6 +42,10 @@ private Resource() { name_ = ""; displayName_ = ""; type_ = ""; + cloudProvider_ = 0; + service_ = ""; + location_ = ""; + resourcePathString_ = ""; } @java.lang.Override @@ -65,6 +69,59 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.securitycenter.v2.Resource.Builder.class); } + private int bitField0_; + private int cloudProviderMetadataCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object cloudProviderMetadata_; + + public enum CloudProviderMetadataCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCP_METADATA(7), + AWS_METADATA(8), + AZURE_METADATA(9), + CLOUDPROVIDERMETADATA_NOT_SET(0); + private final int value; + + private CloudProviderMetadataCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CloudProviderMetadataCase valueOf(int value) { + return forNumber(value); + } + + public static CloudProviderMetadataCase forNumber(int value) { + switch (value) { + case 7: + return GCP_METADATA; + case 8: + return AWS_METADATA; + case 9: + return AZURE_METADATA; + case 0: + return CLOUDPROVIDERMETADATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public CloudProviderMetadataCase getCloudProviderMetadataCase() { + return CloudProviderMetadataCase.forNumber(cloudProviderMetadataCase_); + } + public static final int NAME_FIELD_NUMBER = 1; @SuppressWarnings("serial") @@ -220,569 +277,2468 @@ public com.google.protobuf.ByteString getTypeBytes() { } } - private byte memoizedIsInitialized = -1; - + public static final int CLOUD_PROVIDER_FIELD_NUMBER = 4; + private int cloudProvider_ = 0; + /** + * + * + *
+   * Indicates which cloud provider the finding is from.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The enum numeric value on the wire for cloudProvider. + */ @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + public int getCloudProviderValue() { + return cloudProvider_; } - + /** + * + * + *
+   * Indicates which cloud provider the finding is from.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The cloudProvider. + */ @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); - } - getUnknownFields().writeTo(output); + public com.google.cloud.securitycenter.v2.CloudProvider getCloudProvider() { + com.google.cloud.securitycenter.v2.CloudProvider result = + com.google.cloud.securitycenter.v2.CloudProvider.forNumber(cloudProvider_); + return result == null ? com.google.cloud.securitycenter.v2.CloudProvider.UNRECOGNIZED : result; } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } + public static final int SERVICE_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object service_ = ""; + /** + * + * + *
+   * The service or resource provider associated with the resource.
+   * 
+ * + * string service = 5; + * + * @return The service. + */ @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.securitycenter.v2.Resource)) { - return super.equals(obj); + public java.lang.String getService() { + java.lang.Object ref = service_; + 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(); + service_ = s; + return s; } - com.google.cloud.securitycenter.v2.Resource other = - (com.google.cloud.securitycenter.v2.Resource) obj; - - if (!getName().equals(other.getName())) return false; - if (!getDisplayName().equals(other.getDisplayName())) return false; - if (!getType().equals(other.getType())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; } - + /** + * + * + *
+   * The service or resource provider associated with the resource.
+   * 
+ * + * string service = 5; + * + * @return The bytes for service. + */ @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; - hash = (53 * hash) + getDisplayName().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.securitycenter.v2.Resource parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.securitycenter.v2.Resource 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.securitycenter.v2.Resource parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.securitycenter.v2.Resource 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.securitycenter.v2.Resource parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.securitycenter.v2.Resource parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.securitycenter.v2.Resource parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.securitycenter.v2.Resource 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.securitycenter.v2.Resource parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.securitycenter.v2.Resource 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.securitycenter.v2.Resource parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.cloud.securitycenter.v2.Resource parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + public static final int LOCATION_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** + * + * + *
+   * The region or location of the service (if applicable).
+   * 
+ * + * string location = 6; + * + * @return The location. + */ @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(com.google.cloud.securitycenter.v2.Resource prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } } - + /** + * + * + *
+   * The region or location of the service (if applicable).
+   * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } + public static final int GCP_METADATA_FIELD_NUMBER = 7; /** * * *
-   * Information related to the Google Cloud resource.
+   * The GCP metadata associated with the finding.
    * 
* - * Protobuf type {@code google.cloud.securitycenter.v2.Resource} + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + * + * @return Whether the gcpMetadata field is set. */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.Resource) + @java.lang.Override + public boolean hasGcpMetadata() { + return cloudProviderMetadataCase_ == 7; + } + /** + * + * + *
+   * The GCP metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + * + * @return The gcpMetadata. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.GcpMetadata getGcpMetadata() { + if (cloudProviderMetadataCase_ == 7) { + return (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * The GCP metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder getGcpMetadataOrBuilder() { + if (cloudProviderMetadataCase_ == 7) { + return (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); + } + + public static final int AWS_METADATA_FIELD_NUMBER = 8; + /** + * + * + *
+   * The AWS metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + * + * @return Whether the awsMetadata field is set. + */ + @java.lang.Override + public boolean hasAwsMetadata() { + return cloudProviderMetadataCase_ == 8; + } + /** + * + * + *
+   * The AWS metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + * + * @return The awsMetadata. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata getAwsMetadata() { + if (cloudProviderMetadataCase_ == 8) { + return (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * The AWS metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder getAwsMetadataOrBuilder() { + if (cloudProviderMetadataCase_ == 8) { + return (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); + } + + public static final int AZURE_METADATA_FIELD_NUMBER = 9; + /** + * + * + *
+   * The Azure metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + * + * @return Whether the azureMetadata field is set. + */ + @java.lang.Override + public boolean hasAzureMetadata() { + return cloudProviderMetadataCase_ == 9; + } + /** + * + * + *
+   * The Azure metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + * + * @return The azureMetadata. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadata getAzureMetadata() { + if (cloudProviderMetadataCase_ == 9) { + return (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * The Azure metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder getAzureMetadataOrBuilder() { + if (cloudProviderMetadataCase_ == 9) { + return (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); + } + + public static final int RESOURCE_PATH_FIELD_NUMBER = 10; + private com.google.cloud.securitycenter.v2.ResourcePath resourcePath_; + /** + * + * + *
+   * Provides the path to the resource within the resource hierarchy.
+   * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + * + * @return Whether the resourcePath field is set. + */ + @java.lang.Override + public boolean hasResourcePath() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Provides the path to the resource within the resource hierarchy.
+   * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + * + * @return The resourcePath. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePath getResourcePath() { + return resourcePath_ == null + ? com.google.cloud.securitycenter.v2.ResourcePath.getDefaultInstance() + : resourcePath_; + } + /** + * + * + *
+   * Provides the path to the resource within the resource hierarchy.
+   * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePathOrBuilder getResourcePathOrBuilder() { + return resourcePath_ == null + ? com.google.cloud.securitycenter.v2.ResourcePath.getDefaultInstance() + : resourcePath_; + } + + public static final int RESOURCE_PATH_STRING_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourcePathString_ = ""; + /** + * + * + *
+   * A string representation of the resource path.
+   * For Google Cloud, it has the format of
+   * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+   * where there can be any number of folders.
+   * For AWS, it has the format of
+   * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+   * where there can be any number of organizational units.
+   * For Azure, it has the format of
+   * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+   * where there can be any number of management groups.
+   * 
+ * + * string resource_path_string = 11; + * + * @return The resourcePathString. + */ + @java.lang.Override + public java.lang.String getResourcePathString() { + java.lang.Object ref = resourcePathString_; + 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(); + resourcePathString_ = s; + return s; + } + } + /** + * + * + *
+   * A string representation of the resource path.
+   * For Google Cloud, it has the format of
+   * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+   * where there can be any number of folders.
+   * For AWS, it has the format of
+   * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+   * where there can be any number of organizational units.
+   * For Azure, it has the format of
+   * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+   * where there can be any number of management groups.
+   * 
+ * + * string resource_path_string = 11; + * + * @return The bytes for resourcePathString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourcePathStringBytes() { + java.lang.Object ref = resourcePathString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourcePathString_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); + } + if (cloudProvider_ + != com.google.cloud.securitycenter.v2.CloudProvider.CLOUD_PROVIDER_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, cloudProvider_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, service_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, location_); + } + if (cloudProviderMetadataCase_ == 7) { + output.writeMessage( + 7, (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_); + } + if (cloudProviderMetadataCase_ == 8) { + output.writeMessage( + 8, (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_); + } + if (cloudProviderMetadataCase_ == 9) { + output.writeMessage( + 9, (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(10, getResourcePath()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourcePathString_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, resourcePathString_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); + } + if (cloudProvider_ + != com.google.cloud.securitycenter.v2.CloudProvider.CLOUD_PROVIDER_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, cloudProvider_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, service_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, location_); + } + if (cloudProviderMetadataCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_); + } + if (cloudProviderMetadataCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_); + } + if (cloudProviderMetadataCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getResourcePath()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourcePathString_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, resourcePathString_); + } + size += getUnknownFields().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.securitycenter.v2.Resource)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.Resource other = + (com.google.cloud.securitycenter.v2.Resource) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getType().equals(other.getType())) return false; + if (cloudProvider_ != other.cloudProvider_) return false; + if (!getService().equals(other.getService())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (hasResourcePath() != other.hasResourcePath()) return false; + if (hasResourcePath()) { + if (!getResourcePath().equals(other.getResourcePath())) return false; + } + if (!getResourcePathString().equals(other.getResourcePathString())) return false; + if (!getCloudProviderMetadataCase().equals(other.getCloudProviderMetadataCase())) return false; + switch (cloudProviderMetadataCase_) { + case 7: + if (!getGcpMetadata().equals(other.getGcpMetadata())) return false; + break; + case 8: + if (!getAwsMetadata().equals(other.getAwsMetadata())) return false; + break; + case 9: + if (!getAzureMetadata().equals(other.getAzureMetadata())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + CLOUD_PROVIDER_FIELD_NUMBER; + hash = (53 * hash) + cloudProvider_; + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + if (hasResourcePath()) { + hash = (37 * hash) + RESOURCE_PATH_FIELD_NUMBER; + hash = (53 * hash) + getResourcePath().hashCode(); + } + hash = (37 * hash) + RESOURCE_PATH_STRING_FIELD_NUMBER; + hash = (53 * hash) + getResourcePathString().hashCode(); + switch (cloudProviderMetadataCase_) { + case 7: + hash = (37 * hash) + GCP_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getGcpMetadata().hashCode(); + break; + case 8: + hash = (37 * hash) + AWS_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getAwsMetadata().hashCode(); + break; + case 9: + hash = (37 * hash) + AZURE_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getAzureMetadata().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.Resource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Resource 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.securitycenter.v2.Resource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Resource 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.securitycenter.v2.Resource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.Resource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.Resource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Resource 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.securitycenter.v2.Resource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Resource 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.securitycenter.v2.Resource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.Resource 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.securitycenter.v2.Resource 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; + } + /** + * + * + *
+   * Information related to the Google Cloud resource.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.Resource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.Resource) com.google.cloud.securitycenter.v2.ResourceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.securitycenter.v2.ResourceProto .internal_static_google_cloud_securitycenter_v2_Resource_descriptor; } - + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.Resource.class, + com.google.cloud.securitycenter.v2.Resource.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.Resource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResourcePathFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + type_ = ""; + cloudProvider_ = 0; + service_ = ""; + location_ = ""; + if (gcpMetadataBuilder_ != null) { + gcpMetadataBuilder_.clear(); + } + if (awsMetadataBuilder_ != null) { + awsMetadataBuilder_.clear(); + } + if (azureMetadataBuilder_ != null) { + azureMetadataBuilder_.clear(); + } + resourcePath_ = null; + if (resourcePathBuilder_ != null) { + resourcePathBuilder_.dispose(); + resourcePathBuilder_ = null; + } + resourcePathString_ = ""; + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_Resource_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Resource getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.Resource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Resource build() { + com.google.cloud.securitycenter.v2.Resource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.Resource buildPartial() { + com.google.cloud.securitycenter.v2.Resource result = + new com.google.cloud.securitycenter.v2.Resource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.Resource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cloudProvider_ = cloudProvider_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.service_ = service_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.location_ = location_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000200) != 0)) { + result.resourcePath_ = + resourcePathBuilder_ == null ? resourcePath_ : resourcePathBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.resourcePathString_ = resourcePathString_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.securitycenter.v2.Resource result) { + result.cloudProviderMetadataCase_ = cloudProviderMetadataCase_; + result.cloudProviderMetadata_ = this.cloudProviderMetadata_; + if (cloudProviderMetadataCase_ == 7 && gcpMetadataBuilder_ != null) { + result.cloudProviderMetadata_ = gcpMetadataBuilder_.build(); + } + if (cloudProviderMetadataCase_ == 8 && awsMetadataBuilder_ != null) { + result.cloudProviderMetadata_ = awsMetadataBuilder_.build(); + } + if (cloudProviderMetadataCase_ == 9 && azureMetadataBuilder_ != null) { + result.cloudProviderMetadata_ = azureMetadataBuilder_.build(); + } + } + + @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.securitycenter.v2.Resource) { + return mergeFrom((com.google.cloud.securitycenter.v2.Resource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.Resource other) { + if (other == com.google.cloud.securitycenter.v2.Resource.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.cloudProvider_ != 0) { + setCloudProviderValue(other.getCloudProviderValue()); + } + if (!other.getService().isEmpty()) { + service_ = other.service_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasResourcePath()) { + mergeResourcePath(other.getResourcePath()); + } + if (!other.getResourcePathString().isEmpty()) { + resourcePathString_ = other.resourcePathString_; + bitField0_ |= 0x00000400; + onChanged(); + } + switch (other.getCloudProviderMetadataCase()) { + case GCP_METADATA: + { + mergeGcpMetadata(other.getGcpMetadata()); + break; + } + case AWS_METADATA: + { + mergeAwsMetadata(other.getAwsMetadata()); + break; + } + case AZURE_METADATA: + { + mergeAzureMetadata(other.getAzureMetadata()); + break; + } + case CLOUDPROVIDERMETADATA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + cloudProvider_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + service_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(getGcpMetadataFieldBuilder().getBuilder(), extensionRegistry); + cloudProviderMetadataCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage(getAwsMetadataFieldBuilder().getBuilder(), extensionRegistry); + cloudProviderMetadataCase_ = 8; + break; + } // case 66 + case 74: + { + input.readMessage(getAzureMetadataFieldBuilder().getBuilder(), extensionRegistry); + cloudProviderMetadataCase_ = 9; + break; + } // case 74 + case 82: + { + input.readMessage(getResourcePathFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + resourcePathString_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int cloudProviderMetadataCase_ = 0; + private java.lang.Object cloudProviderMetadata_; + + public CloudProviderMetadataCase getCloudProviderMetadataCase() { + return CloudProviderMetadataCase.forNumber(cloudProviderMetadataCase_); + } + + public Builder clearCloudProviderMetadata() { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The full resource name of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The full resource name of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The full resource name of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource name of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource name of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The human readable name of the resource.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The human readable name of the resource.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The human readable name of the resource.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The human readable name of the resource.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The human readable name of the resource.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * The full resource type of the resource.
+     * 
+ * + * string type = 3; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The full resource type of the resource.
+     * 
+ * + * string type = 3; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The full resource type of the resource.
+     * 
+ * + * string type = 3; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource type of the resource.
+     * 
+ * + * string type = 3; + * + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource type of the resource.
+     * 
+ * + * string type = 3; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + type_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int cloudProvider_ = 0; + /** + * + * + *
+     * Indicates which cloud provider the finding is from.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The enum numeric value on the wire for cloudProvider. + */ + @java.lang.Override + public int getCloudProviderValue() { + return cloudProvider_; + } + /** + * + * + *
+     * Indicates which cloud provider the finding is from.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @param value The enum numeric value on the wire for cloudProvider to set. + * @return This builder for chaining. + */ + public Builder setCloudProviderValue(int value) { + cloudProvider_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates which cloud provider the finding is from.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The cloudProvider. + */ @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.securitycenter.v2.ResourceProto - .internal_static_google_cloud_securitycenter_v2_Resource_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.securitycenter.v2.Resource.class, - com.google.cloud.securitycenter.v2.Resource.Builder.class); + public com.google.cloud.securitycenter.v2.CloudProvider getCloudProvider() { + com.google.cloud.securitycenter.v2.CloudProvider result = + com.google.cloud.securitycenter.v2.CloudProvider.forNumber(cloudProvider_); + return result == null + ? com.google.cloud.securitycenter.v2.CloudProvider.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Indicates which cloud provider the finding is from.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @param value The cloudProvider to set. + * @return This builder for chaining. + */ + public Builder setCloudProvider(com.google.cloud.securitycenter.v2.CloudProvider value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + cloudProvider_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates which cloud provider the finding is from.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return This builder for chaining. + */ + public Builder clearCloudProvider() { + bitField0_ = (bitField0_ & ~0x00000008); + cloudProvider_ = 0; + onChanged(); + return this; } - // Construct using com.google.cloud.securitycenter.v2.Resource.newBuilder() - private Builder() {} + private java.lang.Object service_ = ""; + /** + * + * + *
+     * The service or resource provider associated with the resource.
+     * 
+ * + * string service = 5; + * + * @return The service. + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The service or resource provider associated with the resource.
+     * 
+ * + * string service = 5; + * + * @return The bytes for service. + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The service or resource provider associated with the resource.
+     * 
+ * + * string service = 5; + * + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The service or resource provider associated with the resource.
+     * 
+ * + * string service = 5; + * + * @return This builder for chaining. + */ + public Builder clearService() { + service_ = getDefaultInstance().getService(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * The service or resource provider associated with the resource.
+     * 
+ * + * string service = 5; + * + * @param value The bytes for service to set. + * @return This builder for chaining. + */ + public Builder setServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + service_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); + private java.lang.Object location_ = ""; + /** + * + * + *
+     * The region or location of the service (if applicable).
+     * 
+ * + * string location = 6; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The region or location of the service (if applicable).
+     * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The region or location of the service (if applicable).
+     * 
+ * + * string location = 6; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The region or location of the service (if applicable).
+     * 
+ * + * string location = 6; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * The region or location of the service (if applicable).
+     * 
+ * + * string location = 6; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.GcpMetadata, + com.google.cloud.securitycenter.v2.GcpMetadata.Builder, + com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder> + gcpMetadataBuilder_; + /** + * + * + *
+     * The GCP metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + * + * @return Whether the gcpMetadata field is set. + */ + @java.lang.Override + public boolean hasGcpMetadata() { + return cloudProviderMetadataCase_ == 7; + } + /** + * + * + *
+     * The GCP metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + * + * @return The gcpMetadata. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.GcpMetadata getGcpMetadata() { + if (gcpMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 7) { + return (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); + } else { + if (cloudProviderMetadataCase_ == 7) { + return gcpMetadataBuilder_.getMessage(); + } + return com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * The GCP metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + public Builder setGcpMetadata(com.google.cloud.securitycenter.v2.GcpMetadata value) { + if (gcpMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cloudProviderMetadata_ = value; + onChanged(); + } else { + gcpMetadataBuilder_.setMessage(value); + } + cloudProviderMetadataCase_ = 7; + return this; + } + /** + * + * + *
+     * The GCP metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + public Builder setGcpMetadata( + com.google.cloud.securitycenter.v2.GcpMetadata.Builder builderForValue) { + if (gcpMetadataBuilder_ == null) { + cloudProviderMetadata_ = builderForValue.build(); + onChanged(); + } else { + gcpMetadataBuilder_.setMessage(builderForValue.build()); + } + cloudProviderMetadataCase_ = 7; + return this; + } + /** + * + * + *
+     * The GCP metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + public Builder mergeGcpMetadata(com.google.cloud.securitycenter.v2.GcpMetadata value) { + if (gcpMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 7 + && cloudProviderMetadata_ + != com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance()) { + cloudProviderMetadata_ = + com.google.cloud.securitycenter.v2.GcpMetadata.newBuilder( + (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + cloudProviderMetadata_ = value; + } + onChanged(); + } else { + if (cloudProviderMetadataCase_ == 7) { + gcpMetadataBuilder_.mergeFrom(value); + } else { + gcpMetadataBuilder_.setMessage(value); + } + } + cloudProviderMetadataCase_ = 7; + return this; } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - displayName_ = ""; - type_ = ""; + /** + * + * + *
+     * The GCP metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + public Builder clearGcpMetadata() { + if (gcpMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 7) { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + onChanged(); + } + } else { + if (cloudProviderMetadataCase_ == 7) { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + } + gcpMetadataBuilder_.clear(); + } return this; } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.securitycenter.v2.ResourceProto - .internal_static_google_cloud_securitycenter_v2_Resource_descriptor; + /** + * + * + *
+     * The GCP metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + public com.google.cloud.securitycenter.v2.GcpMetadata.Builder getGcpMetadataBuilder() { + return getGcpMetadataFieldBuilder().getBuilder(); } - + /** + * + * + *
+     * The GCP metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ @java.lang.Override - public com.google.cloud.securitycenter.v2.Resource getDefaultInstanceForType() { - return com.google.cloud.securitycenter.v2.Resource.getDefaultInstance(); + public com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder getGcpMetadataOrBuilder() { + if ((cloudProviderMetadataCase_ == 7) && (gcpMetadataBuilder_ != null)) { + return gcpMetadataBuilder_.getMessageOrBuilder(); + } else { + if (cloudProviderMetadataCase_ == 7) { + return (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); + } } - - @java.lang.Override - public com.google.cloud.securitycenter.v2.Resource build() { - com.google.cloud.securitycenter.v2.Resource result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + /** + * + * + *
+     * The GCP metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.GcpMetadata, + com.google.cloud.securitycenter.v2.GcpMetadata.Builder, + com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder> + getGcpMetadataFieldBuilder() { + if (gcpMetadataBuilder_ == null) { + if (!(cloudProviderMetadataCase_ == 7)) { + cloudProviderMetadata_ = + com.google.cloud.securitycenter.v2.GcpMetadata.getDefaultInstance(); + } + gcpMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.GcpMetadata, + com.google.cloud.securitycenter.v2.GcpMetadata.Builder, + com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder>( + (com.google.cloud.securitycenter.v2.GcpMetadata) cloudProviderMetadata_, + getParentForChildren(), + isClean()); + cloudProviderMetadata_ = null; } - return result; + cloudProviderMetadataCase_ = 7; + onChanged(); + return gcpMetadataBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata, + com.google.cloud.securitycenter.v2.AwsMetadata.Builder, + com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder> + awsMetadataBuilder_; + /** + * + * + *
+     * The AWS metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + * + * @return Whether the awsMetadata field is set. + */ @java.lang.Override - public com.google.cloud.securitycenter.v2.Resource buildPartial() { - com.google.cloud.securitycenter.v2.Resource result = - new com.google.cloud.securitycenter.v2.Resource(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; + public boolean hasAwsMetadata() { + return cloudProviderMetadataCase_ == 8; } - - private void buildPartial0(com.google.cloud.securitycenter.v2.Resource result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; + /** + * + * + *
+     * The AWS metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + * + * @return The awsMetadata. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.AwsMetadata getAwsMetadata() { + if (awsMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 8) { + return (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); + } else { + if (cloudProviderMetadataCase_ == 8) { + return awsMetadataBuilder_.getMessage(); + } + return com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.displayName_ = displayName_; + } + /** + * + * + *
+     * The AWS metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + public Builder setAwsMetadata(com.google.cloud.securitycenter.v2.AwsMetadata value) { + if (awsMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cloudProviderMetadata_ = value; + onChanged(); + } else { + awsMetadataBuilder_.setMessage(value); } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.type_ = type_; + cloudProviderMetadataCase_ = 8; + return this; + } + /** + * + * + *
+     * The AWS metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + public Builder setAwsMetadata( + com.google.cloud.securitycenter.v2.AwsMetadata.Builder builderForValue) { + if (awsMetadataBuilder_ == null) { + cloudProviderMetadata_ = builderForValue.build(); + onChanged(); + } else { + awsMetadataBuilder_.setMessage(builderForValue.build()); } + cloudProviderMetadataCase_ = 8; + return this; } - - @java.lang.Override - public Builder clone() { - return super.clone(); + /** + * + * + *
+     * The AWS metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + public Builder mergeAwsMetadata(com.google.cloud.securitycenter.v2.AwsMetadata value) { + if (awsMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 8 + && cloudProviderMetadata_ + != com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance()) { + cloudProviderMetadata_ = + com.google.cloud.securitycenter.v2.AwsMetadata.newBuilder( + (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + cloudProviderMetadata_ = value; + } + onChanged(); + } else { + if (cloudProviderMetadataCase_ == 8) { + awsMetadataBuilder_.mergeFrom(value); + } else { + awsMetadataBuilder_.setMessage(value); + } + } + cloudProviderMetadataCase_ = 8; + return this; } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + /** + * + * + *
+     * The AWS metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + public Builder clearAwsMetadata() { + if (awsMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 8) { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + onChanged(); + } + } else { + if (cloudProviderMetadataCase_ == 8) { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + } + awsMetadataBuilder_.clear(); + } + return this; } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + /** + * + * + *
+     * The AWS metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + public com.google.cloud.securitycenter.v2.AwsMetadata.Builder getAwsMetadataBuilder() { + return getAwsMetadataFieldBuilder().getBuilder(); } - + /** + * + * + *
+     * The AWS metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + public com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder getAwsMetadataOrBuilder() { + if ((cloudProviderMetadataCase_ == 8) && (awsMetadataBuilder_ != null)) { + return awsMetadataBuilder_.getMessageOrBuilder(); + } else { + if (cloudProviderMetadataCase_ == 8) { + return (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); + } } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + /** + * + * + *
+     * The AWS metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata, + com.google.cloud.securitycenter.v2.AwsMetadata.Builder, + com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder> + getAwsMetadataFieldBuilder() { + if (awsMetadataBuilder_ == null) { + if (!(cloudProviderMetadataCase_ == 8)) { + cloudProviderMetadata_ = + com.google.cloud.securitycenter.v2.AwsMetadata.getDefaultInstance(); + } + awsMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AwsMetadata, + com.google.cloud.securitycenter.v2.AwsMetadata.Builder, + com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder>( + (com.google.cloud.securitycenter.v2.AwsMetadata) cloudProviderMetadata_, + getParentForChildren(), + isClean()); + cloudProviderMetadata_ = null; + } + cloudProviderMetadataCase_ = 8; + onChanged(); + return awsMetadataBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata, + com.google.cloud.securitycenter.v2.AzureMetadata.Builder, + com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder> + azureMetadataBuilder_; + /** + * + * + *
+     * The Azure metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + * + * @return Whether the azureMetadata field is set. + */ @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + public boolean hasAzureMetadata() { + return cloudProviderMetadataCase_ == 9; } - + /** + * + * + *
+     * The Azure metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + * + * @return The azureMetadata. + */ @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.securitycenter.v2.Resource) { - return mergeFrom((com.google.cloud.securitycenter.v2.Resource) other); + public com.google.cloud.securitycenter.v2.AzureMetadata getAzureMetadata() { + if (azureMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 9) { + return (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); } else { - super.mergeFrom(other); - return this; + if (cloudProviderMetadataCase_ == 9) { + return azureMetadataBuilder_.getMessage(); + } + return com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); } } - - public Builder mergeFrom(com.google.cloud.securitycenter.v2.Resource other) { - if (other == com.google.cloud.securitycenter.v2.Resource.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getDisplayName().isEmpty()) { - displayName_ = other.displayName_; - bitField0_ |= 0x00000002; + /** + * + * + *
+     * The Azure metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + */ + public Builder setAzureMetadata(com.google.cloud.securitycenter.v2.AzureMetadata value) { + if (azureMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cloudProviderMetadata_ = value; onChanged(); + } else { + azureMetadataBuilder_.setMessage(value); } - if (!other.getType().isEmpty()) { - type_ = other.type_; - bitField0_ |= 0x00000004; + cloudProviderMetadataCase_ = 9; + return this; + } + /** + * + * + *
+     * The Azure metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + */ + public Builder setAzureMetadata( + com.google.cloud.securitycenter.v2.AzureMetadata.Builder builderForValue) { + if (azureMetadataBuilder_ == null) { + cloudProviderMetadata_ = builderForValue.build(); onChanged(); + } else { + azureMetadataBuilder_.setMessage(builderForValue.build()); } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); + cloudProviderMetadataCase_ = 9; 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 { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - displayName_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - type_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { + /** + * + * + *
+     * The Azure metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + */ + public Builder mergeAzureMetadata(com.google.cloud.securitycenter.v2.AzureMetadata value) { + if (azureMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 9 + && cloudProviderMetadata_ + != com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance()) { + cloudProviderMetadata_ = + com.google.cloud.securitycenter.v2.AzureMetadata.newBuilder( + (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_) + .mergeFrom(value) + .buildPartial(); + } else { + cloudProviderMetadata_ = value; + } onChanged(); - } // finally + } else { + if (cloudProviderMetadataCase_ == 9) { + azureMetadataBuilder_.mergeFrom(value); + } else { + azureMetadataBuilder_.setMessage(value); + } + } + cloudProviderMetadataCase_ = 9; return this; } - - private int bitField0_; - - private java.lang.Object name_ = ""; /** * * *
-     * The full resource name of the resource. See:
-     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * The Azure metadata associated with the finding.
      * 
* - * string name = 1; - * - * @return The name. + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; + public Builder clearAzureMetadata() { + if (azureMetadataBuilder_ == null) { + if (cloudProviderMetadataCase_ == 9) { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + onChanged(); + } } else { - return (java.lang.String) ref; + if (cloudProviderMetadataCase_ == 9) { + cloudProviderMetadataCase_ = 0; + cloudProviderMetadata_ = null; + } + azureMetadataBuilder_.clear(); } + return this; } /** * * *
-     * The full resource name of the resource. See:
-     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * The Azure metadata associated with the finding.
      * 
* - * string name = 1; + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + */ + public com.google.cloud.securitycenter.v2.AzureMetadata.Builder getAzureMetadataBuilder() { + return getAzureMetadataFieldBuilder().getBuilder(); + } + /** * - * @return The bytes for name. + * + *
+     * The Azure metadata associated with the finding.
+     * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; + @java.lang.Override + public com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder getAzureMetadataOrBuilder() { + if ((cloudProviderMetadataCase_ == 9) && (azureMetadataBuilder_ != null)) { + return azureMetadataBuilder_.getMessageOrBuilder(); } else { - return (com.google.protobuf.ByteString) ref; + if (cloudProviderMetadataCase_ == 9) { + return (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_; + } + return com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); } } /** * * *
-     * The full resource name of the resource. See:
-     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * The Azure metadata associated with the finding.
      * 
* - * string name = 1; - * - * @param value The name to set. - * @return This builder for chaining. + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata, + com.google.cloud.securitycenter.v2.AzureMetadata.Builder, + com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder> + getAzureMetadataFieldBuilder() { + if (azureMetadataBuilder_ == null) { + if (!(cloudProviderMetadataCase_ == 9)) { + cloudProviderMetadata_ = + com.google.cloud.securitycenter.v2.AzureMetadata.getDefaultInstance(); + } + azureMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.AzureMetadata, + com.google.cloud.securitycenter.v2.AzureMetadata.Builder, + com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder>( + (com.google.cloud.securitycenter.v2.AzureMetadata) cloudProviderMetadata_, + getParentForChildren(), + isClean()); + cloudProviderMetadata_ = null; } - name_ = value; - bitField0_ |= 0x00000001; + cloudProviderMetadataCase_ = 9; onChanged(); - return this; + return azureMetadataBuilder_; } + + private com.google.cloud.securitycenter.v2.ResourcePath resourcePath_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.ResourcePath, + com.google.cloud.securitycenter.v2.ResourcePath.Builder, + com.google.cloud.securitycenter.v2.ResourcePathOrBuilder> + resourcePathBuilder_; /** * * *
-     * The full resource name of the resource. See:
-     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * Provides the path to the resource within the resource hierarchy.
      * 
* - * string name = 1; + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; * - * @return This builder for chaining. + * @return Whether the resourcePath field is set. */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; + public boolean hasResourcePath() { + return ((bitField0_ & 0x00000200) != 0); } /** * * *
-     * The full resource name of the resource. See:
-     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * Provides the path to the resource within the resource hierarchy.
      * 
* - * string name = 1; + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; * - * @param value The bytes for name to set. - * @return This builder for chaining. + * @return The resourcePath. */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public com.google.cloud.securitycenter.v2.ResourcePath getResourcePath() { + if (resourcePathBuilder_ == null) { + return resourcePath_ == null + ? com.google.cloud.securitycenter.v2.ResourcePath.getDefaultInstance() + : resourcePath_; + } else { + return resourcePathBuilder_.getMessage(); } - checkByteStringIsUtf8(value); - name_ = value; - bitField0_ |= 0x00000001; + } + /** + * + * + *
+     * Provides the path to the resource within the resource hierarchy.
+     * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + */ + public Builder setResourcePath(com.google.cloud.securitycenter.v2.ResourcePath value) { + if (resourcePathBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resourcePath_ = value; + } else { + resourcePathBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; onChanged(); return this; } - - private java.lang.Object displayName_ = ""; /** * * *
-     * The human readable name of the resource.
+     * Provides the path to the resource within the resource hierarchy.
      * 
* - * string display_name = 2; - * - * @return The displayName. + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; + public Builder setResourcePath( + com.google.cloud.securitycenter.v2.ResourcePath.Builder builderForValue) { + if (resourcePathBuilder_ == null) { + resourcePath_ = builderForValue.build(); } else { - return (java.lang.String) ref; + resourcePathBuilder_.setMessage(builderForValue.build()); } + bitField0_ |= 0x00000200; + onChanged(); + return this; } /** * * *
-     * The human readable name of the resource.
+     * Provides the path to the resource within the resource hierarchy.
      * 
* - * string display_name = 2; - * - * @return The bytes for displayName. + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; */ - public com.google.protobuf.ByteString getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - displayName_ = b; - return b; + public Builder mergeResourcePath(com.google.cloud.securitycenter.v2.ResourcePath value) { + if (resourcePathBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && resourcePath_ != null + && resourcePath_ + != com.google.cloud.securitycenter.v2.ResourcePath.getDefaultInstance()) { + getResourcePathBuilder().mergeFrom(value); + } else { + resourcePath_ = value; + } } else { - return (com.google.protobuf.ByteString) ref; + resourcePathBuilder_.mergeFrom(value); } + if (resourcePath_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; } /** * * *
-     * The human readable name of the resource.
+     * Provides the path to the resource within the resource hierarchy.
      * 
* - * string display_name = 2; - * - * @param value The displayName to set. - * @return This builder for chaining. + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; */ - public Builder setDisplayName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder clearResourcePath() { + bitField0_ = (bitField0_ & ~0x00000200); + resourcePath_ = null; + if (resourcePathBuilder_ != null) { + resourcePathBuilder_.dispose(); + resourcePathBuilder_ = null; } - displayName_ = value; - bitField0_ |= 0x00000002; onChanged(); return this; } @@ -790,60 +2746,87 @@ public Builder setDisplayName(java.lang.String value) { * * *
-     * The human readable name of the resource.
+     * Provides the path to the resource within the resource hierarchy.
      * 
* - * string display_name = 2; - * - * @return This builder for chaining. + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; */ - public Builder clearDisplayName() { - displayName_ = getDefaultInstance().getDisplayName(); - bitField0_ = (bitField0_ & ~0x00000002); + public com.google.cloud.securitycenter.v2.ResourcePath.Builder getResourcePathBuilder() { + bitField0_ |= 0x00000200; onChanged(); - return this; + return getResourcePathFieldBuilder().getBuilder(); } /** * * *
-     * The human readable name of the resource.
+     * Provides the path to the resource within the resource hierarchy.
      * 
* - * string display_name = 2; + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + */ + public com.google.cloud.securitycenter.v2.ResourcePathOrBuilder getResourcePathOrBuilder() { + if (resourcePathBuilder_ != null) { + return resourcePathBuilder_.getMessageOrBuilder(); + } else { + return resourcePath_ == null + ? com.google.cloud.securitycenter.v2.ResourcePath.getDefaultInstance() + : resourcePath_; + } + } + /** * - * @param value The bytes for displayName to set. - * @return This builder for chaining. + * + *
+     * Provides the path to the resource within the resource hierarchy.
+     * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; */ - public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.ResourcePath, + com.google.cloud.securitycenter.v2.ResourcePath.Builder, + com.google.cloud.securitycenter.v2.ResourcePathOrBuilder> + getResourcePathFieldBuilder() { + if (resourcePathBuilder_ == null) { + resourcePathBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v2.ResourcePath, + com.google.cloud.securitycenter.v2.ResourcePath.Builder, + com.google.cloud.securitycenter.v2.ResourcePathOrBuilder>( + getResourcePath(), getParentForChildren(), isClean()); + resourcePath_ = null; } - checkByteStringIsUtf8(value); - displayName_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; + return resourcePathBuilder_; } - private java.lang.Object type_ = ""; + private java.lang.Object resourcePathString_ = ""; /** * * *
-     * The full resource type of the resource.
+     * A string representation of the resource path.
+     * For Google Cloud, it has the format of
+     * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+     * where there can be any number of folders.
+     * For AWS, it has the format of
+     * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+     * where there can be any number of organizational units.
+     * For Azure, it has the format of
+     * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+     * where there can be any number of management groups.
      * 
* - * string type = 3; + * string resource_path_string = 11; * - * @return The type. + * @return The resourcePathString. */ - public java.lang.String getType() { - java.lang.Object ref = type_; + public java.lang.String getResourcePathString() { + java.lang.Object ref = resourcePathString_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - type_ = s; + resourcePathString_ = s; return s; } else { return (java.lang.String) ref; @@ -853,19 +2836,28 @@ public java.lang.String getType() { * * *
-     * The full resource type of the resource.
+     * A string representation of the resource path.
+     * For Google Cloud, it has the format of
+     * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+     * where there can be any number of folders.
+     * For AWS, it has the format of
+     * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+     * where there can be any number of organizational units.
+     * For Azure, it has the format of
+     * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+     * where there can be any number of management groups.
      * 
* - * string type = 3; + * string resource_path_string = 11; * - * @return The bytes for type. + * @return The bytes for resourcePathString. */ - public com.google.protobuf.ByteString getTypeBytes() { - java.lang.Object ref = type_; + public com.google.protobuf.ByteString getResourcePathStringBytes() { + java.lang.Object ref = resourcePathString_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - type_ = b; + resourcePathString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -875,20 +2867,29 @@ public com.google.protobuf.ByteString getTypeBytes() { * * *
-     * The full resource type of the resource.
+     * A string representation of the resource path.
+     * For Google Cloud, it has the format of
+     * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+     * where there can be any number of folders.
+     * For AWS, it has the format of
+     * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+     * where there can be any number of organizational units.
+     * For Azure, it has the format of
+     * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+     * where there can be any number of management groups.
      * 
* - * string type = 3; + * string resource_path_string = 11; * - * @param value The type to set. + * @param value The resourcePathString to set. * @return This builder for chaining. */ - public Builder setType(java.lang.String value) { + public Builder setResourcePathString(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - type_ = value; - bitField0_ |= 0x00000004; + resourcePathString_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -896,16 +2897,25 @@ public Builder setType(java.lang.String value) { * * *
-     * The full resource type of the resource.
+     * A string representation of the resource path.
+     * For Google Cloud, it has the format of
+     * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+     * where there can be any number of folders.
+     * For AWS, it has the format of
+     * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+     * where there can be any number of organizational units.
+     * For Azure, it has the format of
+     * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+     * where there can be any number of management groups.
      * 
* - * string type = 3; + * string resource_path_string = 11; * * @return This builder for chaining. */ - public Builder clearType() { - type_ = getDefaultInstance().getType(); - bitField0_ = (bitField0_ & ~0x00000004); + public Builder clearResourcePathString() { + resourcePathString_ = getDefaultInstance().getResourcePathString(); + bitField0_ = (bitField0_ & ~0x00000400); onChanged(); return this; } @@ -913,21 +2923,30 @@ public Builder clearType() { * * *
-     * The full resource type of the resource.
+     * A string representation of the resource path.
+     * For Google Cloud, it has the format of
+     * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+     * where there can be any number of folders.
+     * For AWS, it has the format of
+     * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+     * where there can be any number of organizational units.
+     * For Azure, it has the format of
+     * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+     * where there can be any number of management groups.
      * 
* - * string type = 3; + * string resource_path_string = 11; * - * @param value The bytes for type to set. + * @param value The bytes for resourcePathString to set. * @return This builder for chaining. */ - public Builder setTypeBytes(com.google.protobuf.ByteString value) { + public Builder setResourcePathStringBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - type_ = value; - bitField0_ |= 0x00000004; + resourcePathString_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceOrBuilder.java index 51c3147056d7..3fe038e801a8 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceOrBuilder.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceOrBuilder.java @@ -100,4 +100,265 @@ public interface ResourceOrBuilder * @return The bytes for type. */ com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * Indicates which cloud provider the finding is from.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The enum numeric value on the wire for cloudProvider. + */ + int getCloudProviderValue(); + /** + * + * + *
+   * Indicates which cloud provider the finding is from.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The cloudProvider. + */ + com.google.cloud.securitycenter.v2.CloudProvider getCloudProvider(); + + /** + * + * + *
+   * The service or resource provider associated with the resource.
+   * 
+ * + * string service = 5; + * + * @return The service. + */ + java.lang.String getService(); + /** + * + * + *
+   * The service or resource provider associated with the resource.
+   * 
+ * + * string service = 5; + * + * @return The bytes for service. + */ + com.google.protobuf.ByteString getServiceBytes(); + + /** + * + * + *
+   * The region or location of the service (if applicable).
+   * 
+ * + * string location = 6; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * The region or location of the service (if applicable).
+   * 
+ * + * string location = 6; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * The GCP metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + * + * @return Whether the gcpMetadata field is set. + */ + boolean hasGcpMetadata(); + /** + * + * + *
+   * The GCP metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + * + * @return The gcpMetadata. + */ + com.google.cloud.securitycenter.v2.GcpMetadata getGcpMetadata(); + /** + * + * + *
+   * The GCP metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.GcpMetadata gcp_metadata = 7; + */ + com.google.cloud.securitycenter.v2.GcpMetadataOrBuilder getGcpMetadataOrBuilder(); + + /** + * + * + *
+   * The AWS metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + * + * @return Whether the awsMetadata field is set. + */ + boolean hasAwsMetadata(); + /** + * + * + *
+   * The AWS metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + * + * @return The awsMetadata. + */ + com.google.cloud.securitycenter.v2.AwsMetadata getAwsMetadata(); + /** + * + * + *
+   * The AWS metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.AwsMetadata aws_metadata = 8; + */ + com.google.cloud.securitycenter.v2.AwsMetadataOrBuilder getAwsMetadataOrBuilder(); + + /** + * + * + *
+   * The Azure metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + * + * @return Whether the azureMetadata field is set. + */ + boolean hasAzureMetadata(); + /** + * + * + *
+   * The Azure metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + * + * @return The azureMetadata. + */ + com.google.cloud.securitycenter.v2.AzureMetadata getAzureMetadata(); + /** + * + * + *
+   * The Azure metadata associated with the finding.
+   * 
+ * + * .google.cloud.securitycenter.v2.AzureMetadata azure_metadata = 9; + */ + com.google.cloud.securitycenter.v2.AzureMetadataOrBuilder getAzureMetadataOrBuilder(); + + /** + * + * + *
+   * Provides the path to the resource within the resource hierarchy.
+   * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + * + * @return Whether the resourcePath field is set. + */ + boolean hasResourcePath(); + /** + * + * + *
+   * Provides the path to the resource within the resource hierarchy.
+   * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + * + * @return The resourcePath. + */ + com.google.cloud.securitycenter.v2.ResourcePath getResourcePath(); + /** + * + * + *
+   * Provides the path to the resource within the resource hierarchy.
+   * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath resource_path = 10; + */ + com.google.cloud.securitycenter.v2.ResourcePathOrBuilder getResourcePathOrBuilder(); + + /** + * + * + *
+   * A string representation of the resource path.
+   * For Google Cloud, it has the format of
+   * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+   * where there can be any number of folders.
+   * For AWS, it has the format of
+   * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+   * where there can be any number of organizational units.
+   * For Azure, it has the format of
+   * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+   * where there can be any number of management groups.
+   * 
+ * + * string resource_path_string = 11; + * + * @return The resourcePathString. + */ + java.lang.String getResourcePathString(); + /** + * + * + *
+   * A string representation of the resource path.
+   * For Google Cloud, it has the format of
+   * organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
+   * where there can be any number of folders.
+   * For AWS, it has the format of
+   * org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
+   * where there can be any number of organizational units.
+   * For Azure, it has the format of
+   * mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
+   * where there can be any number of management groups.
+   * 
+ * + * string resource_path_string = 11; + * + * @return The bytes for resourcePathString. + */ + com.google.protobuf.ByteString getResourcePathStringBytes(); + + com.google.cloud.securitycenter.v2.Resource.CloudProviderMetadataCase + getCloudProviderMetadataCase(); } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourcePath.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourcePath.java new file mode 100644 index 000000000000..14eb307eea03 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourcePath.java @@ -0,0 +1,2370 @@ +/* + * Copyright 2024 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/securitycenter/v2/resource.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +/** + * + * + *
+ * Represents the path of resources leading up to the resource this finding is
+ * about.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.ResourcePath} + */ +public final class ResourcePath extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.ResourcePath) + ResourcePathOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResourcePath.newBuilder() to construct. + private ResourcePath(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResourcePath() { + nodes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourcePath(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_ResourcePath_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_ResourcePath_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.ResourcePath.class, + com.google.cloud.securitycenter.v2.ResourcePath.Builder.class); + } + + /** + * + * + *
+   * The type of resource the node represents.
+   * 
+ * + * Protobuf enum {@code google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType} + */ + public enum ResourcePathNodeType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Node type is unspecified.
+     * 
+ * + * RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0; + */ + RESOURCE_PATH_NODE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The node represents a Google Cloud organization.
+     * 
+ * + * GCP_ORGANIZATION = 1; + */ + GCP_ORGANIZATION(1), + /** + * + * + *
+     * The node represents a Google Cloud folder.
+     * 
+ * + * GCP_FOLDER = 2; + */ + GCP_FOLDER(2), + /** + * + * + *
+     * The node represents a Google Cloud project.
+     * 
+ * + * GCP_PROJECT = 3; + */ + GCP_PROJECT(3), + /** + * + * + *
+     * The node represents an AWS organization.
+     * 
+ * + * AWS_ORGANIZATION = 4; + */ + AWS_ORGANIZATION(4), + /** + * + * + *
+     * The node represents an AWS organizational unit.
+     * 
+ * + * AWS_ORGANIZATIONAL_UNIT = 5; + */ + AWS_ORGANIZATIONAL_UNIT(5), + /** + * + * + *
+     * The node represents an AWS account.
+     * 
+ * + * AWS_ACCOUNT = 6; + */ + AWS_ACCOUNT(6), + /** + * + * + *
+     * The node represents an Azure management group.
+     * 
+ * + * AZURE_MANAGEMENT_GROUP = 7; + */ + AZURE_MANAGEMENT_GROUP(7), + /** + * + * + *
+     * The node represents an Azure subscription.
+     * 
+ * + * AZURE_SUBSCRIPTION = 8; + */ + AZURE_SUBSCRIPTION(8), + /** + * + * + *
+     * The node represents an Azure resource group.
+     * 
+ * + * AZURE_RESOURCE_GROUP = 9; + */ + AZURE_RESOURCE_GROUP(9), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Node type is unspecified.
+     * 
+ * + * RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0; + */ + public static final int RESOURCE_PATH_NODE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The node represents a Google Cloud organization.
+     * 
+ * + * GCP_ORGANIZATION = 1; + */ + public static final int GCP_ORGANIZATION_VALUE = 1; + /** + * + * + *
+     * The node represents a Google Cloud folder.
+     * 
+ * + * GCP_FOLDER = 2; + */ + public static final int GCP_FOLDER_VALUE = 2; + /** + * + * + *
+     * The node represents a Google Cloud project.
+     * 
+ * + * GCP_PROJECT = 3; + */ + public static final int GCP_PROJECT_VALUE = 3; + /** + * + * + *
+     * The node represents an AWS organization.
+     * 
+ * + * AWS_ORGANIZATION = 4; + */ + public static final int AWS_ORGANIZATION_VALUE = 4; + /** + * + * + *
+     * The node represents an AWS organizational unit.
+     * 
+ * + * AWS_ORGANIZATIONAL_UNIT = 5; + */ + public static final int AWS_ORGANIZATIONAL_UNIT_VALUE = 5; + /** + * + * + *
+     * The node represents an AWS account.
+     * 
+ * + * AWS_ACCOUNT = 6; + */ + public static final int AWS_ACCOUNT_VALUE = 6; + /** + * + * + *
+     * The node represents an Azure management group.
+     * 
+ * + * AZURE_MANAGEMENT_GROUP = 7; + */ + public static final int AZURE_MANAGEMENT_GROUP_VALUE = 7; + /** + * + * + *
+     * The node represents an Azure subscription.
+     * 
+ * + * AZURE_SUBSCRIPTION = 8; + */ + public static final int AZURE_SUBSCRIPTION_VALUE = 8; + /** + * + * + *
+     * The node represents an Azure resource group.
+     * 
+ * + * AZURE_RESOURCE_GROUP = 9; + */ + public static final int AZURE_RESOURCE_GROUP_VALUE = 9; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ResourcePathNodeType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ResourcePathNodeType forNumber(int value) { + switch (value) { + case 0: + return RESOURCE_PATH_NODE_TYPE_UNSPECIFIED; + case 1: + return GCP_ORGANIZATION; + case 2: + return GCP_FOLDER; + case 3: + return GCP_PROJECT; + case 4: + return AWS_ORGANIZATION; + case 5: + return AWS_ORGANIZATIONAL_UNIT; + case 6: + return AWS_ACCOUNT; + case 7: + return AZURE_MANAGEMENT_GROUP; + case 8: + return AZURE_SUBSCRIPTION; + case 9: + return AZURE_RESOURCE_GROUP; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ResourcePathNodeType findValueByNumber(int number) { + return ResourcePathNodeType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourcePath.getDescriptor().getEnumTypes().get(0); + } + + private static final ResourcePathNodeType[] VALUES = values(); + + public static ResourcePathNodeType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ResourcePathNodeType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType) + } + + public interface ResourcePathNodeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The type of resource this node represents.
+     * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType node_type = 1; + * + * @return The enum numeric value on the wire for nodeType. + */ + int getNodeTypeValue(); + /** + * + * + *
+     * The type of resource this node represents.
+     * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType node_type = 1; + * + * @return The nodeType. + */ + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType getNodeType(); + + /** + * + * + *
+     * The ID of the resource this node represents.
+     * 
+ * + * string id = 2; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+     * The ID of the resource this node represents.
+     * 
+ * + * string id = 2; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+     * The display name of the resource this node represents.
+     * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+     * The display name of the resource this node represents.
+     * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + } + /** + * + * + *
+   * A node within the resource path. Each node represents a resource within the
+   * resource hierarchy.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode} + */ + public static final class ResourcePathNode extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode) + ResourcePathNodeOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResourcePathNode.newBuilder() to construct. + private ResourcePathNode(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResourcePathNode() { + nodeType_ = 0; + id_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourcePathNode(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_ResourcePath_ResourcePathNode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_ResourcePath_ResourcePathNode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.class, + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.Builder.class); + } + + public static final int NODE_TYPE_FIELD_NUMBER = 1; + private int nodeType_ = 0; + /** + * + * + *
+     * The type of resource this node represents.
+     * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType node_type = 1; + * + * @return The enum numeric value on the wire for nodeType. + */ + @java.lang.Override + public int getNodeTypeValue() { + return nodeType_; + } + /** + * + * + *
+     * The type of resource this node represents.
+     * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType node_type = 1; + * + * @return The nodeType. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType getNodeType() { + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType result = + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType.forNumber(nodeType_); + return result == null + ? com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType.UNRECOGNIZED + : result; + } + + public static final int ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+     * The ID of the resource this node represents.
+     * 
+ * + * string id = 2; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+     * The ID of the resource this node represents.
+     * 
+ * + * string id = 2; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The display name of the resource this node represents.
+     * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+     * The display name of the resource this node represents.
+     * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = 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 (nodeType_ + != com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType + .RESOURCE_PATH_NODE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, nodeType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nodeType_ + != com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType + .RESOURCE_PATH_NODE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, nodeType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_); + } + size += getUnknownFields().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.securitycenter.v2.ResourcePath.ResourcePathNode)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode other = + (com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode) obj; + + if (nodeType_ != other.nodeType_) return false; + if (!getId().equals(other.getId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NODE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + nodeType_; + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode 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.securitycenter.v2.ResourcePath.ResourcePathNode parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode 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.securitycenter.v2.ResourcePath.ResourcePathNode parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode 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.securitycenter.v2.ResourcePath.ResourcePathNode + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + 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.securitycenter.v2.ResourcePath.ResourcePathNode parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode 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.securitycenter.v2.ResourcePath.ResourcePathNode 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; + } + /** + * + * + *
+     * A node within the resource path. Each node represents a resource within the
+     * resource hierarchy.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode) + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_ResourcePath_ResourcePathNode_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_ResourcePath_ResourcePathNode_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.class, + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + nodeType_ = 0; + id_ = ""; + displayName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_ResourcePath_ResourcePathNode_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode build() { + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode buildPartial() { + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode result = + new com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.nodeType_ = nodeType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.displayName_ = displayName_; + } + } + + @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.securitycenter.v2.ResourcePath.ResourcePathNode) { + return mergeFrom( + (com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode other) { + if (other + == com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + .getDefaultInstance()) return this; + if (other.nodeType_ != 0) { + setNodeTypeValue(other.getNodeTypeValue()); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + nodeType_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int nodeType_ = 0; + /** + * + * + *
+       * The type of resource this node represents.
+       * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType node_type = 1; + * + * + * @return The enum numeric value on the wire for nodeType. + */ + @java.lang.Override + public int getNodeTypeValue() { + return nodeType_; + } + /** + * + * + *
+       * The type of resource this node represents.
+       * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType node_type = 1; + * + * + * @param value The enum numeric value on the wire for nodeType to set. + * @return This builder for chaining. + */ + public Builder setNodeTypeValue(int value) { + nodeType_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The type of resource this node represents.
+       * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType node_type = 1; + * + * + * @return The nodeType. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType getNodeType() { + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType result = + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType.forNumber( + nodeType_); + return result == null + ? com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The type of resource this node represents.
+       * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType node_type = 1; + * + * + * @param value The nodeType to set. + * @return This builder for chaining. + */ + public Builder setNodeType( + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + nodeType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The type of resource this node represents.
+       * 
+ * + * .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType node_type = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearNodeType() { + bitField0_ = (bitField0_ & ~0x00000001); + nodeType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+       * The ID of the resource this node represents.
+       * 
+ * + * string id = 2; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The ID of the resource this node represents.
+       * 
+ * + * string id = 2; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The ID of the resource this node represents.
+       * 
+ * + * string id = 2; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + id_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The ID of the resource this node represents.
+       * 
+ * + * string id = 2; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The ID of the resource this node represents.
+       * 
+ * + * string id = 2; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+       * The display name of the resource this node represents.
+       * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The display name of the resource this node represents.
+       * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The display name of the resource this node represents.
+       * 
+ * + * string display_name = 3; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * The display name of the resource this node represents.
+       * 
+ * + * string display_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * The display name of the resource this node represents.
+       * 
+ * + * string display_name = 3; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000004; + 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.securitycenter.v2.ResourcePath.ResourcePathNode) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode) + private static final com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode(); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourcePathNode parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.ResourcePath.ResourcePathNode + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NODES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List nodes_; + /** + * + * + *
+   * The list of nodes that make the up resource path, ordered from lowest
+   * level to highest level.
+   * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + */ + @java.lang.Override + public java.util.List + getNodesList() { + return nodes_; + } + /** + * + * + *
+   * The list of nodes that make the up resource path, ordered from lowest
+   * level to highest level.
+   * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeOrBuilder> + getNodesOrBuilderList() { + return nodes_; + } + /** + * + * + *
+   * The list of nodes that make the up resource path, ordered from lowest
+   * level to highest level.
+   * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + */ + @java.lang.Override + public int getNodesCount() { + return nodes_.size(); + } + /** + * + * + *
+   * The list of nodes that make the up resource path, ordered from lowest
+   * level to highest level.
+   * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode getNodes(int index) { + return nodes_.get(index); + } + /** + * + * + *
+   * The list of nodes that make the up resource path, ordered from lowest
+   * level to highest level.
+   * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeOrBuilder + getNodesOrBuilder(int index) { + return nodes_.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 < nodes_.size(); i++) { + output.writeMessage(1, nodes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < nodes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, nodes_.get(i)); + } + size += getUnknownFields().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.securitycenter.v2.ResourcePath)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.ResourcePath other = + (com.google.cloud.securitycenter.v2.ResourcePath) obj; + + if (!getNodesList().equals(other.getNodesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNodesCount() > 0) { + hash = (37 * hash) + NODES_FIELD_NUMBER; + hash = (53 * hash) + getNodesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.ResourcePath parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath 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.securitycenter.v2.ResourcePath parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath 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.securitycenter.v2.ResourcePath parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath 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.securitycenter.v2.ResourcePath parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath 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.securitycenter.v2.ResourcePath parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath 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.securitycenter.v2.ResourcePath 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; + } + /** + * + * + *
+   * Represents the path of resources leading up to the resource this finding is
+   * about.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.ResourcePath} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.ResourcePath) + com.google.cloud.securitycenter.v2.ResourcePathOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_ResourcePath_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_ResourcePath_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.ResourcePath.class, + com.google.cloud.securitycenter.v2.ResourcePath.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.ResourcePath.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + } else { + nodes_ = null; + nodesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.ResourceProto + .internal_static_google_cloud_securitycenter_v2_ResourcePath_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePath getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.ResourcePath.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePath build() { + com.google.cloud.securitycenter.v2.ResourcePath result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.ResourcePath buildPartial() { + com.google.cloud.securitycenter.v2.ResourcePath result = + new com.google.cloud.securitycenter.v2.ResourcePath(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.securitycenter.v2.ResourcePath result) { + if (nodesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + nodes_ = java.util.Collections.unmodifiableList(nodes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.nodes_ = nodes_; + } else { + result.nodes_ = nodesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.ResourcePath result) { + int from_bitField0_ = bitField0_; + } + + @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.securitycenter.v2.ResourcePath) { + return mergeFrom((com.google.cloud.securitycenter.v2.ResourcePath) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.ResourcePath other) { + if (other == com.google.cloud.securitycenter.v2.ResourcePath.getDefaultInstance()) + return this; + if (nodesBuilder_ == null) { + if (!other.nodes_.isEmpty()) { + if (nodes_.isEmpty()) { + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNodesIsMutable(); + nodes_.addAll(other.nodes_); + } + onChanged(); + } + } else { + if (!other.nodes_.isEmpty()) { + if (nodesBuilder_.isEmpty()) { + nodesBuilder_.dispose(); + nodesBuilder_ = null; + nodes_ = other.nodes_; + bitField0_ = (bitField0_ & ~0x00000001); + nodesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNodesFieldBuilder() + : null; + } else { + nodesBuilder_.addAllMessages(other.nodes_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode m = + input.readMessage( + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.parser(), + extensionRegistry); + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(m); + } else { + nodesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + nodes_ = java.util.Collections.emptyList(); + + private void ensureNodesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + nodes_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode>(nodes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode, + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.Builder, + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeOrBuilder> + nodesBuilder_; + + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public java.util.List + getNodesList() { + if (nodesBuilder_ == null) { + return java.util.Collections.unmodifiableList(nodes_); + } else { + return nodesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public int getNodesCount() { + if (nodesBuilder_ == null) { + return nodes_.size(); + } else { + return nodesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode getNodes(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public Builder setNodes( + int index, com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.set(index, value); + onChanged(); + } else { + nodesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public Builder setNodes( + int index, + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.set(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public Builder addNodes( + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(value); + onChanged(); + } else { + nodesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public Builder addNodes( + int index, com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode value) { + if (nodesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNodesIsMutable(); + nodes_.add(index, value); + onChanged(); + } else { + nodesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public Builder addNodes( + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public Builder addNodes( + int index, + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.Builder builderForValue) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.add(index, builderForValue.build()); + onChanged(); + } else { + nodesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public Builder addAllNodes( + java.lang.Iterable< + ? extends com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode> + values) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nodes_); + onChanged(); + } else { + nodesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public Builder clearNodes() { + if (nodesBuilder_ == null) { + nodes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + nodesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public Builder removeNodes(int index) { + if (nodesBuilder_ == null) { + ensureNodesIsMutable(); + nodes_.remove(index); + onChanged(); + } else { + nodesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.Builder getNodesBuilder( + int index) { + return getNodesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeOrBuilder + getNodesOrBuilder(int index) { + if (nodesBuilder_ == null) { + return nodes_.get(index); + } else { + return nodesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeOrBuilder> + getNodesOrBuilderList() { + if (nodesBuilder_ != null) { + return nodesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nodes_); + } + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.Builder + addNodesBuilder() { + return getNodesFieldBuilder() + .addBuilder( + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + .getDefaultInstance()); + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.Builder addNodesBuilder( + int index) { + return getNodesFieldBuilder() + .addBuilder( + index, + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode + .getDefaultInstance()); + } + /** + * + * + *
+     * The list of nodes that make the up resource path, ordered from lowest
+     * level to highest level.
+     * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + * + */ + public java.util.List + getNodesBuilderList() { + return getNodesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode, + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.Builder, + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeOrBuilder> + getNodesFieldBuilder() { + if (nodesBuilder_ == null) { + nodesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode, + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode.Builder, + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeOrBuilder>( + nodes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + nodes_ = null; + } + return nodesBuilder_; + } + + @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.securitycenter.v2.ResourcePath) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.ResourcePath) + private static final com.google.cloud.securitycenter.v2.ResourcePath DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.ResourcePath(); + } + + public static com.google.cloud.securitycenter.v2.ResourcePath getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourcePath parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.ResourcePath getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourcePathOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourcePathOrBuilder.java new file mode 100644 index 000000000000..d97ba3c5a795 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourcePathOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2024 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/securitycenter/v2/resource.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public interface ResourcePathOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.ResourcePath) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of nodes that make the up resource path, ordered from lowest
+   * level to highest level.
+   * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + */ + java.util.List getNodesList(); + /** + * + * + *
+   * The list of nodes that make the up resource path, ordered from lowest
+   * level to highest level.
+   * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + */ + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode getNodes(int index); + /** + * + * + *
+   * The list of nodes that make the up resource path, ordered from lowest
+   * level to highest level.
+   * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + */ + int getNodesCount(); + /** + * + * + *
+   * The list of nodes that make the up resource path, ordered from lowest
+   * level to highest level.
+   * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + */ + java.util.List< + ? extends com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeOrBuilder> + getNodesOrBuilderList(); + /** + * + * + *
+   * The list of nodes that make the up resource path, ordered from lowest
+   * level to highest level.
+   * 
+ * + * repeated .google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode nodes = 1; + */ + com.google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeOrBuilder getNodesOrBuilder( + int index); +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceProto.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceProto.java index b37115e59785..56ea7ab64d80 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceProto.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceProto.java @@ -32,6 +32,50 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_securitycenter_v2_Resource_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_securitycenter_v2_Resource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_GcpMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_GcpMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_AwsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_AwsMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganization_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganization_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganizationalUnit_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganizationalUnit_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsAccount_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsAccount_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_AzureMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_AzureMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureManagementGroup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureManagementGroup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureSubscription_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureSubscription_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureResourceGroup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureResourceGroup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_ResourcePath_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_ResourcePath_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v2_ResourcePath_ResourcePathNode_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v2_ResourcePath_ResourcePathNode_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -43,21 +87,75 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n-google/cloud/securitycenter/v2/resourc" + "e.proto\022\036google.cloud.securitycenter.v2\032" - + "\037google/api/field_behavior.proto\"<\n\010Reso" - + "urce\022\014\n\004name\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t" - + "\022\014\n\004type\030\003 \001(\tB\347\001\n\"com.google.cloud.secu" - + "ritycenter.v2B\rResourceProtoP\001ZJcloud.go" - + "ogle.com/go/securitycenter/apiv2/securit" - + "ycenterpb;securitycenterpb\252\002\036Google.Clou" - + "d.SecurityCenter.V2\312\002\036Google\\Cloud\\Secur" - + "ityCenter\\V2\352\002!Google::Cloud::SecurityCe" - + "nter::V2b\006proto3" + + "\037google/api/field_behavior.proto\032+google" + + "/cloud/securitycenter/v2/folder.proto\"\367\003" + + "\n\010Resource\022\014\n\004name\030\001 \001(\t\022\024\n\014display_name" + + "\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\022E\n\016cloud_provider\030\004" + + " \001(\0162-.google.cloud.securitycenter.v2.Cl" + + "oudProvider\022\017\n\007service\030\005 \001(\t\022\020\n\010location" + + "\030\006 \001(\t\022C\n\014gcp_metadata\030\007 \001(\0132+.google.cl" + + "oud.securitycenter.v2.GcpMetadataH\000\022C\n\014a" + + "ws_metadata\030\010 \001(\0132+.google.cloud.securit" + + "ycenter.v2.AwsMetadataH\000\022G\n\016azure_metada" + + "ta\030\t \001(\0132-.google.cloud.securitycenter.v" + + "2.AzureMetadataH\000\022C\n\rresource_path\030\n \001(\013" + + "2,.google.cloud.securitycenter.v2.Resour" + + "cePath\022\034\n\024resource_path_string\030\013 \001(\tB\031\n\027" + + "cloud_provider_metadata\"\275\001\n\013GcpMetadata\022" + + "\017\n\007project\030\001 \001(\t\022\034\n\024project_display_name" + + "\030\002 \001(\t\022\016\n\006parent\030\003 \001(\t\022\033\n\023parent_display" + + "_name\030\004 \001(\t\022<\n\007folders\030\005 \003(\0132&.google.cl" + + "oud.securitycenter.v2.FolderB\003\340A\003\022\024\n\014org" + + "anization\030\006 \001(\t\"\204\003\n\013AwsMetadata\022Q\n\014organ" + + "ization\030\001 \001(\0132;.google.cloud.securitycen" + + "ter.v2.AwsMetadata.AwsOrganization\022_\n\024or" + + "ganizational_units\030\002 \003(\0132A.google.cloud." + + "securitycenter.v2.AwsMetadata.AwsOrganiz" + + "ationalUnit\022G\n\007account\030\003 \001(\01326.google.cl" + + "oud.securitycenter.v2.AwsMetadata.AwsAcc" + + "ount\032\035\n\017AwsOrganization\022\n\n\002id\030\001 \001(\t\0321\n\025A" + + "wsOrganizationalUnit\022\n\n\002id\030\001 \001(\t\022\014\n\004name" + + "\030\002 \001(\t\032&\n\nAwsAccount\022\n\n\002id\030\001 \001(\t\022\014\n\004name" + + "\030\002 \001(\t\"\264\003\n\rAzureMetadata\022]\n\021management_g" + + "roups\030\001 \003(\0132B.google.cloud.securitycente" + + "r.v2.AzureMetadata.AzureManagementGroup\022" + + "U\n\014subscription\030\002 \001(\0132?.google.cloud.sec" + + "uritycenter.v2.AzureMetadata.AzureSubscr" + + "iption\022X\n\016resource_group\030\003 \001(\0132@.google." + + "cloud.securitycenter.v2.AzureMetadata.Az" + + "ureResourceGroup\0328\n\024AzureManagementGroup" + + "\022\n\n\002id\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\0325\n\021Az" + + "ureSubscription\022\n\n\002id\030\001 \001(\t\022\024\n\014display_n" + + "ame\030\002 \001(\t\032\"\n\022AzureResourceGroup\022\014\n\004name\030" + + "\001 \001(\t\"\364\003\n\014ResourcePath\022L\n\005nodes\030\001 \003(\0132=." + + "google.cloud.securitycenter.v2.ResourceP" + + "ath.ResourcePathNode\032\212\001\n\020ResourcePathNod" + + "e\022T\n\tnode_type\030\001 \001(\0162A.google.cloud.secu" + + "ritycenter.v2.ResourcePath.ResourcePathN" + + "odeType\022\n\n\002id\030\002 \001(\t\022\024\n\014display_name\030\003 \001(" + + "\t\"\210\002\n\024ResourcePathNodeType\022\'\n#RESOURCE_P" + + "ATH_NODE_TYPE_UNSPECIFIED\020\000\022\024\n\020GCP_ORGAN" + + "IZATION\020\001\022\016\n\nGCP_FOLDER\020\002\022\017\n\013GCP_PROJECT" + + "\020\003\022\024\n\020AWS_ORGANIZATION\020\004\022\033\n\027AWS_ORGANIZA" + + "TIONAL_UNIT\020\005\022\017\n\013AWS_ACCOUNT\020\006\022\032\n\026AZURE_" + + "MANAGEMENT_GROUP\020\007\022\026\n\022AZURE_SUBSCRIPTION" + + "\020\010\022\030\n\024AZURE_RESOURCE_GROUP\020\t*x\n\rCloudPro" + + "vider\022\036\n\032CLOUD_PROVIDER_UNSPECIFIED\020\000\022\031\n" + + "\025GOOGLE_CLOUD_PLATFORM\020\001\022\027\n\023AMAZON_WEB_S" + + "ERVICES\020\002\022\023\n\017MICROSOFT_AZURE\020\003B\347\001\n\"com.g" + + "oogle.cloud.securitycenter.v2B\rResourceP" + + "rotoP\001ZJcloud.google.com/go/securitycent" + + "er/apiv2/securitycenterpb;securitycenter" + + "pb\252\002\036Google.Cloud.SecurityCenter.V2\312\002\036Go" + + "ogle\\Cloud\\SecurityCenter\\V2\352\002!Google::C" + + "loud::SecurityCenter::V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.securitycenter.v2.FolderProto.getDescriptor(), }); internal_static_google_cloud_securitycenter_v2_Resource_descriptor = getDescriptor().getMessageTypes().get(0); @@ -65,9 +163,133 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_securitycenter_v2_Resource_descriptor, new java.lang.String[] { - "Name", "DisplayName", "Type", + "Name", + "DisplayName", + "Type", + "CloudProvider", + "Service", + "Location", + "GcpMetadata", + "AwsMetadata", + "AzureMetadata", + "ResourcePath", + "ResourcePathString", + "CloudProviderMetadata", + }); + internal_static_google_cloud_securitycenter_v2_GcpMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_securitycenter_v2_GcpMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_GcpMetadata_descriptor, + new java.lang.String[] { + "Project", + "ProjectDisplayName", + "Parent", + "ParentDisplayName", + "Folders", + "Organization", + }); + internal_static_google_cloud_securitycenter_v2_AwsMetadata_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_securitycenter_v2_AwsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_AwsMetadata_descriptor, + new java.lang.String[] { + "Organization", "OrganizationalUnits", "Account", + }); + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganization_descriptor = + internal_static_google_cloud_securitycenter_v2_AwsMetadata_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganization_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganization_descriptor, + new java.lang.String[] { + "Id", + }); + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganizationalUnit_descriptor = + internal_static_google_cloud_securitycenter_v2_AwsMetadata_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganizationalUnit_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsOrganizationalUnit_descriptor, + new java.lang.String[] { + "Id", "Name", + }); + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsAccount_descriptor = + internal_static_google_cloud_securitycenter_v2_AwsMetadata_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsAccount_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_AwsMetadata_AwsAccount_descriptor, + new java.lang.String[] { + "Id", "Name", + }); + internal_static_google_cloud_securitycenter_v2_AzureMetadata_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_securitycenter_v2_AzureMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_AzureMetadata_descriptor, + new java.lang.String[] { + "ManagementGroups", "Subscription", "ResourceGroup", + }); + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureManagementGroup_descriptor = + internal_static_google_cloud_securitycenter_v2_AzureMetadata_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureManagementGroup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureManagementGroup_descriptor, + new java.lang.String[] { + "Id", "DisplayName", + }); + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureSubscription_descriptor = + internal_static_google_cloud_securitycenter_v2_AzureMetadata_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureSubscription_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureSubscription_descriptor, + new java.lang.String[] { + "Id", "DisplayName", + }); + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureResourceGroup_descriptor = + internal_static_google_cloud_securitycenter_v2_AzureMetadata_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureResourceGroup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_AzureMetadata_AzureResourceGroup_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_securitycenter_v2_ResourcePath_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_securitycenter_v2_ResourcePath_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_ResourcePath_descriptor, + new java.lang.String[] { + "Nodes", + }); + internal_static_google_cloud_securitycenter_v2_ResourcePath_ResourcePathNode_descriptor = + internal_static_google_cloud_securitycenter_v2_ResourcePath_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v2_ResourcePath_ResourcePathNode_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v2_ResourcePath_ResourcePathNode_descriptor, + new java.lang.String[] { + "NodeType", "Id", "DisplayName", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.securitycenter.v2.FolderProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfig.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfig.java index 15cd3e25c933..774bf132f348 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfig.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfig.java @@ -23,8 +23,8 @@ * * *
- * A resource value config (RVC) is a mapping configuration of user's resources
- * to resource values. Used in Attack path simulations.
+ * A resource value configuration (RVC) is a mapping configuration of user's
+ * resources to resource values. Used in Attack path simulations.
  * 
* * Protobuf type {@code google.cloud.securitycenter.v2.ResourceValueConfig} @@ -46,6 +46,7 @@ private ResourceValueConfig() { resourceType_ = ""; scope_ = ""; description_ = ""; + cloudProvider_ = 0; } @java.lang.Override @@ -967,7 +968,7 @@ public com.google.protobuf.Parser getParserForTy * * *
-   * Name for the resource value config
+   * Name for the resource value configuration
    * 
* * string name = 1; @@ -990,7 +991,7 @@ public java.lang.String getName() { * * *
-   * Name for the resource value config
+   * Name for the resource value configuration
    * 
* * string name = 1; @@ -1056,9 +1057,9 @@ public com.google.cloud.securitycenter.v2.ResourceValue getResourceValue() { * * *
-   * Required. Tag values combined with AND to check against.
+   * Required. Tag values combined with <code>AND</code> to check against.
    * Values in the form "tagValues/123"
-   * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+   * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
    * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
    * 
* @@ -1073,9 +1074,9 @@ public com.google.protobuf.ProtocolStringList getTagValuesList() { * * *
-   * Required. Tag values combined with AND to check against.
+   * Required. Tag values combined with <code>AND</code> to check against.
    * Values in the form "tagValues/123"
-   * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+   * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
    * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
    * 
* @@ -1090,9 +1091,9 @@ public int getTagValuesCount() { * * *
-   * Required. Tag values combined with AND to check against.
+   * Required. Tag values combined with <code>AND</code> to check against.
    * Values in the form "tagValues/123"
-   * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+   * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
    * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
    * 
* @@ -1108,9 +1109,9 @@ public java.lang.String getTagValues(int index) { * * *
-   * Required. Tag values combined with AND to check against.
+   * Required. Tag values combined with <code>AND</code> to check against.
    * Values in the form "tagValues/123"
-   * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+   * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
    * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
    * 
* @@ -1132,9 +1133,9 @@ public com.google.protobuf.ByteString getTagValuesBytes(int index) { * *
    * Apply resource_value only to resources that match resource_type.
-   * resource_type will be checked with "AND" of other resources.
-   * E.g. "storage.googleapis.com/Bucket" with resource_value "HIGH" will
-   * apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
+   * resource_type will be checked with <code>AND</code> of other resources.
+   * For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
+   * will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
    * 
* * string resource_type = 4; @@ -1158,9 +1159,9 @@ public java.lang.String getResourceType() { * *
    * Apply resource_value only to resources that match resource_type.
-   * resource_type will be checked with "AND" of other resources.
-   * E.g. "storage.googleapis.com/Bucket" with resource_value "HIGH" will
-   * apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
+   * resource_type will be checked with <code>AND</code> of other resources.
+   * For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
+   * will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
    * 
* * string resource_type = 4; @@ -1188,10 +1189,10 @@ public com.google.protobuf.ByteString getResourceTypeBytes() { * * *
-   * Project or folder to scope this config to.
-   * For example, "project/456" would apply this config only to resources in
-   * "project/456"
-   * scope will be checked with "AND" of other resources.
+   * Project or folder to scope this configuration to.
+   * For example, "project/456" would apply this configuration only to resources
+   * in "project/456" scope will be checked with <code>AND</code> of other
+   * resources.
    * 
* * string scope = 5; @@ -1214,10 +1215,10 @@ public java.lang.String getScope() { * * *
-   * Project or folder to scope this config to.
-   * For example, "project/456" would apply this config only to resources in
-   * "project/456"
-   * scope will be checked with "AND" of other resources.
+   * Project or folder to scope this configuration to.
+   * For example, "project/456" would apply this configuration only to resources
+   * in "project/456" scope will be checked with <code>AND</code> of other
+   * resources.
    * 
* * string scope = 5; @@ -1269,9 +1270,10 @@ public int getResourceLabelsSelectorCount() { * * *
-   * List of resource labels to search for, evaluated with AND.
-   * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-   * will match resources with labels "key": "value" AND "env": "prod"
+   * List of resource labels to search for, evaluated with <code>AND</code>.
+   * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+   * will match resources with labels "key": "value" <code>AND</code> "env":
+   * "prod"
    * https://cloud.google.com/resource-manager/docs/creating-managing-labels
    * 
* @@ -1294,9 +1296,10 @@ public java.util.Map getResourceLabelsSelect * * *
-   * List of resource labels to search for, evaluated with AND.
-   * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-   * will match resources with labels "key": "value" AND "env": "prod"
+   * List of resource labels to search for, evaluated with <code>AND</code>.
+   * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+   * will match resources with labels "key": "value" <code>AND</code> "env":
+   * "prod"
    * https://cloud.google.com/resource-manager/docs/creating-managing-labels
    * 
* @@ -1310,9 +1313,10 @@ public java.util.Map getResourceLabelsSelect * * *
-   * List of resource labels to search for, evaluated with AND.
-   * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-   * will match resources with labels "key": "value" AND "env": "prod"
+   * List of resource labels to search for, evaluated with <code>AND</code>.
+   * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+   * will match resources with labels "key": "value" <code>AND</code> "env":
+   * "prod"
    * https://cloud.google.com/resource-manager/docs/creating-managing-labels
    * 
* @@ -1334,9 +1338,10 @@ public java.util.Map getResourceLabelsSelect * * *
-   * List of resource labels to search for, evaluated with AND.
-   * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-   * will match resources with labels "key": "value" AND "env": "prod"
+   * List of resource labels to search for, evaluated with <code>AND</code>.
+   * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+   * will match resources with labels "key": "value" <code>AND</code> "env":
+   * "prod"
    * https://cloud.google.com/resource-manager/docs/creating-managing-labels
    * 
* @@ -1363,7 +1368,7 @@ public java.lang.String getResourceLabelsSelectorOrThrow(java.lang.String key) { * * *
-   * Description of the resource value config.
+   * Description of the resource value configuration.
    * 
* * string description = 7; @@ -1386,7 +1391,7 @@ public java.lang.String getDescription() { * * *
-   * Description of the resource value config.
+   * Description of the resource value configuration.
    * 
* * string description = 7; @@ -1412,7 +1417,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * * *
-   * Output only. Timestamp this resource value config was created.
+   * Output only. Timestamp this resource value configuration was created.
    * 
* * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1428,7 +1433,7 @@ public boolean hasCreateTime() { * * *
-   * Output only. Timestamp this resource value config was created.
+   * Output only. Timestamp this resource value configuration was created.
    * 
* * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1444,7 +1449,7 @@ public com.google.protobuf.Timestamp getCreateTime() { * * *
-   * Output only. Timestamp this resource value config was created.
+   * Output only. Timestamp this resource value configuration was created.
    * 
* * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1461,7 +1466,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * *
-   * Output only. Timestamp this resource value config was last updated.
+   * Output only. Timestamp this resource value configuration was last updated.
    * 
* * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1477,7 +1482,7 @@ public boolean hasUpdateTime() { * * *
-   * Output only. Timestamp this resource value config was last updated.
+   * Output only. Timestamp this resource value configuration was last updated.
    * 
* * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1493,7 +1498,7 @@ public com.google.protobuf.Timestamp getUpdateTime() { * * *
-   * Output only. Timestamp this resource value config was last updated.
+   * Output only. Timestamp this resource value configuration was last updated.
    * 
* * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1504,6 +1509,41 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; } + public static final int CLOUD_PROVIDER_FIELD_NUMBER = 10; + private int cloudProvider_ = 0; + /** + * + * + *
+   * Cloud provider this configuration applies to
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 10; + * + * @return The enum numeric value on the wire for cloudProvider. + */ + @java.lang.Override + public int getCloudProviderValue() { + return cloudProvider_; + } + /** + * + * + *
+   * Cloud provider this configuration applies to
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 10; + * + * @return The cloudProvider. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.CloudProvider getCloudProvider() { + com.google.cloud.securitycenter.v2.CloudProvider result = + com.google.cloud.securitycenter.v2.CloudProvider.forNumber(cloudProvider_); + return result == null ? com.google.cloud.securitycenter.v2.CloudProvider.UNRECOGNIZED : result; + } + public static final int SENSITIVE_DATA_PROTECTION_MAPPING_FIELD_NUMBER = 11; private com.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping sensitiveDataProtectionMapping_; @@ -1620,6 +1660,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(9, getUpdateTime()); } + if (cloudProvider_ + != com.google.cloud.securitycenter.v2.CloudProvider.CLOUD_PROVIDER_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, cloudProvider_); + } if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(11, getSensitiveDataProtectionMapping()); } @@ -1673,6 +1718,11 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getUpdateTime()); } + if (cloudProvider_ + != com.google.cloud.securitycenter.v2.CloudProvider.CLOUD_PROVIDER_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, cloudProvider_); + } if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( @@ -1710,6 +1760,7 @@ public boolean equals(final java.lang.Object obj) { if (hasUpdateTime()) { if (!getUpdateTime().equals(other.getUpdateTime())) return false; } + if (cloudProvider_ != other.cloudProvider_) return false; if (hasSensitiveDataProtectionMapping() != other.hasSensitiveDataProtectionMapping()) return false; if (hasSensitiveDataProtectionMapping()) { @@ -1753,6 +1804,8 @@ public int hashCode() { hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getUpdateTime().hashCode(); } + hash = (37 * hash) + CLOUD_PROVIDER_FIELD_NUMBER; + hash = (53 * hash) + cloudProvider_; if (hasSensitiveDataProtectionMapping()) { hash = (37 * hash) + SENSITIVE_DATA_PROTECTION_MAPPING_FIELD_NUMBER; hash = (53 * hash) + getSensitiveDataProtectionMapping().hashCode(); @@ -1862,8 +1915,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * A resource value config (RVC) is a mapping configuration of user's resources
-   * to resource values. Used in Attack path simulations.
+   * A resource value configuration (RVC) is a mapping configuration of user's
+   * resources to resource values. Used in Attack path simulations.
    * 
* * Protobuf type {@code google.cloud.securitycenter.v2.ResourceValueConfig} @@ -1948,6 +2001,7 @@ public Builder clear() { updateTimeBuilder_.dispose(); updateTimeBuilder_ = null; } + cloudProvider_ = 0; sensitiveDataProtectionMapping_ = null; if (sensitiveDataProtectionMappingBuilder_ != null) { sensitiveDataProtectionMappingBuilder_.dispose(); @@ -2022,6 +2076,9 @@ private void buildPartial0(com.google.cloud.securitycenter.v2.ResourceValueConfi to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x00000200) != 0)) { + result.cloudProvider_ = cloudProvider_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { result.sensitiveDataProtectionMapping_ = sensitiveDataProtectionMappingBuilder_ == null ? sensitiveDataProtectionMapping_ @@ -2119,6 +2176,9 @@ public Builder mergeFrom(com.google.cloud.securitycenter.v2.ResourceValueConfig if (other.hasUpdateTime()) { mergeUpdateTime(other.getUpdateTime()); } + if (other.cloudProvider_ != 0) { + setCloudProviderValue(other.getCloudProviderValue()); + } if (other.hasSensitiveDataProtectionMapping()) { mergeSensitiveDataProtectionMapping(other.getSensitiveDataProtectionMapping()); } @@ -2211,12 +2271,18 @@ public Builder mergeFrom( bitField0_ |= 0x00000100; break; } // case 74 + case 80: + { + cloudProvider_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 80 case 90: { input.readMessage( getSensitiveDataProtectionMappingFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; break; } // case 90 default: @@ -2243,7 +2309,7 @@ public Builder mergeFrom( * * *
-     * Name for the resource value config
+     * Name for the resource value configuration
      * 
* * string name = 1; @@ -2265,7 +2331,7 @@ public java.lang.String getName() { * * *
-     * Name for the resource value config
+     * Name for the resource value configuration
      * 
* * string name = 1; @@ -2287,7 +2353,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Name for the resource value config
+     * Name for the resource value configuration
      * 
* * string name = 1; @@ -2308,7 +2374,7 @@ public Builder setName(java.lang.String value) { * * *
-     * Name for the resource value config
+     * Name for the resource value configuration
      * 
* * string name = 1; @@ -2325,7 +2391,7 @@ public Builder clearName() { * * *
-     * Name for the resource value config
+     * Name for the resource value configuration
      * 
* * string name = 1; @@ -2454,9 +2520,9 @@ private void ensureTagValuesIsMutable() { * * *
-     * Required. Tag values combined with AND to check against.
+     * Required. Tag values combined with <code>AND</code> to check against.
      * Values in the form "tagValues/123"
-     * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+     * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
      * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
      * 
* @@ -2472,9 +2538,9 @@ public com.google.protobuf.ProtocolStringList getTagValuesList() { * * *
-     * Required. Tag values combined with AND to check against.
+     * Required. Tag values combined with <code>AND</code> to check against.
      * Values in the form "tagValues/123"
-     * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+     * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
      * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
      * 
* @@ -2489,9 +2555,9 @@ public int getTagValuesCount() { * * *
-     * Required. Tag values combined with AND to check against.
+     * Required. Tag values combined with <code>AND</code> to check against.
      * Values in the form "tagValues/123"
-     * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+     * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
      * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
      * 
* @@ -2507,9 +2573,9 @@ public java.lang.String getTagValues(int index) { * * *
-     * Required. Tag values combined with AND to check against.
+     * Required. Tag values combined with <code>AND</code> to check against.
      * Values in the form "tagValues/123"
-     * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+     * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
      * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
      * 
* @@ -2525,9 +2591,9 @@ public com.google.protobuf.ByteString getTagValuesBytes(int index) { * * *
-     * Required. Tag values combined with AND to check against.
+     * Required. Tag values combined with <code>AND</code> to check against.
      * Values in the form "tagValues/123"
-     * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+     * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
      * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
      * 
* @@ -2551,9 +2617,9 @@ public Builder setTagValues(int index, java.lang.String value) { * * *
-     * Required. Tag values combined with AND to check against.
+     * Required. Tag values combined with <code>AND</code> to check against.
      * Values in the form "tagValues/123"
-     * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+     * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
      * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
      * 
* @@ -2576,9 +2642,9 @@ public Builder addTagValues(java.lang.String value) { * * *
-     * Required. Tag values combined with AND to check against.
+     * Required. Tag values combined with <code>AND</code> to check against.
      * Values in the form "tagValues/123"
-     * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+     * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
      * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
      * 
* @@ -2598,9 +2664,9 @@ public Builder addAllTagValues(java.lang.Iterable values) { * * *
-     * Required. Tag values combined with AND to check against.
+     * Required. Tag values combined with <code>AND</code> to check against.
      * Values in the form "tagValues/123"
-     * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+     * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
      * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
      * 
* @@ -2619,9 +2685,9 @@ public Builder clearTagValues() { * * *
-     * Required. Tag values combined with AND to check against.
+     * Required. Tag values combined with <code>AND</code> to check against.
      * Values in the form "tagValues/123"
-     * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+     * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
      * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
      * 
* @@ -2648,9 +2714,9 @@ public Builder addTagValuesBytes(com.google.protobuf.ByteString value) { * *
      * Apply resource_value only to resources that match resource_type.
-     * resource_type will be checked with "AND" of other resources.
-     * E.g. "storage.googleapis.com/Bucket" with resource_value "HIGH" will
-     * apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
+     * resource_type will be checked with <code>AND</code> of other resources.
+     * For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
+     * will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
      * 
* * string resource_type = 4; @@ -2673,9 +2739,9 @@ public java.lang.String getResourceType() { * *
      * Apply resource_value only to resources that match resource_type.
-     * resource_type will be checked with "AND" of other resources.
-     * E.g. "storage.googleapis.com/Bucket" with resource_value "HIGH" will
-     * apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
+     * resource_type will be checked with <code>AND</code> of other resources.
+     * For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
+     * will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
      * 
* * string resource_type = 4; @@ -2698,9 +2764,9 @@ public com.google.protobuf.ByteString getResourceTypeBytes() { * *
      * Apply resource_value only to resources that match resource_type.
-     * resource_type will be checked with "AND" of other resources.
-     * E.g. "storage.googleapis.com/Bucket" with resource_value "HIGH" will
-     * apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
+     * resource_type will be checked with <code>AND</code> of other resources.
+     * For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
+     * will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
      * 
* * string resource_type = 4; @@ -2722,9 +2788,9 @@ public Builder setResourceType(java.lang.String value) { * *
      * Apply resource_value only to resources that match resource_type.
-     * resource_type will be checked with "AND" of other resources.
-     * E.g. "storage.googleapis.com/Bucket" with resource_value "HIGH" will
-     * apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
+     * resource_type will be checked with <code>AND</code> of other resources.
+     * For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
+     * will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
      * 
* * string resource_type = 4; @@ -2742,9 +2808,9 @@ public Builder clearResourceType() { * *
      * Apply resource_value only to resources that match resource_type.
-     * resource_type will be checked with "AND" of other resources.
-     * E.g. "storage.googleapis.com/Bucket" with resource_value "HIGH" will
-     * apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
+     * resource_type will be checked with <code>AND</code> of other resources.
+     * For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
+     * will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
      * 
* * string resource_type = 4; @@ -2768,10 +2834,10 @@ public Builder setResourceTypeBytes(com.google.protobuf.ByteString value) { * * *
-     * Project or folder to scope this config to.
-     * For example, "project/456" would apply this config only to resources in
-     * "project/456"
-     * scope will be checked with "AND" of other resources.
+     * Project or folder to scope this configuration to.
+     * For example, "project/456" would apply this configuration only to resources
+     * in "project/456" scope will be checked with <code>AND</code> of other
+     * resources.
      * 
* * string scope = 5; @@ -2793,10 +2859,10 @@ public java.lang.String getScope() { * * *
-     * Project or folder to scope this config to.
-     * For example, "project/456" would apply this config only to resources in
-     * "project/456"
-     * scope will be checked with "AND" of other resources.
+     * Project or folder to scope this configuration to.
+     * For example, "project/456" would apply this configuration only to resources
+     * in "project/456" scope will be checked with <code>AND</code> of other
+     * resources.
      * 
* * string scope = 5; @@ -2818,10 +2884,10 @@ public com.google.protobuf.ByteString getScopeBytes() { * * *
-     * Project or folder to scope this config to.
-     * For example, "project/456" would apply this config only to resources in
-     * "project/456"
-     * scope will be checked with "AND" of other resources.
+     * Project or folder to scope this configuration to.
+     * For example, "project/456" would apply this configuration only to resources
+     * in "project/456" scope will be checked with <code>AND</code> of other
+     * resources.
      * 
* * string scope = 5; @@ -2842,10 +2908,10 @@ public Builder setScope(java.lang.String value) { * * *
-     * Project or folder to scope this config to.
-     * For example, "project/456" would apply this config only to resources in
-     * "project/456"
-     * scope will be checked with "AND" of other resources.
+     * Project or folder to scope this configuration to.
+     * For example, "project/456" would apply this configuration only to resources
+     * in "project/456" scope will be checked with <code>AND</code> of other
+     * resources.
      * 
* * string scope = 5; @@ -2862,10 +2928,10 @@ public Builder clearScope() { * * *
-     * Project or folder to scope this config to.
-     * For example, "project/456" would apply this config only to resources in
-     * "project/456"
-     * scope will be checked with "AND" of other resources.
+     * Project or folder to scope this configuration to.
+     * For example, "project/456" would apply this configuration only to resources
+     * in "project/456" scope will be checked with <code>AND</code> of other
+     * resources.
      * 
* * string scope = 5; @@ -2918,9 +2984,10 @@ public int getResourceLabelsSelectorCount() { * * *
-     * List of resource labels to search for, evaluated with AND.
-     * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-     * will match resources with labels "key": "value" AND "env": "prod"
+     * List of resource labels to search for, evaluated with <code>AND</code>.
+     * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+     * will match resources with labels "key": "value" <code>AND</code> "env":
+     * "prod"
      * https://cloud.google.com/resource-manager/docs/creating-managing-labels
      * 
* @@ -2943,9 +3010,10 @@ public java.util.Map getResourceLabelsSelect * * *
-     * List of resource labels to search for, evaluated with AND.
-     * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-     * will match resources with labels "key": "value" AND "env": "prod"
+     * List of resource labels to search for, evaluated with <code>AND</code>.
+     * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+     * will match resources with labels "key": "value" <code>AND</code> "env":
+     * "prod"
      * https://cloud.google.com/resource-manager/docs/creating-managing-labels
      * 
* @@ -2959,9 +3027,10 @@ public java.util.Map getResourceLabelsSelect * * *
-     * List of resource labels to search for, evaluated with AND.
-     * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-     * will match resources with labels "key": "value" AND "env": "prod"
+     * List of resource labels to search for, evaluated with <code>AND</code>.
+     * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+     * will match resources with labels "key": "value" <code>AND</code> "env":
+     * "prod"
      * https://cloud.google.com/resource-manager/docs/creating-managing-labels
      * 
* @@ -2983,9 +3052,10 @@ public java.util.Map getResourceLabelsSelect * * *
-     * List of resource labels to search for, evaluated with AND.
-     * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-     * will match resources with labels "key": "value" AND "env": "prod"
+     * List of resource labels to search for, evaluated with <code>AND</code>.
+     * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+     * will match resources with labels "key": "value" <code>AND</code> "env":
+     * "prod"
      * https://cloud.google.com/resource-manager/docs/creating-managing-labels
      * 
* @@ -3013,9 +3083,10 @@ public Builder clearResourceLabelsSelector() { * * *
-     * List of resource labels to search for, evaluated with AND.
-     * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-     * will match resources with labels "key": "value" AND "env": "prod"
+     * List of resource labels to search for, evaluated with <code>AND</code>.
+     * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+     * will match resources with labels "key": "value" <code>AND</code> "env":
+     * "prod"
      * https://cloud.google.com/resource-manager/docs/creating-managing-labels
      * 
* @@ -3038,9 +3109,10 @@ public java.util.Map getMutableResourceLabel * * *
-     * List of resource labels to search for, evaluated with AND.
-     * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-     * will match resources with labels "key": "value" AND "env": "prod"
+     * List of resource labels to search for, evaluated with <code>AND</code>.
+     * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+     * will match resources with labels "key": "value" <code>AND</code> "env":
+     * "prod"
      * https://cloud.google.com/resource-manager/docs/creating-managing-labels
      * 
* @@ -3061,9 +3133,10 @@ public Builder putResourceLabelsSelector(java.lang.String key, java.lang.String * * *
-     * List of resource labels to search for, evaluated with AND.
-     * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-     * will match resources with labels "key": "value" AND "env": "prod"
+     * List of resource labels to search for, evaluated with <code>AND</code>.
+     * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+     * will match resources with labels "key": "value" <code>AND</code> "env":
+     * "prod"
      * https://cloud.google.com/resource-manager/docs/creating-managing-labels
      * 
* @@ -3081,7 +3154,7 @@ public Builder putAllResourceLabelsSelector( * * *
-     * Description of the resource value config.
+     * Description of the resource value configuration.
      * 
* * string description = 7; @@ -3103,7 +3176,7 @@ public java.lang.String getDescription() { * * *
-     * Description of the resource value config.
+     * Description of the resource value configuration.
      * 
* * string description = 7; @@ -3125,7 +3198,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * * *
-     * Description of the resource value config.
+     * Description of the resource value configuration.
      * 
* * string description = 7; @@ -3146,7 +3219,7 @@ public Builder setDescription(java.lang.String value) { * * *
-     * Description of the resource value config.
+     * Description of the resource value configuration.
      * 
* * string description = 7; @@ -3163,7 +3236,7 @@ public Builder clearDescription() { * * *
-     * Description of the resource value config.
+     * Description of the resource value configuration.
      * 
* * string description = 7; @@ -3192,7 +3265,7 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { * * *
-     * Output only. Timestamp this resource value config was created.
+     * Output only. Timestamp this resource value configuration was created.
      * 
* * @@ -3208,7 +3281,7 @@ public boolean hasCreateTime() { * * *
-     * Output only. Timestamp this resource value config was created.
+     * Output only. Timestamp this resource value configuration was created.
      * 
* * @@ -3230,7 +3303,7 @@ public com.google.protobuf.Timestamp getCreateTime() { * * *
-     * Output only. Timestamp this resource value config was created.
+     * Output only. Timestamp this resource value configuration was created.
      * 
* * @@ -3254,7 +3327,7 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { * * *
-     * Output only. Timestamp this resource value config was created.
+     * Output only. Timestamp this resource value configuration was created.
      * 
* * @@ -3275,7 +3348,7 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal * * *
-     * Output only. Timestamp this resource value config was created.
+     * Output only. Timestamp this resource value configuration was created.
      * 
* * @@ -3304,7 +3377,7 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * * *
-     * Output only. Timestamp this resource value config was created.
+     * Output only. Timestamp this resource value configuration was created.
      * 
* * @@ -3325,7 +3398,7 @@ public Builder clearCreateTime() { * * *
-     * Output only. Timestamp this resource value config was created.
+     * Output only. Timestamp this resource value configuration was created.
      * 
* * @@ -3341,7 +3414,7 @@ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { * * *
-     * Output only. Timestamp this resource value config was created.
+     * Output only. Timestamp this resource value configuration was created.
      * 
* * @@ -3361,7 +3434,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * *
-     * Output only. Timestamp this resource value config was created.
+     * Output only. Timestamp this resource value configuration was created.
      * 
* * @@ -3395,7 +3468,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * *
-     * Output only. Timestamp this resource value config was last updated.
+     * Output only. Timestamp this resource value configuration was last updated.
      * 
* * @@ -3411,7 +3484,7 @@ public boolean hasUpdateTime() { * * *
-     * Output only. Timestamp this resource value config was last updated.
+     * Output only. Timestamp this resource value configuration was last updated.
      * 
* * @@ -3433,7 +3506,7 @@ public com.google.protobuf.Timestamp getUpdateTime() { * * *
-     * Output only. Timestamp this resource value config was last updated.
+     * Output only. Timestamp this resource value configuration was last updated.
      * 
* * @@ -3457,7 +3530,7 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { * * *
-     * Output only. Timestamp this resource value config was last updated.
+     * Output only. Timestamp this resource value configuration was last updated.
      * 
* * @@ -3478,7 +3551,7 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForVal * * *
-     * Output only. Timestamp this resource value config was last updated.
+     * Output only. Timestamp this resource value configuration was last updated.
      * 
* * @@ -3507,7 +3580,7 @@ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { * * *
-     * Output only. Timestamp this resource value config was last updated.
+     * Output only. Timestamp this resource value configuration was last updated.
      * 
* * @@ -3528,7 +3601,7 @@ public Builder clearUpdateTime() { * * *
-     * Output only. Timestamp this resource value config was last updated.
+     * Output only. Timestamp this resource value configuration was last updated.
      * 
* * @@ -3544,7 +3617,7 @@ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { * * *
-     * Output only. Timestamp this resource value config was last updated.
+     * Output only. Timestamp this resource value configuration was last updated.
      * 
* * @@ -3564,7 +3637,7 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * * *
-     * Output only. Timestamp this resource value config was last updated.
+     * Output only. Timestamp this resource value configuration was last updated.
      * 
* * @@ -3588,6 +3661,98 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return updateTimeBuilder_; } + private int cloudProvider_ = 0; + /** + * + * + *
+     * Cloud provider this configuration applies to
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 10; + * + * @return The enum numeric value on the wire for cloudProvider. + */ + @java.lang.Override + public int getCloudProviderValue() { + return cloudProvider_; + } + /** + * + * + *
+     * Cloud provider this configuration applies to
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 10; + * + * @param value The enum numeric value on the wire for cloudProvider to set. + * @return This builder for chaining. + */ + public Builder setCloudProviderValue(int value) { + cloudProvider_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Cloud provider this configuration applies to
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 10; + * + * @return The cloudProvider. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.CloudProvider getCloudProvider() { + com.google.cloud.securitycenter.v2.CloudProvider result = + com.google.cloud.securitycenter.v2.CloudProvider.forNumber(cloudProvider_); + return result == null + ? com.google.cloud.securitycenter.v2.CloudProvider.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Cloud provider this configuration applies to
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 10; + * + * @param value The cloudProvider to set. + * @return This builder for chaining. + */ + public Builder setCloudProvider(com.google.cloud.securitycenter.v2.CloudProvider value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + cloudProvider_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Cloud provider this configuration applies to
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 10; + * + * @return This builder for chaining. + */ + public Builder clearCloudProvider() { + bitField0_ = (bitField0_ & ~0x00000200); + cloudProvider_ = 0; + onChanged(); + return this; + } + private com.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping sensitiveDataProtectionMapping_; private com.google.protobuf.SingleFieldBuilderV3< @@ -3614,7 +3779,7 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * @return Whether the sensitiveDataProtectionMapping field is set. */ public boolean hasSensitiveDataProtectionMapping() { - return ((bitField0_ & 0x00000200) != 0); + return ((bitField0_ & 0x00000400) != 0); } /** * @@ -3668,7 +3833,7 @@ public Builder setSensitiveDataProtectionMapping( } else { sensitiveDataProtectionMappingBuilder_.setMessage(value); } - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -3695,7 +3860,7 @@ public Builder setSensitiveDataProtectionMapping( } else { sensitiveDataProtectionMappingBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -3717,7 +3882,7 @@ public Builder mergeSensitiveDataProtectionMapping( com.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping value) { if (sensitiveDataProtectionMappingBuilder_ == null) { - if (((bitField0_ & 0x00000200) != 0) + if (((bitField0_ & 0x00000400) != 0) && sensitiveDataProtectionMapping_ != null && sensitiveDataProtectionMapping_ != com.google.cloud.securitycenter.v2.ResourceValueConfig @@ -3730,7 +3895,7 @@ public Builder mergeSensitiveDataProtectionMapping( sensitiveDataProtectionMappingBuilder_.mergeFrom(value); } if (sensitiveDataProtectionMapping_ != null) { - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); } return this; @@ -3750,7 +3915,7 @@ public Builder mergeSensitiveDataProtectionMapping( *
*/ public Builder clearSensitiveDataProtectionMapping() { - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000400); sensitiveDataProtectionMapping_ = null; if (sensitiveDataProtectionMappingBuilder_ != null) { sensitiveDataProtectionMappingBuilder_.dispose(); @@ -3776,7 +3941,7 @@ public Builder clearSensitiveDataProtectionMapping() { public com.google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping .Builder getSensitiveDataProtectionMappingBuilder() { - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); return getSensitiveDataProtectionMappingFieldBuilder().getBuilder(); } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfigName.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfigName.java index 0e6e0955bd43..8dd92a1790ec 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfigName.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfigName.java @@ -17,6 +17,7 @@ package com.google.cloud.securitycenter.v2; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,19 +33,35 @@ public class ResourceValueConfigName implements ResourceName { private static final PathTemplate ORGANIZATION_RESOURCE_VALUE_CONFIG = PathTemplate.createWithoutUrlEncoding( "organizations/{organization}/resourceValueConfigs/{resource_value_config}"); + private static final PathTemplate ORGANIZATION_LOCATION_RESOURCE_VALUE_CONFIG = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; private final String organization; private final String resourceValueConfig; + private final String location; @Deprecated protected ResourceValueConfigName() { organization = null; resourceValueConfig = null; + location = null; } private ResourceValueConfigName(Builder builder) { organization = Preconditions.checkNotNull(builder.getOrganization()); resourceValueConfig = Preconditions.checkNotNull(builder.getResourceValueConfig()); + location = null; + pathTemplate = ORGANIZATION_RESOURCE_VALUE_CONFIG; + } + + private ResourceValueConfigName(OrganizationLocationResourceValueConfigBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + resourceValueConfig = Preconditions.checkNotNull(builder.getResourceValueConfig()); + pathTemplate = ORGANIZATION_LOCATION_RESOURCE_VALUE_CONFIG; } public String getOrganization() { @@ -55,10 +72,23 @@ public String getResourceValueConfig() { return resourceValueConfig; } + public String getLocation() { + return location; + } + public static Builder newBuilder() { return new Builder(); } + public static Builder newOrganizationResourceValueConfigBuilder() { + return new Builder(); + } + + public static OrganizationLocationResourceValueConfigBuilder + newOrganizationLocationResourceValueConfigBuilder() { + return new OrganizationLocationResourceValueConfigBuilder(); + } + public Builder toBuilder() { return new Builder(this); } @@ -70,6 +100,23 @@ public static ResourceValueConfigName of(String organization, String resourceVal .build(); } + public static ResourceValueConfigName ofOrganizationResourceValueConfigName( + String organization, String resourceValueConfig) { + return newBuilder() + .setOrganization(organization) + .setResourceValueConfig(resourceValueConfig) + .build(); + } + + public static ResourceValueConfigName ofOrganizationLocationResourceValueConfigName( + String organization, String location, String resourceValueConfig) { + return newOrganizationLocationResourceValueConfigBuilder() + .setOrganization(organization) + .setLocation(location) + .setResourceValueConfig(resourceValueConfig) + .build(); + } + public static String format(String organization, String resourceValueConfig) { return newBuilder() .setOrganization(organization) @@ -78,14 +125,43 @@ public static String format(String organization, String resourceValueConfig) { .toString(); } + public static String formatOrganizationResourceValueConfigName( + String organization, String resourceValueConfig) { + return newBuilder() + .setOrganization(organization) + .setResourceValueConfig(resourceValueConfig) + .build() + .toString(); + } + + public static String formatOrganizationLocationResourceValueConfigName( + String organization, String location, String resourceValueConfig) { + return newOrganizationLocationResourceValueConfigBuilder() + .setOrganization(organization) + .setLocation(location) + .setResourceValueConfig(resourceValueConfig) + .build() + .toString(); + } + public static ResourceValueConfigName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - ORGANIZATION_RESOURCE_VALUE_CONFIG.validatedMatch( - formattedString, "ResourceValueConfigName.parse: formattedString not in valid format"); - return of(matchMap.get("organization"), matchMap.get("resource_value_config")); + if (ORGANIZATION_RESOURCE_VALUE_CONFIG.matches(formattedString)) { + Map matchMap = ORGANIZATION_RESOURCE_VALUE_CONFIG.match(formattedString); + return ofOrganizationResourceValueConfigName( + matchMap.get("organization"), matchMap.get("resource_value_config")); + } else if (ORGANIZATION_LOCATION_RESOURCE_VALUE_CONFIG.matches(formattedString)) { + Map matchMap = + ORGANIZATION_LOCATION_RESOURCE_VALUE_CONFIG.match(formattedString); + return ofOrganizationLocationResourceValueConfigName( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("resource_value_config")); + } + throw new ValidationException( + "ResourceValueConfigName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -109,7 +185,8 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return ORGANIZATION_RESOURCE_VALUE_CONFIG.matches(formattedString); + return ORGANIZATION_RESOURCE_VALUE_CONFIG.matches(formattedString) + || ORGANIZATION_LOCATION_RESOURCE_VALUE_CONFIG.matches(formattedString); } @Override @@ -124,6 +201,9 @@ public Map getFieldValuesMap() { if (resourceValueConfig != null) { fieldMapBuilder.put("resource_value_config", resourceValueConfig); } + if (location != null) { + fieldMapBuilder.put("location", location); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -137,8 +217,7 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return ORGANIZATION_RESOURCE_VALUE_CONFIG.instantiate( - "organization", organization, "resource_value_config", resourceValueConfig); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } @Override @@ -149,7 +228,8 @@ public boolean equals(java.lang.Object o) { if (o != null && getClass() == o.getClass()) { ResourceValueConfigName that = ((ResourceValueConfigName) o); return Objects.equals(this.organization, that.organization) - && Objects.equals(this.resourceValueConfig, that.resourceValueConfig); + && Objects.equals(this.resourceValueConfig, that.resourceValueConfig) + && Objects.equals(this.location, that.location); } return false; } @@ -158,9 +238,13 @@ public boolean equals(java.lang.Object o) { public int hashCode() { int h = 1; h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; h ^= Objects.hashCode(organization); h *= 1000003; h ^= Objects.hashCode(resourceValueConfig); + h *= 1000003; + h ^= Objects.hashCode(location); return h; } @@ -190,6 +274,9 @@ public Builder setResourceValueConfig(String resourceValueConfig) { } private Builder(ResourceValueConfigName resourceValueConfigName) { + Preconditions.checkArgument( + Objects.equals(resourceValueConfigName.pathTemplate, ORGANIZATION_RESOURCE_VALUE_CONFIG), + "toBuilder is only supported when ResourceValueConfigName has the pattern of organizations/{organization}/resourceValueConfigs/{resource_value_config}"); this.organization = resourceValueConfigName.organization; this.resourceValueConfig = resourceValueConfigName.resourceValueConfig; } @@ -198,4 +285,48 @@ public ResourceValueConfigName build() { return new ResourceValueConfigName(this); } } + + /** + * Builder for + * organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}. + */ + public static class OrganizationLocationResourceValueConfigBuilder { + private String organization; + private String location; + private String resourceValueConfig; + + protected OrganizationLocationResourceValueConfigBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getResourceValueConfig() { + return resourceValueConfig; + } + + public OrganizationLocationResourceValueConfigBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationResourceValueConfigBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationResourceValueConfigBuilder setResourceValueConfig( + String resourceValueConfig) { + this.resourceValueConfig = resourceValueConfig; + return this; + } + + public ResourceValueConfigName build() { + return new ResourceValueConfigName(this); + } + } } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfigOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfigOrBuilder.java index 9110675813d9..ea3e8f0568da 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfigOrBuilder.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfigOrBuilder.java @@ -28,7 +28,7 @@ public interface ResourceValueConfigOrBuilder * * *
-   * Name for the resource value config
+   * Name for the resource value configuration
    * 
* * string name = 1; @@ -40,7 +40,7 @@ public interface ResourceValueConfigOrBuilder * * *
-   * Name for the resource value config
+   * Name for the resource value configuration
    * 
* * string name = 1; @@ -80,9 +80,9 @@ public interface ResourceValueConfigOrBuilder * * *
-   * Required. Tag values combined with AND to check against.
+   * Required. Tag values combined with <code>AND</code> to check against.
    * Values in the form "tagValues/123"
-   * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+   * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
    * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
    * 
* @@ -95,9 +95,9 @@ public interface ResourceValueConfigOrBuilder * * *
-   * Required. Tag values combined with AND to check against.
+   * Required. Tag values combined with <code>AND</code> to check against.
    * Values in the form "tagValues/123"
-   * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+   * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
    * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
    * 
* @@ -110,9 +110,9 @@ public interface ResourceValueConfigOrBuilder * * *
-   * Required. Tag values combined with AND to check against.
+   * Required. Tag values combined with <code>AND</code> to check against.
    * Values in the form "tagValues/123"
-   * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+   * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
    * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
    * 
* @@ -126,9 +126,9 @@ public interface ResourceValueConfigOrBuilder * * *
-   * Required. Tag values combined with AND to check against.
+   * Required. Tag values combined with <code>AND</code> to check against.
    * Values in the form "tagValues/123"
-   * E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ]
+   * Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ]
    * https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing
    * 
* @@ -144,9 +144,9 @@ public interface ResourceValueConfigOrBuilder * *
    * Apply resource_value only to resources that match resource_type.
-   * resource_type will be checked with "AND" of other resources.
-   * E.g. "storage.googleapis.com/Bucket" with resource_value "HIGH" will
-   * apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
+   * resource_type will be checked with <code>AND</code> of other resources.
+   * For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
+   * will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
    * 
* * string resource_type = 4; @@ -159,9 +159,9 @@ public interface ResourceValueConfigOrBuilder * *
    * Apply resource_value only to resources that match resource_type.
-   * resource_type will be checked with "AND" of other resources.
-   * E.g. "storage.googleapis.com/Bucket" with resource_value "HIGH" will
-   * apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
+   * resource_type will be checked with <code>AND</code> of other resources.
+   * For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
+   * will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
    * 
* * string resource_type = 4; @@ -174,10 +174,10 @@ public interface ResourceValueConfigOrBuilder * * *
-   * Project or folder to scope this config to.
-   * For example, "project/456" would apply this config only to resources in
-   * "project/456"
-   * scope will be checked with "AND" of other resources.
+   * Project or folder to scope this configuration to.
+   * For example, "project/456" would apply this configuration only to resources
+   * in "project/456" scope will be checked with <code>AND</code> of other
+   * resources.
    * 
* * string scope = 5; @@ -189,10 +189,10 @@ public interface ResourceValueConfigOrBuilder * * *
-   * Project or folder to scope this config to.
-   * For example, "project/456" would apply this config only to resources in
-   * "project/456"
-   * scope will be checked with "AND" of other resources.
+   * Project or folder to scope this configuration to.
+   * For example, "project/456" would apply this configuration only to resources
+   * in "project/456" scope will be checked with <code>AND</code> of other
+   * resources.
    * 
* * string scope = 5; @@ -205,9 +205,10 @@ public interface ResourceValueConfigOrBuilder * * *
-   * List of resource labels to search for, evaluated with AND.
-   * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-   * will match resources with labels "key": "value" AND "env": "prod"
+   * List of resource labels to search for, evaluated with <code>AND</code>.
+   * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+   * will match resources with labels "key": "value" <code>AND</code> "env":
+   * "prod"
    * https://cloud.google.com/resource-manager/docs/creating-managing-labels
    * 
* @@ -218,9 +219,10 @@ public interface ResourceValueConfigOrBuilder * * *
-   * List of resource labels to search for, evaluated with AND.
-   * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-   * will match resources with labels "key": "value" AND "env": "prod"
+   * List of resource labels to search for, evaluated with <code>AND</code>.
+   * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+   * will match resources with labels "key": "value" <code>AND</code> "env":
+   * "prod"
    * https://cloud.google.com/resource-manager/docs/creating-managing-labels
    * 
* @@ -234,9 +236,10 @@ public interface ResourceValueConfigOrBuilder * * *
-   * List of resource labels to search for, evaluated with AND.
-   * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-   * will match resources with labels "key": "value" AND "env": "prod"
+   * List of resource labels to search for, evaluated with <code>AND</code>.
+   * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+   * will match resources with labels "key": "value" <code>AND</code> "env":
+   * "prod"
    * https://cloud.google.com/resource-manager/docs/creating-managing-labels
    * 
* @@ -247,9 +250,10 @@ public interface ResourceValueConfigOrBuilder * * *
-   * List of resource labels to search for, evaluated with AND.
-   * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-   * will match resources with labels "key": "value" AND "env": "prod"
+   * List of resource labels to search for, evaluated with <code>AND</code>.
+   * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+   * will match resources with labels "key": "value" <code>AND</code> "env":
+   * "prod"
    * https://cloud.google.com/resource-manager/docs/creating-managing-labels
    * 
* @@ -264,9 +268,10 @@ java.lang.String getResourceLabelsSelectorOrDefault( * * *
-   * List of resource labels to search for, evaluated with AND.
-   * E.g. "resource_labels_selector": {"key": "value", "env": "prod"}
-   * will match resources with labels "key": "value" AND "env": "prod"
+   * List of resource labels to search for, evaluated with <code>AND</code>.
+   * For example, "resource_labels_selector": {"key": "value", "env": "prod"}
+   * will match resources with labels "key": "value" <code>AND</code> "env":
+   * "prod"
    * https://cloud.google.com/resource-manager/docs/creating-managing-labels
    * 
* @@ -278,7 +283,7 @@ java.lang.String getResourceLabelsSelectorOrDefault( * * *
-   * Description of the resource value config.
+   * Description of the resource value configuration.
    * 
* * string description = 7; @@ -290,7 +295,7 @@ java.lang.String getResourceLabelsSelectorOrDefault( * * *
-   * Description of the resource value config.
+   * Description of the resource value configuration.
    * 
* * string description = 7; @@ -303,7 +308,7 @@ java.lang.String getResourceLabelsSelectorOrDefault( * * *
-   * Output only. Timestamp this resource value config was created.
+   * Output only. Timestamp this resource value configuration was created.
    * 
* * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -316,7 +321,7 @@ java.lang.String getResourceLabelsSelectorOrDefault( * * *
-   * Output only. Timestamp this resource value config was created.
+   * Output only. Timestamp this resource value configuration was created.
    * 
* * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -329,7 +334,7 @@ java.lang.String getResourceLabelsSelectorOrDefault( * * *
-   * Output only. Timestamp this resource value config was created.
+   * Output only. Timestamp this resource value configuration was created.
    * 
* * .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -341,7 +346,7 @@ java.lang.String getResourceLabelsSelectorOrDefault( * * *
-   * Output only. Timestamp this resource value config was last updated.
+   * Output only. Timestamp this resource value configuration was last updated.
    * 
* * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -354,7 +359,7 @@ java.lang.String getResourceLabelsSelectorOrDefault( * * *
-   * Output only. Timestamp this resource value config was last updated.
+   * Output only. Timestamp this resource value configuration was last updated.
    * 
* * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -367,7 +372,7 @@ java.lang.String getResourceLabelsSelectorOrDefault( * * *
-   * Output only. Timestamp this resource value config was last updated.
+   * Output only. Timestamp this resource value configuration was last updated.
    * 
* * .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -375,6 +380,31 @@ java.lang.String getResourceLabelsSelectorOrDefault( */ com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + /** + * + * + *
+   * Cloud provider this configuration applies to
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 10; + * + * @return The enum numeric value on the wire for cloudProvider. + */ + int getCloudProviderValue(); + /** + * + * + *
+   * Cloud provider this configuration applies to
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 10; + * + * @return The cloudProvider. + */ + com.google.cloud.securitycenter.v2.CloudProvider getCloudProvider(); + /** * * diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfigProto.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfigProto.java index f09316bb7a15..4db01fc710e8 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfigProto.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ResourceValueConfigProto.java @@ -52,40 +52,47 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n:google/cloud/securitycenter/v2/resourc" + "e_value_config.proto\022\036google.cloud.secur" + "itycenter.v2\032\037google/api/field_behavior." - + "proto\032\031google/api/resource.proto\032\037google" - + "/protobuf/timestamp.proto\"\246\007\n\023ResourceVa" - + "lueConfig\022\014\n\004name\030\001 \001(\t\022E\n\016resource_valu" - + "e\030\002 \001(\0162-.google.cloud.securitycenter.v2" - + ".ResourceValue\022\027\n\ntag_values\030\003 \003(\tB\003\340A\002\022" - + "\025\n\rresource_type\030\004 \001(\t\022\r\n\005scope\030\005 \001(\t\022q\n" - + "\030resource_labels_selector\030\006 \003(\0132O.google" - + ".cloud.securitycenter.v2.ResourceValueCo" - + "nfig.ResourceLabelsSelectorEntry\022\023\n\013desc" - + "ription\030\007 \001(\t\0224\n\013create_time\030\010 \001(\0132\032.goo" - + "gle.protobuf.TimestampB\003\340A\003\0224\n\013update_ti" - + "me\030\t \001(\0132\032.google.protobuf.TimestampB\003\340A" - + "\003\022}\n!sensitive_data_protection_mapping\030\013" - + " \001(\0132R.google.cloud.securitycenter.v2.Re" - + "sourceValueConfig.SensitiveDataProtectio" - + "nMapping\032\304\001\n\036SensitiveDataProtectionMapp" - + "ing\022O\n\030high_sensitivity_mapping\030\001 \001(\0162-." - + "google.cloud.securitycenter.v2.ResourceV" - + "alue\022Q\n\032medium_sensitivity_mapping\030\002 \001(\016" - + "2-.google.cloud.securitycenter.v2.Resour" - + "ceValue\032=\n\033ResourceLabelsSelectorEntry\022\013" - + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\201\001\352A~\n1se" - + "curitycenter.googleapis.com/ResourceValu" - + "eConfig\022Iorganizations/{organization}/re" - + "sourceValueConfigs/{resource_value_confi" - + "g}*X\n\rResourceValue\022\036\n\032RESOURCE_VALUE_UN" - + "SPECIFIED\020\000\022\010\n\004HIGH\020\001\022\n\n\006MEDIUM\020\002\022\007\n\003LOW" - + "\020\003\022\010\n\004NONE\020\004B\362\001\n\"com.google.cloud.securi" - + "tycenter.v2B\030ResourceValueConfigProtoP\001Z" - + "Jcloud.google.com/go/securitycenter/apiv" - + "2/securitycenterpb;securitycenterpb\252\002\036Go" - + "ogle.Cloud.SecurityCenter.V2\312\002\036Google\\Cl" - + "oud\\SecurityCenter\\V2\352\002!Google::Cloud::S" - + "ecurityCenter::V2b\006proto3" + + "proto\032\031google/api/resource.proto\032-google" + + "/cloud/securitycenter/v2/resource.proto\032" + + "\037google/protobuf/timestamp.proto\"\371\010\n\023Res" + + "ourceValueConfig\022\014\n\004name\030\001 \001(\t\022E\n\016resour" + + "ce_value\030\002 \001(\0162-.google.cloud.securityce" + + "nter.v2.ResourceValue\022\027\n\ntag_values\030\003 \003(" + + "\tB\003\340A\002\022\025\n\rresource_type\030\004 \001(\t\022\r\n\005scope\030\005" + + " \001(\t\022q\n\030resource_labels_selector\030\006 \003(\0132O" + + ".google.cloud.securitycenter.v2.Resource" + + "ValueConfig.ResourceLabelsSelectorEntry\022" + + "\023\n\013description\030\007 \001(\t\0224\n\013create_time\030\010 \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n\013up" + + "date_time\030\t \001(\0132\032.google.protobuf.Timest" + + "ampB\003\340A\003\022E\n\016cloud_provider\030\n \001(\0162-.googl" + + "e.cloud.securitycenter.v2.CloudProvider\022" + + "}\n!sensitive_data_protection_mapping\030\013 \001" + + "(\0132R.google.cloud.securitycenter.v2.Reso" + + "urceValueConfig.SensitiveDataProtectionM" + + "apping\032\304\001\n\036SensitiveDataProtectionMappin" + + "g\022O\n\030high_sensitivity_mapping\030\001 \001(\0162-.go" + + "ogle.cloud.securitycenter.v2.ResourceVal" + + "ue\022Q\n\032medium_sensitivity_mapping\030\002 \001(\0162-" + + ".google.cloud.securitycenter.v2.Resource" + + "Value\032=\n\033ResourceLabelsSelectorEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\215\002\352A\211\002\n1sec" + + "uritycenter.googleapis.com/ResourceValue" + + "Config\022Iorganizations/{organization}/res" + + "ourceValueConfigs/{resource_value_config" + + "}\022^organizations/{organization}/location" + + "s/{location}/resourceValueConfigs/{resou" + + "rce_value_config}*\024resourceValueConfigs2" + + "\023resourceValueConfig*X\n\rResourceValue\022\036\n" + + "\032RESOURCE_VALUE_UNSPECIFIED\020\000\022\010\n\004HIGH\020\001\022" + + "\n\n\006MEDIUM\020\002\022\007\n\003LOW\020\003\022\010\n\004NONE\020\004B\362\001\n\"com.g" + + "oogle.cloud.securitycenter.v2B\030ResourceV" + + "alueConfigProtoP\001ZJcloud.google.com/go/s" + + "ecuritycenter/apiv2/securitycenterpb;sec" + + "uritycenterpb\252\002\036Google.Cloud.SecurityCen" + + "ter.V2\312\002\036Google\\Cloud\\SecurityCenter\\V2\352" + + "\002!Google::Cloud::SecurityCenter::V2b\006pro" + + "to3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -93,6 +100,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.securitycenter.v2.ResourceProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_cloud_securitycenter_v2_ResourceValueConfig_descriptor = @@ -110,6 +118,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Description", "CreateTime", "UpdateTime", + "CloudProvider", "SensitiveDataProtectionMapping", }); internal_static_google_cloud_securitycenter_v2_ResourceValueConfig_SensitiveDataProtectionMapping_descriptor = @@ -140,6 +149,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.securitycenter.v2.ResourceProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SecurityPolicy.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SecurityPolicy.java new file mode 100644 index 000000000000..0183c7a252cb --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SecurityPolicy.java @@ -0,0 +1,925 @@ +/* + * Copyright 2024 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/securitycenter/v2/cloud_armor.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +/** + * + * + *
+ * Information about the [Google Cloud Armor security
+ * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+ * relevant to the finding.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.SecurityPolicy} + */ +public final class SecurityPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.SecurityPolicy) + SecurityPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecurityPolicy.newBuilder() to construct. + private SecurityPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecurityPolicy() { + name_ = ""; + type_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecurityPolicy(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_SecurityPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_SecurityPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.SecurityPolicy.class, + com.google.cloud.securitycenter.v2.SecurityPolicy.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The name of the Google Cloud Armor security policy, for example,
+   * "my-security-policy".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the Google Cloud Armor security policy, for example,
+   * "my-security-policy".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** + * + * + *
+   * The type of Google Cloud Armor security policy for example, 'backend
+   * security policy', 'edge security policy', 'network edge security policy',
+   * or 'always-on DDoS protection'.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * The type of Google Cloud Armor security policy for example, 'backend
+   * security policy', 'edge security policy', 'network edge security policy',
+   * or 'always-on DDoS protection'.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREVIEW_FIELD_NUMBER = 3; + private boolean preview_ = false; + /** + * + * + *
+   * Whether or not the associated rule or policy is in preview mode.
+   * 
+ * + * bool preview = 3; + * + * @return The preview. + */ + @java.lang.Override + public boolean getPreview() { + return preview_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + if (preview_ != false) { + output.writeBool(3, preview_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + if (preview_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, preview_); + } + size += getUnknownFields().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.securitycenter.v2.SecurityPolicy)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v2.SecurityPolicy other = + (com.google.cloud.securitycenter.v2.SecurityPolicy) obj; + + if (!getName().equals(other.getName())) return false; + if (!getType().equals(other.getType())) return false; + if (getPreview() != other.getPreview()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + PREVIEW_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPreview()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v2.SecurityPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.SecurityPolicy 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.securitycenter.v2.SecurityPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.SecurityPolicy 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.securitycenter.v2.SecurityPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v2.SecurityPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v2.SecurityPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.SecurityPolicy 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.securitycenter.v2.SecurityPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.SecurityPolicy 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.securitycenter.v2.SecurityPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v2.SecurityPolicy 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.securitycenter.v2.SecurityPolicy 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; + } + /** + * + * + *
+   * Information about the [Google Cloud Armor security
+   * policy](https://cloud.google.com/armor/docs/security-policy-overview)
+   * relevant to the finding.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v2.SecurityPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.SecurityPolicy) + com.google.cloud.securitycenter.v2.SecurityPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_SecurityPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_SecurityPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v2.SecurityPolicy.class, + com.google.cloud.securitycenter.v2.SecurityPolicy.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v2.SecurityPolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + type_ = ""; + preview_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v2.CloudArmorProto + .internal_static_google_cloud_securitycenter_v2_SecurityPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.SecurityPolicy getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v2.SecurityPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.SecurityPolicy build() { + com.google.cloud.securitycenter.v2.SecurityPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v2.SecurityPolicy buildPartial() { + com.google.cloud.securitycenter.v2.SecurityPolicy result = + new com.google.cloud.securitycenter.v2.SecurityPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securitycenter.v2.SecurityPolicy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.preview_ = preview_; + } + } + + @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.securitycenter.v2.SecurityPolicy) { + return mergeFrom((com.google.cloud.securitycenter.v2.SecurityPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v2.SecurityPolicy other) { + if (other == com.google.cloud.securitycenter.v2.SecurityPolicy.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPreview() != false) { + setPreview(other.getPreview()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + preview_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the Google Cloud Armor security policy, for example,
+     * "my-security-policy".
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the Google Cloud Armor security policy, for example,
+     * "my-security-policy".
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the Google Cloud Armor security policy, for example,
+     * "my-security-policy".
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the Google Cloud Armor security policy, for example,
+     * "my-security-policy".
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the Google Cloud Armor security policy, for example,
+     * "my-security-policy".
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * The type of Google Cloud Armor security policy for example, 'backend
+     * security policy', 'edge security policy', 'network edge security policy',
+     * or 'always-on DDoS protection'.
+     * 
+ * + * string type = 2; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The type of Google Cloud Armor security policy for example, 'backend
+     * security policy', 'edge security policy', 'network edge security policy',
+     * or 'always-on DDoS protection'.
+     * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The type of Google Cloud Armor security policy for example, 'backend
+     * security policy', 'edge security policy', 'network edge security policy',
+     * or 'always-on DDoS protection'.
+     * 
+ * + * string type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of Google Cloud Armor security policy for example, 'backend
+     * security policy', 'edge security policy', 'network edge security policy',
+     * or 'always-on DDoS protection'.
+     * 
+ * + * string type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of Google Cloud Armor security policy for example, 'backend
+     * security policy', 'edge security policy', 'network edge security policy',
+     * or 'always-on DDoS protection'.
+     * 
+ * + * string type = 2; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + type_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean preview_; + /** + * + * + *
+     * Whether or not the associated rule or policy is in preview mode.
+     * 
+ * + * bool preview = 3; + * + * @return The preview. + */ + @java.lang.Override + public boolean getPreview() { + return preview_; + } + /** + * + * + *
+     * Whether or not the associated rule or policy is in preview mode.
+     * 
+ * + * bool preview = 3; + * + * @param value The preview to set. + * @return This builder for chaining. + */ + public Builder setPreview(boolean value) { + + preview_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether or not the associated rule or policy is in preview mode.
+     * 
+ * + * bool preview = 3; + * + * @return This builder for chaining. + */ + public Builder clearPreview() { + bitField0_ = (bitField0_ & ~0x00000004); + preview_ = false; + 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.securitycenter.v2.SecurityPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.SecurityPolicy) + private static final com.google.cloud.securitycenter.v2.SecurityPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.SecurityPolicy(); + } + + public static com.google.cloud.securitycenter.v2.SecurityPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecurityPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.securitycenter.v2.SecurityPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SecurityPolicyOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SecurityPolicyOrBuilder.java new file mode 100644 index 000000000000..803bb66c09e0 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SecurityPolicyOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2024 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/securitycenter/v2/cloud_armor.proto + +// Protobuf Java Version: 3.25.3 +package com.google.cloud.securitycenter.v2; + +public interface SecurityPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v2.SecurityPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the Google Cloud Armor security policy, for example,
+   * "my-security-policy".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the Google Cloud Armor security policy, for example,
+   * "my-security-policy".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The type of Google Cloud Armor security policy for example, 'backend
+   * security policy', 'edge security policy', 'network edge security policy',
+   * or 'always-on DDoS protection'.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * The type of Google Cloud Armor security policy for example, 'backend
+   * security policy', 'edge security policy', 'network edge security policy',
+   * or 'always-on DDoS protection'.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * Whether or not the associated rule or policy is in preview mode.
+   * 
+ * + * bool preview = 3; + * + * @return The preview. + */ + boolean getPreview(); +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SecuritycenterServiceProto.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SecuritycenterServiceProto.java index 9e90943f31bf..fb0ca6064836 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SecuritycenterServiceProto.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SecuritycenterServiceProto.java @@ -262,304 +262,320 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "/cloud/securitycenter/v2/finding.proto\0320" + "google/cloud/securitycenter/v2/mute_conf" + "ig.proto\0328google/cloud/securitycenter/v2" - + "/notification_config.proto\032:google/cloud" - + "/securitycenter/v2/resource_value_config" - + ".proto\0323google/cloud/securitycenter/v2/s" - + "ecurity_marks.proto\032/google/cloud/securi" - + "tycenter/v2/simulation.proto\032+google/clo" - + "ud/securitycenter/v2/source.proto\0324googl" - + "e/cloud/securitycenter/v2/valued_resourc" - + "e.proto\032\036google/iam/v1/iam_policy.proto\032" - + "\032google/iam/v1/policy.proto\032#google/long" - + "running/operations.proto\032\033google/protobu" - + "f/empty.proto\032 google/protobuf/field_mas" - + "k.proto\032\034google/protobuf/struct.proto\"\314\001" - + "\n&BatchCreateResourceValueConfigsRequest" - + "\022I\n\006parent\030\001 \001(\tB9\340A\002\372A3\0221securitycenter" - + ".googleapis.com/ResourceValueConfig\022W\n\010r" - + "equests\030\002 \003(\0132@.google.cloud.securitycen" - + "ter.v2.CreateResourceValueConfigRequestB" - + "\003\340A\002\"~\n\'BatchCreateResourceValueConfigsR" - + "esponse\022S\n\026resource_value_configs\030\001 \003(\0132" - + "3.google.cloud.securitycenter.v2.Resourc" - + "eValueConfig\"D\n\027BulkMuteFindingsRequest\022" - + "\031\n\006parent\030\001 \001(\tB\t\340A\002\372A\003\n\001*\022\016\n\006filter\030\002 \001" - + "(\t\"\032\n\030BulkMuteFindingsResponse\"\324\001\n\033Creat" - + "eBigQueryExportRequest\022D\n\006parent\030\001 \001(\tB4" - + "\340A\002\372A.\022,securitycenter.googleapis.com/Bi" - + "gQueryExport\022M\n\020big_query_export\030\002 \001(\0132." - + ".google.cloud.securitycenter.v2.BigQuery" - + "ExportB\003\340A\002\022 \n\023big_query_export_id\030\003 \001(\t" - + "B\003\340A\002\"\254\001\n\024CreateFindingRequest\022<\n\006parent" - + "\030\001 \001(\tB,\340A\002\372A&\n$securitycenter.googleapi" - + "s.com/Source\022\027\n\nfinding_id\030\002 \001(\tB\003\340A\002\022=\n" - + "\007finding\030\003 \001(\0132\'.google.cloud.securityce" - + "nter.v2.FindingB\003\340A\002\"\276\001\n\027CreateMuteConfi" - + "gRequest\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\022(securi" - + "tycenter.googleapis.com/MuteConfig\022D\n\013mu" - + "te_config\030\002 \001(\0132*.google.cloud.securityc" - + "enter.v2.MuteConfigB\003\340A\002\022\033\n\016mute_config_" - + "id\030\003 \001(\tB\003\340A\002\"\331\001\n\037CreateNotificationConf" - + "igRequest\022H\n\006parent\030\001 \001(\tB8\340A\002\372A2\0220secur" - + "itycenter.googleapis.com/NotificationCon" - + "fig\022\026\n\tconfig_id\030\002 \001(\tB\003\340A\002\022T\n\023notificat" - + "ion_config\030\003 \001(\01322.google.cloud.security" - + "center.v2.NotificationConfigB\003\340A\002\"\306\001\n Cr" - + "eateResourceValueConfigRequest\022I\n\006parent" - + "\030\001 \001(\tB9\340A\002\372A3\0221securitycenter.googleapi" - + "s.com/ResourceValueConfig\022W\n\025resource_va" - + "lue_config\030\002 \001(\01323.google.cloud.security" - + "center.v2.ResourceValueConfigB\003\340A\002\"\234\001\n\023C" - + "reateSourceRequest\022H\n\006parent\030\001 \001(\tB8\340A\002\372" - + "A2\n0cloudresourcemanager.googleapis.com/" - + "Organization\022;\n\006source\030\002 \001(\0132&.google.cl" - + "oud.securitycenter.v2.SourceB\003\340A\002\"a\n\033Del" - + "eteBigQueryExportRequest\022B\n\004name\030\001 \001(\tB4" - + "\340A\002\372A.\n,securitycenter.googleapis.com/Bi" - + "gQueryExport\"Y\n\027DeleteMuteConfigRequest\022" - + ">\n\004name\030\001 \001(\tB0\340A\002\372A*\n(securitycenter.go" - + "ogleapis.com/MuteConfig\"i\n\037DeleteNotific" - + "ationConfigRequest\022F\n\004name\030\001 \001(\tB8\340A\002\372A2" - + "\n0securitycenter.googleapis.com/Notifica" - + "tionConfig\"k\n DeleteResourceValueConfigR" - + "equest\022G\n\004name\030\001 \001(\tB9\340A\002\372A3\n1securityce" - + "nter.googleapis.com/ResourceValueConfig\"" - + "^\n\030GetBigQueryExportRequest\022B\n\004name\030\001 \001(" - + "\tB4\340A\002\372A.\n,securitycenter.googleapis.com" - + "/BigQueryExport\"V\n\024GetMuteConfigRequest\022" - + ">\n\004name\030\001 \001(\tB0\340A\002\372A*\n(securitycenter.go" - + "ogleapis.com/MuteConfig\"f\n\034GetNotificati" - + "onConfigRequest\022F\n\004name\030\001 \001(\tB8\340A\002\372A2\n0s" - + "ecuritycenter.googleapis.com/Notificatio" - + "nConfig\"h\n\035GetResourceValueConfigRequest" - + "\022G\n\004name\030\001 \001(\tB9\340A\002\372A3\n1securitycenter.g" - + "oogleapis.com/ResourceValueConfig\"N\n\020Get" - + "SourceRequest\022:\n\004name\030\001 \001(\tB,\340A\002\372A&\n$sec" - + "uritycenter.googleapis.com/Source\"\242\001\n\024Gr" - + "oupFindingsRequest\022<\n\006parent\030\001 \001(\tB,\340A\002\372" + + "/notification_config.proto\032-google/cloud" + + "/securitycenter/v2/resource.proto\032:googl" + + "e/cloud/securitycenter/v2/resource_value" + + "_config.proto\0323google/cloud/securitycent" + + "er/v2/security_marks.proto\032/google/cloud" + + "/securitycenter/v2/simulation.proto\032+goo" + + "gle/cloud/securitycenter/v2/source.proto" + + "\0324google/cloud/securitycenter/v2/valued_" + + "resource.proto\032\036google/iam/v1/iam_policy" + + ".proto\032\032google/iam/v1/policy.proto\032#goog" + + "le/longrunning/operations.proto\032\033google/" + + "protobuf/empty.proto\032 google/protobuf/fi" + + "eld_mask.proto\032\034google/protobuf/struct.p" + + "roto\"\314\001\n&BatchCreateResourceValueConfigs" + + "Request\022I\n\006parent\030\001 \001(\tB9\340A\002\372A3\0221securit" + + "ycenter.googleapis.com/ResourceValueConf" + + "ig\022W\n\010requests\030\002 \003(\0132@.google.cloud.secu" + + "ritycenter.v2.CreateResourceValueConfigR" + + "equestB\003\340A\002\"~\n\'BatchCreateResourceValueC" + + "onfigsResponse\022S\n\026resource_value_configs" + + "\030\001 \003(\01323.google.cloud.securitycenter.v2." + + "ResourceValueConfig\"D\n\027BulkMuteFindingsR" + + "equest\022\031\n\006parent\030\001 \001(\tB\t\340A\002\372A\003\n\001*\022\016\n\006fil" + + "ter\030\002 \001(\t\"\032\n\030BulkMuteFindingsResponse\"\324\001" + + "\n\033CreateBigQueryExportRequest\022D\n\006parent\030" + + "\001 \001(\tB4\340A\002\372A.\022,securitycenter.googleapis" + + ".com/BigQueryExport\022M\n\020big_query_export\030" + + "\002 \001(\0132..google.cloud.securitycenter.v2.B" + + "igQueryExportB\003\340A\002\022 \n\023big_query_export_i" + + "d\030\003 \001(\tB\003\340A\002\"\254\001\n\024CreateFindingRequest\022<\n" + + "\006parent\030\001 \001(\tB,\340A\002\372A&\n$securitycenter.go" + + "ogleapis.com/Source\022\027\n\nfinding_id\030\002 \001(\tB" + + "\003\340A\002\022=\n\007finding\030\003 \001(\0132\'.google.cloud.sec" + + "uritycenter.v2.FindingB\003\340A\002\"\276\001\n\027CreateMu" + + "teConfigRequest\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\022" + + "(securitycenter.googleapis.com/MuteConfi" + + "g\022D\n\013mute_config\030\002 \001(\0132*.google.cloud.se" + + "curitycenter.v2.MuteConfigB\003\340A\002\022\033\n\016mute_" + + "config_id\030\003 \001(\tB\003\340A\002\"\331\001\n\037CreateNotificat" + + "ionConfigRequest\022H\n\006parent\030\001 \001(\tB8\340A\002\372A2" + + "\0220securitycenter.googleapis.com/Notifica" + + "tionConfig\022\026\n\tconfig_id\030\002 \001(\tB\003\340A\002\022T\n\023no" + + "tification_config\030\003 \001(\01322.google.cloud.s" + + "ecuritycenter.v2.NotificationConfigB\003\340A\002" + + "\"\306\001\n CreateResourceValueConfigRequest\022I\n" + + "\006parent\030\001 \001(\tB9\340A\002\372A3\0221securitycenter.go" + + "ogleapis.com/ResourceValueConfig\022W\n\025reso" + + "urce_value_config\030\002 \001(\01323.google.cloud.s" + + "ecuritycenter.v2.ResourceValueConfigB\003\340A" + + "\002\"\234\001\n\023CreateSourceRequest\022H\n\006parent\030\001 \001(" + + "\tB8\340A\002\372A2\n0cloudresourcemanager.googleap" + + "is.com/Organization\022;\n\006source\030\002 \001(\0132&.go" + + "ogle.cloud.securitycenter.v2.SourceB\003\340A\002" + + "\"a\n\033DeleteBigQueryExportRequest\022B\n\004name\030" + + "\001 \001(\tB4\340A\002\372A.\n,securitycenter.googleapis" + + ".com/BigQueryExport\"Y\n\027DeleteMuteConfigR" + + "equest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n(securityce" + + "nter.googleapis.com/MuteConfig\"i\n\037Delete" + + "NotificationConfigRequest\022F\n\004name\030\001 \001(\tB" + + "8\340A\002\372A2\n0securitycenter.googleapis.com/N" + + "otificationConfig\"k\n DeleteResourceValue" + + "ConfigRequest\022G\n\004name\030\001 \001(\tB9\340A\002\372A3\n1sec" + + "uritycenter.googleapis.com/ResourceValue" + + "Config\"^\n\030GetBigQueryExportRequest\022B\n\004na" + + "me\030\001 \001(\tB4\340A\002\372A.\n,securitycenter.googlea" + + "pis.com/BigQueryExport\"V\n\024GetMuteConfigR" + + "equest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n(securityce" + + "nter.googleapis.com/MuteConfig\"f\n\034GetNot" + + "ificationConfigRequest\022F\n\004name\030\001 \001(\tB8\340A" + + "\002\372A2\n0securitycenter.googleapis.com/Noti" + + "ficationConfig\"h\n\035GetResourceValueConfig" + + "Request\022G\n\004name\030\001 \001(\tB9\340A\002\372A3\n1securityc" + + "enter.googleapis.com/ResourceValueConfig" + + "\"N\n\020GetSourceRequest\022:\n\004name\030\001 \001(\tB,\340A\002\372" + "A&\n$securitycenter.googleapis.com/Source" - + "\022\016\n\006filter\030\002 \001(\t\022\025\n\010group_by\030\003 \001(\tB\003\340A\002\022" - + "\022\n\npage_token\030\007 \001(\t\022\021\n\tpage_size\030\010 \001(\005\"\213" - + "\001\n\025GroupFindingsResponse\022E\n\020group_by_res" - + "ults\030\001 \003(\0132+.google.cloud.securitycenter" - + ".v2.GroupResult\022\027\n\017next_page_token\030\003 \001(\t" - + "\022\022\n\ntotal_size\030\004 \001(\005\"\270\001\n\013GroupResult\022O\n\n" - + "properties\030\001 \003(\0132;.google.cloud.security" - + "center.v2.GroupResult.PropertiesEntry\022\r\n" - + "\005count\030\002 \001(\003\032I\n\017PropertiesEntry\022\013\n\003key\030\001" - + " \001(\t\022%\n\005value\030\002 \001(\0132\026.google.protobuf.Va" - + "lue:\0028\001\"\221\001\n\026ListAttackPathsRequest\022@\n\006pa" - + "rent\030\001 \001(\tB0\340A\002\372A*\022(securitycenter.googl" - + "eapis.com/AttackPath\022\016\n\006filter\030\002 \001(\t\022\022\n\n" - + "page_token\030\003 \001(\t\022\021\n\tpage_size\030\004 \001(\005\"t\n\027L" - + "istAttackPathsResponse\022@\n\014attack_paths\030\001" - + " \003(\0132*.google.cloud.securitycenter.v2.At" - + "tackPath\022\027\n\017next_page_token\030\002 \001(\t\"V\n\024Get" - + "SimulationRequest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n" - + "(securitycenter.googleapis.com/Simulatio" - + "n\"^\n\030GetValuedResourceRequest\022B\n\004name\030\001 " - + "\001(\tB4\340A\002\372A.\n,securitycenter.googleapis.c" - + "om/ValuedResource\"\211\001\n\032ListBigQueryExport" - + "sRequest\022D\n\006parent\030\001 \001(\tB4\340A\002\372A.\022,securi" - + "tycenter.googleapis.com/BigQueryExport\022\021" - + "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\201\001" - + "\n\033ListBigQueryExportsResponse\022I\n\021big_que" - + "ry_exports\030\001 \003(\0132..google.cloud.security" - + "center.v2.BigQueryExport\022\027\n\017next_page_to" - + "ken\030\002 \001(\t\"\314\001\n\023ListFindingsRequest\022<\n\006par" - + "ent\030\001 \001(\tB,\340A\002\372A&\n$securitycenter.google" - + "apis.com/Source\022\016\n\006filter\030\002 \001(\t\022\020\n\010order" - + "_by\030\003 \001(\t\022.\n\nfield_mask\030\007 \001(\0132\032.google.p" - + "rotobuf.FieldMask\022\022\n\npage_token\030\010 \001(\t\022\021\n" - + "\tpage_size\030\t \001(\005\"\243\003\n\024ListFindingsRespons" - + "e\022f\n\025list_findings_results\030\001 \003(\0132G.googl" - + "e.cloud.securitycenter.v2.ListFindingsRe" - + "sponse.ListFindingsResult\022\027\n\017next_page_t" - + "oken\030\003 \001(\t\022\022\n\ntotal_size\030\004 \001(\005\032\365\001\n\022ListF" - + "indingsResult\0228\n\007finding\030\001 \001(\0132\'.google." - + "cloud.securitycenter.v2.Finding\022g\n\010resou" - + "rce\030\003 \001(\0132P.google.cloud.securitycenter." - + "v2.ListFindingsResponse.ListFindingsResu" - + "lt.ResourceB\003\340A\003\032<\n\010Resource\022\014\n\004name\030\001 \001" - + "(\t\022\024\n\014display_name\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\"\201" - + "\001\n\026ListMuteConfigsRequest\022@\n\006parent\030\001 \001(" - + "\tB0\340A\002\372A*\022(securitycenter.googleapis.com" - + "/MuteConfig\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_t" - + "oken\030\003 \001(\t\"t\n\027ListMuteConfigsResponse\022@\n" - + "\014mute_configs\030\001 \003(\0132*.google.cloud.secur" - + "itycenter.v2.MuteConfig\022\027\n\017next_page_tok" - + "en\030\002 \001(\t\"\221\001\n\036ListNotificationConfigsRequ" - + "est\022H\n\006parent\030\001 \001(\tB8\340A\002\372A2\0220securitycen" - + "ter.googleapis.com/NotificationConfig\022\022\n" - + "\npage_token\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\"\214\001\n" - + "\037ListNotificationConfigsResponse\022P\n\024noti" - + "fication_configs\030\001 \003(\01322.google.cloud.se" - + "curitycenter.v2.NotificationConfig\022\027\n\017ne" - + "xt_page_token\030\002 \001(\t\"\223\001\n\037ListResourceValu" - + "eConfigsRequest\022I\n\006parent\030\001 \001(\tB9\340A\002\372A3\022" - + "1securitycenter.googleapis.com/ResourceV" - + "alueConfig\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_to" - + "ken\030\003 \001(\t\"\220\001\n ListResourceValueConfigsRe" - + "sponse\022S\n\026resource_value_configs\030\001 \003(\01323" - + ".google.cloud.securitycenter.v2.Resource" - + "ValueConfig\022\027\n\017next_page_token\030\002 \001(\t\"y\n\022" - + "ListSourcesRequest\022<\n\006parent\030\001 \001(\tB,\340A\002\372" - + "A&\022$securitycenter.googleapis.com/Source" - + "\022\022\n\npage_token\030\002 \001(\t\022\021\n\tpage_size\030\007 \001(\005\"" - + "g\n\023ListSourcesResponse\0227\n\007sources\030\001 \003(\0132" - + "&.google.cloud.securitycenter.v2.Source\022" - + "\027\n\017next_page_token\030\002 \001(\t\"\260\001\n\032ListValuedR" - + "esourcesRequest\022D\n\006parent\030\001 \001(\tB4\340A\002\372A.\022" - + ",securitycenter.googleapis.com/ValuedRes" - + "ource\022\016\n\006filter\030\002 \001(\t\022\022\n\npage_token\030\003 \001(" - + "\t\022\021\n\tpage_size\030\004 \001(\005\022\025\n\010order_by\030\005 \001(\tB\003" - + "\340A\001\"\224\001\n\033ListValuedResourcesResponse\022H\n\020v" - + "alued_resources\030\001 \003(\0132..google.cloud.sec" - + "uritycenter.v2.ValuedResource\022\027\n\017next_pa" - + "ge_token\030\002 \001(\t\022\022\n\ntotal_size\030\003 \001(\005\"\230\001\n\026S" - + "etFindingStateRequest\022;\n\004name\030\001 \001(\tB-\340A\002" - + "\372A\'\n%securitycenter.googleapis.com/Findi" - + "ng\022A\n\005state\030\002 \001(\0162-.google.cloud.securit" - + "ycenter.v2.Finding.StateB\003\340A\002\"\216\001\n\016SetMut" - + "eRequest\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n%security" - + "center.googleapis.com/Finding\022?\n\004mute\030\002 " - + "\001(\0162,.google.cloud.securitycenter.v2.Fin" - + "ding.MuteB\003\340A\002\"\235\001\n\033UpdateBigQueryExportR" - + "equest\022M\n\020big_query_export\030\001 \001(\0132..googl" - + "e.cloud.securitycenter.v2.BigQueryExport" - + "B\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google.prot" - + "obuf.FieldMask\"\234\001\n\033UpdateExternalSystemR" - + "equest\022L\n\017external_system\030\001 \001(\0132..google" - + ".cloud.securitycenter.v2.ExternalSystemB" - + "\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google.proto" - + "buf.FieldMask\"\206\001\n\024UpdateFindingRequest\022=" - + "\n\007finding\030\001 \001(\0132\'.google.cloud.securityc" - + "enter.v2.FindingB\003\340A\002\022/\n\013update_mask\030\002 \001" - + "(\0132\032.google.protobuf.FieldMask\"\220\001\n\027Updat" - + "eMuteConfigRequest\022D\n\013mute_config\030\001 \001(\0132" - + "*.google.cloud.securitycenter.v2.MuteCon" - + "figB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google.p" - + "rotobuf.FieldMask\"\250\001\n\037UpdateNotification" - + "ConfigRequest\022T\n\023notification_config\030\001 \001" - + "(\01322.google.cloud.securitycenter.v2.Noti" - + "ficationConfigB\003\340A\002\022/\n\013update_mask\030\002 \001(\013" - + "2\032.google.protobuf.FieldMask\"\254\001\n UpdateR" - + "esourceValueConfigRequest\022W\n\025resource_va" - + "lue_config\030\001 \001(\01323.google.cloud.security" - + "center.v2.ResourceValueConfigB\003\340A\002\022/\n\013up" - + "date_mask\030\002 \001(\0132\032.google.protobuf.FieldM" - + "ask\"\231\001\n\032UpdateSecurityMarksRequest\022J\n\016se" - + "curity_marks\030\001 \001(\0132-.google.cloud.securi" - + "tycenter.v2.SecurityMarksB\003\340A\002\022/\n\013update" + + "\"\242\001\n\024GroupFindingsRequest\022<\n\006parent\030\001 \001(" + + "\tB,\340A\002\372A&\n$securitycenter.googleapis.com" + + "/Source\022\016\n\006filter\030\002 \001(\t\022\025\n\010group_by\030\003 \001(" + + "\tB\003\340A\002\022\022\n\npage_token\030\007 \001(\t\022\021\n\tpage_size\030" + + "\010 \001(\005\"\213\001\n\025GroupFindingsResponse\022E\n\020group" + + "_by_results\030\001 \003(\0132+.google.cloud.securit" + + "ycenter.v2.GroupResult\022\027\n\017next_page_toke" + + "n\030\003 \001(\t\022\022\n\ntotal_size\030\004 \001(\005\"\270\001\n\013GroupRes" + + "ult\022O\n\nproperties\030\001 \003(\0132;.google.cloud.s" + + "ecuritycenter.v2.GroupResult.PropertiesE" + + "ntry\022\r\n\005count\030\002 \001(\003\032I\n\017PropertiesEntry\022\013" + + "\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.google.prot" + + "obuf.Value:\0028\001\"\221\001\n\026ListAttackPathsReques" + + "t\022@\n\006parent\030\001 \001(\tB0\340A\002\372A*\022(securitycente" + + "r.googleapis.com/AttackPath\022\016\n\006filter\030\002 " + + "\001(\t\022\022\n\npage_token\030\003 \001(\t\022\021\n\tpage_size\030\004 \001" + + "(\005\"t\n\027ListAttackPathsResponse\022@\n\014attack_" + + "paths\030\001 \003(\0132*.google.cloud.securitycente" + + "r.v2.AttackPath\022\027\n\017next_page_token\030\002 \001(\t" + + "\"V\n\024GetSimulationRequest\022>\n\004name\030\001 \001(\tB0" + + "\340A\002\372A*\n(securitycenter.googleapis.com/Si" + + "mulation\"^\n\030GetValuedResourceRequest\022B\n\004" + + "name\030\001 \001(\tB4\340A\002\372A.\n,securitycenter.googl" + + "eapis.com/ValuedResource\"\211\001\n\032ListBigQuer" + + "yExportsRequest\022D\n\006parent\030\001 \001(\tB4\340A\002\372A.\022" + + ",securitycenter.googleapis.com/BigQueryE" + + "xport\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003" + + " \001(\t\"\201\001\n\033ListBigQueryExportsResponse\022I\n\021" + + "big_query_exports\030\001 \003(\0132..google.cloud.s" + + "ecuritycenter.v2.BigQueryExport\022\027\n\017next_" + + "page_token\030\002 \001(\t\"\314\001\n\023ListFindingsRequest" + + "\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&\n$securitycenter" + + ".googleapis.com/Source\022\016\n\006filter\030\002 \001(\t\022\020" + + "\n\010order_by\030\003 \001(\t\022.\n\nfield_mask\030\007 \001(\0132\032.g" + + "oogle.protobuf.FieldMask\022\022\n\npage_token\030\010" + + " \001(\t\022\021\n\tpage_size\030\t \001(\005\"\337\006\n\024ListFindings" + + "Response\022f\n\025list_findings_results\030\001 \003(\0132" + + "G.google.cloud.securitycenter.v2.ListFin" + + "dingsResponse.ListFindingsResult\022\027\n\017next" + + "_page_token\030\003 \001(\t\022\022\n\ntotal_size\030\004 \001(\005\032\261\005" + + "\n\022ListFindingsResult\0228\n\007finding\030\001 \001(\0132\'." + + "google.cloud.securitycenter.v2.Finding\022g" + + "\n\010resource\030\003 \001(\0132P.google.cloud.security" + + "center.v2.ListFindingsResponse.ListFindi" + + "ngsResult.ResourceB\003\340A\003\032\367\003\n\010Resource\022\014\n\004" + + "name\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022\014\n\004type" + + "\030\003 \001(\t\022E\n\016cloud_provider\030\004 \001(\0162-.google." + + "cloud.securitycenter.v2.CloudProvider\022\017\n" + + "\007service\030\005 \001(\t\022\020\n\010location\030\006 \001(\t\022C\n\014gcp_" + + "metadata\030\007 \001(\0132+.google.cloud.securityce" + + "nter.v2.GcpMetadataH\000\022C\n\014aws_metadata\030\010 " + + "\001(\0132+.google.cloud.securitycenter.v2.Aws" + + "MetadataH\000\022G\n\016azure_metadata\030\t \001(\0132-.goo" + + "gle.cloud.securitycenter.v2.AzureMetadat" + + "aH\000\022C\n\rresource_path\030\n \001(\0132,.google.clou" + + "d.securitycenter.v2.ResourcePath\022\034\n\024reso" + + "urce_path_string\030\013 \001(\tB\031\n\027cloud_provider" + + "_metadata\"\201\001\n\026ListMuteConfigsRequest\022@\n\006" + + "parent\030\001 \001(\tB0\340A\002\372A*\022(securitycenter.goo" + + "gleapis.com/MuteConfig\022\021\n\tpage_size\030\002 \001(" + + "\005\022\022\n\npage_token\030\003 \001(\t\"t\n\027ListMuteConfigs" + + "Response\022@\n\014mute_configs\030\001 \003(\0132*.google." + + "cloud.securitycenter.v2.MuteConfig\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\"\221\001\n\036ListNotification" + + "ConfigsRequest\022H\n\006parent\030\001 \001(\tB8\340A\002\372A2\0220" + + "securitycenter.googleapis.com/Notificati" + + "onConfig\022\022\n\npage_token\030\002 \001(\t\022\021\n\tpage_siz" + + "e\030\003 \001(\005\"\214\001\n\037ListNotificationConfigsRespo" + + "nse\022P\n\024notification_configs\030\001 \003(\01322.goog" + + "le.cloud.securitycenter.v2.NotificationC" + + "onfig\022\027\n\017next_page_token\030\002 \001(\t\"\223\001\n\037ListR" + + "esourceValueConfigsRequest\022I\n\006parent\030\001 \001" + + "(\tB9\340A\002\372A3\0221securitycenter.googleapis.co" + + "m/ResourceValueConfig\022\021\n\tpage_size\030\002 \001(\005" + + "\022\022\n\npage_token\030\003 \001(\t\"\220\001\n ListResourceVal" + + "ueConfigsResponse\022S\n\026resource_value_conf" + + "igs\030\001 \003(\01323.google.cloud.securitycenter." + + "v2.ResourceValueConfig\022\027\n\017next_page_toke" + + "n\030\002 \001(\t\"y\n\022ListSourcesRequest\022<\n\006parent\030" + + "\001 \001(\tB,\340A\002\372A&\022$securitycenter.googleapis" + + ".com/Source\022\022\n\npage_token\030\002 \001(\t\022\021\n\tpage_" + + "size\030\007 \001(\005\"g\n\023ListSourcesResponse\0227\n\007sou" + + "rces\030\001 \003(\0132&.google.cloud.securitycenter" + + ".v2.Source\022\027\n\017next_page_token\030\002 \001(\t\"\260\001\n\032" + + "ListValuedResourcesRequest\022D\n\006parent\030\001 \001" + + "(\tB4\340A\002\372A.\022,securitycenter.googleapis.co" + + "m/ValuedResource\022\016\n\006filter\030\002 \001(\t\022\022\n\npage" + + "_token\030\003 \001(\t\022\021\n\tpage_size\030\004 \001(\005\022\025\n\010order" + + "_by\030\005 \001(\tB\003\340A\001\"\224\001\n\033ListValuedResourcesRe" + + "sponse\022H\n\020valued_resources\030\001 \003(\0132..googl" + + "e.cloud.securitycenter.v2.ValuedResource" + + "\022\027\n\017next_page_token\030\002 \001(\t\022\022\n\ntotal_size\030" + + "\003 \001(\005\"\230\001\n\026SetFindingStateRequest\022;\n\004name" + + "\030\001 \001(\tB-\340A\002\372A\'\n%securitycenter.googleapi" + + "s.com/Finding\022A\n\005state\030\002 \001(\0162-.google.cl" + + "oud.securitycenter.v2.Finding.StateB\003\340A\002" + + "\"\216\001\n\016SetMuteRequest\022;\n\004name\030\001 \001(\tB-\340A\002\372A" + + "\'\n%securitycenter.googleapis.com/Finding" + + "\022?\n\004mute\030\002 \001(\0162,.google.cloud.securityce" + + "nter.v2.Finding.MuteB\003\340A\002\"\235\001\n\033UpdateBigQ" + + "ueryExportRequest\022M\n\020big_query_export\030\001 " + + "\001(\0132..google.cloud.securitycenter.v2.Big" + + "QueryExportB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032." + + "google.protobuf.FieldMask\"\234\001\n\033UpdateExte" + + "rnalSystemRequest\022L\n\017external_system\030\001 \001" + + "(\0132..google.cloud.securitycenter.v2.Exte" + + "rnalSystemB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.g" + + "oogle.protobuf.FieldMask\"\206\001\n\024UpdateFindi" + + "ngRequest\022=\n\007finding\030\001 \001(\0132\'.google.clou" + + "d.securitycenter.v2.FindingB\003\340A\002\022/\n\013upda" + + "te_mask\030\002 \001(\0132\032.google.protobuf.FieldMas" + + "k\"\220\001\n\027UpdateMuteConfigRequest\022D\n\013mute_co" + + "nfig\030\001 \001(\0132*.google.cloud.securitycenter" + + ".v2.MuteConfigB\003\340A\002\022/\n\013update_mask\030\002 \001(\013" + + "2\032.google.protobuf.FieldMask\"\250\001\n\037UpdateN" + + "otificationConfigRequest\022T\n\023notification" + + "_config\030\001 \001(\01322.google.cloud.securitycen" + + "ter.v2.NotificationConfigB\003\340A\002\022/\n\013update" + "_mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"" - + "\203\001\n\023UpdateSourceRequest\022;\n\006source\030\001 \001(\0132" - + "&.google.cloud.securitycenter.v2.SourceB" - + "\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google.proto" - + "buf.FieldMask2\305{\n\016SecurityCenter\022\216\002\n\037Bat" - + "chCreateResourceValueConfigs\022F.google.cl" - + "oud.securitycenter.v2.BatchCreateResourc" - + "eValueConfigsRequest\032G.google.cloud.secu" - + "ritycenter.v2.BatchCreateResourceValueCo" - + "nfigsResponse\"Z\332A\017parent,requests\202\323\344\223\002B\"" - + "=/v2/{parent=organizations/*}/resourceVa" - + "lueConfigs:batchCreate:\001*\022\232\004\n\020BulkMuteFi" - + "ndings\0227.google.cloud.securitycenter.v2." - + "BulkMuteFindingsRequest\032\035.google.longrun" - + "ning.Operation\"\255\003\312AP\n7google.cloud.secur" - + "itycenter.v2.BulkMuteFindingsResponse\022\025g" - + "oogle.protobuf.Empty\332A\006parent\202\323\344\223\002\312\002\"./v" - + "2/{parent=organizations/*}/findings:bulk" - + "Mute:\001*Z?\":/v2/{parent=organizations/*/l" - + "ocations/*}/findings:bulkMute:\001*Z-\"(/v2/" - + "{parent=folders/*}/findings:bulkMute:\001*Z" - + "9\"4/v2/{parent=folders/*/locations/*}/fi" - + "ndings:bulkMute:\001*Z.\")/v2/{parent=projec" - + "ts/*}/findings:bulkMute:\001*Z:\"5/v2/{paren" - + "t=projects/*/locations/*}/findings:bulkM" - + "ute:\001*\022\230\003\n\024CreateBigQueryExport\022;.google" - + ".cloud.securitycenter.v2.CreateBigQueryE" - + "xportRequest\032..google.cloud.securitycent" - + "er.v2.BigQueryExport\"\222\002\332A+parent,big_que" - + "ry_export,big_query_export_id\202\323\344\223\002\335\001\"8/v" - + "2/{parent=organizations/*/locations/*}/b" - + "igQueryExports:\020big_query_exportZF\"2/v2/" - + "{parent=folders/*/locations/*}/bigQueryE" - + "xports:\020big_query_exportZG\"3/v2/{parent=" - + "projects/*/locations/*}/bigQueryExports:" - + "\020big_query_export\022\226\002\n\rCreateFinding\0224.go" - + "ogle.cloud.securitycenter.v2.CreateFindi" - + "ngRequest\032\'.google.cloud.securitycenter." - + "v2.Finding\"\245\001\332A\031parent,finding,finding_i" - + "d\202\323\344\223\002\202\001\";/v2/{parent=organizations/*/so" - + "urces/*/locations/*}/findings:\007findingZ:" - + "\"//v2/{parent=organizations/*/sources/*}" - + "/findings:\007finding\022\231\005\n\020CreateMuteConfig\022" - + "7.google.cloud.securitycenter.v2.CreateM" - + "uteConfigRequest\032*.google.cloud.security" - + "center.v2.MuteConfig\"\237\004\332A!parent,mute_co" - + "nfig,mute_config_id\202\323\344\223\002\342\002\"4/v2/{parent=" - + "organizations/*/locations/*}/muteConfigs" - + ":\013mute_configZ=\"./v2/{parent=folders/*/l" - + "ocations/*}/muteConfigs:\013mute_configZ>\"/" - + "/v2/{parent=projects/*/locations/*}/mute" - + "Configs:\013mute_configZ7\"(/v2/{parent=orga" - + "nizations/*}/muteConfigs:\013mute_configZ1\"" - + "\"/v2/{parent=folders/*}/muteConfigs:\013mut" - + "e_configZ2\"#/v2/{parent=projects/*}/mute" - + "Configs:\013mute_config\212\323\344\223\002\213\001\022+\n\006parent\022!p" - + "rojects/*/locations/{location=*}\0220\n\006pare" - + "nt\022&organizations/*/locations/{location=" - + "*}\022*\n\006parent\022 folders/*/locations/{locat" - + "ion=*}\022\262\003\n\030CreateNotificationConfig\022?.go" - + "ogle.cloud.securitycenter.v2.CreateNotif" - + "icationConfigRequest\0322.google.cloud.secu" - + "ritycenter.v2.NotificationConfig\"\240\002\332A$pa" - + "rent,notification_config,config_id\202\323\344\223\002\362" - + "\001\"\"//v2/{parent=projects/*/loc" + + "ations/*}/muteConfigs:\013mute_configZ7\"(/v" + + "2/{parent=organizations/*}/muteConfigs:\013" + + "mute_configZ1\"\"/v2/{parent=folders/*}/mu" + + "teConfigs:\013mute_configZ2\"#/v2/{parent=pr" + + "ojects/*}/muteConfigs:\013mute_config\212\323\344\223\002\213" + + "\001\022+\n\006parent\022!projects/*/locations/{locat" + + "ion=*}\0220\n\006parent\022&organizations/*/locati" + + "ons/{location=*}\022*\n\006parent\022 folders/*/lo" + + "cations/{location=*}\022\262\003\n\030CreateNotificat" + + "ionConfig\022?.google.cloud.securitycenter." + + "v2.CreateNotificationConfigRequest\0322.goo" + + "gle.cloud.securitycenter.v2.Notification" + + "Config\"\240\002\332A$parent,notification_config,c" + + "onfig_id\202\323\344\223\002\362\001\".google.cloud.securitycente" - + "r.v2.ListNotificationConfigsRequest\032?.go" - + "ogle.cloud.securitycenter.v2.ListNotific" - + "ationConfigsResponse\"\303\001\332A\006parent\202\323\344\223\002\263\001\022" - + "/v2/{name=folders/*/so" + + "quest\032;.google.cloud.securitycenter.v2.L" + + "istBigQueryExportsResponse\"\267\001\332A\006parent\202\323" + + "\344\223\002\247\001\0228/v2/{parent=organizations/*/locat" + + "ions/*}/bigQueryExportsZ4\0222/v2/{parent=f" + + "olders/*/locations/*}/bigQueryExportsZ5\022" + + "3/v2/{parent=projects/*/locations/*}/big" + + "QueryExports\022\312\003\n\014ListFindings\0223.google.c" + + "loud.securitycenter.v2.ListFindingsReque" + + "st\0324.google.cloud.securitycenter.v2.List" + + "FindingsResponse\"\316\002\332A\006parent\202\323\344\223\002\276\002\022//v2" + + "/{parent=organizations/*/sources/*}/find" + + "ingsZ=\022;/v2/{parent=organizations/*/sour" + + "ces/*/locations/*}/findingsZ+\022)/v2/{pare" + + "nt=folders/*/sources/*}/findingsZ7\0225/v2/" + + "{parent=folders/*/sources/*/locations/*}" + + "/findingsZ,\022*/v2/{parent=projects/*/sour" + + "ces/*}/findingsZ8\0226/v2/{parent=projects/" + + "*/sources/*/locations/*}/findings\022\337\004\n\017Li" + + "stMuteConfigs\0226.google.cloud.securitycen" + + "ter.v2.ListMuteConfigsRequest\0327.google.c" + + "loud.securitycenter.v2.ListMuteConfigsRe" + + "sponse\"\332\003\332A\006parent\202\323\344\223\002\224\002\022(/v2/{parent=o" + + "rganizations/*}/muteConfigsZ6\0224/v2/{pare" + + "nt=organizations/*/locations/*}/muteConf" + + "igsZ$\022\"/v2/{parent=folders/*}/muteConfig" + + "sZ0\022./v2/{parent=folders/*/locations/*}/" + + "muteConfigsZ%\022#/v2/{parent=projects/*}/m" + + "uteConfigsZ1\022//v2/{parent=projects/*/loc" + + "ations/*}/muteConfigs\212\323\344\223\002\257\001\0227\n\006parent\022-" + + "projects/*/locations/{location=*}/muteCo" + + "nfigs\022<\n\006parent\0222organizations/*/locatio" + + "ns/{location=*}/muteConfigs\0226\n\006parent\022,f" + + "olders/*/locations/{location=*}/muteConf" + + "igs\022\340\002\n\027ListNotificationConfigs\022>.google" + + ".cloud.securitycenter.v2.ListNotificatio" + + "nConfigsRequest\032?.google.cloud.securityc" + + "enter.v2.ListNotificationConfigsResponse" + + "\"\303\001\332A\006parent\202\323\344\223\002\263\001\022/v2/{name=projects/*/source" - + "s/*/locations/*/findings/*}:setMute:\001*\022\310" - + "\001\n\022TestIamPermissions\022(.google.iam.v1.Te" - + "stIamPermissionsRequest\032).google.iam.v1." - + "TestIamPermissionsResponse\"]\332A\024resource," - + "permissions\202\323\344\223\002@\";/v2/{resource=organiz" - + "ations/*/sources/*}:testIamPermissions:\001" - + "*\022\274\003\n\024UpdateBigQueryExport\022;.google.clou" - + "d.securitycenter.v2.UpdateBigQueryExport" - + "Request\032..google.cloud.securitycenter.v2" - + ".BigQueryExport\"\266\002\332A\034big_query_export,up" - + "date_mask\202\323\344\223\002\220\0022I/v2/{big_query_export." - + "name=organizations/*/locations/*/bigQuer" - + "yExports/*}:\020big_query_exportZW2C/v2/{bi" - + "g_query_export.name=folders/*/locations/" - + "*/bigQueryExports/*}:\020big_query_exportZX" - + "2D/v2/{big_query_export.name=projects/*/" - + "locations/*/bigQueryExports/*}:\020big_quer" - + "y_export\022\233\006\n\024UpdateExternalSystem\022;.goog" - + "le.cloud.securitycenter.v2.UpdateExterna" - + "lSystemRequest\032..google.cloud.securityce" - + "nter.v2.ExternalSystem\"\225\005\332A\033external_sys" - + "tem,update_mask\202\323\344\223\002\360\0042Q/v2/{external_sy" - + "stem.name=organizations/*/sources/*/find" + + ":\001*Z7\"2/v2/{name=folders/*/sources/*/fin" + + "dings/*}:setState:\001*ZC\">/v2/{name=folder" + + "s/*/sources/*/locations/*/findings/*}:se" + + "tState:\001*Z8\"3/v2/{name=projects/*/source" + + "s/*/findings/*}:setState:\001*ZD\"?/v2/{name" + + "=projects/*/sources/*/locations/*/findin" + + "gs/*}:setState:\001*\022\235\001\n\014SetIamPolicy\022\".goo" + + "gle.iam.v1.SetIamPolicyRequest\032\025.google." + + "iam.v1.Policy\"R\332A\017resource,policy\202\323\344\223\002:\"" + + "5/v2/{resource=organizations/*/sources/*" + + "}:setIamPolicy:\001*\022\370\003\n\007SetMute\022..google.c" + + "loud.securitycenter.v2.SetMuteRequest\032\'." + + "google.cloud.securitycenter.v2.Finding\"\223" + + "\003\332A\tname,mute\202\323\344\223\002\200\003\"7/v2/{name=organiza" + + "tions/*/sources/*/findings/*}:setMute:\001*" + + "ZH\"C/v2/{name=organizations/*/sources/*/" + + "locations/*/findings/*}:setMute:\001*Z6\"1/v" + + "2/{name=folders/*/sources/*/findings/*}:" + + "setMute:\001*ZB\"=/v2/{name=folders/*/source" + + "s/*/locations/*/findings/*}:setMute:\001*Z7" + + "\"2/v2/{name=projects/*/sources/*/finding" + + "s/*}:setMute:\001*ZC\">/v2/{name=projects/*/" + + "sources/*/locations/*/findings/*}:setMut" + + "e:\001*\022\310\001\n\022TestIamPermissions\022(.google.iam" + + ".v1.TestIamPermissionsRequest\032).google.i" + + "am.v1.TestIamPermissionsResponse\"]\332A\024res" + + "ource,permissions\202\323\344\223\002@\";/v2/{resource=o" + + "rganizations/*/sources/*}:testIamPermiss" + + "ions:\001*\022\274\003\n\024UpdateBigQueryExport\022;.googl" + + "e.cloud.securitycenter.v2.UpdateBigQuery" + + "ExportRequest\032..google.cloud.securitycen" + + "ter.v2.BigQueryExport\"\266\002\332A\034big_query_exp" + + "ort,update_mask\202\323\344\223\002\220\0022I/v2/{big_query_e" + + "xport.name=organizations/*/locations/*/b" + + "igQueryExports/*}:\020big_query_exportZW2C/" + + "v2/{big_query_export.name=folders/*/loca" + + "tions/*/bigQueryExports/*}:\020big_query_ex" + + "portZX2D/v2/{big_query_export.name=proje" + + "cts/*/locations/*/bigQueryExports/*}:\020bi" + + "g_query_export\022\233\006\n\024UpdateExternalSystem\022" + + ";.google.cloud.securitycenter.v2.UpdateE" + + "xternalSystemRequest\032..google.cloud.secu" + + "ritycenter.v2.ExternalSystem\"\225\005\332A\033extern" + + "al_system,update_mask\202\323\344\223\002\360\0042Q/v2/{exter" + + "nal_system.name=organizations/*/sources/" + + "*/findings/*/externalSystems/*}:\017externa" + + "l_systemZp2]/v2/{external_system.name=or" + + "ganizations/*/sources/*/locations/*/find" + "ings/*/externalSystems/*}:\017external_syst" - + "emZp2]/v2/{external_system.name=organiza" - + "tions/*/sources/*/locations/*/findings/*" - + "/externalSystems/*}:\017external_systemZ^2K" - + "/v2/{external_system.name=folders/*/sour" - + "ces/*/findings/*/externalSystems/*}:\017ext" - + "ernal_systemZj2W/v2/{external_system.nam" - + "e=folders/*/sources/*/locations/*/findin" - + "gs/*/externalSystems/*}:\017external_system" - + "Z_2L/v2/{external_system.name=projects/*" - + "/sources/*/findings/*/externalSystems/*}" - + ":\017external_systemZk2X/v2/{external_syste" - + "m.name=projects/*/sources/*/locations/*/" + + "emZ^2K/v2/{external_system.name=folders/" + + "*/sources/*/findings/*/externalSystems/*" + + "}:\017external_systemZj2W/v2/{external_syst" + + "em.name=folders/*/sources/*/locations/*/" + "findings/*/externalSystems/*}:\017external_" - + "system\022\262\004\n\rUpdateFinding\0224.google.cloud." - + "securitycenter.v2.UpdateFindingRequest\032\'" - + ".google.cloud.securitycenter.v2.Finding\"" - + "\301\003\332A\023finding,update_mask\202\323\344\223\002\244\00327/v2/{fi" - + "nding.name=organizations/*/sources/*/fin" - + "dings/*}:\007findingZN2C/v2/{finding.name=o" - + "rganizations/*/sources/*/locations/*/fin" - + "dings/*}:\007findingZ<21/v2/{finding.name=f" - + "olders/*/sources/*/findings/*}:\007findingZ" - + "H2=/v2/{finding.name=folders/*/sources/*" - + "/locations/*/findings/*}:\007findingZ=22/v2" - + "/{finding.name=projects/*/sources/*/find" - + "ings/*}:\007findingZI2>/v2/{finding.name=pr" - + "ojects/*/sources/*/locations/*/findings/" - + "*}:\007finding\022\237\006\n\020UpdateMuteConfig\0227.googl" - + "e.cloud.securitycenter.v2.UpdateMuteConf" - + "igRequest\032*.google.cloud.securitycenter." - + "v2.MuteConfig\"\245\005\332A\027mute_config,update_ma" - + "sk\202\323\344\223\002\252\00324/v2/{mute_config.name=organiz" - + "ations/*/muteConfigs/*}:\013mute_configZO2@" - + "/v2/{mute_config.name=organizations/*/lo" - + "cations/*/muteConfigs/*}:\013mute_configZ=2" - + "./v2/{mute_config.name=folders/*/muteCon" - + "figs/*}:\013mute_configZI2:/v2/{mute_config" - + ".name=folders/*/locations/*/muteConfigs/" - + "*}:\013mute_configZ>2//v2/{mute_config.name" - + "=projects/*/muteConfigs/*}:\013mute_configZ" - + "J2;/v2/{mute_config.name=projects/*/loca" - + "tions/*/muteConfigs/*}:\013mute_config\212\323\344\223\002" - + "\323\001\022C\n\020mute_config.name\022/projects/*/locat" - + "ions/{location=*}/muteConfigs/*\022H\n\020mute_" - + "config.name\0224organizations/*/locations/{" - + "location=*}/muteConfigs/*\022B\n\020mute_config" - + ".name\022.folders/*/locations/{location=*}/" - + "muteConfigs/*\022\351\003\n\030UpdateNotificationConf" - + "ig\022?.google.cloud.securitycenter.v2.Upda" - + "teNotificationConfigRequest\0322.google.clo" - + "ud.securitycenter.v2.NotificationConfig\"" - + "\327\002\332A\037notification_config,update_mask\202\323\344\223" - + "\002\256\0022P/v2/{notification_config.name=organ" - + "izations/*/locations/*/notificationConfi" - + "gs/*}:\023notification_configZa2J/v2/{notif" - + "ication_config.name=folders/*/locations/" - + "*/notificationConfigs/*}:\023notification_c" - + "onfigZb2K/v2/{notification_config.name=p" - + "rojects/*/locations/*/notificationConfig" - + "s/*}:\023notification_config\022\237\002\n\031UpdateReso" - + "urceValueConfig\022@.google.cloud.securityc" - + "enter.v2.UpdateResourceValueConfigReques" - + "t\0323.google.cloud.securitycenter.v2.Resou" - + "rceValueConfig\"\212\001\332A!resource_value_confi" - + "g,update_mask\202\323\344\223\002`2G/v2/{resource_value" - + "_config.name=organizations/*/resourceVal" - + "ueConfigs/*}:\025resource_value_config\022\344\007\n\023" - + "UpdateSecurityMarks\022:.google.cloud.secur" - + "itycenter.v2.UpdateSecurityMarksRequest\032" - + "-.google.cloud.securitycenter.v2.Securit" - + "yMarks\"\341\006\332A\032security_marks,update_mask\202\323" - + "\344\223\002\275\0062L/v2/{security_marks.name=organiza" - + "tions/*/sources/*/findings/*/securityMar" - + "ks}:\016security_marksZR2@/v2/{security_mar" - + "ks.name=organizations/*/assets/*/securit" - + "yMarks}:\016security_marksZj2X/v2/{security" - + "_marks.name=organizations/*/sources/*/lo" - + "cations/*/findings/*/securityMarks}:\016sec" - + "urity_marksZX2F/v2/{security_marks.name=" - + "folders/*/sources/*/findings/*/securityM" - + "arks}:\016security_marksZL2:/v2/{security_m" - + "arks.name=folders/*/assets/*/securityMar" - + "ks}:\016security_marksZd2R/v2/{security_mar" - + "ks.name=folders/*/sources/*/locations/*/" - + "findings/*/securityMarks}:\016security_mark" - + "sZY2G/v2/{security_marks.name=projects/*" - + "/sources/*/findings/*/securityMarks}:\016se" - + "curity_marksZM2;/v2/{security_marks.name" - + "=projects/*/assets/*/securityMarks}:\016sec" - + "urity_marksZe2S/v2/{security_marks.name=" - + "projects/*/sources/*/locations/*/finding" - + "s/*/securityMarks}:\016security_marks\022\275\001\n\014U" - + "pdateSource\0223.google.cloud.securitycente" - + "r.v2.UpdateSourceRequest\032&.google.cloud." - + "securitycenter.v2.Source\"P\332A\022source,upda" - + "te_mask\202\323\344\223\00252+/v2/{source.name=organiza" - + "tions/*/sources/*}:\006source\032Q\312A\035securityc" - + "enter.googleapis.com\322A.https://www.googl" - + "eapis.com/auth/cloud-platformB\266\003\n\"com.go" - + "ogle.cloud.securitycenter.v2B\032Securityce" - + "nterServiceProtoP\001ZJcloud.google.com/go/" - + "securitycenter/apiv2/securitycenterpb;se" - + "curitycenterpb\252\002\036Google.Cloud.SecurityCe" - + "nter.V2\312\002\036Google\\Cloud\\SecurityCenter\\V2" - + "\352\002!Google::Cloud::SecurityCenter::V2\352Ag\n" - + "2securitycenter.googleapis.com/Organizat" - + "ionLocation\0221organizations/{organization" - + "}/locations/{location}\352AU\n,securitycente" - + "r.googleapis.com/FolderLocation\022%folders" - + "/{folder}/locations/{location}b\006proto3" + + "systemZ_2L/v2/{external_system.name=proj" + + "ects/*/sources/*/findings/*/externalSyst" + + "ems/*}:\017external_systemZk2X/v2/{external" + + "_system.name=projects/*/sources/*/locati" + + "ons/*/findings/*/externalSystems/*}:\017ext" + + "ernal_system\022\262\004\n\rUpdateFinding\0224.google." + + "cloud.securitycenter.v2.UpdateFindingReq" + + "uest\032\'.google.cloud.securitycenter.v2.Fi" + + "nding\"\301\003\332A\023finding,update_mask\202\323\344\223\002\244\00327/" + + "v2/{finding.name=organizations/*/sources" + + "/*/findings/*}:\007findingZN2C/v2/{finding." + + "name=organizations/*/sources/*/locations" + + "/*/findings/*}:\007findingZ<21/v2/{finding." + + "name=folders/*/sources/*/findings/*}:\007fi" + + "ndingZH2=/v2/{finding.name=folders/*/sou" + + "rces/*/locations/*/findings/*}:\007findingZ" + + "=22/v2/{finding.name=projects/*/sources/" + + "*/findings/*}:\007findingZI2>/v2/{finding.n" + + "ame=projects/*/sources/*/locations/*/fin" + + "dings/*}:\007finding\022\237\006\n\020UpdateMuteConfig\0227" + + ".google.cloud.securitycenter.v2.UpdateMu" + + "teConfigRequest\032*.google.cloud.securityc" + + "enter.v2.MuteConfig\"\245\005\332A\027mute_config,upd" + + "ate_mask\202\323\344\223\002\252\00324/v2/{mute_config.name=o" + + "rganizations/*/muteConfigs/*}:\013mute_conf" + + "igZO2@/v2/{mute_config.name=organization" + + "s/*/locations/*/muteConfigs/*}:\013mute_con" + + "figZ=2./v2/{mute_config.name=folders/*/m" + + "uteConfigs/*}:\013mute_configZI2:/v2/{mute_" + + "config.name=folders/*/locations/*/muteCo" + + "nfigs/*}:\013mute_configZ>2//v2/{mute_confi" + + "g.name=projects/*/muteConfigs/*}:\013mute_c" + + "onfigZJ2;/v2/{mute_config.name=projects/" + + "*/locations/*/muteConfigs/*}:\013mute_confi" + + "g\212\323\344\223\002\323\001\022C\n\020mute_config.name\022/projects/*" + + "/locations/{location=*}/muteConfigs/*\022H\n" + + "\020mute_config.name\0224organizations/*/locat" + + "ions/{location=*}/muteConfigs/*\022B\n\020mute_" + + "config.name\022.folders/*/locations/{locati" + + "on=*}/muteConfigs/*\022\351\003\n\030UpdateNotificati" + + "onConfig\022?.google.cloud.securitycenter.v" + + "2.UpdateNotificationConfigRequest\0322.goog" + + "le.cloud.securitycenter.v2.NotificationC" + + "onfig\"\327\002\332A\037notification_config,update_ma" + + "sk\202\323\344\223\002\256\0022P/v2/{notification_config.name" + + "=organizations/*/locations/*/notificatio" + + "nConfigs/*}:\023notification_configZa2J/v2/" + + "{notification_config.name=folders/*/loca" + + "tions/*/notificationConfigs/*}:\023notifica" + + "tion_configZb2K/v2/{notification_config." + + "name=projects/*/locations/*/notification" + + "Configs/*}:\023notification_config\022\216\003\n\031Upda" + + "teResourceValueConfig\022@.google.cloud.sec" + + "uritycenter.v2.UpdateResourceValueConfig" + + "Request\0323.google.cloud.securitycenter.v2" + + ".ResourceValueConfig\"\371\001\332A!resource_value" + + "_config,update_mask\202\323\344\223\002\316\0012G/v2/{resourc" + + "e_value_config.name=organizations/*/reso" + + "urceValueConfigs/*}:\025resource_value_conf" + + "igZl2S/v2/{resource_value_config.name=or" + + "ganizations/*/locations/*/resourceValueC" + + "onfigs/*}:\025resource_value_config\022\344\007\n\023Upd" + + "ateSecurityMarks\022:.google.cloud.security" + + "center.v2.UpdateSecurityMarksRequest\032-.g" + + "oogle.cloud.securitycenter.v2.SecurityMa" + + "rks\"\341\006\332A\032security_marks,update_mask\202\323\344\223\002" + + "\275\0062L/v2/{security_marks.name=organizatio" + + "ns/*/sources/*/findings/*/securityMarks}" + + ":\016security_marksZR2@/v2/{security_marks." + + "name=organizations/*/assets/*/securityMa" + + "rks}:\016security_marksZj2X/v2/{security_ma" + + "rks.name=organizations/*/sources/*/locat" + + "ions/*/findings/*/securityMarks}:\016securi" + + "ty_marksZX2F/v2/{security_marks.name=fol" + + "ders/*/sources/*/findings/*/securityMark" + + "s}:\016security_marksZL2:/v2/{security_mark" + + "s.name=folders/*/assets/*/securityMarks}" + + ":\016security_marksZd2R/v2/{security_marks." + + "name=folders/*/sources/*/locations/*/fin" + + "dings/*/securityMarks}:\016security_marksZY" + + "2G/v2/{security_marks.name=projects/*/so" + + "urces/*/findings/*/securityMarks}:\016secur" + + "ity_marksZM2;/v2/{security_marks.name=pr" + + "ojects/*/assets/*/securityMarks}:\016securi" + + "ty_marksZe2S/v2/{security_marks.name=pro" + + "jects/*/sources/*/locations/*/findings/*" + + "/securityMarks}:\016security_marks\022\275\001\n\014Upda" + + "teSource\0223.google.cloud.securitycenter.v" + + "2.UpdateSourceRequest\032&.google.cloud.sec" + + "uritycenter.v2.Source\"P\332A\022source,update_" + + "mask\202\323\344\223\00252+/v2/{source.name=organizatio" + + "ns/*/sources/*}:\006source\032Q\312A\035securitycent" + + "er.googleapis.com\322A.https://www.googleap" + + "is.com/auth/cloud-platformB\342\004\n\"com.googl" + + "e.cloud.securitycenter.v2B\032Securitycente" + + "rServiceProtoP\001ZJcloud.google.com/go/sec" + + "uritycenter/apiv2/securitycenterpb;secur" + + "itycenterpb\252\002\036Google.Cloud.SecurityCente" + + "r.V2\312\002\036Google\\Cloud\\SecurityCenter\\V2\352\002!" + + "Google::Cloud::SecurityCenter::V2\352Ag\n2se" + + "curitycenter.googleapis.com/Organization" + + "Location\0221organizations/{organization}/l" + + "ocations/{location}\352AU\n,securitycenter.g" + + "oogleapis.com/FolderLocation\022%folders/{f" + + "older}/locations/{location}\352A\250\001\n8securit" + + "ycenter.googleapis.com/OrganizationValue" + + "dResource\022lorganizations/{organization}/" + + "locations/{location}/simulations/{simula" + + "tion}/valuedResources/{valued_resource}b" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -878,6 +913,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.securitycenter.v2.FindingProto.getDescriptor(), com.google.cloud.securitycenter.v2.MuteConfigProto.getDescriptor(), com.google.cloud.securitycenter.v2.NotificationConfigProto.getDescriptor(), + com.google.cloud.securitycenter.v2.ResourceProto.getDescriptor(), com.google.cloud.securitycenter.v2.ResourceValueConfigProto.getDescriptor(), com.google.cloud.securitycenter.v2.SecurityMarksProto.getDescriptor(), com.google.cloud.securitycenter.v2.SimulationProto.getDescriptor(), @@ -1156,7 +1192,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_securitycenter_v2_ListFindingsResponse_ListFindingsResult_Resource_descriptor, new java.lang.String[] { - "Name", "DisplayName", "Type", + "Name", + "DisplayName", + "Type", + "CloudProvider", + "Service", + "Location", + "GcpMetadata", + "AwsMetadata", + "AzureMetadata", + "ResourcePath", + "ResourcePathString", + "CloudProviderMetadata", }); internal_static_google_cloud_securitycenter_v2_ListMuteConfigsRequest_descriptor = getDescriptor().getMessageTypes().get(30); @@ -1342,6 +1389,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.securitycenter.v2.FindingProto.getDescriptor(); com.google.cloud.securitycenter.v2.MuteConfigProto.getDescriptor(); com.google.cloud.securitycenter.v2.NotificationConfigProto.getDescriptor(); + com.google.cloud.securitycenter.v2.ResourceProto.getDescriptor(); com.google.cloud.securitycenter.v2.ResourceValueConfigProto.getDescriptor(); com.google.cloud.securitycenter.v2.SecurityMarksProto.getDescriptor(); com.google.cloud.securitycenter.v2.SimulationProto.getDescriptor(); diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Simulation.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Simulation.java index f0d27755df95..87f61f788b34 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Simulation.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/Simulation.java @@ -41,6 +41,7 @@ private Simulation(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Simulation() { name_ = ""; resourceValueConfigsMetadata_ = java.util.Collections.emptyList(); + cloudProvider_ = 0; } @java.lang.Override @@ -258,6 +259,41 @@ public int getResourceValueConfigsMetadataCount() { return resourceValueConfigsMetadata_.get(index); } + public static final int CLOUD_PROVIDER_FIELD_NUMBER = 4; + private int cloudProvider_ = 0; + /** + * + * + *
+   * Indicates which cloud provider was used in this simulation.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The enum numeric value on the wire for cloudProvider. + */ + @java.lang.Override + public int getCloudProviderValue() { + return cloudProvider_; + } + /** + * + * + *
+   * Indicates which cloud provider was used in this simulation.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The cloudProvider. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.CloudProvider getCloudProvider() { + com.google.cloud.securitycenter.v2.CloudProvider result = + com.google.cloud.securitycenter.v2.CloudProvider.forNumber(cloudProvider_); + return result == null ? com.google.cloud.securitycenter.v2.CloudProvider.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -281,6 +317,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < resourceValueConfigsMetadata_.size(); i++) { output.writeMessage(3, resourceValueConfigsMetadata_.get(i)); } + if (cloudProvider_ + != com.google.cloud.securitycenter.v2.CloudProvider.CLOUD_PROVIDER_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, cloudProvider_); + } getUnknownFields().writeTo(output); } @@ -301,6 +342,11 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 3, resourceValueConfigsMetadata_.get(i)); } + if (cloudProvider_ + != com.google.cloud.securitycenter.v2.CloudProvider.CLOUD_PROVIDER_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, cloudProvider_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -324,6 +370,7 @@ public boolean equals(final java.lang.Object obj) { } if (!getResourceValueConfigsMetadataList().equals(other.getResourceValueConfigsMetadataList())) return false; + if (cloudProvider_ != other.cloudProvider_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -345,6 +392,8 @@ public int hashCode() { hash = (37 * hash) + RESOURCE_VALUE_CONFIGS_METADATA_FIELD_NUMBER; hash = (53 * hash) + getResourceValueConfigsMetadataList().hashCode(); } + hash = (37 * hash) + CLOUD_PROVIDER_FIELD_NUMBER; + hash = (53 * hash) + cloudProvider_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -507,6 +556,7 @@ public Builder clear() { resourceValueConfigsMetadataBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); + cloudProvider_ = 0; return this; } @@ -565,6 +615,9 @@ private void buildPartial0(com.google.cloud.securitycenter.v2.Simulation result) result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); to_bitField0_ |= 0x00000001; } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cloudProvider_ = cloudProvider_; + } result.bitField0_ |= to_bitField0_; } @@ -649,6 +702,9 @@ public Builder mergeFrom(com.google.cloud.securitycenter.v2.Simulation other) { } } } + if (other.cloudProvider_ != 0) { + setCloudProviderValue(other.getCloudProviderValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -701,6 +757,12 @@ public Builder mergeFrom( } break; } // case 26 + case 32: + { + cloudProvider_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1460,6 +1522,98 @@ public Builder removeResourceValueConfigsMetadata(int index) { return resourceValueConfigsMetadataBuilder_; } + private int cloudProvider_ = 0; + /** + * + * + *
+     * Indicates which cloud provider was used in this simulation.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The enum numeric value on the wire for cloudProvider. + */ + @java.lang.Override + public int getCloudProviderValue() { + return cloudProvider_; + } + /** + * + * + *
+     * Indicates which cloud provider was used in this simulation.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @param value The enum numeric value on the wire for cloudProvider to set. + * @return This builder for chaining. + */ + public Builder setCloudProviderValue(int value) { + cloudProvider_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates which cloud provider was used in this simulation.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The cloudProvider. + */ + @java.lang.Override + public com.google.cloud.securitycenter.v2.CloudProvider getCloudProvider() { + com.google.cloud.securitycenter.v2.CloudProvider result = + com.google.cloud.securitycenter.v2.CloudProvider.forNumber(cloudProvider_); + return result == null + ? com.google.cloud.securitycenter.v2.CloudProvider.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Indicates which cloud provider was used in this simulation.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @param value The cloudProvider to set. + * @return This builder for chaining. + */ + public Builder setCloudProvider(com.google.cloud.securitycenter.v2.CloudProvider value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + cloudProvider_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates which cloud provider was used in this simulation.
+     * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return This builder for chaining. + */ + public Builder clearCloudProvider() { + bitField0_ = (bitField0_ & ~0x00000008); + cloudProvider_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SimulationName.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SimulationName.java index 98e5dd48ce3c..2985216b829b 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SimulationName.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SimulationName.java @@ -17,6 +17,7 @@ package com.google.cloud.securitycenter.v2; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,19 +33,39 @@ public class SimulationName implements ResourceName { private static final PathTemplate ORGANIZATION_SIMULATION = PathTemplate.createWithoutUrlEncoding( "organizations/{organization}/simulations/{simulation}"); + private static final PathTemplate ORGANIZATION_LOCATION_SIMLUATION = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/simulations/{simluation}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; private final String organization; private final String simulation; + private final String location; + private final String simluation; @Deprecated protected SimulationName() { organization = null; simulation = null; + location = null; + simluation = null; } private SimulationName(Builder builder) { organization = Preconditions.checkNotNull(builder.getOrganization()); simulation = Preconditions.checkNotNull(builder.getSimulation()); + location = null; + simluation = null; + pathTemplate = ORGANIZATION_SIMULATION; + } + + private SimulationName(OrganizationLocationSimluationBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + simluation = Preconditions.checkNotNull(builder.getSimluation()); + simulation = null; + pathTemplate = ORGANIZATION_LOCATION_SIMLUATION; } public String getOrganization() { @@ -55,10 +76,26 @@ public String getSimulation() { return simulation; } + public String getLocation() { + return location; + } + + public String getSimluation() { + return simluation; + } + public static Builder newBuilder() { return new Builder(); } + public static Builder newOrganizationSimulationBuilder() { + return new Builder(); + } + + public static OrganizationLocationSimluationBuilder newOrganizationLocationSimluationBuilder() { + return new OrganizationLocationSimluationBuilder(); + } + public Builder toBuilder() { return new Builder(this); } @@ -67,18 +104,51 @@ public static SimulationName of(String organization, String simulation) { return newBuilder().setOrganization(organization).setSimulation(simulation).build(); } + public static SimulationName ofOrganizationSimulationName( + String organization, String simulation) { + return newBuilder().setOrganization(organization).setSimulation(simulation).build(); + } + + public static SimulationName ofOrganizationLocationSimluationName( + String organization, String location, String simluation) { + return newOrganizationLocationSimluationBuilder() + .setOrganization(organization) + .setLocation(location) + .setSimluation(simluation) + .build(); + } + public static String format(String organization, String simulation) { return newBuilder().setOrganization(organization).setSimulation(simulation).build().toString(); } + public static String formatOrganizationSimulationName(String organization, String simulation) { + return newBuilder().setOrganization(organization).setSimulation(simulation).build().toString(); + } + + public static String formatOrganizationLocationSimluationName( + String organization, String location, String simluation) { + return newOrganizationLocationSimluationBuilder() + .setOrganization(organization) + .setLocation(location) + .setSimluation(simluation) + .build() + .toString(); + } + public static SimulationName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - ORGANIZATION_SIMULATION.validatedMatch( - formattedString, "SimulationName.parse: formattedString not in valid format"); - return of(matchMap.get("organization"), matchMap.get("simulation")); + if (ORGANIZATION_SIMULATION.matches(formattedString)) { + Map matchMap = ORGANIZATION_SIMULATION.match(formattedString); + return ofOrganizationSimulationName(matchMap.get("organization"), matchMap.get("simulation")); + } else if (ORGANIZATION_LOCATION_SIMLUATION.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOCATION_SIMLUATION.match(formattedString); + return ofOrganizationLocationSimluationName( + matchMap.get("organization"), matchMap.get("location"), matchMap.get("simluation")); + } + throw new ValidationException("SimulationName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -102,7 +172,8 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return ORGANIZATION_SIMULATION.matches(formattedString); + return ORGANIZATION_SIMULATION.matches(formattedString) + || ORGANIZATION_LOCATION_SIMLUATION.matches(formattedString); } @Override @@ -117,6 +188,12 @@ public Map getFieldValuesMap() { if (simulation != null) { fieldMapBuilder.put("simulation", simulation); } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (simluation != null) { + fieldMapBuilder.put("simluation", simluation); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -130,8 +207,7 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return ORGANIZATION_SIMULATION.instantiate( - "organization", organization, "simulation", simulation); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } @Override @@ -142,7 +218,9 @@ public boolean equals(java.lang.Object o) { if (o != null && getClass() == o.getClass()) { SimulationName that = ((SimulationName) o); return Objects.equals(this.organization, that.organization) - && Objects.equals(this.simulation, that.simulation); + && Objects.equals(this.simulation, that.simulation) + && Objects.equals(this.location, that.location) + && Objects.equals(this.simluation, that.simluation); } return false; } @@ -151,9 +229,15 @@ public boolean equals(java.lang.Object o) { public int hashCode() { int h = 1; h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; h ^= Objects.hashCode(organization); h *= 1000003; h ^= Objects.hashCode(simulation); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(simluation); return h; } @@ -183,6 +267,9 @@ public Builder setSimulation(String simulation) { } private Builder(SimulationName simulationName) { + Preconditions.checkArgument( + Objects.equals(simulationName.pathTemplate, ORGANIZATION_SIMULATION), + "toBuilder is only supported when SimulationName has the pattern of organizations/{organization}/simulations/{simulation}"); this.organization = simulationName.organization; this.simulation = simulationName.simulation; } @@ -191,4 +278,44 @@ public SimulationName build() { return new SimulationName(this); } } + + /** Builder for organizations/{organization}/locations/{location}/simulations/{simluation}. */ + public static class OrganizationLocationSimluationBuilder { + private String organization; + private String location; + private String simluation; + + protected OrganizationLocationSimluationBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getSimluation() { + return simluation; + } + + public OrganizationLocationSimluationBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationSimluationBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationSimluationBuilder setSimluation(String simluation) { + this.simluation = simluation; + return this; + } + + public SimulationName build() { + return new SimulationName(this); + } + } } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SimulationOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SimulationOrBuilder.java index ef2cbe5a84db..62fa8d04bf58 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SimulationOrBuilder.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SimulationOrBuilder.java @@ -158,4 +158,29 @@ com.google.cloud.securitycenter.v2.ResourceValueConfigMetadata getResourceValueC */ com.google.cloud.securitycenter.v2.ResourceValueConfigMetadataOrBuilder getResourceValueConfigsMetadataOrBuilder(int index); + + /** + * + * + *
+   * Indicates which cloud provider was used in this simulation.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The enum numeric value on the wire for cloudProvider. + */ + int getCloudProviderValue(); + /** + * + * + *
+   * Indicates which cloud provider was used in this simulation.
+   * 
+ * + * .google.cloud.securitycenter.v2.CloudProvider cloud_provider = 4; + * + * @return The cloudProvider. + */ + com.google.cloud.securitycenter.v2.CloudProvider getCloudProvider(); } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SimulationProto.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SimulationProto.java index d1f2ad1e1566..cead2b632f55 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SimulationProto.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/SimulationProto.java @@ -44,23 +44,28 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n/google/cloud/securitycenter/v2/simulat" + "ion.proto\022\036google.cloud.securitycenter.v" + "2\032\037google/api/field_behavior.proto\032\031goog" - + "le/api/resource.proto\0324google/cloud/secu" - + "ritycenter/v2/valued_resource.proto\032\037goo" - + "gle/protobuf/timestamp.proto\"\265\002\n\nSimulat" - + "ion\022\014\n\004name\030\001 \001(\t\0224\n\013create_time\030\002 \001(\0132\032" - + ".google.protobuf.TimestampB\003\340A\003\022d\n\037resou" - + "rce_value_configs_metadata\030\003 \003(\0132;.googl" - + "e.cloud.securitycenter.v2.ResourceValueC" - + "onfigMetadata:}\352Az\n(securitycenter.googl" + + "le/api/resource.proto\032-google/cloud/secu" + + "ritycenter/v2/resource.proto\0324google/clo" + + "ud/securitycenter/v2/valued_resource.pro" + + "to\032\037google/protobuf/timestamp.proto\"\312\003\n\n" + + "Simulation\022\014\n\004name\030\001 \001(\t\0224\n\013create_time\030" + + "\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022d" + + "\n\037resource_value_configs_metadata\030\003 \003(\0132" + + ";.google.cloud.securitycenter.v2.Resourc" + + "eValueConfigMetadata\022E\n\016cloud_provider\030\004" + + " \001(\0162-.google.cloud.securitycenter.v2.Cl" + + "oudProvider:\312\001\352A\306\001\n(securitycenter.googl" + "eapis.com/Simulation\0225organizations/{org" - + "anization}/simulations/{simulation}*\013sim" - + "ulations2\nsimulationB\351\001\n\"com.google.clou" - + "d.securitycenter.v2B\017SimulationProtoP\001ZJ" - + "cloud.google.com/go/securitycenter/apiv2" - + "/securitycenterpb;securitycenterpb\252\002\036Goo" - + "gle.Cloud.SecurityCenter.V2\312\002\036Google\\Clo" - + "ud\\SecurityCenter\\V2\352\002!Google::Cloud::Se" - + "curityCenter::V2b\006proto3" + + "anization}/simulations/{simulation}\022Jorg" + + "anizations/{organization}/locations/{loc" + + "ation}/simulations/{simluation}*\013simulat" + + "ions2\nsimulationB\351\001\n\"com.google.cloud.se" + + "curitycenter.v2B\017SimulationProtoP\001ZJclou" + + "d.google.com/go/securitycenter/apiv2/sec" + + "uritycenterpb;securitycenterpb\252\002\036Google." + + "Cloud.SecurityCenter.V2\312\002\036Google\\Cloud\\S" + + "ecurityCenter\\V2\352\002!Google::Cloud::Securi" + + "tyCenter::V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -68,6 +73,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.securitycenter.v2.ResourceProto.getDescriptor(), com.google.cloud.securitycenter.v2.ValuedResourceProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); @@ -77,7 +83,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_securitycenter_v2_Simulation_descriptor, new java.lang.String[] { - "Name", "CreateTime", "ResourceValueConfigsMetadata", + "Name", "CreateTime", "ResourceValueConfigsMetadata", "CloudProvider", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); @@ -87,6 +93,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.securitycenter.v2.ResourceProto.getDescriptor(); com.google.cloud.securitycenter.v2.ValuedResourceProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/UpdateResourceValueConfigRequest.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/UpdateResourceValueConfigRequest.java index 73908c344d97..6771cba2d011 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/UpdateResourceValueConfigRequest.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/UpdateResourceValueConfigRequest.java @@ -128,6 +128,10 @@ public com.google.cloud.securitycenter.v2.ResourceValueConfig getResourceValueCo *
    * The list of fields to be updated.
    * If empty all mutable fields will be updated.
+   *
+   * To update nested fields, include the top level field in the mask
+   * For example, to update gcp_metadata.resource_type, include the
+   * "gcp_metadata" field mask
    * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -144,6 +148,10 @@ public boolean hasUpdateMask() { *
    * The list of fields to be updated.
    * If empty all mutable fields will be updated.
+   *
+   * To update nested fields, include the top level field in the mask
+   * For example, to update gcp_metadata.resource_type, include the
+   * "gcp_metadata" field mask
    * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -160,6 +168,10 @@ public com.google.protobuf.FieldMask getUpdateMask() { *
    * The list of fields to be updated.
    * If empty all mutable fields will be updated.
+   *
+   * To update nested fields, include the top level field in the mask
+   * For example, to update gcp_metadata.resource_type, include the
+   * "gcp_metadata" field mask
    * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -797,6 +809,10 @@ public Builder clearResourceValueConfig() { *
      * The list of fields to be updated.
      * If empty all mutable fields will be updated.
+     *
+     * To update nested fields, include the top level field in the mask
+     * For example, to update gcp_metadata.resource_type, include the
+     * "gcp_metadata" field mask
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -812,6 +828,10 @@ public boolean hasUpdateMask() { *
      * The list of fields to be updated.
      * If empty all mutable fields will be updated.
+     *
+     * To update nested fields, include the top level field in the mask
+     * For example, to update gcp_metadata.resource_type, include the
+     * "gcp_metadata" field mask
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -833,6 +853,10 @@ public com.google.protobuf.FieldMask getUpdateMask() { *
      * The list of fields to be updated.
      * If empty all mutable fields will be updated.
+     *
+     * To update nested fields, include the top level field in the mask
+     * For example, to update gcp_metadata.resource_type, include the
+     * "gcp_metadata" field mask
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -856,6 +880,10 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { *
      * The list of fields to be updated.
      * If empty all mutable fields will be updated.
+     *
+     * To update nested fields, include the top level field in the mask
+     * For example, to update gcp_metadata.resource_type, include the
+     * "gcp_metadata" field mask
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -876,6 +904,10 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal *
      * The list of fields to be updated.
      * If empty all mutable fields will be updated.
+     *
+     * To update nested fields, include the top level field in the mask
+     * For example, to update gcp_metadata.resource_type, include the
+     * "gcp_metadata" field mask
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -904,6 +936,10 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { *
      * The list of fields to be updated.
      * If empty all mutable fields will be updated.
+     *
+     * To update nested fields, include the top level field in the mask
+     * For example, to update gcp_metadata.resource_type, include the
+     * "gcp_metadata" field mask
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -924,6 +960,10 @@ public Builder clearUpdateMask() { *
      * The list of fields to be updated.
      * If empty all mutable fields will be updated.
+     *
+     * To update nested fields, include the top level field in the mask
+     * For example, to update gcp_metadata.resource_type, include the
+     * "gcp_metadata" field mask
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -939,6 +979,10 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { *
      * The list of fields to be updated.
      * If empty all mutable fields will be updated.
+     *
+     * To update nested fields, include the top level field in the mask
+     * For example, to update gcp_metadata.resource_type, include the
+     * "gcp_metadata" field mask
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -958,6 +1002,10 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { *
      * The list of fields to be updated.
      * If empty all mutable fields will be updated.
+     *
+     * To update nested fields, include the top level field in the mask
+     * For example, to update gcp_metadata.resource_type, include the
+     * "gcp_metadata" field mask
      * 
* * .google.protobuf.FieldMask update_mask = 2; diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/UpdateResourceValueConfigRequestOrBuilder.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/UpdateResourceValueConfigRequestOrBuilder.java index 60ed0680af2a..fdad807946c1 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/UpdateResourceValueConfigRequestOrBuilder.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/UpdateResourceValueConfigRequestOrBuilder.java @@ -71,6 +71,10 @@ public interface UpdateResourceValueConfigRequestOrBuilder *
    * The list of fields to be updated.
    * If empty all mutable fields will be updated.
+   *
+   * To update nested fields, include the top level field in the mask
+   * For example, to update gcp_metadata.resource_type, include the
+   * "gcp_metadata" field mask
    * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -84,6 +88,10 @@ public interface UpdateResourceValueConfigRequestOrBuilder *
    * The list of fields to be updated.
    * If empty all mutable fields will be updated.
+   *
+   * To update nested fields, include the top level field in the mask
+   * For example, to update gcp_metadata.resource_type, include the
+   * "gcp_metadata" field mask
    * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -97,6 +105,10 @@ public interface UpdateResourceValueConfigRequestOrBuilder *
    * The list of fields to be updated.
    * If empty all mutable fields will be updated.
+   *
+   * To update nested fields, include the top level field in the mask
+   * For example, to update gcp_metadata.resource_type, include the
+   * "gcp_metadata" field mask
    * 
* * .google.protobuf.FieldMask update_mask = 2; diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ValuedResourceName.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ValuedResourceName.java index 992a1a354b7b..fde8db747d94 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ValuedResourceName.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ValuedResourceName.java @@ -17,6 +17,7 @@ package com.google.cloud.securitycenter.v2; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -32,22 +33,43 @@ public class ValuedResourceName implements ResourceName { private static final PathTemplate ORGANIZATION_SIMULATION_VALUED_RESOURCE = PathTemplate.createWithoutUrlEncoding( "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}"); + private static final PathTemplate ORGANIZATION_LOCATION_SIMLUATION_VALUED_RESOURCE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; private final String organization; private final String simulation; private final String valuedResource; + private final String location; + private final String simluation; @Deprecated protected ValuedResourceName() { organization = null; simulation = null; valuedResource = null; + location = null; + simluation = null; } private ValuedResourceName(Builder builder) { organization = Preconditions.checkNotNull(builder.getOrganization()); simulation = Preconditions.checkNotNull(builder.getSimulation()); valuedResource = Preconditions.checkNotNull(builder.getValuedResource()); + location = null; + simluation = null; + pathTemplate = ORGANIZATION_SIMULATION_VALUED_RESOURCE; + } + + private ValuedResourceName(OrganizationLocationSimluationValuedResourceBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + simluation = Preconditions.checkNotNull(builder.getSimluation()); + valuedResource = Preconditions.checkNotNull(builder.getValuedResource()); + simulation = null; + pathTemplate = ORGANIZATION_LOCATION_SIMLUATION_VALUED_RESOURCE; } public String getOrganization() { @@ -62,10 +84,27 @@ public String getValuedResource() { return valuedResource; } + public String getLocation() { + return location; + } + + public String getSimluation() { + return simluation; + } + public static Builder newBuilder() { return new Builder(); } + public static Builder newOrganizationSimulationValuedResourceBuilder() { + return new Builder(); + } + + public static OrganizationLocationSimluationValuedResourceBuilder + newOrganizationLocationSimluationValuedResourceBuilder() { + return new OrganizationLocationSimluationValuedResourceBuilder(); + } + public Builder toBuilder() { return new Builder(this); } @@ -79,6 +118,25 @@ public static ValuedResourceName of( .build(); } + public static ValuedResourceName ofOrganizationSimulationValuedResourceName( + String organization, String simulation, String valuedResource) { + return newBuilder() + .setOrganization(organization) + .setSimulation(simulation) + .setValuedResource(valuedResource) + .build(); + } + + public static ValuedResourceName ofOrganizationLocationSimluationValuedResourceName( + String organization, String location, String simluation, String valuedResource) { + return newOrganizationLocationSimluationValuedResourceBuilder() + .setOrganization(organization) + .setLocation(location) + .setSimluation(simluation) + .setValuedResource(valuedResource) + .build(); + } + public static String format(String organization, String simulation, String valuedResource) { return newBuilder() .setOrganization(organization) @@ -88,15 +146,47 @@ public static String format(String organization, String simulation, String value .toString(); } + public static String formatOrganizationSimulationValuedResourceName( + String organization, String simulation, String valuedResource) { + return newBuilder() + .setOrganization(organization) + .setSimulation(simulation) + .setValuedResource(valuedResource) + .build() + .toString(); + } + + public static String formatOrganizationLocationSimluationValuedResourceName( + String organization, String location, String simluation, String valuedResource) { + return newOrganizationLocationSimluationValuedResourceBuilder() + .setOrganization(organization) + .setLocation(location) + .setSimluation(simluation) + .setValuedResource(valuedResource) + .build() + .toString(); + } + public static ValuedResourceName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - ORGANIZATION_SIMULATION_VALUED_RESOURCE.validatedMatch( - formattedString, "ValuedResourceName.parse: formattedString not in valid format"); - return of( - matchMap.get("organization"), matchMap.get("simulation"), matchMap.get("valued_resource")); + if (ORGANIZATION_SIMULATION_VALUED_RESOURCE.matches(formattedString)) { + Map matchMap = ORGANIZATION_SIMULATION_VALUED_RESOURCE.match(formattedString); + return ofOrganizationSimulationValuedResourceName( + matchMap.get("organization"), + matchMap.get("simulation"), + matchMap.get("valued_resource")); + } else if (ORGANIZATION_LOCATION_SIMLUATION_VALUED_RESOURCE.matches(formattedString)) { + Map matchMap = + ORGANIZATION_LOCATION_SIMLUATION_VALUED_RESOURCE.match(formattedString); + return ofOrganizationLocationSimluationValuedResourceName( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("simluation"), + matchMap.get("valued_resource")); + } + throw new ValidationException("ValuedResourceName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -120,7 +210,8 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return ORGANIZATION_SIMULATION_VALUED_RESOURCE.matches(formattedString); + return ORGANIZATION_SIMULATION_VALUED_RESOURCE.matches(formattedString) + || ORGANIZATION_LOCATION_SIMLUATION_VALUED_RESOURCE.matches(formattedString); } @Override @@ -138,6 +229,12 @@ public Map getFieldValuesMap() { if (valuedResource != null) { fieldMapBuilder.put("valued_resource", valuedResource); } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (simluation != null) { + fieldMapBuilder.put("simluation", simluation); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -151,8 +248,7 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return ORGANIZATION_SIMULATION_VALUED_RESOURCE.instantiate( - "organization", organization, "simulation", simulation, "valued_resource", valuedResource); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } @Override @@ -164,7 +260,9 @@ public boolean equals(java.lang.Object o) { ValuedResourceName that = ((ValuedResourceName) o); return Objects.equals(this.organization, that.organization) && Objects.equals(this.simulation, that.simulation) - && Objects.equals(this.valuedResource, that.valuedResource); + && Objects.equals(this.valuedResource, that.valuedResource) + && Objects.equals(this.location, that.location) + && Objects.equals(this.simluation, that.simluation); } return false; } @@ -173,11 +271,17 @@ public boolean equals(java.lang.Object o) { public int hashCode() { int h = 1; h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; h ^= Objects.hashCode(organization); h *= 1000003; h ^= Objects.hashCode(simulation); h *= 1000003; h ^= Objects.hashCode(valuedResource); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(simluation); return h; } @@ -220,6 +324,9 @@ public Builder setValuedResource(String valuedResource) { } private Builder(ValuedResourceName valuedResourceName) { + Preconditions.checkArgument( + Objects.equals(valuedResourceName.pathTemplate, ORGANIZATION_SIMULATION_VALUED_RESOURCE), + "toBuilder is only supported when ValuedResourceName has the pattern of organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}"); this.organization = valuedResourceName.organization; this.simulation = valuedResourceName.simulation; this.valuedResource = valuedResourceName.valuedResource; @@ -229,4 +336,59 @@ public ValuedResourceName build() { return new ValuedResourceName(this); } } + + /** + * Builder for + * organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}. + */ + public static class OrganizationLocationSimluationValuedResourceBuilder { + private String organization; + private String location; + private String simluation; + private String valuedResource; + + protected OrganizationLocationSimluationValuedResourceBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getSimluation() { + return simluation; + } + + public String getValuedResource() { + return valuedResource; + } + + public OrganizationLocationSimluationValuedResourceBuilder setOrganization( + String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationSimluationValuedResourceBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationSimluationValuedResourceBuilder setSimluation(String simluation) { + this.simluation = simluation; + return this; + } + + public OrganizationLocationSimluationValuedResourceBuilder setValuedResource( + String valuedResource) { + this.valuedResource = valuedResource; + return this; + } + + public ValuedResourceName build() { + return new ValuedResourceName(this); + } + } } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ValuedResourceProto.java b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ValuedResourceProto.java index 8482bc030e70..5f903a82a0ea 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ValuedResourceProto.java +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/java/com/google/cloud/securitycenter/v2/ValuedResourceProto.java @@ -47,7 +47,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n4google/cloud/securitycenter/v2/valued_" + "resource.proto\022\036google.cloud.securitycen" - + "ter.v2\032\031google/api/resource.proto\"\330\004\n\016Va" + + "ter.v2\032\031google/api/resource.proto\"\306\005\n\016Va" + "luedResource\022\014\n\004name\030\001 \001(\t\022\020\n\010resource\030\002" + " \001(\t\022\025\n\rresource_type\030\003 \001(\t\022\024\n\014display_n" + "ame\030\004 \001(\t\022T\n\016resource_value\030\005 \001(\0162<.goog" @@ -58,19 +58,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ueConfigMetadata\"{\n\rResourceValue\022\036\n\032RES" + "OURCE_VALUE_UNSPECIFIED\020\000\022\026\n\022RESOURCE_VA" + "LUE_LOW\020\001\022\031\n\025RESOURCE_VALUE_MEDIUM\020\002\022\027\n\023" - + "RESOURCE_VALUE_HIGH\020\003:\254\001\352A\250\001\n,securityce" + + "RESOURCE_VALUE_HIGH\020\003:\232\002\352A\226\002\n,securityce" + "nter.googleapis.com/ValuedResource\022Worga" + "nizations/{organization}/simulations/{si" + "mulation}/valuedResources/{valued_resour" - + "ce}*\017valuedResources2\016valuedResource\"+\n\033" - + "ResourceValueConfigMetadata\022\014\n\004name\030\001 \001(" - + "\tB\355\001\n\"com.google.cloud.securitycenter.v2" - + "B\023ValuedResourceProtoP\001ZJcloud.google.co" - + "m/go/securitycenter/apiv2/securitycenter" - + "pb;securitycenterpb\252\002\036Google.Cloud.Secur" - + "ityCenter.V2\312\002\036Google\\Cloud\\SecurityCent" - + "er\\V2\352\002!Google::Cloud::SecurityCenter::V" - + "2b\006proto3" + + "ce}\022lorganizations/{organization}/locati" + + "ons/{location}/simulations/{simluation}/" + + "valuedResources/{valued_resource}*\017value" + + "dResources2\016valuedResource\"+\n\033ResourceVa" + + "lueConfigMetadata\022\014\n\004name\030\001 \001(\tB\355\001\n\"com." + + "google.cloud.securitycenter.v2B\023ValuedRe" + + "sourceProtoP\001ZJcloud.google.com/go/secur" + + "itycenter/apiv2/securitycenterpb;securit" + + "ycenterpb\252\002\036Google.Cloud.SecurityCenter." + + "V2\312\002\036Google\\Cloud\\SecurityCenter\\V2\352\002!Go" + + "ogle::Cloud::SecurityCenter::V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/attack_path.proto b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/attack_path.proto index af78ec66cf3f..b41641b0e101 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/attack_path.proto +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/attack_path.proto @@ -31,6 +31,7 @@ message AttackPath { option (google.api.resource) = { type: "securitycenter.googleapis.com/AttackPath" pattern: "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}" + pattern: "organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}/attackPaths/{attack_path}" plural: "attackPaths" singular: "attackPath" }; diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/cloud_armor.proto b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/cloud_armor.proto new file mode 100644 index 000000000000..19c6b66c1758 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/cloud_armor.proto @@ -0,0 +1,114 @@ +// Copyright 2024 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.securitycenter.v2; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudArmorProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Fields related to Google Cloud Armor findings. +message CloudArmor { + // Information about the [Google Cloud Armor security + // policy](https://cloud.google.com/armor/docs/security-policy-overview) + // relevant to the finding. + SecurityPolicy security_policy = 1; + + // Information about incoming requests evaluated by [Google Cloud Armor + // security + // policies](https://cloud.google.com/armor/docs/security-policy-overview). + Requests requests = 2; + + // Information about potential Layer 7 DDoS attacks identified by [Google + // Cloud Armor Adaptive + // Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview). + AdaptiveProtection adaptive_protection = 3; + + // Information about DDoS attack volume and classification. + Attack attack = 4; + + // Distinguish between volumetric & protocol DDoS attack and + // application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS + // attacks, or "L_7" for Layer 7 DDoS attacks. + string threat_vector = 5; + + // Duration of attack from the start until the current moment (updated every 5 + // minutes). + google.protobuf.Duration duration = 6; +} + +// Information about the [Google Cloud Armor security +// policy](https://cloud.google.com/armor/docs/security-policy-overview) +// relevant to the finding. +message SecurityPolicy { + // The name of the Google Cloud Armor security policy, for example, + // "my-security-policy". + string name = 1; + + // The type of Google Cloud Armor security policy for example, 'backend + // security policy', 'edge security policy', 'network edge security policy', + // or 'always-on DDoS protection'. + string type = 2; + + // Whether or not the associated rule or policy is in preview mode. + bool preview = 3; +} + +// Information about the requests relevant to the finding. +message Requests { + // For 'Increasing deny ratio', the ratio is the denied traffic divided by the + // allowed traffic. For 'Allowed traffic spike', the ratio is the allowed + // traffic in the short term divided by allowed traffic in the long term. + double ratio = 1; + + // Allowed RPS (requests per second) in the short term. + int32 short_term_allowed = 2; + + // Allowed RPS (requests per second) over the long term. + int32 long_term_allowed = 3; + + // Denied RPS (requests per second) over the long term. + int32 long_term_denied = 4; +} + +// Information about [Google Cloud Armor Adaptive +// Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection). +message AdaptiveProtection { + // A score of 0 means that there is low confidence that the detected event is + // an actual attack. A score of 1 means that there is high confidence that the + // detected event is an attack. See the [Adaptive Protection + // documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning) + // for further explanation. + double confidence = 1; +} + +// Information about DDoS attack volume and classification. +message Attack { + // Total PPS (packets per second) volume of attack. + int32 volume_pps = 1; + + // Total BPS (bytes per second) volume of attack. + int32 volume_bps = 2; + + // Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'. + string classification = 3; +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/finding.proto b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/finding.proto index f14c6d69f677..ee5ca55c7a1b 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/finding.proto +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/finding.proto @@ -22,6 +22,7 @@ import "google/cloud/securitycenter/v2/access.proto"; import "google/cloud/securitycenter/v2/application.proto"; import "google/cloud/securitycenter/v2/attack_exposure.proto"; import "google/cloud/securitycenter/v2/backup_disaster_recovery.proto"; +import "google/cloud/securitycenter/v2/cloud_armor.proto"; import "google/cloud/securitycenter/v2/cloud_dlp_data_profile.proto"; import "google/cloud/securitycenter/v2/cloud_dlp_inspection.proto"; import "google/cloud/securitycenter/v2/compliance.proto"; @@ -40,6 +41,7 @@ import "google/cloud/securitycenter/v2/kubernetes.proto"; import "google/cloud/securitycenter/v2/load_balancer.proto"; import "google/cloud/securitycenter/v2/log_entry.proto"; import "google/cloud/securitycenter/v2/mitre_attack.proto"; +import "google/cloud/securitycenter/v2/notebook.proto"; import "google/cloud/securitycenter/v2/org_policy.proto"; import "google/cloud/securitycenter/v2/process.proto"; import "google/cloud/securitycenter/v2/security_marks.proto"; @@ -431,6 +433,12 @@ message Finding { // The load balancers associated with the finding. repeated LoadBalancer load_balancers = 50; + // Fields related to Cloud Armor findings. + CloudArmor cloud_armor = 51; + + // Notebook associated with the finding. + Notebook notebook = 55; + // Contains details about a group of security issues that, when the issues // occur together, represent a greater risk than when the issues occur // independently. A group of such issues is referred to as a toxic diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/folder.proto b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/folder.proto new file mode 100644 index 000000000000..d965797b0628 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/folder.proto @@ -0,0 +1,36 @@ +// Copyright 2024 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.securitycenter.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "FolderProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Message that contains the resource name and display name of a folder +// resource. +message Folder { + // Full resource name of this folder. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_folder = 1; + + // The user defined display name for this folder. + string resource_folder_display_name = 2; +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/mitre_attack.proto b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/mitre_attack.proto index 3963d6f09377..7c2b56c0400a 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/mitre_attack.proto +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/mitre_attack.proto @@ -78,7 +78,7 @@ message MitreAttack { // MITRE ATT&CK techniques that can be referenced by SCC findings. // See: https://attack.mitre.org/techniques/enterprise/ - // Next ID: 59 + // Next ID: 63 enum Technique { // Unspecified value. TECHNIQUE_UNSPECIFIED = 0; @@ -107,6 +107,9 @@ message MitreAttack { // T1059.004 UNIX_SHELL = 7; + // T1059.006 + PYTHON = 59; + // T1069 PERMISSION_GROUPS_DISCOVERY = 18; @@ -254,8 +257,17 @@ message MitreAttack { // T1595.001 SCANNING_IP_BLOCKS = 2; + // T1613 + CONTAINER_ADMINISTRATION_COMMAND = 60; + + // T1611 + ESCAPE_TO_HOST = 61; + // T1613 CONTAINER_AND_RESOURCE_DISCOVERY = 57; + + // T1649 + STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES = 62; } // The MITRE ATT&CK tactic most closely represented by this finding, if any. diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/notebook.proto b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/notebook.proto new file mode 100644 index 000000000000..b2fd80474e05 --- /dev/null +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/notebook.proto @@ -0,0 +1,44 @@ +// Copyright 2024 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.securitycenter.v2; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "NotebookProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise +// notebook](https://cloud.google.com/colab/docs/introduction) file, that is +// associated with a finding. +message Notebook { + // The name of the notebook. + string name = 1; + + // The source notebook service, for example, "Colab Enterprise". + string service = 2; + + // The user ID of the latest author to modify the notebook. + string last_author = 3; + + // The most recent time the notebook was updated. + google.protobuf.Timestamp notebook_update_time = 4; +} diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/resource.proto b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/resource.proto index 3738837292fa..0bf07600b13d 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/resource.proto +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/resource.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.securitycenter.v2; import "google/api/field_behavior.proto"; +import "google/cloud/securitycenter/v2/folder.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; @@ -37,4 +38,220 @@ message Resource { // The full resource type of the resource. string type = 3; + + // Indicates which cloud provider the finding is from. + CloudProvider cloud_provider = 4; + + // The service or resource provider associated with the resource. + string service = 5; + + // The region or location of the service (if applicable). + string location = 6; + + oneof cloud_provider_metadata { + // The GCP metadata associated with the finding. + GcpMetadata gcp_metadata = 7; + + // The AWS metadata associated with the finding. + AwsMetadata aws_metadata = 8; + + // The Azure metadata associated with the finding. + AzureMetadata azure_metadata = 9; + } + + // Provides the path to the resource within the resource hierarchy. + ResourcePath resource_path = 10; + + // A string representation of the resource path. + // For Google Cloud, it has the format of + // organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id} + // where there can be any number of folders. + // For AWS, it has the format of + // org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id} + // where there can be any number of organizational units. + // For Azure, it has the format of + // mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name} + // where there can be any number of management groups. + string resource_path_string = 11; +} + +// The cloud provider the finding pertains to. +enum CloudProvider { + // The cloud provider is unspecified. + CLOUD_PROVIDER_UNSPECIFIED = 0; + + // The cloud provider is Google Cloud Platform. + GOOGLE_CLOUD_PLATFORM = 1; + + // The cloud provider is Amazon Web Services. + AMAZON_WEB_SERVICES = 2; + + // The cloud provider is Microsoft Azure. + MICROSOFT_AZURE = 3; +} + +// GCP metadata associated with the resource, only applicable if the finding's +// cloud provider is Google Cloud Platform. +message GcpMetadata { + // The full resource name of project that the resource belongs to. + string project = 1; + + // The project ID that the resource belongs to. + string project_display_name = 2; + + // The full resource name of resource's parent. + string parent = 3; + + // The human readable name of resource's parent. + string parent_display_name = 4; + + // Output only. Contains a Folder message for each folder in the assets + // ancestry. The first folder is the deepest nested folder, and the last + // folder is the folder directly under the Organization. + repeated Folder folders = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The name of the organization that the resource belongs to. + string organization = 6; +} + +// AWS metadata associated with the resource, only applicable if the finding's +// cloud provider is Amazon Web Services. +message AwsMetadata { + // An organization is a collection of accounts that are centrally managed + // together using consolidated billing, organized hierarchically with + // organizational units (OUs), and controlled with policies. + message AwsOrganization { + // The unique identifier (ID) for the organization. The regex pattern for an + // organization ID string requires "o-" followed by from 10 to 32 lowercase + // letters or digits. + string id = 1; + } + + // An Organizational Unit (OU) is a container of AWS accounts within a root of + // an organization. Policies that are attached to an OU apply to all accounts + // contained in that OU and in any child OUs. + message AwsOrganizationalUnit { + // The unique identifier (ID) associated with this OU. The regex pattern for + // an organizational unit ID string requires "ou-" followed by from 4 to 32 + // lowercase letters or digits (the ID of the root that contains the OU). + // This string is followed by a second "-" dash and from 8 to 32 additional + // lowercase letters or digits. For example, "ou-ab12-cd34ef56". + string id = 1; + + // The friendly name of the OU. + string name = 2; + } + + // An AWS account that is a member of an organization. + message AwsAccount { + // The unique identifier (ID) of the account, containing exactly 12 digits. + string id = 1; + + // The friendly name of this account. + string name = 2; + } + + // The AWS organization associated with the resource. + AwsOrganization organization = 1; + + // A list of AWS organizational units associated with the resource, ordered + // from lowest level (closest to the account) to highest level. + repeated AwsOrganizationalUnit organizational_units = 2; + + // The AWS account associated with the resource. + AwsAccount account = 3; +} + +// Azure metadata associated with the resource, only applicable if the finding's +// cloud provider is Microsoft Azure. +message AzureMetadata { + // Represents an Azure management group. + message AzureManagementGroup { + // The UUID of the Azure management group, for example, + // "20000000-0001-0000-0000-000000000000". + string id = 1; + + // The display name of the Azure management group. + string display_name = 2; + } + + // Represents an Azure subscription. + message AzureSubscription { + // The UUID of the Azure subscription, for example, + // "291bba3f-e0a5-47bc-a099-3bdcb2a50a05". + string id = 1; + + // The display name of the Azure subscription. + string display_name = 2; + } + + // Represents an Azure resource group. + message AzureResourceGroup { + // The name of the Azure resource group. This is not a UUID. + string name = 1; + } + + // A list of Azure management groups associated with the resource, ordered + // from lowest level (closest to the subscription) to highest level. + repeated AzureManagementGroup management_groups = 1; + + // The Azure subscription associated with the resource. + AzureSubscription subscription = 2; + + // The Azure resource group associated with the resource. + AzureResourceGroup resource_group = 3; +} + +// Represents the path of resources leading up to the resource this finding is +// about. +message ResourcePath { + // The type of resource the node represents. + enum ResourcePathNodeType { + // Node type is unspecified. + RESOURCE_PATH_NODE_TYPE_UNSPECIFIED = 0; + + // The node represents a Google Cloud organization. + GCP_ORGANIZATION = 1; + + // The node represents a Google Cloud folder. + GCP_FOLDER = 2; + + // The node represents a Google Cloud project. + GCP_PROJECT = 3; + + // The node represents an AWS organization. + AWS_ORGANIZATION = 4; + + // The node represents an AWS organizational unit. + AWS_ORGANIZATIONAL_UNIT = 5; + + // The node represents an AWS account. + AWS_ACCOUNT = 6; + + // The node represents an Azure management group. + AZURE_MANAGEMENT_GROUP = 7; + + // The node represents an Azure subscription. + AZURE_SUBSCRIPTION = 8; + + // The node represents an Azure resource group. + AZURE_RESOURCE_GROUP = 9; + } + + // A node within the resource path. Each node represents a resource within the + // resource hierarchy. + message ResourcePathNode { + // The type of resource this node represents. + ResourcePathNodeType node_type = 1; + + // The ID of the resource this node represents. + string id = 2; + + // The display name of the resource this node represents. + string display_name = 3; + } + + // The list of nodes that make the up resource path, ordered from lowest + // level to highest level. + repeated ResourcePathNode nodes = 1; } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/resource_value_config.proto b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/resource_value_config.proto index ee224524d1a5..683fb13455f5 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/resource_value_config.proto +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/resource_value_config.proto @@ -18,6 +18,7 @@ package google.cloud.securitycenter.v2; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/securitycenter/v2/resource.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; @@ -28,12 +29,15 @@ option java_package = "com.google.cloud.securitycenter.v2"; option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; option ruby_package = "Google::Cloud::SecurityCenter::V2"; -// A resource value config (RVC) is a mapping configuration of user's resources -// to resource values. Used in Attack path simulations. +// A resource value configuration (RVC) is a mapping configuration of user's +// resources to resource values. Used in Attack path simulations. message ResourceValueConfig { option (google.api.resource) = { type: "securitycenter.googleapis.com/ResourceValueConfig" pattern: "organizations/{organization}/resourceValueConfigs/{resource_value_config}" + pattern: "organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}" + plural: "resourceValueConfigs" + singular: "resourceValueConfig" }; // Resource value mapping for Sensitive Data Protection findings @@ -49,48 +53,52 @@ message ResourceValueConfig { ResourceValue medium_sensitivity_mapping = 2; } - // Name for the resource value config + // Name for the resource value configuration string name = 1; // Resource value level this expression represents // Only required when there is no SDP mapping in the request ResourceValue resource_value = 2; - // Required. Tag values combined with AND to check against. + // Required. Tag values combined with AND to check against. // Values in the form "tagValues/123" - // E.g. [ "tagValues/123", "tagValues/456", "tagValues/789" ] + // Example: [ "tagValues/123", "tagValues/456", "tagValues/789" ] // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing repeated string tag_values = 3 [(google.api.field_behavior) = REQUIRED]; // Apply resource_value only to resources that match resource_type. - // resource_type will be checked with "AND" of other resources. - // E.g. "storage.googleapis.com/Bucket" with resource_value "HIGH" will - // apply "HIGH" value only to "storage.googleapis.com/Bucket" resources. + // resource_type will be checked with AND of other resources. + // For example, "storage.googleapis.com/Bucket" with resource_value "HIGH" + // will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources. string resource_type = 4; - // Project or folder to scope this config to. - // For example, "project/456" would apply this config only to resources in - // "project/456" - // scope will be checked with "AND" of other resources. + // Project or folder to scope this configuration to. + // For example, "project/456" would apply this configuration only to resources + // in "project/456" scope will be checked with AND of other + // resources. string scope = 5; - // List of resource labels to search for, evaluated with AND. - // E.g. "resource_labels_selector": {"key": "value", "env": "prod"} - // will match resources with labels "key": "value" AND "env": "prod" + // List of resource labels to search for, evaluated with AND. + // For example, "resource_labels_selector": {"key": "value", "env": "prod"} + // will match resources with labels "key": "value" AND "env": + // "prod" // https://cloud.google.com/resource-manager/docs/creating-managing-labels map resource_labels_selector = 6; - // Description of the resource value config. + // Description of the resource value configuration. string description = 7; - // Output only. Timestamp this resource value config was created. + // Output only. Timestamp this resource value configuration was created. google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Timestamp this resource value config was last updated. + // Output only. Timestamp this resource value configuration was last updated. google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Cloud provider this configuration applies to + CloudProvider cloud_provider = 10; + // A mapping of the sensitivity on Sensitive Data Protection finding to // resource values. This mapping can only be used in combination with a // resource_type that is related to BigQuery, e.g. diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/securitycenter_service.proto b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/securitycenter_service.proto index cfb1745331e5..f14bfaa8e1e7 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/securitycenter_service.proto +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/securitycenter_service.proto @@ -27,6 +27,7 @@ import "google/cloud/securitycenter/v2/external_system.proto"; import "google/cloud/securitycenter/v2/finding.proto"; import "google/cloud/securitycenter/v2/mute_config.proto"; import "google/cloud/securitycenter/v2/notification_config.proto"; +import "google/cloud/securitycenter/v2/resource.proto"; import "google/cloud/securitycenter/v2/resource_value_config.proto"; import "google/cloud/securitycenter/v2/security_marks.proto"; import "google/cloud/securitycenter/v2/simulation.proto"; @@ -54,6 +55,10 @@ option (google.api.resource_definition) = { type: "securitycenter.googleapis.com/FolderLocation" pattern: "folders/{folder}/locations/{location}" }; +option (google.api.resource_definition) = { + type: "securitycenter.googleapis.com/OrganizationValuedResource" + pattern: "organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}" +}; // V2 APIs for Security Center service. service SecurityCenter { @@ -68,6 +73,10 @@ service SecurityCenter { option (google.api.http) = { post: "/v2/{parent=organizations/*}/resourceValueConfigs:batchCreate" body: "*" + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs:batchCreate" + body: "*" + } }; option (google.api.method_signature) = "parent,requests"; } @@ -283,6 +292,9 @@ service SecurityCenter { returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v2/{name=organizations/*/resourceValueConfigs/*}" + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}" + } }; option (google.api.method_signature) = "name"; } @@ -306,6 +318,9 @@ service SecurityCenter { rpc GetSimulation(GetSimulationRequest) returns (Simulation) { option (google.api.http) = { get: "/v2/{name=organizations/*/simulations/*}" + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/simulations/*}" + } }; option (google.api.method_signature) = "name"; } @@ -314,6 +329,9 @@ service SecurityCenter { rpc GetValuedResource(GetValuedResourceRequest) returns (ValuedResource) { option (google.api.http) = { get: "/v2/{name=organizations/*/simulations/*/valuedResources/*}" + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/simulations/*/valuedResources/*}" + } }; option (google.api.method_signature) = "name"; } @@ -382,6 +400,9 @@ service SecurityCenter { returns (ResourceValueConfig) { option (google.api.http) = { get: "/v2/{name=organizations/*/resourceValueConfigs/*}" + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/resourceValueConfigs/*}" + } }; option (google.api.method_signature) = "name"; } @@ -445,9 +466,15 @@ service SecurityCenter { additional_bindings { get: "/v2/{parent=organizations/*/simulations/*/valuedResources/*}/attackPaths" } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*/simulations/*/valuedResources/*}/attackPaths" + } additional_bindings { get: "/v2/{parent=organizations/*/simulations/*/attackExposureResults/*}/attackPaths" } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*/simulations/*/attackExposureResults/*}/attackPaths" + } }; option (google.api.method_signature) = "parent"; } @@ -553,6 +580,9 @@ service SecurityCenter { returns (ListResourceValueConfigsResponse) { option (google.api.http) = { get: "/v2/{parent=organizations/*}/resourceValueConfigs" + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/resourceValueConfigs" + } }; option (google.api.method_signature) = "parent"; } @@ -808,6 +838,10 @@ service SecurityCenter { option (google.api.http) = { patch: "/v2/{resource_value_config.name=organizations/*/resourceValueConfigs/*}" body: "resource_value_config" + additional_bindings { + patch: "/v2/{resource_value_config.name=organizations/*/locations/*/resourceValueConfigs/*}" + body: "resource_value_config" + } }; option (google.api.method_signature) = "resource_value_config,update_mask"; } @@ -1295,14 +1329,6 @@ message GroupFindingsRequest { // Required. Expression that defines what assets fields to use for grouping. // The string value should follow SQL syntax: comma separated list of fields. // For example: "parent,resource_name". - // - // The following fields are supported: - // - // * resource_name - // * category - // * state - // * parent - // * severity string group_by = 3 [(google.api.field_behavior) = REQUIRED]; // The value returned by the last `GroupFindingsResponse`; indicates @@ -1580,6 +1606,41 @@ message ListFindingsResponse { // The full resource type of the resource. string type = 3; + + // Indicates which cloud provider the finding is from. + CloudProvider cloud_provider = 4; + + // The service or resource provider associated with the resource. + string service = 5; + + // The region or location of the service (if applicable). + string location = 6; + + oneof cloud_provider_metadata { + // The GCP metadata associated with the finding. + GcpMetadata gcp_metadata = 7; + + // The AWS metadata associated with the finding. + AwsMetadata aws_metadata = 8; + + // The Azure metadata associated with the finding. + AzureMetadata azure_metadata = 9; + } + + // Provides the path to the resource within the resource hierarchy. + ResourcePath resource_path = 10; + + // A string representation of the resource path. + // For Google Cloud, it has the format of + // organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id} + // where there can be any number of folders. + // For AWS, it has the format of + // org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id} + // where there can be any number of organizational units. + // For Azure, it has the format of + // mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name} + // where there can be any number of management groups. + string resource_path_string = 11; } // Finding matching the search request. @@ -1936,6 +1997,10 @@ message UpdateResourceValueConfigRequest { // The list of fields to be updated. // If empty all mutable fields will be updated. + // + // To update nested fields, include the top level field in the mask + // For example, to update gcp_metadata.resource_type, include the + // "gcp_metadata" field mask google.protobuf.FieldMask update_mask = 2; } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/simulation.proto b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/simulation.proto index 8656e373e3e7..d682d7cbf97e 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/simulation.proto +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/simulation.proto @@ -18,6 +18,7 @@ package google.cloud.securitycenter.v2; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/securitycenter/v2/resource.proto"; import "google/cloud/securitycenter/v2/valued_resource.proto"; import "google/protobuf/timestamp.proto"; @@ -34,6 +35,7 @@ message Simulation { option (google.api.resource) = { type: "securitycenter.googleapis.com/Simulation" pattern: "organizations/{organization}/simulations/{simulation}" + pattern: "organizations/{organization}/locations/{location}/simulations/{simluation}" plural: "simulations" singular: "simulation" }; @@ -49,4 +51,7 @@ message Simulation { // Resource value configurations' metadata used in this simulation. Maximum of // 100. repeated ResourceValueConfigMetadata resource_value_configs_metadata = 3; + + // Indicates which cloud provider was used in this simulation. + CloudProvider cloud_provider = 4; } diff --git a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/valued_resource.proto b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/valued_resource.proto index a2efdde5293c..994918b58dd5 100644 --- a/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/valued_resource.proto +++ b/java-securitycenter/proto-google-cloud-securitycenter-v2/src/main/proto/google/cloud/securitycenter/v2/valued_resource.proto @@ -31,6 +31,7 @@ message ValuedResource { option (google.api.resource) = { type: "securitycenter.googleapis.com/ValuedResource" pattern: "organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}" + pattern: "organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}" plural: "valuedResources" singular: "valuedResource" }; diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/batchcreateresourcevalueconfigs/SyncBatchCreateResourceValueConfigsOrganizationlocationnameListcreateresourcevalueconfigrequest.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/batchcreateresourcevalueconfigs/SyncBatchCreateResourceValueConfigsOrganizationlocationnameListcreateresourcevalueconfigrequest.java new file mode 100644 index 000000000000..9c0aa02c1b05 --- /dev/null +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/batchcreateresourcevalueconfigs/SyncBatchCreateResourceValueConfigsOrganizationlocationnameListcreateresourcevalueconfigrequest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 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. + */ + +package com.google.cloud.securitycenter.v2.samples; + +// [START securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_OrganizationlocationnameListcreateresourcevalueconfigrequest_sync] +import com.google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse; +import com.google.cloud.securitycenter.v2.CreateResourceValueConfigRequest; +import com.google.cloud.securitycenter.v2.OrganizationLocationName; +import com.google.cloud.securitycenter.v2.SecurityCenterClient; +import java.util.ArrayList; +import java.util.List; + +public +class SyncBatchCreateResourceValueConfigsOrganizationlocationnameListcreateresourcevalueconfigrequest { + + public static void main(String[] args) throws Exception { + syncBatchCreateResourceValueConfigsOrganizationlocationnameListcreateresourcevalueconfigrequest(); + } + + public static void + syncBatchCreateResourceValueConfigsOrganizationlocationnameListcreateresourcevalueconfigrequest() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + List requests = new ArrayList<>(); + BatchCreateResourceValueConfigsResponse response = + securityCenterClient.batchCreateResourceValueConfigs(parent, requests); + } + } +} +// [END securitycenter_v2_generated_SecurityCenter_BatchCreateResourceValueConfigs_OrganizationlocationnameListcreateresourcevalueconfigrequest_sync] diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/AsyncDeleteResourceValueConfig.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/AsyncDeleteResourceValueConfig.java index d7aa4d9d00b2..6ebc32a2c602 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/AsyncDeleteResourceValueConfig.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/AsyncDeleteResourceValueConfig.java @@ -39,7 +39,8 @@ public static void asyncDeleteResourceValueConfig() throws Exception { DeleteResourceValueConfigRequest request = DeleteResourceValueConfigRequest.newBuilder() .setName( - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") .toString()) .build(); ApiFuture future = diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/SyncDeleteResourceValueConfig.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/SyncDeleteResourceValueConfig.java index d20aa3f80dca..701c995bceb3 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/SyncDeleteResourceValueConfig.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/SyncDeleteResourceValueConfig.java @@ -38,7 +38,8 @@ public static void syncDeleteResourceValueConfig() throws Exception { DeleteResourceValueConfigRequest request = DeleteResourceValueConfigRequest.newBuilder() .setName( - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") .toString()) .build(); securityCenterClient.deleteResourceValueConfig(request); diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/SyncDeleteResourceValueConfigResourcevalueconfigname.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/SyncDeleteResourceValueConfigResourcevalueconfigname.java index 657fc4fbcca6..02fe1d894cbc 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/SyncDeleteResourceValueConfigResourcevalueconfigname.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/SyncDeleteResourceValueConfigResourcevalueconfigname.java @@ -35,7 +35,8 @@ public static void syncDeleteResourceValueConfigResourcevalueconfigname() throws // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ResourceValueConfigName name = - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); securityCenterClient.deleteResourceValueConfig(name); } } diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/SyncDeleteResourceValueConfigString.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/SyncDeleteResourceValueConfigString.java index 1693f42fa951..fa63e18f7026 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/SyncDeleteResourceValueConfigString.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/deleteresourcevalueconfig/SyncDeleteResourceValueConfigString.java @@ -35,7 +35,9 @@ public static void syncDeleteResourceValueConfigString() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String name = - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]").toString(); + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + .toString(); securityCenterClient.deleteResourceValueConfig(name); } } diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/AsyncGetResourceValueConfig.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/AsyncGetResourceValueConfig.java index 50ea9e048f3b..56a9149afe42 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/AsyncGetResourceValueConfig.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/AsyncGetResourceValueConfig.java @@ -39,7 +39,8 @@ public static void asyncGetResourceValueConfig() throws Exception { GetResourceValueConfigRequest request = GetResourceValueConfigRequest.newBuilder() .setName( - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") .toString()) .build(); ApiFuture future = diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/SyncGetResourceValueConfig.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/SyncGetResourceValueConfig.java index 30107cfb9d38..506de1e88eba 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/SyncGetResourceValueConfig.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/SyncGetResourceValueConfig.java @@ -38,7 +38,8 @@ public static void syncGetResourceValueConfig() throws Exception { GetResourceValueConfigRequest request = GetResourceValueConfigRequest.newBuilder() .setName( - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") .toString()) .build(); ResourceValueConfig response = securityCenterClient.getResourceValueConfig(request); diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/SyncGetResourceValueConfigResourcevalueconfigname.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/SyncGetResourceValueConfigResourcevalueconfigname.java index 59a40e2b2d95..c0912f974853 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/SyncGetResourceValueConfigResourcevalueconfigname.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/SyncGetResourceValueConfigResourcevalueconfigname.java @@ -35,7 +35,8 @@ public static void syncGetResourceValueConfigResourcevalueconfigname() throws Ex // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ResourceValueConfigName name = - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]"); ResourceValueConfig response = securityCenterClient.getResourceValueConfig(name); } } diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/SyncGetResourceValueConfigString.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/SyncGetResourceValueConfigString.java index d0646ffba790..a8095d1344e3 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/SyncGetResourceValueConfigString.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getresourcevalueconfig/SyncGetResourceValueConfigString.java @@ -35,7 +35,9 @@ public static void syncGetResourceValueConfigString() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String name = - ResourceValueConfigName.of("[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]").toString(); + ResourceValueConfigName.ofOrganizationResourceValueConfigName( + "[ORGANIZATION]", "[RESOURCE_VALUE_CONFIG]") + .toString(); ResourceValueConfig response = securityCenterClient.getResourceValueConfig(name); } } diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/AsyncGetSimulation.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/AsyncGetSimulation.java index 4792172e5457..699122db4f63 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/AsyncGetSimulation.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/AsyncGetSimulation.java @@ -38,7 +38,9 @@ public static void asyncGetSimulation() throws Exception { try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GetSimulationRequest request = GetSimulationRequest.newBuilder() - .setName(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + .setName( + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + .toString()) .build(); ApiFuture future = securityCenterClient.getSimulationCallable().futureCall(request); diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/SyncGetSimulation.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/SyncGetSimulation.java index 6af8385f783a..29c6317de5ff 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/SyncGetSimulation.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/SyncGetSimulation.java @@ -37,7 +37,9 @@ public static void syncGetSimulation() throws Exception { try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GetSimulationRequest request = GetSimulationRequest.newBuilder() - .setName(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + .setName( + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + .toString()) .build(); Simulation response = securityCenterClient.getSimulation(request); } diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/SyncGetSimulationSimulationname.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/SyncGetSimulationSimulationname.java index 32b314fca0c5..e7fca86fc50d 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/SyncGetSimulationSimulationname.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/SyncGetSimulationSimulationname.java @@ -34,7 +34,8 @@ public static void syncGetSimulationSimulationname() throws Exception { // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { - SimulationName name = SimulationName.of("[ORGANIZATION]", "[SIMULATION]"); + SimulationName name = + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]"); Simulation response = securityCenterClient.getSimulation(name); } } diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/SyncGetSimulationString.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/SyncGetSimulationString.java index 09eb22f3ed67..82551472c268 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/SyncGetSimulationString.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getsimulation/SyncGetSimulationString.java @@ -34,7 +34,8 @@ public static void syncGetSimulationString() throws Exception { // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { - String name = SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString(); + String name = + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]").toString(); Simulation response = securityCenterClient.getSimulation(name); } } diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/AsyncGetValuedResource.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/AsyncGetValuedResource.java index c7602298be80..95e48e74a618 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/AsyncGetValuedResource.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/AsyncGetValuedResource.java @@ -39,7 +39,8 @@ public static void asyncGetValuedResource() throws Exception { GetValuedResourceRequest request = GetValuedResourceRequest.newBuilder() .setName( - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") .toString()) .build(); ApiFuture future = diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/SyncGetValuedResource.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/SyncGetValuedResource.java index 4d32b1a3cb94..eb747560a597 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/SyncGetValuedResource.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/SyncGetValuedResource.java @@ -38,7 +38,8 @@ public static void syncGetValuedResource() throws Exception { GetValuedResourceRequest request = GetValuedResourceRequest.newBuilder() .setName( - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") .toString()) .build(); ValuedResource response = securityCenterClient.getValuedResource(request); diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/SyncGetValuedResourceString.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/SyncGetValuedResourceString.java index 08f1d85b91dc..0437fe9bccc1 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/SyncGetValuedResourceString.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/SyncGetValuedResourceString.java @@ -35,7 +35,9 @@ public static void syncGetValuedResourceString() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String name = - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]").toString(); + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + .toString(); ValuedResource response = securityCenterClient.getValuedResource(name); } } diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/SyncGetValuedResourceValuedresourcename.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/SyncGetValuedResourceValuedresourcename.java index 38dd63a83715..559651ae9561 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/SyncGetValuedResourceValuedresourcename.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/getvaluedresource/SyncGetValuedResourceValuedresourcename.java @@ -35,7 +35,8 @@ public static void syncGetValuedResourceValuedresourcename() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ValuedResourceName name = - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); ValuedResource response = securityCenterClient.getValuedResource(name); } } diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/AsyncListAttackPaths.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/AsyncListAttackPaths.java index 530112dfe9af..2ada6105481c 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/AsyncListAttackPaths.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/AsyncListAttackPaths.java @@ -39,7 +39,8 @@ public static void asyncListAttackPaths() throws Exception { ListAttackPathsRequest request = ListAttackPathsRequest.newBuilder() .setParent( - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") .toString()) .setFilter("filter-1274492040") .setPageToken("pageToken873572522") diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/AsyncListAttackPathsPaged.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/AsyncListAttackPathsPaged.java index eb3cbd936d6a..d5621787c42c 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/AsyncListAttackPathsPaged.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/AsyncListAttackPathsPaged.java @@ -40,7 +40,8 @@ public static void asyncListAttackPathsPaged() throws Exception { ListAttackPathsRequest request = ListAttackPathsRequest.newBuilder() .setParent( - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") .toString()) .setFilter("filter-1274492040") .setPageToken("pageToken873572522") diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPaths.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPaths.java index eed8a6d7477a..922b93306924 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPaths.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPaths.java @@ -38,7 +38,8 @@ public static void syncListAttackPaths() throws Exception { ListAttackPathsRequest request = ListAttackPathsRequest.newBuilder() .setParent( - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") .toString()) .setFilter("filter-1274492040") .setPageToken("pageToken873572522") diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPathsOrganizationvaluedresourcename.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPathsOrganizationvaluedresourcename.java new file mode 100644 index 000000000000..33d9f5d79dde --- /dev/null +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPathsOrganizationvaluedresourcename.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 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. + */ + +package com.google.cloud.securitycenter.v2.samples; + +// [START securitycenter_v2_generated_SecurityCenter_ListAttackPaths_Organizationvaluedresourcename_sync] +import com.google.cloud.securitycenter.v2.AttackPath; +import com.google.cloud.securitycenter.v2.OrganizationValuedResourceName; +import com.google.cloud.securitycenter.v2.SecurityCenterClient; + +public class SyncListAttackPathsOrganizationvaluedresourcename { + + public static void main(String[] args) throws Exception { + syncListAttackPathsOrganizationvaluedresourcename(); + } + + public static void syncListAttackPathsOrganizationvaluedresourcename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { + OrganizationValuedResourceName parent = + OrganizationValuedResourceName.of( + "[ORGANIZATION]", "[LOCATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + for (AttackPath element : securityCenterClient.listAttackPaths(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securitycenter_v2_generated_SecurityCenter_ListAttackPaths_Organizationvaluedresourcename_sync] diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPathsString.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPathsString.java index ed0af48007b0..a006a8bc34ab 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPathsString.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPathsString.java @@ -35,7 +35,9 @@ public static void syncListAttackPathsString() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String parent = - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]").toString(); + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]") + .toString(); for (AttackPath element : securityCenterClient.listAttackPaths(parent).iterateAll()) { // doThingsWith(element); } diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPathsValuedresourcename.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPathsValuedresourcename.java index 432d794bec1e..de3309892c9e 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPathsValuedresourcename.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listattackpaths/SyncListAttackPathsValuedresourcename.java @@ -35,7 +35,8 @@ public static void syncListAttackPathsValuedresourcename() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ValuedResourceName parent = - ValuedResourceName.of("[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); + ValuedResourceName.ofOrganizationSimulationValuedResourceName( + "[ORGANIZATION]", "[SIMULATION]", "[VALUED_RESOURCE]"); for (AttackPath element : securityCenterClient.listAttackPaths(parent).iterateAll()) { // doThingsWith(element); } diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listresourcevalueconfigs/SyncListResourceValueConfigsOrganizationlocationname.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listresourcevalueconfigs/SyncListResourceValueConfigsOrganizationlocationname.java new file mode 100644 index 000000000000..22f11754f68f --- /dev/null +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listresourcevalueconfigs/SyncListResourceValueConfigsOrganizationlocationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 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. + */ + +package com.google.cloud.securitycenter.v2.samples; + +// [START securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_Organizationlocationname_sync] +import com.google.cloud.securitycenter.v2.OrganizationLocationName; +import com.google.cloud.securitycenter.v2.ResourceValueConfig; +import com.google.cloud.securitycenter.v2.SecurityCenterClient; + +public class SyncListResourceValueConfigsOrganizationlocationname { + + public static void main(String[] args) throws Exception { + syncListResourceValueConfigsOrganizationlocationname(); + } + + public static void syncListResourceValueConfigsOrganizationlocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + for (ResourceValueConfig element : + securityCenterClient.listResourceValueConfigs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securitycenter_v2_generated_SecurityCenter_ListResourceValueConfigs_Organizationlocationname_sync] diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/AsyncListValuedResources.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/AsyncListValuedResources.java index 34578241921f..0e8f649ee8af 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/AsyncListValuedResources.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/AsyncListValuedResources.java @@ -38,7 +38,9 @@ public static void asyncListValuedResources() throws Exception { try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListValuedResourcesRequest request = ListValuedResourcesRequest.newBuilder() - .setParent(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + .setParent( + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + .toString()) .setFilter("filter-1274492040") .setPageToken("pageToken873572522") .setPageSize(883849137) diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/AsyncListValuedResourcesPaged.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/AsyncListValuedResourcesPaged.java index 83a9b9db4b19..765dc12b63d3 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/AsyncListValuedResourcesPaged.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/AsyncListValuedResourcesPaged.java @@ -39,7 +39,9 @@ public static void asyncListValuedResourcesPaged() throws Exception { try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListValuedResourcesRequest request = ListValuedResourcesRequest.newBuilder() - .setParent(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + .setParent( + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + .toString()) .setFilter("filter-1274492040") .setPageToken("pageToken873572522") .setPageSize(883849137) diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/SyncListValuedResources.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/SyncListValuedResources.java index d31c869ff220..adf0346c5e66 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/SyncListValuedResources.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/SyncListValuedResources.java @@ -37,7 +37,9 @@ public static void syncListValuedResources() throws Exception { try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListValuedResourcesRequest request = ListValuedResourcesRequest.newBuilder() - .setParent(SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString()) + .setParent( + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]") + .toString()) .setFilter("filter-1274492040") .setPageToken("pageToken873572522") .setPageSize(883849137) diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/SyncListValuedResourcesSimulationname.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/SyncListValuedResourcesSimulationname.java index 3fd489cfe9c0..94986a37c741 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/SyncListValuedResourcesSimulationname.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/SyncListValuedResourcesSimulationname.java @@ -34,7 +34,8 @@ public static void syncListValuedResourcesSimulationname() throws Exception { // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { - SimulationName parent = SimulationName.of("[ORGANIZATION]", "[SIMULATION]"); + SimulationName parent = + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]"); for (ValuedResource element : securityCenterClient.listValuedResources(parent).iterateAll()) { // doThingsWith(element); } diff --git a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/SyncListValuedResourcesString.java b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/SyncListValuedResourcesString.java index 95ca54a2c92b..45865a6fec6e 100644 --- a/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/SyncListValuedResourcesString.java +++ b/java-securitycenter/samples/snippets/generated/com/google/cloud/securitycenter/v2/securitycenter/listvaluedresources/SyncListValuedResourcesString.java @@ -34,7 +34,8 @@ public static void syncListValuedResourcesString() throws Exception { // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { - String parent = SimulationName.of("[ORGANIZATION]", "[SIMULATION]").toString(); + String parent = + SimulationName.ofOrganizationSimulationName("[ORGANIZATION]", "[SIMULATION]").toString(); for (ValuedResource element : securityCenterClient.listValuedResources(parent).iterateAll()) { // doThingsWith(element); }