From 1175022db1edab863af7789df5b3fb11fe22b67d Mon Sep 17 00:00:00 2001 From: Kristen O'Leary Date: Thu, 7 Mar 2019 18:33:59 -0500 Subject: [PATCH 1/3] Add Cloud Security Center v1 API. --- .../pom.xml | 31 + .../securitycenter/v1/SecurityCenterGrpc.java | 2590 ++++++++++ google-api-grpc/pom.xml | 12 + .../pom.xml | 36 + .../google/cloud/securitycenter/v1/Asset.java | 4586 +++++++++++++++++ .../securitycenter/v1/AssetOrBuilder.java | 274 + .../securitycenter/v1/AssetOuterClass.java | 130 + .../v1/AssetSecurityMarksName.java | 180 + .../v1/CreateFindingRequest.java | 1060 ++++ .../v1/CreateFindingRequestOrBuilder.java | 92 + .../v1/CreateSourceRequest.java | 885 ++++ .../v1/CreateSourceRequestOrBuilder.java | 67 + .../cloud/securitycenter/v1/Finding.java | 2828 ++++++++++ .../cloud/securitycenter/v1/FindingName.java | 209 + .../securitycenter/v1/FindingOrBuilder.java | 339 ++ .../securitycenter/v1/FindingOuterClass.java | 105 + .../v1/FindingSecurityMarksName.java | 208 + .../v1/GetOrganizationSettingsRequest.java | 617 +++ ...tOrganizationSettingsRequestOrBuilder.java | 33 + .../securitycenter/v1/GetSourceRequest.java | 606 +++ .../v1/GetSourceRequestOrBuilder.java | 33 + .../securitycenter/v1/GroupAssetsRequest.java | 2369 +++++++++ .../v1/GroupAssetsRequestOrBuilder.java | 327 ++ .../v1/GroupAssetsResponse.java | 1492 ++++++ .../v1/GroupAssetsResponseOrBuilder.java | 137 + .../v1/GroupFindingsRequest.java | 2350 +++++++++ .../v1/GroupFindingsRequestOrBuilder.java | 322 ++ .../v1/GroupFindingsResponse.java | 1492 ++++++ .../v1/GroupFindingsResponseOrBuilder.java | 137 + .../cloud/securitycenter/v1/GroupResult.java | 847 +++ .../v1/GroupResultOrBuilder.java | 76 + .../securitycenter/v1/ListAssetsRequest.java | 2623 ++++++++++ .../v1/ListAssetsRequestOrBuilder.java | 357 ++ .../securitycenter/v1/ListAssetsResponse.java | 2638 ++++++++++ .../v1/ListAssetsResponseOrBuilder.java | 141 + .../v1/ListFindingsRequest.java | 2612 ++++++++++ .../v1/ListFindingsRequestOrBuilder.java | 354 ++ .../v1/ListFindingsResponse.java | 2687 ++++++++++ .../v1/ListFindingsResponseOrBuilder.java | 142 + .../securitycenter/v1/ListSourcesRequest.java | 866 ++++ .../v1/ListSourcesRequestOrBuilder.java | 70 + .../v1/ListSourcesResponse.java | 1099 ++++ .../v1/ListSourcesResponseOrBuilder.java | 85 + .../securitycenter/v1/OrganizationName.java | 160 + .../v1/OrganizationSettings.java | 2140 ++++++++ .../v1/OrganizationSettingsName.java | 160 + .../v1/OrganizationSettingsOrBuilder.java | 90 + .../v1/OrganizationSettingsOuterClass.java | 86 + .../v1/OrganizationSourcesName.java | 160 + .../v1/RunAssetDiscoveryRequest.java | 607 +++ .../v1/RunAssetDiscoveryRequestOrBuilder.java | 33 + .../securitycenter/v1/SecurityMarks.java | 1013 ++++ .../v1/SecurityMarksOrBuilder.java | 123 + .../v1/SecurityMarksOuterClass.java | 79 + .../v1/SecuritycenterService.java | 596 +++ .../securitycenter/v1/SecuritymarksName.java | 23 + .../securitycenter/v1/SecuritymarksNames.java | 31 + .../v1/SetFindingStateRequest.java | 1009 ++++ .../v1/SetFindingStateRequestOrBuilder.java | 89 + .../cloud/securitycenter/v1/Source.java | 1028 ++++ .../cloud/securitycenter/v1/SourceName.java | 180 + .../securitycenter/v1/SourceOrBuilder.java | 103 + .../securitycenter/v1/SourceOuterClass.java | 63 + .../v1/UntypedSecuritymarksName.java | 99 + .../v1/UpdateFindingRequest.java | 1073 ++++ .../v1/UpdateFindingRequestOrBuilder.java | 99 + .../v1/UpdateOrganizationSettingsRequest.java | 998 ++++ ...eOrganizationSettingsRequestOrBuilder.java | 76 + .../v1/UpdateSecurityMarksRequest.java | 1287 +++++ .../UpdateSecurityMarksRequestOrBuilder.java | 118 + .../v1/UpdateSourceRequest.java | 977 ++++ .../v1/UpdateSourceRequestOrBuilder.java | 75 + .../cloud/securitycenter/v1/asset.proto | 101 + .../cloud/securitycenter/v1/finding.proto | 99 + .../v1/organization_settings.proto | 76 + .../securitycenter/v1/security_marks.proto | 46 + .../v1/securitycenter_service.proto | 891 ++++ .../cloud/securitycenter/v1/source.proto | 55 + google-cloud-bom/pom.xml | 10 + .../google-cloud-securitycenter/pom.xml | 8 + .../v1/SecurityCenterClient.java | 2471 +++++++++ .../v1/SecurityCenterSettings.java | 399 ++ .../cloud/securitycenter/v1/package-info.java | 38 + .../GrpcSecurityCenterCallableFactory.java | 115 + .../v1/stub/GrpcSecurityCenterStub.java | 620 +++ .../v1/stub/SecurityCenterStub.java | 183 + .../v1/stub/SecurityCenterStubSettings.java | 1082 ++++ .../securitycenter/v1/MockSecurityCenter.java | 57 + .../v1/MockSecurityCenterImpl.java | 332 ++ .../v1/SecurityCenterClientTest.java | 795 +++ .../synth.metadata | 16 +- .../google-cloud-securitycenter/synth.py | 2 +- versions.txt | 2 + 93 files changed, 58113 insertions(+), 4 deletions(-) create mode 100644 google-api-grpc/grpc-google-cloud-securitycenter-v1/pom.xml create mode 100644 google-api-grpc/grpc-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterGrpc.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/pom.xml create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Asset.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/AssetOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/AssetOuterClass.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/AssetSecurityMarksName.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateFindingRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateFindingRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateSourceRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateSourceRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Finding.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingName.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingOuterClass.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingSecurityMarksName.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetOrganizationSettingsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetOrganizationSettingsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetSourceRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetSourceRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupResult.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupResultOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsResponse.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesResponse.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationName.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettings.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettingsName.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettingsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettingsOuterClass.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSourcesName.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/RunAssetDiscoveryRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/RunAssetDiscoveryRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityMarks.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityMarksOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityMarksOuterClass.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecuritycenterService.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecuritymarksName.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecuritymarksNames.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SetFindingStateRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SetFindingStateRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Source.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SourceName.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SourceOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SourceOuterClass.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UntypedSecuritymarksName.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateFindingRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateFindingRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateOrganizationSettingsRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateOrganizationSettingsRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSecurityMarksRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSecurityMarksRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSourceRequest.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSourceRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/asset.proto create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/finding.proto create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/organization_settings.proto create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/security_marks.proto create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/securitycenter_service.proto create mode 100644 google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/source.proto create mode 100644 google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java create mode 100644 google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterSettings.java create mode 100644 google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/package-info.java create mode 100644 google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/GrpcSecurityCenterCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/GrpcSecurityCenterStub.java create mode 100644 google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/SecurityCenterStub.java create mode 100644 google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/SecurityCenterStubSettings.java create mode 100644 google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1/MockSecurityCenter.java create mode 100644 google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1/MockSecurityCenterImpl.java create mode 100644 google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1/SecurityCenterClientTest.java diff --git a/google-api-grpc/grpc-google-cloud-securitycenter-v1/pom.xml b/google-api-grpc/grpc-google-cloud-securitycenter-v1/pom.xml new file mode 100644 index 000000000000..00fd730790f3 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-securitycenter-v1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + grpc-google-cloud-securitycenter-v1 + 0.47.1-SNAPSHOT + grpc-google-cloud-securitycenter-v1 + GRPC library for grpc-google-cloud-securitycenter-v1 + + com.google.api.grpc + google-api-grpc + 0.47.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-securitycenter-v1 + compile + + + diff --git a/google-api-grpc/grpc-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterGrpc.java b/google-api-grpc/grpc-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterGrpc.java new file mode 100644 index 000000000000..8a6a42b43489 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterGrpc.java @@ -0,0 +1,2590 @@ +package com.google.cloud.securitycenter.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * V1 APIs for Security Center service.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/securitycenter/v1/securitycenter_service.proto") +public final class SecurityCenterGrpc { + + private SecurityCenterGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.securitycenter.v1.SecurityCenter"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateSourceMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.CreateSourceRequest, + com.google.cloud.securitycenter.v1.Source> + METHOD_CREATE_SOURCE = getCreateSourceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.CreateSourceRequest, + com.google.cloud.securitycenter.v1.Source> + getCreateSourceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.CreateSourceRequest, + com.google.cloud.securitycenter.v1.Source> + getCreateSourceMethod() { + return getCreateSourceMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.CreateSourceRequest, + com.google.cloud.securitycenter.v1.Source> + getCreateSourceMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.CreateSourceRequest, + com.google.cloud.securitycenter.v1.Source> + getCreateSourceMethod; + if ((getCreateSourceMethod = SecurityCenterGrpc.getCreateSourceMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getCreateSourceMethod = SecurityCenterGrpc.getCreateSourceMethod) == null) { + SecurityCenterGrpc.getCreateSourceMethod = + getCreateSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "CreateSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.CreateSourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.Source.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("CreateSource")) + .build(); + } + } + } + return getCreateSourceMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateFindingMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.CreateFindingRequest, + com.google.cloud.securitycenter.v1.Finding> + METHOD_CREATE_FINDING = getCreateFindingMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.CreateFindingRequest, + com.google.cloud.securitycenter.v1.Finding> + getCreateFindingMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.CreateFindingRequest, + com.google.cloud.securitycenter.v1.Finding> + getCreateFindingMethod() { + return getCreateFindingMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.CreateFindingRequest, + com.google.cloud.securitycenter.v1.Finding> + getCreateFindingMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.CreateFindingRequest, + com.google.cloud.securitycenter.v1.Finding> + getCreateFindingMethod; + if ((getCreateFindingMethod = SecurityCenterGrpc.getCreateFindingMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getCreateFindingMethod = SecurityCenterGrpc.getCreateFindingMethod) == null) { + SecurityCenterGrpc.getCreateFindingMethod = + getCreateFindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "CreateFinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.CreateFindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.Finding.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("CreateFinding")) + .build(); + } + } + } + return getCreateFindingMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetIamPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + METHOD_GET_IAM_POLICY = getGetIamPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + return getGetIamPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethodHelper() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = SecurityCenterGrpc.getGetIamPolicyMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getGetIamPolicyMethod = SecurityCenterGrpc.getGetIamPolicyMethod) == null) { + SecurityCenterGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetOrganizationSettingsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1.OrganizationSettings> + METHOD_GET_ORGANIZATION_SETTINGS = getGetOrganizationSettingsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1.OrganizationSettings> + getGetOrganizationSettingsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1.OrganizationSettings> + getGetOrganizationSettingsMethod() { + return getGetOrganizationSettingsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1.OrganizationSettings> + getGetOrganizationSettingsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1.OrganizationSettings> + getGetOrganizationSettingsMethod; + if ((getGetOrganizationSettingsMethod = SecurityCenterGrpc.getGetOrganizationSettingsMethod) + == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getGetOrganizationSettingsMethod = SecurityCenterGrpc.getGetOrganizationSettingsMethod) + == null) { + SecurityCenterGrpc.getGetOrganizationSettingsMethod = + getGetOrganizationSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", + "GetOrganizationSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.OrganizationSettings + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("GetOrganizationSettings")) + .build(); + } + } + } + return getGetOrganizationSettingsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetSourceMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GetSourceRequest, + com.google.cloud.securitycenter.v1.Source> + METHOD_GET_SOURCE = getGetSourceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GetSourceRequest, + com.google.cloud.securitycenter.v1.Source> + getGetSourceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GetSourceRequest, + com.google.cloud.securitycenter.v1.Source> + getGetSourceMethod() { + return getGetSourceMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GetSourceRequest, + com.google.cloud.securitycenter.v1.Source> + getGetSourceMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GetSourceRequest, + com.google.cloud.securitycenter.v1.Source> + getGetSourceMethod; + if ((getGetSourceMethod = SecurityCenterGrpc.getGetSourceMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getGetSourceMethod = SecurityCenterGrpc.getGetSourceMethod) == null) { + SecurityCenterGrpc.getGetSourceMethod = + getGetSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "GetSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.GetSourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.Source.getDefaultInstance())) + .setSchemaDescriptor(new SecurityCenterMethodDescriptorSupplier("GetSource")) + .build(); + } + } + } + return getGetSourceMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGroupAssetsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1.GroupAssetsResponse> + METHOD_GROUP_ASSETS = getGroupAssetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1.GroupAssetsResponse> + getGroupAssetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1.GroupAssetsResponse> + getGroupAssetsMethod() { + return getGroupAssetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1.GroupAssetsResponse> + getGroupAssetsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1.GroupAssetsResponse> + getGroupAssetsMethod; + if ((getGroupAssetsMethod = SecurityCenterGrpc.getGroupAssetsMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getGroupAssetsMethod = SecurityCenterGrpc.getGroupAssetsMethod) == null) { + SecurityCenterGrpc.getGroupAssetsMethod = + getGroupAssetsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "GroupAssets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.GroupAssetsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.GroupAssetsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("GroupAssets")) + .build(); + } + } + } + return getGroupAssetsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGroupFindingsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1.GroupFindingsResponse> + METHOD_GROUP_FINDINGS = getGroupFindingsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1.GroupFindingsResponse> + getGroupFindingsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1.GroupFindingsResponse> + getGroupFindingsMethod() { + return getGroupFindingsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1.GroupFindingsResponse> + getGroupFindingsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1.GroupFindingsResponse> + getGroupFindingsMethod; + if ((getGroupFindingsMethod = SecurityCenterGrpc.getGroupFindingsMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getGroupFindingsMethod = SecurityCenterGrpc.getGroupFindingsMethod) == null) { + SecurityCenterGrpc.getGroupFindingsMethod = + getGroupFindingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "GroupFindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.GroupFindingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.GroupFindingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("GroupFindings")) + .build(); + } + } + } + return getGroupFindingsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListAssetsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListAssetsRequest, + com.google.cloud.securitycenter.v1.ListAssetsResponse> + METHOD_LIST_ASSETS = getListAssetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListAssetsRequest, + com.google.cloud.securitycenter.v1.ListAssetsResponse> + getListAssetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListAssetsRequest, + com.google.cloud.securitycenter.v1.ListAssetsResponse> + getListAssetsMethod() { + return getListAssetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListAssetsRequest, + com.google.cloud.securitycenter.v1.ListAssetsResponse> + getListAssetsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListAssetsRequest, + com.google.cloud.securitycenter.v1.ListAssetsResponse> + getListAssetsMethod; + if ((getListAssetsMethod = SecurityCenterGrpc.getListAssetsMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getListAssetsMethod = SecurityCenterGrpc.getListAssetsMethod) == null) { + SecurityCenterGrpc.getListAssetsMethod = + getListAssetsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "ListAssets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.ListAssetsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.ListAssetsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SecurityCenterMethodDescriptorSupplier("ListAssets")) + .build(); + } + } + } + return getListAssetsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListFindingsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListFindingsRequest, + com.google.cloud.securitycenter.v1.ListFindingsResponse> + METHOD_LIST_FINDINGS = getListFindingsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListFindingsRequest, + com.google.cloud.securitycenter.v1.ListFindingsResponse> + getListFindingsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListFindingsRequest, + com.google.cloud.securitycenter.v1.ListFindingsResponse> + getListFindingsMethod() { + return getListFindingsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListFindingsRequest, + com.google.cloud.securitycenter.v1.ListFindingsResponse> + getListFindingsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListFindingsRequest, + com.google.cloud.securitycenter.v1.ListFindingsResponse> + getListFindingsMethod; + if ((getListFindingsMethod = SecurityCenterGrpc.getListFindingsMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getListFindingsMethod = SecurityCenterGrpc.getListFindingsMethod) == null) { + SecurityCenterGrpc.getListFindingsMethod = + getListFindingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "ListFindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.ListFindingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.ListFindingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("ListFindings")) + .build(); + } + } + } + return getListFindingsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListSourcesMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListSourcesRequest, + com.google.cloud.securitycenter.v1.ListSourcesResponse> + METHOD_LIST_SOURCES = getListSourcesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListSourcesRequest, + com.google.cloud.securitycenter.v1.ListSourcesResponse> + getListSourcesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListSourcesRequest, + com.google.cloud.securitycenter.v1.ListSourcesResponse> + getListSourcesMethod() { + return getListSourcesMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListSourcesRequest, + com.google.cloud.securitycenter.v1.ListSourcesResponse> + getListSourcesMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.ListSourcesRequest, + com.google.cloud.securitycenter.v1.ListSourcesResponse> + getListSourcesMethod; + if ((getListSourcesMethod = SecurityCenterGrpc.getListSourcesMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getListSourcesMethod = SecurityCenterGrpc.getListSourcesMethod) == null) { + SecurityCenterGrpc.getListSourcesMethod = + getListSourcesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "ListSources")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.ListSourcesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.ListSourcesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("ListSources")) + .build(); + } + } + } + return getListSourcesMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getRunAssetDiscoveryMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation> + METHOD_RUN_ASSET_DISCOVERY = getRunAssetDiscoveryMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation> + getRunAssetDiscoveryMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation> + getRunAssetDiscoveryMethod() { + return getRunAssetDiscoveryMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation> + getRunAssetDiscoveryMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation> + getRunAssetDiscoveryMethod; + if ((getRunAssetDiscoveryMethod = SecurityCenterGrpc.getRunAssetDiscoveryMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getRunAssetDiscoveryMethod = SecurityCenterGrpc.getRunAssetDiscoveryMethod) == null) { + SecurityCenterGrpc.getRunAssetDiscoveryMethod = + getRunAssetDiscoveryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "RunAssetDiscovery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("RunAssetDiscovery")) + .build(); + } + } + } + return getRunAssetDiscoveryMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getSetFindingStateMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1.Finding> + METHOD_SET_FINDING_STATE = getSetFindingStateMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1.Finding> + getSetFindingStateMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1.Finding> + getSetFindingStateMethod() { + return getSetFindingStateMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1.Finding> + getSetFindingStateMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1.Finding> + getSetFindingStateMethod; + if ((getSetFindingStateMethod = SecurityCenterGrpc.getSetFindingStateMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getSetFindingStateMethod = SecurityCenterGrpc.getSetFindingStateMethod) == null) { + SecurityCenterGrpc.getSetFindingStateMethod = + getSetFindingStateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "SetFindingState")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.SetFindingStateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.Finding.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("SetFindingState")) + .build(); + } + } + } + return getSetFindingStateMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getSetIamPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + METHOD_SET_IAM_POLICY = getSetIamPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + return getSetIamPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethodHelper() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = SecurityCenterGrpc.getSetIamPolicyMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getSetIamPolicyMethod = SecurityCenterGrpc.getSetIamPolicyMethod) == null) { + SecurityCenterGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getTestIamPermissionsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + METHOD_TEST_IAM_PERMISSIONS = getTestIamPermissionsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + return getTestIamPermissionsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = SecurityCenterGrpc.getTestIamPermissionsMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getTestIamPermissionsMethod = SecurityCenterGrpc.getTestIamPermissionsMethod) + == null) { + SecurityCenterGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", + "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateFindingMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1.Finding> + METHOD_UPDATE_FINDING = getUpdateFindingMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1.Finding> + getUpdateFindingMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1.Finding> + getUpdateFindingMethod() { + return getUpdateFindingMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1.Finding> + getUpdateFindingMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1.Finding> + getUpdateFindingMethod; + if ((getUpdateFindingMethod = SecurityCenterGrpc.getUpdateFindingMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getUpdateFindingMethod = SecurityCenterGrpc.getUpdateFindingMethod) == null) { + SecurityCenterGrpc.getUpdateFindingMethod = + getUpdateFindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "UpdateFinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.UpdateFindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.Finding.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("UpdateFinding")) + .build(); + } + } + } + return getUpdateFindingMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateOrganizationSettingsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1.OrganizationSettings> + METHOD_UPDATE_ORGANIZATION_SETTINGS = getUpdateOrganizationSettingsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1.OrganizationSettings> + getUpdateOrganizationSettingsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1.OrganizationSettings> + getUpdateOrganizationSettingsMethod() { + return getUpdateOrganizationSettingsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1.OrganizationSettings> + getUpdateOrganizationSettingsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1.OrganizationSettings> + getUpdateOrganizationSettingsMethod; + if ((getUpdateOrganizationSettingsMethod = + SecurityCenterGrpc.getUpdateOrganizationSettingsMethod) + == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getUpdateOrganizationSettingsMethod = + SecurityCenterGrpc.getUpdateOrganizationSettingsMethod) + == null) { + SecurityCenterGrpc.getUpdateOrganizationSettingsMethod = + getUpdateOrganizationSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", + "UpdateOrganizationSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.OrganizationSettings + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("UpdateOrganizationSettings")) + .build(); + } + } + } + return getUpdateOrganizationSettingsMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateSourceMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1.Source> + METHOD_UPDATE_SOURCE = getUpdateSourceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1.Source> + getUpdateSourceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1.Source> + getUpdateSourceMethod() { + return getUpdateSourceMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1.Source> + getUpdateSourceMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1.Source> + getUpdateSourceMethod; + if ((getUpdateSourceMethod = SecurityCenterGrpc.getUpdateSourceMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getUpdateSourceMethod = SecurityCenterGrpc.getUpdateSourceMethod) == null) { + SecurityCenterGrpc.getUpdateSourceMethod = + getUpdateSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", "UpdateSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.UpdateSourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.Source.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("UpdateSource")) + .build(); + } + } + } + return getUpdateSourceMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateSecurityMarksMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1.SecurityMarks> + METHOD_UPDATE_SECURITY_MARKS = getUpdateSecurityMarksMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1.SecurityMarks> + getUpdateSecurityMarksMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1.SecurityMarks> + getUpdateSecurityMarksMethod() { + return getUpdateSecurityMarksMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1.SecurityMarks> + getUpdateSecurityMarksMethodHelper() { + io.grpc.MethodDescriptor< + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1.SecurityMarks> + getUpdateSecurityMarksMethod; + if ((getUpdateSecurityMarksMethod = SecurityCenterGrpc.getUpdateSecurityMarksMethod) == null) { + synchronized (SecurityCenterGrpc.class) { + if ((getUpdateSecurityMarksMethod = SecurityCenterGrpc.getUpdateSecurityMarksMethod) + == null) { + SecurityCenterGrpc.getUpdateSecurityMarksMethod = + getUpdateSecurityMarksMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter", + "UpdateSecurityMarks")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1.SecurityMarks + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityCenterMethodDescriptorSupplier("UpdateSecurityMarks")) + .build(); + } + } + } + return getUpdateSecurityMarksMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SecurityCenterStub newStub(io.grpc.Channel channel) { + return new SecurityCenterStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SecurityCenterBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new SecurityCenterBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SecurityCenterFutureStub newFutureStub(io.grpc.Channel channel) { + return new SecurityCenterFutureStub(channel); + } + + /** + * + * + *
+   * V1 APIs for Security Center service.
+   * 
+ */ + public abstract static class SecurityCenterImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a source.
+     * 
+ */ + public void createSource( + com.google.cloud.securitycenter.v1.CreateSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateSourceMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Creates a finding. The corresponding source must exist for finding creation
+     * to succeed.
+     * 
+ */ + public void createFinding( + com.google.cloud.securitycenter.v1.CreateFindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateFindingMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets the access control policy on the specified Source.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetIamPolicyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets the settings for an organization.
+     * 
+ */ + public void getOrganizationSettings( + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetOrganizationSettingsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Gets a source.
+     * 
+ */ + public void getSource( + com.google.cloud.securitycenter.v1.GetSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetSourceMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Filters an organization's assets and  groups them by their specified
+     * properties.
+     * 
+ */ + public void groupAssets( + com.google.cloud.securitycenter.v1.GroupAssetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGroupAssetsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Filters an organization or source's findings and  groups them by their
+     * specified properties.
+     * To group across all sources provide a `-` as the source id.
+     * Example: /v1/organizations/123/sources/-/findings
+     * 
+ */ + public void groupFindings( + com.google.cloud.securitycenter.v1.GroupFindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGroupFindingsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists an organization's assets.
+     * 
+ */ + public void listAssets( + com.google.cloud.securitycenter.v1.ListAssetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListAssetsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists an organization or source's findings.
+     * To list across all sources provide a `-` as the source id.
+     * Example: /v1/organizations/123/sources/-/findings
+     * 
+ */ + public void listFindings( + com.google.cloud.securitycenter.v1.ListFindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListFindingsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Lists all sources belonging to an organization.
+     * 
+ */ + public void listSources( + com.google.cloud.securitycenter.v1.ListSourcesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListSourcesMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Runs asset discovery. The discovery is tracked with a long-running
+     * operation.
+     * This API can only be called with limited frequency for an organization. If
+     * it is called too frequently the caller will receive a TOO_MANY_REQUESTS
+     * error.
+     * 
+ */ + public void runAssetDiscovery( + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getRunAssetDiscoveryMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates the state of a finding.
+     * 
+ */ + public void setFindingState( + com.google.cloud.securitycenter.v1.SetFindingStateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSetFindingStateMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy on the specified Source.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSetIamPolicyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Returns the permissions that a caller has on the specified source.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getTestIamPermissionsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Creates or updates a finding. The corresponding source must exist for a
+     * finding creation to succeed.
+     * 
+ */ + public void updateFinding( + com.google.cloud.securitycenter.v1.UpdateFindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateFindingMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates an organization's settings.
+     * 
+ */ + public void updateOrganizationSettings( + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateOrganizationSettingsMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates a source.
+     * 
+ */ + public void updateSource( + com.google.cloud.securitycenter.v1.UpdateSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateSourceMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates security marks.
+     * 
+ */ + public void updateSecurityMarks( + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateSecurityMarksMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateSourceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.CreateSourceRequest, + com.google.cloud.securitycenter.v1.Source>(this, METHODID_CREATE_SOURCE))) + .addMethod( + getCreateFindingMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.CreateFindingRequest, + com.google.cloud.securitycenter.v1.Finding>(this, METHODID_CREATE_FINDING))) + .addMethod( + getGetIamPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getGetOrganizationSettingsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1.OrganizationSettings>( + this, METHODID_GET_ORGANIZATION_SETTINGS))) + .addMethod( + getGetSourceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.GetSourceRequest, + com.google.cloud.securitycenter.v1.Source>(this, METHODID_GET_SOURCE))) + .addMethod( + getGroupAssetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1.GroupAssetsResponse>( + this, METHODID_GROUP_ASSETS))) + .addMethod( + getGroupFindingsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1.GroupFindingsResponse>( + this, METHODID_GROUP_FINDINGS))) + .addMethod( + getListAssetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.ListAssetsRequest, + com.google.cloud.securitycenter.v1.ListAssetsResponse>( + this, METHODID_LIST_ASSETS))) + .addMethod( + getListFindingsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.ListFindingsRequest, + com.google.cloud.securitycenter.v1.ListFindingsResponse>( + this, METHODID_LIST_FINDINGS))) + .addMethod( + getListSourcesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.ListSourcesRequest, + com.google.cloud.securitycenter.v1.ListSourcesResponse>( + this, METHODID_LIST_SOURCES))) + .addMethod( + getRunAssetDiscoveryMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation>(this, METHODID_RUN_ASSET_DISCOVERY))) + .addMethod( + getSetFindingStateMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1.Finding>( + this, METHODID_SET_FINDING_STATE))) + .addMethod( + getSetIamPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) + .addMethod( + getUpdateFindingMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1.Finding>(this, METHODID_UPDATE_FINDING))) + .addMethod( + getUpdateOrganizationSettingsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1.OrganizationSettings>( + this, METHODID_UPDATE_ORGANIZATION_SETTINGS))) + .addMethod( + getUpdateSourceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1.Source>(this, METHODID_UPDATE_SOURCE))) + .addMethod( + getUpdateSecurityMarksMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1.SecurityMarks>( + this, METHODID_UPDATE_SECURITY_MARKS))) + .build(); + } + } + + /** + * + * + *
+   * V1 APIs for Security Center service.
+   * 
+ */ + public static final class SecurityCenterStub + extends io.grpc.stub.AbstractStub { + private SecurityCenterStub(io.grpc.Channel channel) { + super(channel); + } + + private SecurityCenterStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SecurityCenterStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SecurityCenterStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a source.
+     * 
+ */ + public void createSource( + com.google.cloud.securitycenter.v1.CreateSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateSourceMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a finding. The corresponding source must exist for finding creation
+     * to succeed.
+     * 
+ */ + public void createFinding( + com.google.cloud.securitycenter.v1.CreateFindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateFindingMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the access control policy on the specified Source.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the settings for an organization.
+     * 
+ */ + public void getOrganizationSettings( + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetOrganizationSettingsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a source.
+     * 
+ */ + public void getSource( + com.google.cloud.securitycenter.v1.GetSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetSourceMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Filters an organization's assets and  groups them by their specified
+     * properties.
+     * 
+ */ + public void groupAssets( + com.google.cloud.securitycenter.v1.GroupAssetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGroupAssetsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Filters an organization or source's findings and  groups them by their
+     * specified properties.
+     * To group across all sources provide a `-` as the source id.
+     * Example: /v1/organizations/123/sources/-/findings
+     * 
+ */ + public void groupFindings( + com.google.cloud.securitycenter.v1.GroupFindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGroupFindingsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists an organization's assets.
+     * 
+ */ + public void listAssets( + com.google.cloud.securitycenter.v1.ListAssetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListAssetsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists an organization or source's findings.
+     * To list across all sources provide a `-` as the source id.
+     * Example: /v1/organizations/123/sources/-/findings
+     * 
+ */ + public void listFindings( + com.google.cloud.securitycenter.v1.ListFindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListFindingsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all sources belonging to an organization.
+     * 
+ */ + public void listSources( + com.google.cloud.securitycenter.v1.ListSourcesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListSourcesMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Runs asset discovery. The discovery is tracked with a long-running
+     * operation.
+     * This API can only be called with limited frequency for an organization. If
+     * it is called too frequently the caller will receive a TOO_MANY_REQUESTS
+     * error.
+     * 
+ */ + public void runAssetDiscovery( + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getRunAssetDiscoveryMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the state of a finding.
+     * 
+ */ + public void setFindingState( + com.google.cloud.securitycenter.v1.SetFindingStateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSetFindingStateMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sets the access control policy on the specified Source.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns the permissions that a caller has on the specified source.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates or updates a finding. The corresponding source must exist for a
+     * finding creation to succeed.
+     * 
+ */ + public void updateFinding( + com.google.cloud.securitycenter.v1.UpdateFindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateFindingMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an organization's settings.
+     * 
+ */ + public void updateOrganizationSettings( + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateOrganizationSettingsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a source.
+     * 
+ */ + public void updateSource( + com.google.cloud.securitycenter.v1.UpdateSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateSourceMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates security marks.
+     * 
+ */ + public void updateSecurityMarks( + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateSecurityMarksMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * V1 APIs for Security Center service.
+   * 
+ */ + public static final class SecurityCenterBlockingStub + extends io.grpc.stub.AbstractStub { + private SecurityCenterBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private SecurityCenterBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SecurityCenterBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SecurityCenterBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a source.
+     * 
+ */ + public com.google.cloud.securitycenter.v1.Source createSource( + com.google.cloud.securitycenter.v1.CreateSourceRequest request) { + return blockingUnaryCall( + getChannel(), getCreateSourceMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a finding. The corresponding source must exist for finding creation
+     * to succeed.
+     * 
+ */ + public com.google.cloud.securitycenter.v1.Finding createFinding( + com.google.cloud.securitycenter.v1.CreateFindingRequest request) { + return blockingUnaryCall( + getChannel(), getCreateFindingMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the access control policy on the specified Source.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getGetIamPolicyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the settings for an organization.
+     * 
+ */ + public com.google.cloud.securitycenter.v1.OrganizationSettings getOrganizationSettings( + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest request) { + return blockingUnaryCall( + getChannel(), getGetOrganizationSettingsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a source.
+     * 
+ */ + public com.google.cloud.securitycenter.v1.Source getSource( + com.google.cloud.securitycenter.v1.GetSourceRequest request) { + return blockingUnaryCall(getChannel(), getGetSourceMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Filters an organization's assets and  groups them by their specified
+     * properties.
+     * 
+ */ + public com.google.cloud.securitycenter.v1.GroupAssetsResponse groupAssets( + com.google.cloud.securitycenter.v1.GroupAssetsRequest request) { + return blockingUnaryCall( + getChannel(), getGroupAssetsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Filters an organization or source's findings and  groups them by their
+     * specified properties.
+     * To group across all sources provide a `-` as the source id.
+     * Example: /v1/organizations/123/sources/-/findings
+     * 
+ */ + public com.google.cloud.securitycenter.v1.GroupFindingsResponse groupFindings( + com.google.cloud.securitycenter.v1.GroupFindingsRequest request) { + return blockingUnaryCall( + getChannel(), getGroupFindingsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists an organization's assets.
+     * 
+ */ + public com.google.cloud.securitycenter.v1.ListAssetsResponse listAssets( + com.google.cloud.securitycenter.v1.ListAssetsRequest request) { + return blockingUnaryCall( + getChannel(), getListAssetsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists an organization or source's findings.
+     * To list across all sources provide a `-` as the source id.
+     * Example: /v1/organizations/123/sources/-/findings
+     * 
+ */ + public com.google.cloud.securitycenter.v1.ListFindingsResponse listFindings( + com.google.cloud.securitycenter.v1.ListFindingsRequest request) { + return blockingUnaryCall( + getChannel(), getListFindingsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all sources belonging to an organization.
+     * 
+ */ + public com.google.cloud.securitycenter.v1.ListSourcesResponse listSources( + com.google.cloud.securitycenter.v1.ListSourcesRequest request) { + return blockingUnaryCall( + getChannel(), getListSourcesMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Runs asset discovery. The discovery is tracked with a long-running
+     * operation.
+     * This API can only be called with limited frequency for an organization. If
+     * it is called too frequently the caller will receive a TOO_MANY_REQUESTS
+     * error.
+     * 
+ */ + public com.google.longrunning.Operation runAssetDiscovery( + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest request) { + return blockingUnaryCall( + getChannel(), getRunAssetDiscoveryMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the state of a finding.
+     * 
+ */ + public com.google.cloud.securitycenter.v1.Finding setFindingState( + com.google.cloud.securitycenter.v1.SetFindingStateRequest request) { + return blockingUnaryCall( + getChannel(), getSetFindingStateMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the access control policy on the specified Source.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getSetIamPolicyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the permissions that a caller has on the specified source.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return blockingUnaryCall( + getChannel(), getTestIamPermissionsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates or updates a finding. The corresponding source must exist for a
+     * finding creation to succeed.
+     * 
+ */ + public com.google.cloud.securitycenter.v1.Finding updateFinding( + com.google.cloud.securitycenter.v1.UpdateFindingRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateFindingMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an organization's settings.
+     * 
+ */ + public com.google.cloud.securitycenter.v1.OrganizationSettings updateOrganizationSettings( + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateOrganizationSettingsMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a source.
+     * 
+ */ + public com.google.cloud.securitycenter.v1.Source updateSource( + com.google.cloud.securitycenter.v1.UpdateSourceRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateSourceMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates security marks.
+     * 
+ */ + public com.google.cloud.securitycenter.v1.SecurityMarks updateSecurityMarks( + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateSecurityMarksMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * V1 APIs for Security Center service.
+   * 
+ */ + public static final class SecurityCenterFutureStub + extends io.grpc.stub.AbstractStub { + private SecurityCenterFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private SecurityCenterFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SecurityCenterFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SecurityCenterFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.Source> + createSource(com.google.cloud.securitycenter.v1.CreateSourceRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateSourceMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a finding. The corresponding source must exist for finding creation
+     * to succeed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.Finding> + createFinding(com.google.cloud.securitycenter.v1.CreateFindingRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateFindingMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the access control policy on the specified Source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the settings for an organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.OrganizationSettings> + getOrganizationSettings( + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetOrganizationSettingsMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Gets a source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.Source> + getSource(com.google.cloud.securitycenter.v1.GetSourceRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetSourceMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Filters an organization's assets and  groups them by their specified
+     * properties.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.GroupAssetsResponse> + groupAssets(com.google.cloud.securitycenter.v1.GroupAssetsRequest request) { + return futureUnaryCall( + getChannel().newCall(getGroupAssetsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Filters an organization or source's findings and  groups them by their
+     * specified properties.
+     * To group across all sources provide a `-` as the source id.
+     * Example: /v1/organizations/123/sources/-/findings
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.GroupFindingsResponse> + groupFindings(com.google.cloud.securitycenter.v1.GroupFindingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getGroupFindingsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists an organization's assets.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.ListAssetsResponse> + listAssets(com.google.cloud.securitycenter.v1.ListAssetsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListAssetsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists an organization or source's findings.
+     * To list across all sources provide a `-` as the source id.
+     * Example: /v1/organizations/123/sources/-/findings
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.ListFindingsResponse> + listFindings(com.google.cloud.securitycenter.v1.ListFindingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListFindingsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all sources belonging to an organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.ListSourcesResponse> + listSources(com.google.cloud.securitycenter.v1.ListSourcesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListSourcesMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Runs asset discovery. The discovery is tracked with a long-running
+     * operation.
+     * This API can only be called with limited frequency for an organization. If
+     * it is called too frequently the caller will receive a TOO_MANY_REQUESTS
+     * error.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + runAssetDiscovery(com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest request) { + return futureUnaryCall( + getChannel().newCall(getRunAssetDiscoveryMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the state of a finding.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.Finding> + setFindingState(com.google.cloud.securitycenter.v1.SetFindingStateRequest request) { + return futureUnaryCall( + getChannel().newCall(getSetFindingStateMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sets the access control policy on the specified Source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns the permissions that a caller has on the specified source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates or updates a finding. The corresponding source must exist for a
+     * finding creation to succeed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.Finding> + updateFinding(com.google.cloud.securitycenter.v1.UpdateFindingRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateFindingMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an organization's settings.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.OrganizationSettings> + updateOrganizationSettings( + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateOrganizationSettingsMethodHelper(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Updates a source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.Source> + updateSource(com.google.cloud.securitycenter.v1.UpdateSourceRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateSourceMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates security marks.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securitycenter.v1.SecurityMarks> + updateSecurityMarks(com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateSecurityMarksMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SOURCE = 0; + private static final int METHODID_CREATE_FINDING = 1; + private static final int METHODID_GET_IAM_POLICY = 2; + private static final int METHODID_GET_ORGANIZATION_SETTINGS = 3; + private static final int METHODID_GET_SOURCE = 4; + private static final int METHODID_GROUP_ASSETS = 5; + private static final int METHODID_GROUP_FINDINGS = 6; + private static final int METHODID_LIST_ASSETS = 7; + private static final int METHODID_LIST_FINDINGS = 8; + private static final int METHODID_LIST_SOURCES = 9; + private static final int METHODID_RUN_ASSET_DISCOVERY = 10; + private static final int METHODID_SET_FINDING_STATE = 11; + private static final int METHODID_SET_IAM_POLICY = 12; + private static final int METHODID_TEST_IAM_PERMISSIONS = 13; + private static final int METHODID_UPDATE_FINDING = 14; + private static final int METHODID_UPDATE_ORGANIZATION_SETTINGS = 15; + private static final int METHODID_UPDATE_SOURCE = 16; + private static final int METHODID_UPDATE_SECURITY_MARKS = 17; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final SecurityCenterImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SecurityCenterImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_SOURCE: + serviceImpl.createSource( + (com.google.cloud.securitycenter.v1.CreateSourceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_FINDING: + serviceImpl.createFinding( + (com.google.cloud.securitycenter.v1.CreateFindingRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ORGANIZATION_SETTINGS: + serviceImpl.getOrganizationSettings( + (com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SOURCE: + serviceImpl.getSource( + (com.google.cloud.securitycenter.v1.GetSourceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GROUP_ASSETS: + serviceImpl.groupAssets( + (com.google.cloud.securitycenter.v1.GroupAssetsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GROUP_FINDINGS: + serviceImpl.groupFindings( + (com.google.cloud.securitycenter.v1.GroupFindingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securitycenter.v1.GroupFindingsResponse>) + responseObserver); + break; + case METHODID_LIST_ASSETS: + serviceImpl.listAssets( + (com.google.cloud.securitycenter.v1.ListAssetsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_FINDINGS: + serviceImpl.listFindings( + (com.google.cloud.securitycenter.v1.ListFindingsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SOURCES: + serviceImpl.listSources( + (com.google.cloud.securitycenter.v1.ListSourcesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_RUN_ASSET_DISCOVERY: + serviceImpl.runAssetDiscovery( + (com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_FINDING_STATE: + serviceImpl.setFindingState( + (com.google.cloud.securitycenter.v1.SetFindingStateRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_FINDING: + serviceImpl.updateFinding( + (com.google.cloud.securitycenter.v1.UpdateFindingRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_ORGANIZATION_SETTINGS: + serviceImpl.updateOrganizationSettings( + (com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_SOURCE: + serviceImpl.updateSource( + (com.google.cloud.securitycenter.v1.UpdateSourceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_SECURITY_MARKS: + serviceImpl.updateSecurityMarks( + (com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class SecurityCenterBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SecurityCenterBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SecurityCenter"); + } + } + + private static final class SecurityCenterFileDescriptorSupplier + extends SecurityCenterBaseDescriptorSupplier { + SecurityCenterFileDescriptorSupplier() {} + } + + private static final class SecurityCenterMethodDescriptorSupplier + extends SecurityCenterBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SecurityCenterMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SecurityCenterGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SecurityCenterFileDescriptorSupplier()) + .addMethod(getCreateSourceMethodHelper()) + .addMethod(getCreateFindingMethodHelper()) + .addMethod(getGetIamPolicyMethodHelper()) + .addMethod(getGetOrganizationSettingsMethodHelper()) + .addMethod(getGetSourceMethodHelper()) + .addMethod(getGroupAssetsMethodHelper()) + .addMethod(getGroupFindingsMethodHelper()) + .addMethod(getListAssetsMethodHelper()) + .addMethod(getListFindingsMethodHelper()) + .addMethod(getListSourcesMethodHelper()) + .addMethod(getRunAssetDiscoveryMethodHelper()) + .addMethod(getSetFindingStateMethodHelper()) + .addMethod(getSetIamPolicyMethodHelper()) + .addMethod(getTestIamPermissionsMethodHelper()) + .addMethod(getUpdateFindingMethodHelper()) + .addMethod(getUpdateOrganizationSettingsMethodHelper()) + .addMethod(getUpdateSourceMethodHelper()) + .addMethod(getUpdateSecurityMarksMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/pom.xml b/google-api-grpc/pom.xml index 8b46d498aed1..39cf79dfb119 100644 --- a/google-api-grpc/pom.xml +++ b/google-api-grpc/pom.xml @@ -644,6 +644,16 @@ grpc-google-cloud-securitycenter-v1beta1 0.47.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-securitycenter-v1 + 0.47.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-securitycenter-v1 + 0.47.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-websecurityscanner-v1alpha @@ -697,6 +707,7 @@ grpc-google-cloud-redis-v1 grpc-google-cloud-scheduler-v1beta1 grpc-google-cloud-securitycenter-v1beta1 + grpc-google-cloud-securitycenter-v1 grpc-google-cloud-spanner-admin-database-v1 grpc-google-cloud-spanner-admin-instance-v1 grpc-google-cloud-spanner-v1 @@ -751,6 +762,7 @@ proto-google-cloud-redis-v1 proto-google-cloud-scheduler-v1beta1 proto-google-cloud-securitycenter-v1beta1 + proto-google-cloud-securitycenter-v1 proto-google-cloud-spanner-admin-database-v1 proto-google-cloud-spanner-admin-instance-v1 proto-google-cloud-spanner-v1 diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/pom.xml b/google-api-grpc/proto-google-cloud-securitycenter-v1/pom.xml new file mode 100644 index 000000000000..2daae1330ff1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/pom.xml @@ -0,0 +1,36 @@ + + 4.0.0 + proto-google-cloud-securitycenter-v1 + 0.47.1-SNAPSHOT + proto-google-cloud-securitycenter-v1 + PROTO library for proto-google-cloud-securitycenter-v1 + + com.google.api.grpc + google-api-grpc + 0.47.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api + api-common + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + com.google.api.grpc + proto-google-iam-v1 + compile + + + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Asset.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Asset.java new file mode 100644 index 000000000000..0a368c4ef733 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Asset.java @@ -0,0 +1,4586 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/asset.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud
+ * Platform (GCP) resource.
+ * The Asset is a Cloud SCC resource that captures information about a single
+ * GCP resource. All modifications to an Asset are only within the context of
+ * Cloud SCC and don't affect the referenced GCP resource.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.Asset} + */ +public final class Asset extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.Asset) + AssetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Asset.newBuilder() to construct. + private Asset(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Asset() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Asset( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.Builder subBuilder = + null; + if (securityCenterProperties_ != null) { + subBuilder = securityCenterProperties_.toBuilder(); + } + securityCenterProperties_ = + input.readMessage( + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(securityCenterProperties_); + securityCenterProperties_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + resourceProperties_ = + com.google.protobuf.MapField.newMapField( + ResourcePropertiesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry + resourceProperties__ = + input.readMessage( + ResourcePropertiesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + resourceProperties_ + .getMutableMap() + .put(resourceProperties__.getKey(), resourceProperties__.getValue()); + break; + } + case 66: + { + com.google.cloud.securitycenter.v1.SecurityMarks.Builder subBuilder = null; + if (securityMarks_ != null) { + subBuilder = securityMarks_.toBuilder(); + } + securityMarks_ = + input.readMessage( + com.google.cloud.securitycenter.v1.SecurityMarks.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(securityMarks_); + securityMarks_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 90: + { + com.google.cloud.securitycenter.v1.Asset.IamPolicy.Builder subBuilder = null; + if (iamPolicy_ != null) { + subBuilder = iamPolicy_.toBuilder(); + } + iamPolicy_ = + input.readMessage( + com.google.cloud.securitycenter.v1.Asset.IamPolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(iamPolicy_); + iamPolicy_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetResourceProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.Asset.class, + com.google.cloud.securitycenter.v1.Asset.Builder.class); + } + + public interface SecurityCenterPropertiesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The full resource name of the GCP resource this asset
+     * represents. This field is immutable after create time. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_name = 1; + */ + java.lang.String getResourceName(); + /** + * + * + *
+     * The full resource name of the GCP resource this asset
+     * represents. This field is immutable after create time. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_name = 1; + */ + com.google.protobuf.ByteString getResourceNameBytes(); + + /** + * + * + *
+     * The type of the GCP resource. Examples include: APPLICATION,
+     * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+     * Cloud SCC and/or the producer of the resource and is immutable
+     * after create time.
+     * 
+ * + * string resource_type = 2; + */ + java.lang.String getResourceType(); + /** + * + * + *
+     * The type of the GCP resource. Examples include: APPLICATION,
+     * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+     * Cloud SCC and/or the producer of the resource and is immutable
+     * after create time.
+     * 
+ * + * string resource_type = 2; + */ + com.google.protobuf.ByteString getResourceTypeBytes(); + + /** + * + * + *
+     * The full resource name of the immediate parent of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_parent = 3; + */ + java.lang.String getResourceParent(); + /** + * + * + *
+     * The full resource name of the immediate parent of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_parent = 3; + */ + com.google.protobuf.ByteString getResourceParentBytes(); + + /** + * + * + *
+     * The full resource name of the project the resource belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_project = 4; + */ + java.lang.String getResourceProject(); + /** + * + * + *
+     * The full resource name of the project the resource belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_project = 4; + */ + com.google.protobuf.ByteString getResourceProjectBytes(); + + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + */ + java.util.List getResourceOwnersList(); + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + */ + int getResourceOwnersCount(); + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + */ + java.lang.String getResourceOwners(int index); + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + */ + com.google.protobuf.ByteString getResourceOwnersBytes(int index); + } + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by Cloud SCC and
+   * cannot be modified by the user.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} + */ + public static final class SecurityCenterProperties extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) + SecurityCenterPropertiesOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecurityCenterProperties.newBuilder() to construct. + private SecurityCenterProperties(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecurityCenterProperties() { + resourceName_ = ""; + resourceType_ = ""; + resourceParent_ = ""; + resourceProject_ = ""; + resourceOwners_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecurityCenterProperties( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceName_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceType_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceParent_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceProject_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + resourceOwners_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000010; + } + resourceOwners_.add(s); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + resourceOwners_ = resourceOwners_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_SecurityCenterProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_SecurityCenterProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.class, + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.Builder.class); + } + + private int bitField0_; + public static final int RESOURCE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object resourceName_; + /** + * + * + *
+     * The full resource name of the GCP resource this asset
+     * represents. This field is immutable after create time. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_name = 1; + */ + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + 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(); + resourceName_ = s; + return s; + } + } + /** + * + * + *
+     * The full resource name of the GCP resource this asset
+     * represents. This field is immutable after create time. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_name = 1; + */ + public com.google.protobuf.ByteString getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object resourceType_; + /** + * + * + *
+     * The type of the GCP resource. Examples include: APPLICATION,
+     * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+     * Cloud SCC and/or the producer of the resource and is immutable
+     * after create time.
+     * 
+ * + * string resource_type = 2; + */ + public java.lang.String getResourceType() { + java.lang.Object ref = resourceType_; + 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(); + resourceType_ = s; + return s; + } + } + /** + * + * + *
+     * The type of the GCP resource. Examples include: APPLICATION,
+     * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+     * Cloud SCC and/or the producer of the resource and is immutable
+     * after create time.
+     * 
+ * + * string resource_type = 2; + */ + public com.google.protobuf.ByteString getResourceTypeBytes() { + java.lang.Object ref = resourceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_PARENT_FIELD_NUMBER = 3; + private volatile java.lang.Object resourceParent_; + /** + * + * + *
+     * The full resource name of the immediate parent of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_parent = 3; + */ + public java.lang.String getResourceParent() { + java.lang.Object ref = resourceParent_; + 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(); + resourceParent_ = s; + return s; + } + } + /** + * + * + *
+     * The full resource name of the immediate parent of the resource. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_parent = 3; + */ + public com.google.protobuf.ByteString getResourceParentBytes() { + java.lang.Object ref = resourceParent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceParent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_PROJECT_FIELD_NUMBER = 4; + private volatile java.lang.Object resourceProject_; + /** + * + * + *
+     * The full resource name of the project the resource belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_project = 4; + */ + public java.lang.String getResourceProject() { + java.lang.Object ref = resourceProject_; + 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(); + resourceProject_ = s; + return s; + } + } + /** + * + * + *
+     * The full resource name of the project the resource belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * 
+ * + * string resource_project = 4; + */ + public com.google.protobuf.ByteString getResourceProjectBytes() { + java.lang.Object ref = resourceProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_OWNERS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList resourceOwners_; + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + */ + public com.google.protobuf.ProtocolStringList getResourceOwnersList() { + return resourceOwners_; + } + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + */ + public int getResourceOwnersCount() { + return resourceOwners_.size(); + } + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + */ + public java.lang.String getResourceOwners(int index) { + return resourceOwners_.get(index); + } + /** + * + * + *
+     * Owners of the Google Cloud resource.
+     * 
+ * + * repeated string resource_owners = 5; + */ + public com.google.protobuf.ByteString getResourceOwnersBytes(int index) { + return resourceOwners_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getResourceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceName_); + } + if (!getResourceTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceType_); + } + if (!getResourceParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, resourceParent_); + } + if (!getResourceProjectBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, resourceProject_); + } + for (int i = 0; i < resourceOwners_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, resourceOwners_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getResourceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceName_); + } + if (!getResourceTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceType_); + } + if (!getResourceParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, resourceParent_); + } + if (!getResourceProjectBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, resourceProject_); + } + { + int dataSize = 0; + for (int i = 0; i < resourceOwners_.size(); i++) { + dataSize += computeStringSizeNoTag(resourceOwners_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourceOwnersList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties other = + (com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) obj; + + boolean result = true; + result = result && getResourceName().equals(other.getResourceName()); + result = result && getResourceType().equals(other.getResourceType()); + result = result && getResourceParent().equals(other.getResourceParent()); + result = result && getResourceProject().equals(other.getResourceProject()); + result = result && getResourceOwnersList().equals(other.getResourceOwnersList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getResourceName().hashCode(); + hash = (37 * hash) + RESOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getResourceType().hashCode(); + hash = (37 * hash) + RESOURCE_PARENT_FIELD_NUMBER; + hash = (53 * hash) + getResourceParent().hashCode(); + hash = (37 * hash) + RESOURCE_PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getResourceProject().hashCode(); + if (getResourceOwnersCount() > 0) { + hash = (37 * hash) + RESOURCE_OWNERS_FIELD_NUMBER; + hash = (53 * hash) + getResourceOwnersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties 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.v1.Asset.SecurityCenterProperties parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties 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.v1.Asset.SecurityCenterProperties parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties 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.v1.Asset.SecurityCenterProperties + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + 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.v1.Asset.SecurityCenterProperties parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties 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.v1.Asset.SecurityCenterProperties 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; + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by Cloud SCC and
+     * cannot be modified by the user.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.Asset.SecurityCenterProperties} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) + com.google.cloud.securitycenter.v1.Asset.SecurityCenterPropertiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_SecurityCenterProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_SecurityCenterProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.class, + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + resourceName_ = ""; + + resourceType_ = ""; + + resourceParent_ = ""; + + resourceProject_ = ""; + + resourceOwners_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_SecurityCenterProperties_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties build() { + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties buildPartial() { + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties result = + new com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.resourceName_ = resourceName_; + result.resourceType_ = resourceType_; + result.resourceParent_ = resourceParent_; + result.resourceProject_ = resourceProject_; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + resourceOwners_ = resourceOwners_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.resourceOwners_ = resourceOwners_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) { + return mergeFrom( + (com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties other) { + if (other + == com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + .getDefaultInstance()) return this; + if (!other.getResourceName().isEmpty()) { + resourceName_ = other.resourceName_; + onChanged(); + } + if (!other.getResourceType().isEmpty()) { + resourceType_ = other.resourceType_; + onChanged(); + } + if (!other.getResourceParent().isEmpty()) { + resourceParent_ = other.resourceParent_; + onChanged(); + } + if (!other.getResourceProject().isEmpty()) { + resourceProject_ = other.resourceProject_; + onChanged(); + } + if (!other.resourceOwners_.isEmpty()) { + if (resourceOwners_.isEmpty()) { + resourceOwners_ = other.resourceOwners_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureResourceOwnersIsMutable(); + resourceOwners_.addAll(other.resourceOwners_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object resourceName_ = ""; + /** + * + * + *
+       * The full resource name of the GCP resource this asset
+       * represents. This field is immutable after create time. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_name = 1; + */ + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The full resource name of the GCP resource this asset
+       * represents. This field is immutable after create time. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_name = 1; + */ + public com.google.protobuf.ByteString getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The full resource name of the GCP resource this asset
+       * represents. This field is immutable after create time. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_name = 1; + */ + public Builder setResourceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The full resource name of the GCP resource this asset
+       * represents. This field is immutable after create time. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_name = 1; + */ + public Builder clearResourceName() { + + resourceName_ = getDefaultInstance().getResourceName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The full resource name of the GCP resource this asset
+       * represents. This field is immutable after create time. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_name = 1; + */ + public Builder setResourceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceName_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceType_ = ""; + /** + * + * + *
+       * The type of the GCP resource. Examples include: APPLICATION,
+       * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+       * Cloud SCC and/or the producer of the resource and is immutable
+       * after create time.
+       * 
+ * + * string resource_type = 2; + */ + public java.lang.String getResourceType() { + java.lang.Object ref = resourceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The type of the GCP resource. Examples include: APPLICATION,
+       * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+       * Cloud SCC and/or the producer of the resource and is immutable
+       * after create time.
+       * 
+ * + * string resource_type = 2; + */ + public com.google.protobuf.ByteString getResourceTypeBytes() { + java.lang.Object ref = resourceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The type of the GCP resource. Examples include: APPLICATION,
+       * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+       * Cloud SCC and/or the producer of the resource and is immutable
+       * after create time.
+       * 
+ * + * string resource_type = 2; + */ + public Builder setResourceType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The type of the GCP resource. Examples include: APPLICATION,
+       * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+       * Cloud SCC and/or the producer of the resource and is immutable
+       * after create time.
+       * 
+ * + * string resource_type = 2; + */ + public Builder clearResourceType() { + + resourceType_ = getDefaultInstance().getResourceType(); + onChanged(); + return this; + } + /** + * + * + *
+       * The type of the GCP resource. Examples include: APPLICATION,
+       * PROJECT, and ORGANIZATION. This is a case insensitive field defined by
+       * Cloud SCC and/or the producer of the resource and is immutable
+       * after create time.
+       * 
+ * + * string resource_type = 2; + */ + public Builder setResourceTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceType_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceParent_ = ""; + /** + * + * + *
+       * The full resource name of the immediate parent of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_parent = 3; + */ + public java.lang.String getResourceParent() { + java.lang.Object ref = resourceParent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceParent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The full resource name of the immediate parent of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_parent = 3; + */ + public com.google.protobuf.ByteString getResourceParentBytes() { + java.lang.Object ref = resourceParent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceParent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The full resource name of the immediate parent of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_parent = 3; + */ + public Builder setResourceParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceParent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The full resource name of the immediate parent of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_parent = 3; + */ + public Builder clearResourceParent() { + + resourceParent_ = getDefaultInstance().getResourceParent(); + onChanged(); + return this; + } + /** + * + * + *
+       * The full resource name of the immediate parent of the resource. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_parent = 3; + */ + public Builder setResourceParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceParent_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceProject_ = ""; + /** + * + * + *
+       * The full resource name of the project the resource belongs to. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_project = 4; + */ + public java.lang.String getResourceProject() { + java.lang.Object ref = resourceProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceProject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The full resource name of the project the resource belongs to. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_project = 4; + */ + public com.google.protobuf.ByteString getResourceProjectBytes() { + java.lang.Object ref = resourceProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The full resource name of the project the resource belongs to. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_project = 4; + */ + public Builder setResourceProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceProject_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The full resource name of the project the resource belongs to. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_project = 4; + */ + public Builder clearResourceProject() { + + resourceProject_ = getDefaultInstance().getResourceProject(); + onChanged(); + return this; + } + /** + * + * + *
+       * The full resource name of the project the resource belongs to. See:
+       * https://cloud.google.com/apis/design/resource_names#full_resource_name
+       * 
+ * + * string resource_project = 4; + */ + public Builder setResourceProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceProject_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList resourceOwners_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureResourceOwnersIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + resourceOwners_ = new com.google.protobuf.LazyStringArrayList(resourceOwners_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + */ + public com.google.protobuf.ProtocolStringList getResourceOwnersList() { + return resourceOwners_.getUnmodifiableView(); + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + */ + public int getResourceOwnersCount() { + return resourceOwners_.size(); + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + */ + public java.lang.String getResourceOwners(int index) { + return resourceOwners_.get(index); + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + */ + public com.google.protobuf.ByteString getResourceOwnersBytes(int index) { + return resourceOwners_.getByteString(index); + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + */ + public Builder setResourceOwners(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceOwnersIsMutable(); + resourceOwners_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + */ + public Builder addResourceOwners(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceOwnersIsMutable(); + resourceOwners_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + */ + public Builder addAllResourceOwners(java.lang.Iterable values) { + ensureResourceOwnersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resourceOwners_); + onChanged(); + return this; + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + */ + public Builder clearResourceOwners() { + resourceOwners_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+       * Owners of the Google Cloud resource.
+       * 
+ * + * repeated string resource_owners = 5; + */ + public Builder addResourceOwnersBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourceOwnersIsMutable(); + resourceOwners_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.Asset.SecurityCenterProperties) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.Asset.SecurityCenterProperties) + private static final com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties(); + } + + public static com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecurityCenterProperties parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecurityCenterProperties(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface IamPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.Asset.IamPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The JSON representation of the Policy associated with the asset.
+     * See https://cloud.google.com/iam/reference/rest/v1/Policy for format
+     * details.
+     * 
+ * + * string policy_blob = 1; + */ + java.lang.String getPolicyBlob(); + /** + * + * + *
+     * The JSON representation of the Policy associated with the asset.
+     * See https://cloud.google.com/iam/reference/rest/v1/Policy for format
+     * details.
+     * 
+ * + * string policy_blob = 1; + */ + com.google.protobuf.ByteString getPolicyBlobBytes(); + } + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.Asset.IamPolicy} + */ + public static final class IamPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.Asset.IamPolicy) + IamPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use IamPolicy.newBuilder() to construct. + private IamPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IamPolicy() { + policyBlob_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IamPolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + policyBlob_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_IamPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_IamPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.Asset.IamPolicy.class, + com.google.cloud.securitycenter.v1.Asset.IamPolicy.Builder.class); + } + + public static final int POLICY_BLOB_FIELD_NUMBER = 1; + private volatile java.lang.Object policyBlob_; + /** + * + * + *
+     * The JSON representation of the Policy associated with the asset.
+     * See https://cloud.google.com/iam/reference/rest/v1/Policy for format
+     * details.
+     * 
+ * + * string policy_blob = 1; + */ + public java.lang.String getPolicyBlob() { + java.lang.Object ref = policyBlob_; + 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(); + policyBlob_ = s; + return s; + } + } + /** + * + * + *
+     * The JSON representation of the Policy associated with the asset.
+     * See https://cloud.google.com/iam/reference/rest/v1/Policy for format
+     * details.
+     * 
+ * + * string policy_blob = 1; + */ + public com.google.protobuf.ByteString getPolicyBlobBytes() { + java.lang.Object ref = policyBlob_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyBlob_ = 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 (!getPolicyBlobBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, policyBlob_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPolicyBlobBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, policyBlob_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.Asset.IamPolicy)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.Asset.IamPolicy other = + (com.google.cloud.securitycenter.v1.Asset.IamPolicy) obj; + + boolean result = true; + result = result && getPolicyBlob().equals(other.getPolicyBlob()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + POLICY_BLOB_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBlob().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.Asset.IamPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Asset.IamPolicy 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.v1.Asset.IamPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Asset.IamPolicy 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.v1.Asset.IamPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Asset.IamPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.Asset.IamPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Asset.IamPolicy 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.v1.Asset.IamPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Asset.IamPolicy 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.v1.Asset.IamPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Asset.IamPolicy 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.v1.Asset.IamPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.Asset.IamPolicy} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.Asset.IamPolicy) + com.google.cloud.securitycenter.v1.Asset.IamPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_IamPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_IamPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.Asset.IamPolicy.class, + com.google.cloud.securitycenter.v1.Asset.IamPolicy.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.Asset.IamPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + policyBlob_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_IamPolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Asset.IamPolicy getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.Asset.IamPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Asset.IamPolicy build() { + com.google.cloud.securitycenter.v1.Asset.IamPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Asset.IamPolicy buildPartial() { + com.google.cloud.securitycenter.v1.Asset.IamPolicy result = + new com.google.cloud.securitycenter.v1.Asset.IamPolicy(this); + result.policyBlob_ = policyBlob_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.Asset.IamPolicy) { + return mergeFrom((com.google.cloud.securitycenter.v1.Asset.IamPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.Asset.IamPolicy other) { + if (other == com.google.cloud.securitycenter.v1.Asset.IamPolicy.getDefaultInstance()) + return this; + if (!other.getPolicyBlob().isEmpty()) { + policyBlob_ = other.policyBlob_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.Asset.IamPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.Asset.IamPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object policyBlob_ = ""; + /** + * + * + *
+       * The JSON representation of the Policy associated with the asset.
+       * See https://cloud.google.com/iam/reference/rest/v1/Policy for format
+       * details.
+       * 
+ * + * string policy_blob = 1; + */ + public java.lang.String getPolicyBlob() { + java.lang.Object ref = policyBlob_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policyBlob_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The JSON representation of the Policy associated with the asset.
+       * See https://cloud.google.com/iam/reference/rest/v1/Policy for format
+       * details.
+       * 
+ * + * string policy_blob = 1; + */ + public com.google.protobuf.ByteString getPolicyBlobBytes() { + java.lang.Object ref = policyBlob_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyBlob_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The JSON representation of the Policy associated with the asset.
+       * See https://cloud.google.com/iam/reference/rest/v1/Policy for format
+       * details.
+       * 
+ * + * string policy_blob = 1; + */ + public Builder setPolicyBlob(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + policyBlob_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The JSON representation of the Policy associated with the asset.
+       * See https://cloud.google.com/iam/reference/rest/v1/Policy for format
+       * details.
+       * 
+ * + * string policy_blob = 1; + */ + public Builder clearPolicyBlob() { + + policyBlob_ = getDefaultInstance().getPolicyBlob(); + onChanged(); + return this; + } + /** + * + * + *
+       * The JSON representation of the Policy associated with the asset.
+       * See https://cloud.google.com/iam/reference/rest/v1/Policy for format
+       * details.
+       * 
+ * + * string policy_blob = 1; + */ + public Builder setPolicyBlobBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + policyBlob_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.Asset.IamPolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.Asset.IamPolicy) + private static final com.google.cloud.securitycenter.v1.Asset.IamPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.Asset.IamPolicy(); + } + + public static com.google.cloud.securitycenter.v1.Asset.IamPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IamPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IamPolicy(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Asset.IamPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The relative resource name of this asset. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/assets/456".
+   * 
+ * + * string name = 1; + */ + 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 relative resource name of this asset. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/assets/456".
+   * 
+ * + * string name = 1; + */ + 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 SECURITY_CENTER_PROPERTIES_FIELD_NUMBER = 2; + private com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + securityCenterProperties_; + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public boolean hasSecurityCenterProperties() { + return securityCenterProperties_ != null; + } + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + getSecurityCenterProperties() { + return securityCenterProperties_ == null + ? com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.getDefaultInstance() + : securityCenterProperties_; + } + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public com.google.cloud.securitycenter.v1.Asset.SecurityCenterPropertiesOrBuilder + getSecurityCenterPropertiesOrBuilder() { + return getSecurityCenterProperties(); + } + + public static final int RESOURCE_PROPERTIES_FIELD_NUMBER = 7; + + private static final class ResourcePropertiesDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_ResourcePropertiesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField + resourceProperties_; + + private com.google.protobuf.MapField + internalGetResourceProperties() { + if (resourceProperties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ResourcePropertiesDefaultEntryHolder.defaultEntry); + } + return resourceProperties_; + } + + public int getResourcePropertiesCount() { + return internalGetResourceProperties().getMap().size(); + } + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public boolean containsResourceProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetResourceProperties().getMap().containsKey(key); + } + /** Use {@link #getResourcePropertiesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getResourceProperties() { + return getResourcePropertiesMap(); + } + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public java.util.Map getResourcePropertiesMap() { + return internalGetResourceProperties().getMap(); + } + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public com.google.protobuf.Value getResourcePropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetResourceProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public com.google.protobuf.Value getResourcePropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetResourceProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SECURITY_MARKS_FIELD_NUMBER = 8; + private com.google.cloud.securitycenter.v1.SecurityMarks securityMarks_; + /** + * + * + *
+   * User specified security marks. These marks are entirely managed by the user
+   * and come from the SecurityMarks resource that belongs to the asset.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public boolean hasSecurityMarks() { + return securityMarks_ != null; + } + /** + * + * + *
+   * User specified security marks. These marks are entirely managed by the user
+   * and come from the SecurityMarks resource that belongs to the asset.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1.SecurityMarks getSecurityMarks() { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } + /** + * + * + *
+   * User specified security marks. These marks are entirely managed by the user
+   * and come from the SecurityMarks resource that belongs to the asset.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder getSecurityMarksOrBuilder() { + return getSecurityMarks(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time at which the asset was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time at which the asset was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time at which the asset was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * The time at which the asset was last updated, added, or deleted in Cloud
+   * SCC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * The time at which the asset was last updated, added, or deleted in Cloud
+   * SCC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * The time at which the asset was last updated, added, or deleted in Cloud
+   * SCC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int IAM_POLICY_FIELD_NUMBER = 11; + private com.google.cloud.securitycenter.v1.Asset.IamPolicy iamPolicy_; + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + public boolean hasIamPolicy() { + return iamPolicy_ != null; + } + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + public com.google.cloud.securitycenter.v1.Asset.IamPolicy getIamPolicy() { + return iamPolicy_ == null + ? com.google.cloud.securitycenter.v1.Asset.IamPolicy.getDefaultInstance() + : iamPolicy_; + } + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + public com.google.cloud.securitycenter.v1.Asset.IamPolicyOrBuilder getIamPolicyOrBuilder() { + return getIamPolicy(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (securityCenterProperties_ != null) { + output.writeMessage(2, getSecurityCenterProperties()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetResourceProperties(), + ResourcePropertiesDefaultEntryHolder.defaultEntry, + 7); + if (securityMarks_ != null) { + output.writeMessage(8, getSecurityMarks()); + } + if (createTime_ != null) { + output.writeMessage(9, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(10, getUpdateTime()); + } + if (iamPolicy_ != null) { + output.writeMessage(11, getIamPolicy()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (securityCenterProperties_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getSecurityCenterProperties()); + } + for (java.util.Map.Entry entry : + internalGetResourceProperties().getMap().entrySet()) { + com.google.protobuf.MapEntry + resourceProperties__ = + ResourcePropertiesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, resourceProperties__); + } + if (securityMarks_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSecurityMarks()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getUpdateTime()); + } + if (iamPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getIamPolicy()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.Asset)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.Asset other = (com.google.cloud.securitycenter.v1.Asset) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && (hasSecurityCenterProperties() == other.hasSecurityCenterProperties()); + if (hasSecurityCenterProperties()) { + result = result && getSecurityCenterProperties().equals(other.getSecurityCenterProperties()); + } + result = + result && internalGetResourceProperties().equals(other.internalGetResourceProperties()); + result = result && (hasSecurityMarks() == other.hasSecurityMarks()); + if (hasSecurityMarks()) { + result = result && getSecurityMarks().equals(other.getSecurityMarks()); + } + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime().equals(other.getCreateTime()); + } + result = result && (hasUpdateTime() == other.hasUpdateTime()); + if (hasUpdateTime()) { + result = result && getUpdateTime().equals(other.getUpdateTime()); + } + result = result && (hasIamPolicy() == other.hasIamPolicy()); + if (hasIamPolicy()) { + result = result && getIamPolicy().equals(other.getIamPolicy()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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(); + if (hasSecurityCenterProperties()) { + hash = (37 * hash) + SECURITY_CENTER_PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getSecurityCenterProperties().hashCode(); + } + if (!internalGetResourceProperties().getMap().isEmpty()) { + hash = (37 * hash) + RESOURCE_PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + internalGetResourceProperties().hashCode(); + } + if (hasSecurityMarks()) { + hash = (37 * hash) + SECURITY_MARKS_FIELD_NUMBER; + hash = (53 * hash) + getSecurityMarks().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasIamPolicy()) { + hash = (37 * hash) + IAM_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getIamPolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.Asset parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Asset 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.v1.Asset parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Asset 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.v1.Asset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Asset parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.Asset parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Asset 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.v1.Asset parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Asset 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.v1.Asset parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Asset 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.v1.Asset 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; + } + /** + * + * + *
+   * Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud
+   * Platform (GCP) resource.
+   * The Asset is a Cloud SCC resource that captures information about a single
+   * GCP resource. All modifications to an Asset are only within the context of
+   * Cloud SCC and don't affect the referenced GCP resource.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.Asset} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.Asset) + com.google.cloud.securitycenter.v1.AssetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetResourceProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableResourceProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.Asset.class, + com.google.cloud.securitycenter.v1.Asset.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.Asset.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (securityCenterPropertiesBuilder_ == null) { + securityCenterProperties_ = null; + } else { + securityCenterProperties_ = null; + securityCenterPropertiesBuilder_ = null; + } + internalGetMutableResourceProperties().clear(); + if (securityMarksBuilder_ == null) { + securityMarks_ = null; + } else { + securityMarks_ = null; + securityMarksBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (iamPolicyBuilder_ == null) { + iamPolicy_ = null; + } else { + iamPolicy_ = null; + iamPolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.AssetOuterClass + .internal_static_google_cloud_securitycenter_v1_Asset_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Asset getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.Asset.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Asset build() { + com.google.cloud.securitycenter.v1.Asset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Asset buildPartial() { + com.google.cloud.securitycenter.v1.Asset result = + new com.google.cloud.securitycenter.v1.Asset(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (securityCenterPropertiesBuilder_ == null) { + result.securityCenterProperties_ = securityCenterProperties_; + } else { + result.securityCenterProperties_ = securityCenterPropertiesBuilder_.build(); + } + result.resourceProperties_ = internalGetResourceProperties(); + result.resourceProperties_.makeImmutable(); + if (securityMarksBuilder_ == null) { + result.securityMarks_ = securityMarks_; + } else { + result.securityMarks_ = securityMarksBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (iamPolicyBuilder_ == null) { + result.iamPolicy_ = iamPolicy_; + } else { + result.iamPolicy_ = iamPolicyBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.Asset) { + return mergeFrom((com.google.cloud.securitycenter.v1.Asset) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.Asset other) { + if (other == com.google.cloud.securitycenter.v1.Asset.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasSecurityCenterProperties()) { + mergeSecurityCenterProperties(other.getSecurityCenterProperties()); + } + internalGetMutableResourceProperties().mergeFrom(other.internalGetResourceProperties()); + if (other.hasSecurityMarks()) { + mergeSecurityMarks(other.getSecurityMarks()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasIamPolicy()) { + mergeIamPolicy(other.getIamPolicy()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.Asset parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1.Asset) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The relative resource name of this asset. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/assets/456".
+     * 
+ * + * string name = 1; + */ + 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 relative resource name of this asset. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/assets/456".
+     * 
+ * + * string name = 1; + */ + 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 relative resource name of this asset. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/assets/456".
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this asset. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/assets/456".
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this asset. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/assets/456".
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + securityCenterProperties_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties, + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.Builder, + com.google.cloud.securitycenter.v1.Asset.SecurityCenterPropertiesOrBuilder> + securityCenterPropertiesBuilder_; + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public boolean hasSecurityCenterProperties() { + return securityCenterPropertiesBuilder_ != null || securityCenterProperties_ != null; + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties + getSecurityCenterProperties() { + if (securityCenterPropertiesBuilder_ == null) { + return securityCenterProperties_ == null + ? com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.getDefaultInstance() + : securityCenterProperties_; + } else { + return securityCenterPropertiesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public Builder setSecurityCenterProperties( + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties value) { + if (securityCenterPropertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + securityCenterProperties_ = value; + onChanged(); + } else { + securityCenterPropertiesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public Builder setSecurityCenterProperties( + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.Builder builderForValue) { + if (securityCenterPropertiesBuilder_ == null) { + securityCenterProperties_ = builderForValue.build(); + onChanged(); + } else { + securityCenterPropertiesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public Builder mergeSecurityCenterProperties( + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties value) { + if (securityCenterPropertiesBuilder_ == null) { + if (securityCenterProperties_ != null) { + securityCenterProperties_ = + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.newBuilder( + securityCenterProperties_) + .mergeFrom(value) + .buildPartial(); + } else { + securityCenterProperties_ = value; + } + onChanged(); + } else { + securityCenterPropertiesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public Builder clearSecurityCenterProperties() { + if (securityCenterPropertiesBuilder_ == null) { + securityCenterProperties_ = null; + onChanged(); + } else { + securityCenterProperties_ = null; + securityCenterPropertiesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.Builder + getSecurityCenterPropertiesBuilder() { + + onChanged(); + return getSecurityCenterPropertiesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + public com.google.cloud.securitycenter.v1.Asset.SecurityCenterPropertiesOrBuilder + getSecurityCenterPropertiesOrBuilder() { + if (securityCenterPropertiesBuilder_ != null) { + return securityCenterPropertiesBuilder_.getMessageOrBuilder(); + } else { + return securityCenterProperties_ == null + ? com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.getDefaultInstance() + : securityCenterProperties_; + } + } + /** + * + * + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties, + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.Builder, + com.google.cloud.securitycenter.v1.Asset.SecurityCenterPropertiesOrBuilder> + getSecurityCenterPropertiesFieldBuilder() { + if (securityCenterPropertiesBuilder_ == null) { + securityCenterPropertiesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties, + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties.Builder, + com.google.cloud.securitycenter.v1.Asset.SecurityCenterPropertiesOrBuilder>( + getSecurityCenterProperties(), getParentForChildren(), isClean()); + securityCenterProperties_ = null; + } + return securityCenterPropertiesBuilder_; + } + + private com.google.protobuf.MapField + resourceProperties_; + + private com.google.protobuf.MapField + internalGetResourceProperties() { + if (resourceProperties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ResourcePropertiesDefaultEntryHolder.defaultEntry); + } + return resourceProperties_; + } + + private com.google.protobuf.MapField + internalGetMutableResourceProperties() { + onChanged(); + ; + if (resourceProperties_ == null) { + resourceProperties_ = + com.google.protobuf.MapField.newMapField( + ResourcePropertiesDefaultEntryHolder.defaultEntry); + } + if (!resourceProperties_.isMutable()) { + resourceProperties_ = resourceProperties_.copy(); + } + return resourceProperties_; + } + + public int getResourcePropertiesCount() { + return internalGetResourceProperties().getMap().size(); + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public boolean containsResourceProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetResourceProperties().getMap().containsKey(key); + } + /** Use {@link #getResourcePropertiesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getResourceProperties() { + return getResourcePropertiesMap(); + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public java.util.Map getResourcePropertiesMap() { + return internalGetResourceProperties().getMap(); + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public com.google.protobuf.Value getResourcePropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetResourceProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public com.google.protobuf.Value getResourcePropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetResourceProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearResourceProperties() { + internalGetMutableResourceProperties().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public Builder removeResourceProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableResourceProperties().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableResourceProperties() { + return internalGetMutableResourceProperties().getMutableMap(); + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public Builder putResourceProperties(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableResourceProperties().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Resource managed properties. These properties are managed and defined by
+     * the GCP resource and cannot be modified by the user.
+     * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + public Builder putAllResourceProperties( + java.util.Map values) { + internalGetMutableResourceProperties().getMutableMap().putAll(values); + return this; + } + + private com.google.cloud.securitycenter.v1.SecurityMarks securityMarks_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.SecurityMarks, + com.google.cloud.securitycenter.v1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder> + securityMarksBuilder_; + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public boolean hasSecurityMarks() { + return securityMarksBuilder_ != null || securityMarks_ != null; + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1.SecurityMarks getSecurityMarks() { + if (securityMarksBuilder_ == null) { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } else { + return securityMarksBuilder_.getMessage(); + } + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public Builder setSecurityMarks(com.google.cloud.securitycenter.v1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + securityMarks_ = value; + onChanged(); + } else { + securityMarksBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public Builder setSecurityMarks( + com.google.cloud.securitycenter.v1.SecurityMarks.Builder builderForValue) { + if (securityMarksBuilder_ == null) { + securityMarks_ = builderForValue.build(); + onChanged(); + } else { + securityMarksBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public Builder mergeSecurityMarks(com.google.cloud.securitycenter.v1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (securityMarks_ != null) { + securityMarks_ = + com.google.cloud.securitycenter.v1.SecurityMarks.newBuilder(securityMarks_) + .mergeFrom(value) + .buildPartial(); + } else { + securityMarks_ = value; + } + onChanged(); + } else { + securityMarksBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public Builder clearSecurityMarks() { + if (securityMarksBuilder_ == null) { + securityMarks_ = null; + onChanged(); + } else { + securityMarks_ = null; + securityMarksBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1.SecurityMarks.Builder getSecurityMarksBuilder() { + + onChanged(); + return getSecurityMarksFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder getSecurityMarksOrBuilder() { + if (securityMarksBuilder_ != null) { + return securityMarksBuilder_.getMessageOrBuilder(); + } else { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } + } + /** + * + * + *
+     * User specified security marks. These marks are entirely managed by the user
+     * and come from the SecurityMarks resource that belongs to the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.SecurityMarks, + com.google.cloud.securitycenter.v1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder> + getSecurityMarksFieldBuilder() { + if (securityMarksBuilder_ == null) { + securityMarksBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.SecurityMarks, + com.google.cloud.securitycenter.v1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder>( + getSecurityMarks(), getParentForChildren(), isClean()); + securityMarks_ = null; + } + return securityMarksBuilder_; + } + + private com.google.protobuf.Timestamp createTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time at which the asset was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * The time at which the asset was last updated, added, or deleted in Cloud
+     * SCC.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.cloud.securitycenter.v1.Asset.IamPolicy iamPolicy_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Asset.IamPolicy, + com.google.cloud.securitycenter.v1.Asset.IamPolicy.Builder, + com.google.cloud.securitycenter.v1.Asset.IamPolicyOrBuilder> + iamPolicyBuilder_; + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + public boolean hasIamPolicy() { + return iamPolicyBuilder_ != null || iamPolicy_ != null; + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + public com.google.cloud.securitycenter.v1.Asset.IamPolicy getIamPolicy() { + if (iamPolicyBuilder_ == null) { + return iamPolicy_ == null + ? com.google.cloud.securitycenter.v1.Asset.IamPolicy.getDefaultInstance() + : iamPolicy_; + } else { + return iamPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + public Builder setIamPolicy(com.google.cloud.securitycenter.v1.Asset.IamPolicy value) { + if (iamPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + iamPolicy_ = value; + onChanged(); + } else { + iamPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + public Builder setIamPolicy( + com.google.cloud.securitycenter.v1.Asset.IamPolicy.Builder builderForValue) { + if (iamPolicyBuilder_ == null) { + iamPolicy_ = builderForValue.build(); + onChanged(); + } else { + iamPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + public Builder mergeIamPolicy(com.google.cloud.securitycenter.v1.Asset.IamPolicy value) { + if (iamPolicyBuilder_ == null) { + if (iamPolicy_ != null) { + iamPolicy_ = + com.google.cloud.securitycenter.v1.Asset.IamPolicy.newBuilder(iamPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + iamPolicy_ = value; + } + onChanged(); + } else { + iamPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + public Builder clearIamPolicy() { + if (iamPolicyBuilder_ == null) { + iamPolicy_ = null; + onChanged(); + } else { + iamPolicy_ = null; + iamPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + public com.google.cloud.securitycenter.v1.Asset.IamPolicy.Builder getIamPolicyBuilder() { + + onChanged(); + return getIamPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + public com.google.cloud.securitycenter.v1.Asset.IamPolicyOrBuilder getIamPolicyOrBuilder() { + if (iamPolicyBuilder_ != null) { + return iamPolicyBuilder_.getMessageOrBuilder(); + } else { + return iamPolicy_ == null + ? com.google.cloud.securitycenter.v1.Asset.IamPolicy.getDefaultInstance() + : iamPolicy_; + } + } + /** + * + * + *
+     * IAM Policy information associated with the GCP resource described by the
+     * Cloud SCC asset. This information is managed and defined by the GCP
+     * resource and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Asset.IamPolicy, + com.google.cloud.securitycenter.v1.Asset.IamPolicy.Builder, + com.google.cloud.securitycenter.v1.Asset.IamPolicyOrBuilder> + getIamPolicyFieldBuilder() { + if (iamPolicyBuilder_ == null) { + iamPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Asset.IamPolicy, + com.google.cloud.securitycenter.v1.Asset.IamPolicy.Builder, + com.google.cloud.securitycenter.v1.Asset.IamPolicyOrBuilder>( + getIamPolicy(), getParentForChildren(), isClean()); + iamPolicy_ = null; + } + return iamPolicyBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.Asset) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.Asset) + private static final com.google.cloud.securitycenter.v1.Asset DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.Asset(); + } + + public static com.google.cloud.securitycenter.v1.Asset getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Asset parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Asset(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Asset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/AssetOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/AssetOrBuilder.java new file mode 100644 index 000000000000..c0da01733dc4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/AssetOrBuilder.java @@ -0,0 +1,274 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/asset.proto + +package com.google.cloud.securitycenter.v1; + +public interface AssetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.Asset) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The relative resource name of this asset. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/assets/456".
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The relative resource name of this asset. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/assets/456".
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + boolean hasSecurityCenterProperties(); + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + com.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties getSecurityCenterProperties(); + /** + * + * + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * + * .google.cloud.securitycenter.v1.Asset.SecurityCenterProperties security_center_properties = 2; + * + */ + com.google.cloud.securitycenter.v1.Asset.SecurityCenterPropertiesOrBuilder + getSecurityCenterPropertiesOrBuilder(); + + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + int getResourcePropertiesCount(); + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + boolean containsResourceProperties(java.lang.String key); + /** Use {@link #getResourcePropertiesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getResourceProperties(); + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + java.util.Map getResourcePropertiesMap(); + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + com.google.protobuf.Value getResourcePropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Resource managed properties. These properties are managed and defined by
+   * the GCP resource and cannot be modified by the user.
+   * 
+ * + * map<string, .google.protobuf.Value> resource_properties = 7; + */ + com.google.protobuf.Value getResourcePropertiesOrThrow(java.lang.String key); + + /** + * + * + *
+   * User specified security marks. These marks are entirely managed by the user
+   * and come from the SecurityMarks resource that belongs to the asset.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + boolean hasSecurityMarks(); + /** + * + * + *
+   * User specified security marks. These marks are entirely managed by the user
+   * and come from the SecurityMarks resource that belongs to the asset.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + com.google.cloud.securitycenter.v1.SecurityMarks getSecurityMarks(); + /** + * + * + *
+   * User specified security marks. These marks are entirely managed by the user
+   * and come from the SecurityMarks resource that belongs to the asset.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder getSecurityMarksOrBuilder(); + + /** + * + * + *
+   * The time at which the asset was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time at which the asset was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time at which the asset was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the asset was last updated, added, or deleted in Cloud
+   * SCC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * The time at which the asset was last updated, added, or deleted in Cloud
+   * SCC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * The time at which the asset was last updated, added, or deleted in Cloud
+   * SCC.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + boolean hasIamPolicy(); + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + com.google.cloud.securitycenter.v1.Asset.IamPolicy getIamPolicy(); + /** + * + * + *
+   * IAM Policy information associated with the GCP resource described by the
+   * Cloud SCC asset. This information is managed and defined by the GCP
+   * resource and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1.Asset.IamPolicy iam_policy = 11; + */ + com.google.cloud.securitycenter.v1.Asset.IamPolicyOrBuilder getIamPolicyOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/AssetOuterClass.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/AssetOuterClass.java new file mode 100644 index 000000000000..c60e79cade03 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/AssetOuterClass.java @@ -0,0 +1,130 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/asset.proto + +package com.google.cloud.securitycenter.v1; + +public final class AssetOuterClass { + private AssetOuterClass() {} + + 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_v1_Asset_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_Asset_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_Asset_SecurityCenterProperties_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_Asset_SecurityCenterProperties_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_Asset_IamPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_Asset_IamPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_Asset_ResourcePropertiesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_Asset_ResourcePropertiesEntry_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/v1/asset.p" + + "roto\022\036google.cloud.securitycenter.v1\032\034go" + + "ogle/api/annotations.proto\0323google/cloud" + + "/securitycenter/v1/security_marks.proto\032" + + "\034google/protobuf/struct.proto\032\037google/pr" + + "otobuf/timestamp.proto\"\317\005\n\005Asset\022\014\n\004name" + + "\030\001 \001(\t\022b\n\032security_center_properties\030\002 \001" + + "(\0132>.google.cloud.securitycenter.v1.Asse" + + "t.SecurityCenterProperties\022Z\n\023resource_p" + + "roperties\030\007 \003(\0132=.google.cloud.securityc" + + "enter.v1.Asset.ResourcePropertiesEntry\022E" + + "\n\016security_marks\030\010 \001(\0132-.google.cloud.se" + + "curitycenter.v1.SecurityMarks\022/\n\013create_" + + "time\030\t \001(\0132\032.google.protobuf.Timestamp\022/" + + "\n\013update_time\030\n \001(\0132\032.google.protobuf.Ti" + + "mestamp\022C\n\niam_policy\030\013 \001(\0132/.google.clo" + + "ud.securitycenter.v1.Asset.IamPolicy\032\224\001\n" + + "\030SecurityCenterProperties\022\025\n\rresource_na" + + "me\030\001 \001(\t\022\025\n\rresource_type\030\002 \001(\t\022\027\n\017resou" + + "rce_parent\030\003 \001(\t\022\030\n\020resource_project\030\004 \001" + + "(\t\022\027\n\017resource_owners\030\005 \003(\t\032 \n\tIamPolicy" + + "\022\023\n\013policy_blob\030\001 \001(\t\032Q\n\027ResourcePropert" + + "iesEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.g" + + "oogle.protobuf.Value:\0028\001Bt\n\"com.google.c" + + "loud.securitycenter.v1P\001ZLgoogle.golang." + + "org/genproto/googleapis/cloud/securityce" + + "nter/v1;securitycenterb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.securitycenter.v1.SecurityMarksOuterClass.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_securitycenter_v1_Asset_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1_Asset_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_Asset_descriptor, + new java.lang.String[] { + "Name", + "SecurityCenterProperties", + "ResourceProperties", + "SecurityMarks", + "CreateTime", + "UpdateTime", + "IamPolicy", + }); + internal_static_google_cloud_securitycenter_v1_Asset_SecurityCenterProperties_descriptor = + internal_static_google_cloud_securitycenter_v1_Asset_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_securitycenter_v1_Asset_SecurityCenterProperties_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_Asset_SecurityCenterProperties_descriptor, + new java.lang.String[] { + "ResourceName", "ResourceType", "ResourceParent", "ResourceProject", "ResourceOwners", + }); + internal_static_google_cloud_securitycenter_v1_Asset_IamPolicy_descriptor = + internal_static_google_cloud_securitycenter_v1_Asset_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_securitycenter_v1_Asset_IamPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_Asset_IamPolicy_descriptor, + new java.lang.String[] { + "PolicyBlob", + }); + internal_static_google_cloud_securitycenter_v1_Asset_ResourcePropertiesEntry_descriptor = + internal_static_google_cloud_securitycenter_v1_Asset_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_securitycenter_v1_Asset_ResourcePropertiesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_Asset_ResourcePropertiesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.securitycenter.v1.SecurityMarksOuterClass.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/AssetSecurityMarksName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/AssetSecurityMarksName.java new file mode 100644 index 000000000000..5fe396f068a3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/AssetSecurityMarksName.java @@ -0,0 +1,180 @@ +/* + * Copyright 2018 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. + */ + +package com.google.cloud.securitycenter.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class AssetSecurityMarksName extends SecuritymarksName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/assets/{asset}/securityMarks"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String asset; + + public String getOrganization() { + return organization; + } + + public String getAsset() { + return asset; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private AssetSecurityMarksName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + asset = Preconditions.checkNotNull(builder.getAsset()); + } + + public static AssetSecurityMarksName of(String organization, String asset) { + return newBuilder().setOrganization(organization).setAsset(asset).build(); + } + + public static String format(String organization, String asset) { + return newBuilder().setOrganization(organization).setAsset(asset).build().toString(); + } + + public static AssetSecurityMarksName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "AssetSecurityMarksName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("asset")); + } + + 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 (AssetSecurityMarksName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldMapBuilder.put("asset", asset); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization, "asset", asset); + } + + /** Builder for AssetSecurityMarksName. */ + public static class Builder { + + private String organization; + private String asset; + + public String getOrganization() { + return organization; + } + + public String getAsset() { + return asset; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setAsset(String asset) { + this.asset = asset; + return this; + } + + private Builder() {} + + private Builder(AssetSecurityMarksName assetSecurityMarksName) { + organization = assetSecurityMarksName.organization; + asset = assetSecurityMarksName.asset; + } + + public AssetSecurityMarksName build() { + return new AssetSecurityMarksName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AssetSecurityMarksName) { + AssetSecurityMarksName that = (AssetSecurityMarksName) o; + return (this.organization.equals(that.organization)) && (this.asset.equals(that.asset)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= asset.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateFindingRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateFindingRequest.java new file mode 100644 index 000000000000..deb201c8131f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateFindingRequest.java @@ -0,0 +1,1060 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for creating a finding.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.CreateFindingRequest} + */ +public final class CreateFindingRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.CreateFindingRequest) + CreateFindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateFindingRequest.newBuilder() to construct. + private CreateFindingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateFindingRequest() { + parent_ = ""; + findingId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateFindingRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + findingId_ = s; + break; + } + case 26: + { + com.google.cloud.securitycenter.v1.Finding.Builder subBuilder = null; + if (finding_ != null) { + subBuilder = finding_.toBuilder(); + } + finding_ = + input.readMessage( + com.google.cloud.securitycenter.v1.Finding.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(finding_); + finding_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_CreateFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_CreateFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.CreateFindingRequest.class, + com.google.cloud.securitycenter.v1.CreateFindingRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Resource name of the new finding's parent. Its format should be
+   * "organizations/[organization_id]/sources/[source_id]".
+   * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+   * Resource name of the new finding's parent. Its format should be
+   * "organizations/[organization_id]/sources/[source_id]".
+   * 
+ * + * string parent = 1; + */ + 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 FINDING_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object findingId_; + /** + * + * + *
+   * Unique identifier provided by the client within the parent scope.
+   * It must be alphanumeric and less than or equal to 32 characters and
+   * greater than 0 characters in length.
+   * 
+ * + * string finding_id = 2; + */ + public java.lang.String getFindingId() { + java.lang.Object ref = findingId_; + 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(); + findingId_ = s; + return s; + } + } + /** + * + * + *
+   * Unique identifier provided by the client within the parent scope.
+   * It must be alphanumeric and less than or equal to 32 characters and
+   * greater than 0 characters in length.
+   * 
+ * + * string finding_id = 2; + */ + public com.google.protobuf.ByteString getFindingIdBytes() { + java.lang.Object ref = findingId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + findingId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FINDING_FIELD_NUMBER = 3; + private com.google.cloud.securitycenter.v1.Finding finding_; + /** + * + * + *
+   * The Finding being created. The name and security_marks will be ignored as
+   * they are both output only fields on this resource.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + public boolean hasFinding() { + return finding_ != null; + } + /** + * + * + *
+   * The Finding being created. The name and security_marks will be ignored as
+   * they are both output only fields on this resource.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + public com.google.cloud.securitycenter.v1.Finding getFinding() { + return finding_ == null + ? com.google.cloud.securitycenter.v1.Finding.getDefaultInstance() + : finding_; + } + /** + * + * + *
+   * The Finding being created. The name and security_marks will be ignored as
+   * they are both output only fields on this resource.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + public com.google.cloud.securitycenter.v1.FindingOrBuilder getFindingOrBuilder() { + return getFinding(); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFindingIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, findingId_); + } + if (finding_ != null) { + output.writeMessage(3, getFinding()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFindingIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, findingId_); + } + if (finding_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinding()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.CreateFindingRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.CreateFindingRequest other = + (com.google.cloud.securitycenter.v1.CreateFindingRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && getFindingId().equals(other.getFindingId()); + result = result && (hasFinding() == other.hasFinding()); + if (hasFinding()) { + result = result && getFinding().equals(other.getFinding()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FINDING_ID_FIELD_NUMBER; + hash = (53 * hash) + getFindingId().hashCode(); + if (hasFinding()) { + hash = (37 * hash) + FINDING_FIELD_NUMBER; + hash = (53 * hash) + getFinding().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.CreateFindingRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.CreateFindingRequest 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.v1.CreateFindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.CreateFindingRequest 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.v1.CreateFindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.CreateFindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.CreateFindingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.CreateFindingRequest 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.v1.CreateFindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.CreateFindingRequest 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.v1.CreateFindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.CreateFindingRequest 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.v1.CreateFindingRequest 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; + } + /** + * + * + *
+   * Request message for creating a finding.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.CreateFindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.CreateFindingRequest) + com.google.cloud.securitycenter.v1.CreateFindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_CreateFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_CreateFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.CreateFindingRequest.class, + com.google.cloud.securitycenter.v1.CreateFindingRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.CreateFindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + findingId_ = ""; + + if (findingBuilder_ == null) { + finding_ = null; + } else { + finding_ = null; + findingBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_CreateFindingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.CreateFindingRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.CreateFindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.CreateFindingRequest build() { + com.google.cloud.securitycenter.v1.CreateFindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.CreateFindingRequest buildPartial() { + com.google.cloud.securitycenter.v1.CreateFindingRequest result = + new com.google.cloud.securitycenter.v1.CreateFindingRequest(this); + result.parent_ = parent_; + result.findingId_ = findingId_; + if (findingBuilder_ == null) { + result.finding_ = finding_; + } else { + result.finding_ = findingBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.CreateFindingRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.CreateFindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.CreateFindingRequest other) { + if (other == com.google.cloud.securitycenter.v1.CreateFindingRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFindingId().isEmpty()) { + findingId_ = other.findingId_; + onChanged(); + } + if (other.hasFinding()) { + mergeFinding(other.getFinding()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.CreateFindingRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.CreateFindingRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Resource name of the new finding's parent. Its format should be
+     * "organizations/[organization_id]/sources/[source_id]".
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Resource name of the new finding's parent. Its format should be
+     * "organizations/[organization_id]/sources/[source_id]".
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Resource name of the new finding's parent. Its format should be
+     * "organizations/[organization_id]/sources/[source_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the new finding's parent. Its format should be
+     * "organizations/[organization_id]/sources/[source_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the new finding's parent. Its format should be
+     * "organizations/[organization_id]/sources/[source_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object findingId_ = ""; + /** + * + * + *
+     * Unique identifier provided by the client within the parent scope.
+     * It must be alphanumeric and less than or equal to 32 characters and
+     * greater than 0 characters in length.
+     * 
+ * + * string finding_id = 2; + */ + public java.lang.String getFindingId() { + java.lang.Object ref = findingId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + findingId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Unique identifier provided by the client within the parent scope.
+     * It must be alphanumeric and less than or equal to 32 characters and
+     * greater than 0 characters in length.
+     * 
+ * + * string finding_id = 2; + */ + public com.google.protobuf.ByteString getFindingIdBytes() { + java.lang.Object ref = findingId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + findingId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Unique identifier provided by the client within the parent scope.
+     * It must be alphanumeric and less than or equal to 32 characters and
+     * greater than 0 characters in length.
+     * 
+ * + * string finding_id = 2; + */ + public Builder setFindingId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + findingId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Unique identifier provided by the client within the parent scope.
+     * It must be alphanumeric and less than or equal to 32 characters and
+     * greater than 0 characters in length.
+     * 
+ * + * string finding_id = 2; + */ + public Builder clearFindingId() { + + findingId_ = getDefaultInstance().getFindingId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Unique identifier provided by the client within the parent scope.
+     * It must be alphanumeric and less than or equal to 32 characters and
+     * greater than 0 characters in length.
+     * 
+ * + * string finding_id = 2; + */ + public Builder setFindingIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + findingId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.securitycenter.v1.Finding finding_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Finding, + com.google.cloud.securitycenter.v1.Finding.Builder, + com.google.cloud.securitycenter.v1.FindingOrBuilder> + findingBuilder_; + /** + * + * + *
+     * The Finding being created. The name and security_marks will be ignored as
+     * they are both output only fields on this resource.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + public boolean hasFinding() { + return findingBuilder_ != null || finding_ != null; + } + /** + * + * + *
+     * The Finding being created. The name and security_marks will be ignored as
+     * they are both output only fields on this resource.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + public com.google.cloud.securitycenter.v1.Finding getFinding() { + if (findingBuilder_ == null) { + return finding_ == null + ? com.google.cloud.securitycenter.v1.Finding.getDefaultInstance() + : finding_; + } else { + return findingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The Finding being created. The name and security_marks will be ignored as
+     * they are both output only fields on this resource.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + public Builder setFinding(com.google.cloud.securitycenter.v1.Finding value) { + if (findingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finding_ = value; + onChanged(); + } else { + findingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The Finding being created. The name and security_marks will be ignored as
+     * they are both output only fields on this resource.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + public Builder setFinding(com.google.cloud.securitycenter.v1.Finding.Builder builderForValue) { + if (findingBuilder_ == null) { + finding_ = builderForValue.build(); + onChanged(); + } else { + findingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The Finding being created. The name and security_marks will be ignored as
+     * they are both output only fields on this resource.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + public Builder mergeFinding(com.google.cloud.securitycenter.v1.Finding value) { + if (findingBuilder_ == null) { + if (finding_ != null) { + finding_ = + com.google.cloud.securitycenter.v1.Finding.newBuilder(finding_) + .mergeFrom(value) + .buildPartial(); + } else { + finding_ = value; + } + onChanged(); + } else { + findingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The Finding being created. The name and security_marks will be ignored as
+     * they are both output only fields on this resource.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + public Builder clearFinding() { + if (findingBuilder_ == null) { + finding_ = null; + onChanged(); + } else { + finding_ = null; + findingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The Finding being created. The name and security_marks will be ignored as
+     * they are both output only fields on this resource.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + public com.google.cloud.securitycenter.v1.Finding.Builder getFindingBuilder() { + + onChanged(); + return getFindingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Finding being created. The name and security_marks will be ignored as
+     * they are both output only fields on this resource.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + public com.google.cloud.securitycenter.v1.FindingOrBuilder getFindingOrBuilder() { + if (findingBuilder_ != null) { + return findingBuilder_.getMessageOrBuilder(); + } else { + return finding_ == null + ? com.google.cloud.securitycenter.v1.Finding.getDefaultInstance() + : finding_; + } + } + /** + * + * + *
+     * The Finding being created. The name and security_marks will be ignored as
+     * they are both output only fields on this resource.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Finding, + com.google.cloud.securitycenter.v1.Finding.Builder, + com.google.cloud.securitycenter.v1.FindingOrBuilder> + getFindingFieldBuilder() { + if (findingBuilder_ == null) { + findingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Finding, + com.google.cloud.securitycenter.v1.Finding.Builder, + com.google.cloud.securitycenter.v1.FindingOrBuilder>( + getFinding(), getParentForChildren(), isClean()); + finding_ = null; + } + return findingBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.CreateFindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.CreateFindingRequest) + private static final com.google.cloud.securitycenter.v1.CreateFindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.CreateFindingRequest(); + } + + public static com.google.cloud.securitycenter.v1.CreateFindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateFindingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateFindingRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.CreateFindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateFindingRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateFindingRequestOrBuilder.java new file mode 100644 index 000000000000..af623f7a4a15 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateFindingRequestOrBuilder.java @@ -0,0 +1,92 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface CreateFindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.CreateFindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the new finding's parent. Its format should be
+   * "organizations/[organization_id]/sources/[source_id]".
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Resource name of the new finding's parent. Its format should be
+   * "organizations/[organization_id]/sources/[source_id]".
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Unique identifier provided by the client within the parent scope.
+   * It must be alphanumeric and less than or equal to 32 characters and
+   * greater than 0 characters in length.
+   * 
+ * + * string finding_id = 2; + */ + java.lang.String getFindingId(); + /** + * + * + *
+   * Unique identifier provided by the client within the parent scope.
+   * It must be alphanumeric and less than or equal to 32 characters and
+   * greater than 0 characters in length.
+   * 
+ * + * string finding_id = 2; + */ + com.google.protobuf.ByteString getFindingIdBytes(); + + /** + * + * + *
+   * The Finding being created. The name and security_marks will be ignored as
+   * they are both output only fields on this resource.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + boolean hasFinding(); + /** + * + * + *
+   * The Finding being created. The name and security_marks will be ignored as
+   * they are both output only fields on this resource.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + com.google.cloud.securitycenter.v1.Finding getFinding(); + /** + * + * + *
+   * The Finding being created. The name and security_marks will be ignored as
+   * they are both output only fields on this resource.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 3; + */ + com.google.cloud.securitycenter.v1.FindingOrBuilder getFindingOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateSourceRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateSourceRequest.java new file mode 100644 index 000000000000..a16d5f6679f9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateSourceRequest.java @@ -0,0 +1,885 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for creating a source.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.CreateSourceRequest} + */ +public final class CreateSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.CreateSourceRequest) + CreateSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateSourceRequest.newBuilder() to construct. + private CreateSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSourceRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateSourceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.securitycenter.v1.Source.Builder subBuilder = null; + if (source_ != null) { + subBuilder = source_.toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.securitycenter.v1.Source.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(source_); + source_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_CreateSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_CreateSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.CreateSourceRequest.class, + com.google.cloud.securitycenter.v1.CreateSourceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Resource name of the new source's parent. Its format should be
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+   * Resource name of the new source's parent. Its format should be
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + 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 SOURCE_FIELD_NUMBER = 2; + private com.google.cloud.securitycenter.v1.Source source_; + /** + * + * + *
+   * The Source being created, only the display_name and description will be
+   * used. All other fields will be ignored.
+   * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + public boolean hasSource() { + return source_ != null; + } + /** + * + * + *
+   * The Source being created, only the display_name and description will be
+   * used. All other fields will be ignored.
+   * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + public com.google.cloud.securitycenter.v1.Source getSource() { + return source_ == null + ? com.google.cloud.securitycenter.v1.Source.getDefaultInstance() + : source_; + } + /** + * + * + *
+   * The Source being created, only the display_name and description will be
+   * used. All other fields will be ignored.
+   * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + public com.google.cloud.securitycenter.v1.SourceOrBuilder getSourceOrBuilder() { + return getSource(); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (source_ != null) { + output.writeMessage(2, getSource()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (source_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSource()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.CreateSourceRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.CreateSourceRequest other = + (com.google.cloud.securitycenter.v1.CreateSourceRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && (hasSource() == other.hasSource()); + if (hasSource()) { + result = result && getSource().equals(other.getSource()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasSource()) { + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.CreateSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.CreateSourceRequest 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.v1.CreateSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.CreateSourceRequest 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.v1.CreateSourceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.CreateSourceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.CreateSourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.CreateSourceRequest 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.v1.CreateSourceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.CreateSourceRequest 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.v1.CreateSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.CreateSourceRequest 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.v1.CreateSourceRequest 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; + } + /** + * + * + *
+   * Request message for creating a source.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.CreateSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.CreateSourceRequest) + com.google.cloud.securitycenter.v1.CreateSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_CreateSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_CreateSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.CreateSourceRequest.class, + com.google.cloud.securitycenter.v1.CreateSourceRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.CreateSourceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (sourceBuilder_ == null) { + source_ = null; + } else { + source_ = null; + sourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_CreateSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.CreateSourceRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.CreateSourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.CreateSourceRequest build() { + com.google.cloud.securitycenter.v1.CreateSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.CreateSourceRequest buildPartial() { + com.google.cloud.securitycenter.v1.CreateSourceRequest result = + new com.google.cloud.securitycenter.v1.CreateSourceRequest(this); + result.parent_ = parent_; + if (sourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = sourceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.CreateSourceRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.CreateSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.CreateSourceRequest other) { + if (other == com.google.cloud.securitycenter.v1.CreateSourceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasSource()) { + mergeSource(other.getSource()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.CreateSourceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.CreateSourceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Resource name of the new source's parent. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Resource name of the new source's parent. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Resource name of the new source's parent. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the new source's parent. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the new source's parent. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.securitycenter.v1.Source source_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Source, + com.google.cloud.securitycenter.v1.Source.Builder, + com.google.cloud.securitycenter.v1.SourceOrBuilder> + sourceBuilder_; + /** + * + * + *
+     * The Source being created, only the display_name and description will be
+     * used. All other fields will be ignored.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + public boolean hasSource() { + return sourceBuilder_ != null || source_ != null; + } + /** + * + * + *
+     * The Source being created, only the display_name and description will be
+     * used. All other fields will be ignored.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + public com.google.cloud.securitycenter.v1.Source getSource() { + if (sourceBuilder_ == null) { + return source_ == null + ? com.google.cloud.securitycenter.v1.Source.getDefaultInstance() + : source_; + } else { + return sourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The Source being created, only the display_name and description will be
+     * used. All other fields will be ignored.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + public Builder setSource(com.google.cloud.securitycenter.v1.Source value) { + if (sourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + sourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The Source being created, only the display_name and description will be
+     * used. All other fields will be ignored.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + public Builder setSource(com.google.cloud.securitycenter.v1.Source.Builder builderForValue) { + if (sourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + sourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The Source being created, only the display_name and description will be
+     * used. All other fields will be ignored.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + public Builder mergeSource(com.google.cloud.securitycenter.v1.Source value) { + if (sourceBuilder_ == null) { + if (source_ != null) { + source_ = + com.google.cloud.securitycenter.v1.Source.newBuilder(source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + sourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The Source being created, only the display_name and description will be
+     * used. All other fields will be ignored.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + public Builder clearSource() { + if (sourceBuilder_ == null) { + source_ = null; + onChanged(); + } else { + source_ = null; + sourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The Source being created, only the display_name and description will be
+     * used. All other fields will be ignored.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + public com.google.cloud.securitycenter.v1.Source.Builder getSourceBuilder() { + + onChanged(); + return getSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Source being created, only the display_name and description will be
+     * used. All other fields will be ignored.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + public com.google.cloud.securitycenter.v1.SourceOrBuilder getSourceOrBuilder() { + if (sourceBuilder_ != null) { + return sourceBuilder_.getMessageOrBuilder(); + } else { + return source_ == null + ? com.google.cloud.securitycenter.v1.Source.getDefaultInstance() + : source_; + } + } + /** + * + * + *
+     * The Source being created, only the display_name and description will be
+     * used. All other fields will be ignored.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Source, + com.google.cloud.securitycenter.v1.Source.Builder, + com.google.cloud.securitycenter.v1.SourceOrBuilder> + getSourceFieldBuilder() { + if (sourceBuilder_ == null) { + sourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Source, + com.google.cloud.securitycenter.v1.Source.Builder, + com.google.cloud.securitycenter.v1.SourceOrBuilder>( + getSource(), getParentForChildren(), isClean()); + source_ = null; + } + return sourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.CreateSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.CreateSourceRequest) + private static final com.google.cloud.securitycenter.v1.CreateSourceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.CreateSourceRequest(); + } + + public static com.google.cloud.securitycenter.v1.CreateSourceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSourceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSourceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.CreateSourceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateSourceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateSourceRequestOrBuilder.java new file mode 100644 index 000000000000..c6a0268c14ea --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/CreateSourceRequestOrBuilder.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface CreateSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.CreateSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the new source's parent. Its format should be
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Resource name of the new source's parent. Its format should be
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The Source being created, only the display_name and description will be
+   * used. All other fields will be ignored.
+   * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + boolean hasSource(); + /** + * + * + *
+   * The Source being created, only the display_name and description will be
+   * used. All other fields will be ignored.
+   * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + com.google.cloud.securitycenter.v1.Source getSource(); + /** + * + * + *
+   * The Source being created, only the display_name and description will be
+   * used. All other fields will be ignored.
+   * 
+ * + * .google.cloud.securitycenter.v1.Source source = 2; + */ + com.google.cloud.securitycenter.v1.SourceOrBuilder getSourceOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Finding.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Finding.java new file mode 100644 index 000000000000..5a46dc0570b1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Finding.java @@ -0,0 +1,2828 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/finding.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Cloud Security Command Center (Cloud SCC) finding.
+ * A finding is a record of assessment data (security, risk, health or privacy)
+ * ingested into Cloud SCC for presentation, notification, analysis,
+ * policy testing, and enforcement. For example, an XSS vulnerability in an
+ * App Engine application is a finding.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.Finding} + */ +public final class Finding extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.Finding) + FindingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Finding.newBuilder() to construct. + private Finding(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Finding() { + name_ = ""; + parent_ = ""; + resourceName_ = ""; + state_ = 0; + category_ = ""; + externalUri_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Finding( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceName_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + category_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + externalUri_ = s; + break; + } + case 58: + { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + sourceProperties_ = + com.google.protobuf.MapField.newMapField( + SourcePropertiesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000040; + } + com.google.protobuf.MapEntry + sourceProperties__ = + input.readMessage( + SourcePropertiesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + sourceProperties_ + .getMutableMap() + .put(sourceProperties__.getKey(), sourceProperties__.getValue()); + break; + } + case 66: + { + com.google.cloud.securitycenter.v1.SecurityMarks.Builder subBuilder = null; + if (securityMarks_ != null) { + subBuilder = securityMarks_.toBuilder(); + } + securityMarks_ = + input.readMessage( + com.google.cloud.securitycenter.v1.SecurityMarks.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(securityMarks_); + securityMarks_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (eventTime_ != null) { + subBuilder = eventTime_.toBuilder(); + } + eventTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(eventTime_); + eventTime_ = subBuilder.buildPartial(); + } + + break; + } + case 82: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.FindingOuterClass + .internal_static_google_cloud_securitycenter_v1_Finding_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetSourceProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.FindingOuterClass + .internal_static_google_cloud_securitycenter_v1_Finding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.Finding.class, + com.google.cloud.securitycenter.v1.Finding.Builder.class); + } + + /** + * + * + *
+   * The state of the finding.
+   * 
+ * + * Protobuf enum {@code google.cloud.securitycenter.v1.Finding.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The finding requires attention and has not been addressed yet.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * The finding has been fixed, triaged as a non-issue or otherwise addressed
+     * and is no longer active.
+     * 
+ * + * INACTIVE = 2; + */ + INACTIVE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The finding requires attention and has not been addressed yet.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * The finding has been fixed, triaged as a non-issue or otherwise addressed
+     * and is no longer active.
+     * 
+ * + * INACTIVE = 2; + */ + public static final int INACTIVE_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return INACTIVE; + 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 State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.v1.Finding.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State 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 State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securitycenter.v1.Finding.State) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The relative resource name of this finding. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/sources/456/findings/789"
+   * 
+ * + * string name = 1; + */ + 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 relative resource name of this finding. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/sources/456/findings/789"
+   * 
+ * + * string name = 1; + */ + 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 PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The relative resource name of the source the finding belongs to. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * This field is immutable after creation time.
+   * For example:
+   * "organizations/123/sources/456"
+   * 
+ * + * string parent = 2; + */ + 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 relative resource name of the source the finding belongs to. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * This field is immutable after creation time.
+   * For example:
+   * "organizations/123/sources/456"
+   * 
+ * + * string parent = 2; + */ + 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 RESOURCE_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object resourceName_; + /** + * + * + *
+   * The full resource name of the Google Cloud Platform (GCP) resource this
+   * finding is for. See:
+   * https://cloud.google.com/apis/design/resource_names#full_resource_name
+   * This field is immutable after creation time.
+   * 
+ * + * string resource_name = 3; + */ + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + 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(); + resourceName_ = s; + return s; + } + } + /** + * + * + *
+   * The full resource name of the Google Cloud Platform (GCP) resource this
+   * finding is for. See:
+   * https://cloud.google.com/apis/design/resource_names#full_resource_name
+   * This field is immutable after creation time.
+   * 
+ * + * string resource_name = 3; + */ + public com.google.protobuf.ByteString getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * The state of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 4; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The state of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 4; + */ + public com.google.cloud.securitycenter.v1.Finding.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1.Finding.State result = + com.google.cloud.securitycenter.v1.Finding.State.valueOf(state_); + return result == null ? com.google.cloud.securitycenter.v1.Finding.State.UNRECOGNIZED : result; + } + + public static final int CATEGORY_FIELD_NUMBER = 5; + private volatile java.lang.Object category_; + /** + * + * + *
+   * The additional taxonomy group within findings from a given source.
+   * This field is immutable after creation time.
+   * Example: "XSS_FLASH_INJECTION"
+   * 
+ * + * string category = 5; + */ + public java.lang.String getCategory() { + java.lang.Object ref = category_; + 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(); + category_ = s; + return s; + } + } + /** + * + * + *
+   * The additional taxonomy group within findings from a given source.
+   * This field is immutable after creation time.
+   * Example: "XSS_FLASH_INJECTION"
+   * 
+ * + * string category = 5; + */ + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXTERNAL_URI_FIELD_NUMBER = 6; + private volatile java.lang.Object externalUri_; + /** + * + * + *
+   * The URI that, if available, points to a web page outside of Cloud SCC
+   * where additional information about the finding can be found. This field is
+   * guaranteed to be either empty or a well formed URL.
+   * 
+ * + * string external_uri = 6; + */ + public java.lang.String getExternalUri() { + java.lang.Object ref = externalUri_; + 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(); + externalUri_ = s; + return s; + } + } + /** + * + * + *
+   * The URI that, if available, points to a web page outside of Cloud SCC
+   * where additional information about the finding can be found. This field is
+   * guaranteed to be either empty or a well formed URL.
+   * 
+ * + * string external_uri = 6; + */ + public com.google.protobuf.ByteString getExternalUriBytes() { + java.lang.Object ref = externalUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + externalUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_PROPERTIES_FIELD_NUMBER = 7; + + private static final class SourcePropertiesDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.securitycenter.v1.FindingOuterClass + .internal_static_google_cloud_securitycenter_v1_Finding_SourcePropertiesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField + sourceProperties_; + + private com.google.protobuf.MapField + internalGetSourceProperties() { + if (sourceProperties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SourcePropertiesDefaultEntryHolder.defaultEntry); + } + return sourceProperties_; + } + + public int getSourcePropertiesCount() { + return internalGetSourceProperties().getMap().size(); + } + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public boolean containsSourceProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetSourceProperties().getMap().containsKey(key); + } + /** Use {@link #getSourcePropertiesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getSourceProperties() { + return getSourcePropertiesMap(); + } + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public java.util.Map getSourcePropertiesMap() { + return internalGetSourceProperties().getMap(); + } + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public com.google.protobuf.Value getSourcePropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetSourceProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public com.google.protobuf.Value getSourcePropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetSourceProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SECURITY_MARKS_FIELD_NUMBER = 8; + private com.google.cloud.securitycenter.v1.SecurityMarks securityMarks_; + /** + * + * + *
+   * Output only. User specified security marks. These marks are entirely
+   * managed by the user and come from the SecurityMarks resource that belongs
+   * to the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public boolean hasSecurityMarks() { + return securityMarks_ != null; + } + /** + * + * + *
+   * Output only. User specified security marks. These marks are entirely
+   * managed by the user and come from the SecurityMarks resource that belongs
+   * to the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1.SecurityMarks getSecurityMarks() { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } + /** + * + * + *
+   * Output only. User specified security marks. These marks are entirely
+   * managed by the user and come from the SecurityMarks resource that belongs
+   * to the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder getSecurityMarksOrBuilder() { + return getSecurityMarks(); + } + + public static final int EVENT_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp eventTime_; + /** + * + * + *
+   * The time at which the event took place. For example, if the finding
+   * represents an open firewall it would capture the time the open firewall was
+   * detected.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public boolean hasEventTime() { + return eventTime_ != null; + } + /** + * + * + *
+   * The time at which the event took place. For example, if the finding
+   * represents an open firewall it would capture the time the open firewall was
+   * detected.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public com.google.protobuf.Timestamp getEventTime() { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } + /** + * + * + *
+   * The time at which the event took place. For example, if the finding
+   * represents an open firewall it would capture the time the open firewall was
+   * detected.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder() { + return getEventTime(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time at which the finding was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time at which the finding was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time at which the finding was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + if (!getResourceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, resourceName_); + } + if (state_ != com.google.cloud.securitycenter.v1.Finding.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (!getCategoryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, category_); + } + if (!getExternalUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, externalUri_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetSourceProperties(), SourcePropertiesDefaultEntryHolder.defaultEntry, 7); + if (securityMarks_ != null) { + output.writeMessage(8, getSecurityMarks()); + } + if (eventTime_ != null) { + output.writeMessage(9, getEventTime()); + } + if (createTime_ != null) { + output.writeMessage(10, getCreateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + if (!getResourceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, resourceName_); + } + if (state_ != com.google.cloud.securitycenter.v1.Finding.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!getCategoryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, category_); + } + if (!getExternalUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, externalUri_); + } + for (java.util.Map.Entry entry : + internalGetSourceProperties().getMap().entrySet()) { + com.google.protobuf.MapEntry sourceProperties__ = + SourcePropertiesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, sourceProperties__); + } + if (securityMarks_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSecurityMarks()); + } + if (eventTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getEventTime()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getCreateTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.Finding)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.Finding other = + (com.google.cloud.securitycenter.v1.Finding) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && getParent().equals(other.getParent()); + result = result && getResourceName().equals(other.getResourceName()); + result = result && state_ == other.state_; + result = result && getCategory().equals(other.getCategory()); + result = result && getExternalUri().equals(other.getExternalUri()); + result = result && internalGetSourceProperties().equals(other.internalGetSourceProperties()); + result = result && (hasSecurityMarks() == other.hasSecurityMarks()); + if (hasSecurityMarks()) { + result = result && getSecurityMarks().equals(other.getSecurityMarks()); + } + result = result && (hasEventTime() == other.hasEventTime()); + if (hasEventTime()) { + result = result && getEventTime().equals(other.getEventTime()); + } + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime().equals(other.getCreateTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + RESOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getResourceName().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + getCategory().hashCode(); + hash = (37 * hash) + EXTERNAL_URI_FIELD_NUMBER; + hash = (53 * hash) + getExternalUri().hashCode(); + if (!internalGetSourceProperties().getMap().isEmpty()) { + hash = (37 * hash) + SOURCE_PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + internalGetSourceProperties().hashCode(); + } + if (hasSecurityMarks()) { + hash = (37 * hash) + SECURITY_MARKS_FIELD_NUMBER; + hash = (53 * hash) + getSecurityMarks().hashCode(); + } + if (hasEventTime()) { + hash = (37 * hash) + EVENT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEventTime().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.Finding parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Finding 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.v1.Finding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Finding 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.v1.Finding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Finding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.Finding parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Finding 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.v1.Finding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Finding 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.v1.Finding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Finding 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.v1.Finding 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; + } + /** + * + * + *
+   * Cloud Security Command Center (Cloud SCC) finding.
+   * A finding is a record of assessment data (security, risk, health or privacy)
+   * ingested into Cloud SCC for presentation, notification, analysis,
+   * policy testing, and enforcement. For example, an XSS vulnerability in an
+   * App Engine application is a finding.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.Finding} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.Finding) + com.google.cloud.securitycenter.v1.FindingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.FindingOuterClass + .internal_static_google_cloud_securitycenter_v1_Finding_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 7: + return internalGetSourceProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 7: + return internalGetMutableSourceProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.FindingOuterClass + .internal_static_google_cloud_securitycenter_v1_Finding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.Finding.class, + com.google.cloud.securitycenter.v1.Finding.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.Finding.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + parent_ = ""; + + resourceName_ = ""; + + state_ = 0; + + category_ = ""; + + externalUri_ = ""; + + internalGetMutableSourceProperties().clear(); + if (securityMarksBuilder_ == null) { + securityMarks_ = null; + } else { + securityMarks_ = null; + securityMarksBuilder_ = null; + } + if (eventTimeBuilder_ == null) { + eventTime_ = null; + } else { + eventTime_ = null; + eventTimeBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.FindingOuterClass + .internal_static_google_cloud_securitycenter_v1_Finding_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Finding getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.Finding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Finding build() { + com.google.cloud.securitycenter.v1.Finding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Finding buildPartial() { + com.google.cloud.securitycenter.v1.Finding result = + new com.google.cloud.securitycenter.v1.Finding(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + result.parent_ = parent_; + result.resourceName_ = resourceName_; + result.state_ = state_; + result.category_ = category_; + result.externalUri_ = externalUri_; + result.sourceProperties_ = internalGetSourceProperties(); + result.sourceProperties_.makeImmutable(); + if (securityMarksBuilder_ == null) { + result.securityMarks_ = securityMarks_; + } else { + result.securityMarks_ = securityMarksBuilder_.build(); + } + if (eventTimeBuilder_ == null) { + result.eventTime_ = eventTime_; + } else { + result.eventTime_ = eventTimeBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.Finding) { + return mergeFrom((com.google.cloud.securitycenter.v1.Finding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.Finding other) { + if (other == com.google.cloud.securitycenter.v1.Finding.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getResourceName().isEmpty()) { + resourceName_ = other.resourceName_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getCategory().isEmpty()) { + category_ = other.category_; + onChanged(); + } + if (!other.getExternalUri().isEmpty()) { + externalUri_ = other.externalUri_; + onChanged(); + } + internalGetMutableSourceProperties().mergeFrom(other.internalGetSourceProperties()); + if (other.hasSecurityMarks()) { + mergeSecurityMarks(other.getSecurityMarks()); + } + if (other.hasEventTime()) { + mergeEventTime(other.getEventTime()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.Finding parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1.Finding) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The relative resource name of this finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456/findings/789"
+     * 
+ * + * string name = 1; + */ + 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 relative resource name of this finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456/findings/789"
+     * 
+ * + * string name = 1; + */ + 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 relative resource name of this finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456/findings/789"
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456/findings/789"
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456/findings/789"
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The relative resource name of the source the finding belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * This field is immutable after creation time.
+     * For example:
+     * "organizations/123/sources/456"
+     * 
+ * + * string parent = 2; + */ + 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 relative resource name of the source the finding belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * This field is immutable after creation time.
+     * For example:
+     * "organizations/123/sources/456"
+     * 
+ * + * string parent = 2; + */ + 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 relative resource name of the source the finding belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * This field is immutable after creation time.
+     * For example:
+     * "organizations/123/sources/456"
+     * 
+ * + * string parent = 2; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the source the finding belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * This field is immutable after creation time.
+     * For example:
+     * "organizations/123/sources/456"
+     * 
+ * + * string parent = 2; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the source the finding belongs to. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * This field is immutable after creation time.
+     * For example:
+     * "organizations/123/sources/456"
+     * 
+ * + * string parent = 2; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceName_ = ""; + /** + * + * + *
+     * The full resource name of the Google Cloud Platform (GCP) resource this
+     * finding is for. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * This field is immutable after creation time.
+     * 
+ * + * string resource_name = 3; + */ + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The full resource name of the Google Cloud Platform (GCP) resource this
+     * finding is for. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * This field is immutable after creation time.
+     * 
+ * + * string resource_name = 3; + */ + public com.google.protobuf.ByteString getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The full resource name of the Google Cloud Platform (GCP) resource this
+     * finding is for. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * This field is immutable after creation time.
+     * 
+ * + * string resource_name = 3; + */ + public Builder setResourceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource name of the Google Cloud Platform (GCP) resource this
+     * finding is for. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * This field is immutable after creation time.
+     * 
+ * + * string resource_name = 3; + */ + public Builder clearResourceName() { + + resourceName_ = getDefaultInstance().getResourceName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource name of the Google Cloud Platform (GCP) resource this
+     * finding is for. See:
+     * https://cloud.google.com/apis/design/resource_names#full_resource_name
+     * This field is immutable after creation time.
+     * 
+ * + * string resource_name = 3; + */ + public Builder setResourceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceName_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 4; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 4; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 4; + */ + public com.google.cloud.securitycenter.v1.Finding.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1.Finding.State result = + com.google.cloud.securitycenter.v1.Finding.State.valueOf(state_); + return result == null + ? com.google.cloud.securitycenter.v1.Finding.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 4; + */ + public Builder setState(com.google.cloud.securitycenter.v1.Finding.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 4; + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object category_ = ""; + /** + * + * + *
+     * The additional taxonomy group within findings from a given source.
+     * This field is immutable after creation time.
+     * Example: "XSS_FLASH_INJECTION"
+     * 
+ * + * string category = 5; + */ + public java.lang.String getCategory() { + java.lang.Object ref = category_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + category_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The additional taxonomy group within findings from a given source.
+     * This field is immutable after creation time.
+     * Example: "XSS_FLASH_INJECTION"
+     * 
+ * + * string category = 5; + */ + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The additional taxonomy group within findings from a given source.
+     * This field is immutable after creation time.
+     * Example: "XSS_FLASH_INJECTION"
+     * 
+ * + * string category = 5; + */ + public Builder setCategory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + category_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The additional taxonomy group within findings from a given source.
+     * This field is immutable after creation time.
+     * Example: "XSS_FLASH_INJECTION"
+     * 
+ * + * string category = 5; + */ + public Builder clearCategory() { + + category_ = getDefaultInstance().getCategory(); + onChanged(); + return this; + } + /** + * + * + *
+     * The additional taxonomy group within findings from a given source.
+     * This field is immutable after creation time.
+     * Example: "XSS_FLASH_INJECTION"
+     * 
+ * + * string category = 5; + */ + public Builder setCategoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + category_ = value; + onChanged(); + return this; + } + + private java.lang.Object externalUri_ = ""; + /** + * + * + *
+     * The URI that, if available, points to a web page outside of Cloud SCC
+     * where additional information about the finding can be found. This field is
+     * guaranteed to be either empty or a well formed URL.
+     * 
+ * + * string external_uri = 6; + */ + public java.lang.String getExternalUri() { + java.lang.Object ref = externalUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + externalUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URI that, if available, points to a web page outside of Cloud SCC
+     * where additional information about the finding can be found. This field is
+     * guaranteed to be either empty or a well formed URL.
+     * 
+ * + * string external_uri = 6; + */ + public com.google.protobuf.ByteString getExternalUriBytes() { + java.lang.Object ref = externalUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + externalUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URI that, if available, points to a web page outside of Cloud SCC
+     * where additional information about the finding can be found. This field is
+     * guaranteed to be either empty or a well formed URL.
+     * 
+ * + * string external_uri = 6; + */ + public Builder setExternalUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + externalUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URI that, if available, points to a web page outside of Cloud SCC
+     * where additional information about the finding can be found. This field is
+     * guaranteed to be either empty or a well formed URL.
+     * 
+ * + * string external_uri = 6; + */ + public Builder clearExternalUri() { + + externalUri_ = getDefaultInstance().getExternalUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The URI that, if available, points to a web page outside of Cloud SCC
+     * where additional information about the finding can be found. This field is
+     * guaranteed to be either empty or a well formed URL.
+     * 
+ * + * string external_uri = 6; + */ + public Builder setExternalUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + externalUri_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField + sourceProperties_; + + private com.google.protobuf.MapField + internalGetSourceProperties() { + if (sourceProperties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SourcePropertiesDefaultEntryHolder.defaultEntry); + } + return sourceProperties_; + } + + private com.google.protobuf.MapField + internalGetMutableSourceProperties() { + onChanged(); + ; + if (sourceProperties_ == null) { + sourceProperties_ = + com.google.protobuf.MapField.newMapField( + SourcePropertiesDefaultEntryHolder.defaultEntry); + } + if (!sourceProperties_.isMutable()) { + sourceProperties_ = sourceProperties_.copy(); + } + return sourceProperties_; + } + + public int getSourcePropertiesCount() { + return internalGetSourceProperties().getMap().size(); + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public boolean containsSourceProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetSourceProperties().getMap().containsKey(key); + } + /** Use {@link #getSourcePropertiesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getSourceProperties() { + return getSourcePropertiesMap(); + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public java.util.Map getSourcePropertiesMap() { + return internalGetSourceProperties().getMap(); + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public com.google.protobuf.Value getSourcePropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetSourceProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public com.google.protobuf.Value getSourcePropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetSourceProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearSourceProperties() { + internalGetMutableSourceProperties().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public Builder removeSourceProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableSourceProperties().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableSourceProperties() { + return internalGetMutableSourceProperties().getMutableMap(); + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public Builder putSourceProperties(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableSourceProperties().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Source specific properties. These properties are managed by the source
+     * that writes the finding. The key names in the source_properties map must be
+     * between 1 and 255 characters, and must start with a letter and contain
+     * alphanumeric characters or underscores only.
+     * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + public Builder putAllSourceProperties( + java.util.Map values) { + internalGetMutableSourceProperties().getMutableMap().putAll(values); + return this; + } + + private com.google.cloud.securitycenter.v1.SecurityMarks securityMarks_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.SecurityMarks, + com.google.cloud.securitycenter.v1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder> + securityMarksBuilder_; + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public boolean hasSecurityMarks() { + return securityMarksBuilder_ != null || securityMarks_ != null; + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1.SecurityMarks getSecurityMarks() { + if (securityMarksBuilder_ == null) { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } else { + return securityMarksBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public Builder setSecurityMarks(com.google.cloud.securitycenter.v1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + securityMarks_ = value; + onChanged(); + } else { + securityMarksBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public Builder setSecurityMarks( + com.google.cloud.securitycenter.v1.SecurityMarks.Builder builderForValue) { + if (securityMarksBuilder_ == null) { + securityMarks_ = builderForValue.build(); + onChanged(); + } else { + securityMarksBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public Builder mergeSecurityMarks(com.google.cloud.securitycenter.v1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (securityMarks_ != null) { + securityMarks_ = + com.google.cloud.securitycenter.v1.SecurityMarks.newBuilder(securityMarks_) + .mergeFrom(value) + .buildPartial(); + } else { + securityMarks_ = value; + } + onChanged(); + } else { + securityMarksBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public Builder clearSecurityMarks() { + if (securityMarksBuilder_ == null) { + securityMarks_ = null; + onChanged(); + } else { + securityMarks_ = null; + securityMarksBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1.SecurityMarks.Builder getSecurityMarksBuilder() { + + onChanged(); + return getSecurityMarksFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder getSecurityMarksOrBuilder() { + if (securityMarksBuilder_ != null) { + return securityMarksBuilder_.getMessageOrBuilder(); + } else { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } + } + /** + * + * + *
+     * Output only. User specified security marks. These marks are entirely
+     * managed by the user and come from the SecurityMarks resource that belongs
+     * to the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.SecurityMarks, + com.google.cloud.securitycenter.v1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder> + getSecurityMarksFieldBuilder() { + if (securityMarksBuilder_ == null) { + securityMarksBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.SecurityMarks, + com.google.cloud.securitycenter.v1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder>( + getSecurityMarks(), getParentForChildren(), isClean()); + securityMarks_ = null; + } + return securityMarksBuilder_; + } + + private com.google.protobuf.Timestamp eventTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + eventTimeBuilder_; + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the open firewall was
+     * detected.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public boolean hasEventTime() { + return eventTimeBuilder_ != null || eventTime_ != null; + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the open firewall was
+     * detected.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public com.google.protobuf.Timestamp getEventTime() { + if (eventTimeBuilder_ == null) { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } else { + return eventTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the open firewall was
+     * detected.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public Builder setEventTime(com.google.protobuf.Timestamp value) { + if (eventTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + eventTime_ = value; + onChanged(); + } else { + eventTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the open firewall was
+     * detected.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public Builder setEventTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (eventTimeBuilder_ == null) { + eventTime_ = builderForValue.build(); + onChanged(); + } else { + eventTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the open firewall was
+     * detected.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public Builder mergeEventTime(com.google.protobuf.Timestamp value) { + if (eventTimeBuilder_ == null) { + if (eventTime_ != null) { + eventTime_ = + com.google.protobuf.Timestamp.newBuilder(eventTime_).mergeFrom(value).buildPartial(); + } else { + eventTime_ = value; + } + onChanged(); + } else { + eventTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the open firewall was
+     * detected.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public Builder clearEventTime() { + if (eventTimeBuilder_ == null) { + eventTime_ = null; + onChanged(); + } else { + eventTime_ = null; + eventTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the open firewall was
+     * detected.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public com.google.protobuf.Timestamp.Builder getEventTimeBuilder() { + + onChanged(); + return getEventTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the open firewall was
+     * detected.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + public com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder() { + if (eventTimeBuilder_ != null) { + return eventTimeBuilder_.getMessageOrBuilder(); + } else { + return eventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : eventTime_; + } + } + /** + * + * + *
+     * The time at which the event took place. For example, if the finding
+     * represents an open firewall it would capture the time the open firewall was
+     * detected.
+     * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEventTimeFieldBuilder() { + if (eventTimeBuilder_ == null) { + eventTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEventTime(), getParentForChildren(), isClean()); + eventTime_ = null; + } + return eventTimeBuilder_; + } + + private com.google.protobuf.Timestamp createTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time at which the finding was created in Cloud SCC.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.Finding) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.Finding) + private static final com.google.cloud.securitycenter.v1.Finding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.Finding(); + } + + public static com.google.cloud.securitycenter.v1.Finding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Finding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Finding(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Finding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingName.java new file mode 100644 index 000000000000..10ce8f0f4aca --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingName.java @@ -0,0 +1,209 @@ +/* + * Copyright 2018 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. + */ + +package com.google.cloud.securitycenter.v1; + +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; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class FindingName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/sources/{source}/findings/{finding}"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String source; + private final String finding; + + public String getOrganization() { + return organization; + } + + public String getSource() { + return source; + } + + public String getFinding() { + return finding; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private FindingName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + source = Preconditions.checkNotNull(builder.getSource()); + finding = Preconditions.checkNotNull(builder.getFinding()); + } + + public static FindingName of(String organization, String source, String finding) { + return newBuilder().setOrganization(organization).setSource(source).setFinding(finding).build(); + } + + public static String format(String organization, String source, String finding) { + return newBuilder() + .setOrganization(organization) + .setSource(source) + .setFinding(finding) + .build() + .toString(); + } + + public static FindingName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "FindingName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("source"), matchMap.get("finding")); + } + + 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 (FindingName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldMapBuilder.put("source", source); + fieldMapBuilder.put("finding", finding); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "organization", organization, "source", source, "finding", finding); + } + + /** Builder for FindingName. */ + public static class Builder { + + private String organization; + private String source; + private String finding; + + public String getOrganization() { + return organization; + } + + public String getSource() { + return source; + } + + public String getFinding() { + return finding; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setSource(String source) { + this.source = source; + return this; + } + + public Builder setFinding(String finding) { + this.finding = finding; + return this; + } + + private Builder() {} + + private Builder(FindingName findingName) { + organization = findingName.organization; + source = findingName.source; + finding = findingName.finding; + } + + public FindingName build() { + return new FindingName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FindingName) { + FindingName that = (FindingName) o; + return (this.organization.equals(that.organization)) + && (this.source.equals(that.source)) + && (this.finding.equals(that.finding)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= source.hashCode(); + h *= 1000003; + h ^= finding.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingOrBuilder.java new file mode 100644 index 000000000000..67ce2d3a67e8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingOrBuilder.java @@ -0,0 +1,339 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/finding.proto + +package com.google.cloud.securitycenter.v1; + +public interface FindingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.Finding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The relative resource name of this finding. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/sources/456/findings/789"
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The relative resource name of this finding. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/sources/456/findings/789"
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The relative resource name of the source the finding belongs to. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * This field is immutable after creation time.
+   * For example:
+   * "organizations/123/sources/456"
+   * 
+ * + * string parent = 2; + */ + java.lang.String getParent(); + /** + * + * + *
+   * The relative resource name of the source the finding belongs to. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * This field is immutable after creation time.
+   * For example:
+   * "organizations/123/sources/456"
+   * 
+ * + * string parent = 2; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The full resource name of the Google Cloud Platform (GCP) resource this
+   * finding is for. See:
+   * https://cloud.google.com/apis/design/resource_names#full_resource_name
+   * This field is immutable after creation time.
+   * 
+ * + * string resource_name = 3; + */ + java.lang.String getResourceName(); + /** + * + * + *
+   * The full resource name of the Google Cloud Platform (GCP) resource this
+   * finding is for. See:
+   * https://cloud.google.com/apis/design/resource_names#full_resource_name
+   * This field is immutable after creation time.
+   * 
+ * + * string resource_name = 3; + */ + com.google.protobuf.ByteString getResourceNameBytes(); + + /** + * + * + *
+   * The state of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 4; + */ + int getStateValue(); + /** + * + * + *
+   * The state of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 4; + */ + com.google.cloud.securitycenter.v1.Finding.State getState(); + + /** + * + * + *
+   * The additional taxonomy group within findings from a given source.
+   * This field is immutable after creation time.
+   * Example: "XSS_FLASH_INJECTION"
+   * 
+ * + * string category = 5; + */ + java.lang.String getCategory(); + /** + * + * + *
+   * The additional taxonomy group within findings from a given source.
+   * This field is immutable after creation time.
+   * Example: "XSS_FLASH_INJECTION"
+   * 
+ * + * string category = 5; + */ + com.google.protobuf.ByteString getCategoryBytes(); + + /** + * + * + *
+   * The URI that, if available, points to a web page outside of Cloud SCC
+   * where additional information about the finding can be found. This field is
+   * guaranteed to be either empty or a well formed URL.
+   * 
+ * + * string external_uri = 6; + */ + java.lang.String getExternalUri(); + /** + * + * + *
+   * The URI that, if available, points to a web page outside of Cloud SCC
+   * where additional information about the finding can be found. This field is
+   * guaranteed to be either empty or a well formed URL.
+   * 
+ * + * string external_uri = 6; + */ + com.google.protobuf.ByteString getExternalUriBytes(); + + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + int getSourcePropertiesCount(); + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + boolean containsSourceProperties(java.lang.String key); + /** Use {@link #getSourcePropertiesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getSourceProperties(); + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + java.util.Map getSourcePropertiesMap(); + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + com.google.protobuf.Value getSourcePropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding. The key names in the source_properties map must be
+   * between 1 and 255 characters, and must start with a letter and contain
+   * alphanumeric characters or underscores only.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + com.google.protobuf.Value getSourcePropertiesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. User specified security marks. These marks are entirely
+   * managed by the user and come from the SecurityMarks resource that belongs
+   * to the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + boolean hasSecurityMarks(); + /** + * + * + *
+   * Output only. User specified security marks. These marks are entirely
+   * managed by the user and come from the SecurityMarks resource that belongs
+   * to the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + com.google.cloud.securitycenter.v1.SecurityMarks getSecurityMarks(); + /** + * + * + *
+   * Output only. User specified security marks. These marks are entirely
+   * managed by the user and come from the SecurityMarks resource that belongs
+   * to the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 8; + */ + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder getSecurityMarksOrBuilder(); + + /** + * + * + *
+   * The time at which the event took place. For example, if the finding
+   * represents an open firewall it would capture the time the open firewall was
+   * detected.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + boolean hasEventTime(); + /** + * + * + *
+   * The time at which the event took place. For example, if the finding
+   * represents an open firewall it would capture the time the open firewall was
+   * detected.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + com.google.protobuf.Timestamp getEventTime(); + /** + * + * + *
+   * The time at which the event took place. For example, if the finding
+   * represents an open firewall it would capture the time the open firewall was
+   * detected.
+   * 
+ * + * .google.protobuf.Timestamp event_time = 9; + */ + com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder(); + + /** + * + * + *
+   * The time at which the finding was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time at which the finding was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time at which the finding was created in Cloud SCC.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 10; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingOuterClass.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingOuterClass.java new file mode 100644 index 000000000000..18990019673b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingOuterClass.java @@ -0,0 +1,105 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/finding.proto + +package com.google.cloud.securitycenter.v1; + +public final class FindingOuterClass { + private FindingOuterClass() {} + + 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_v1_Finding_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_Finding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_Finding_SourcePropertiesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_Finding_SourcePropertiesEntry_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/v1/finding" + + ".proto\022\036google.cloud.securitycenter.v1\032\034" + + "google/api/annotations.proto\0323google/clo" + + "ud/securitycenter/v1/security_marks.prot" + + "o\032\034google/protobuf/struct.proto\032\037google/" + + "protobuf/timestamp.proto\"\261\004\n\007Finding\022\014\n\004" + + "name\030\001 \001(\t\022\016\n\006parent\030\002 \001(\t\022\025\n\rresource_n" + + "ame\030\003 \001(\t\022<\n\005state\030\004 \001(\0162-.google.cloud." + + "securitycenter.v1.Finding.State\022\020\n\010categ" + + "ory\030\005 \001(\t\022\024\n\014external_uri\030\006 \001(\t\022X\n\021sourc" + + "e_properties\030\007 \003(\0132=.google.cloud.securi" + + "tycenter.v1.Finding.SourcePropertiesEntr" + + "y\022E\n\016security_marks\030\010 \001(\0132-.google.cloud" + + ".securitycenter.v1.SecurityMarks\022.\n\neven" + + "t_time\030\t \001(\0132\032.google.protobuf.Timestamp" + + "\022/\n\013create_time\030\n \001(\0132\032.google.protobuf." + + "Timestamp\032O\n\025SourcePropertiesEntry\022\013\n\003ke" + + "y\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.google.protobuf" + + ".Value:\0028\001\"8\n\005State\022\025\n\021STATE_UNSPECIFIED" + + "\020\000\022\n\n\006ACTIVE\020\001\022\014\n\010INACTIVE\020\002Bt\n\"com.goog" + + "le.cloud.securitycenter.v1P\001ZLgoogle.gol" + + "ang.org/genproto/googleapis/cloud/securi" + + "tycenter/v1;securitycenterb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.securitycenter.v1.SecurityMarksOuterClass.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_securitycenter_v1_Finding_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1_Finding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_Finding_descriptor, + new java.lang.String[] { + "Name", + "Parent", + "ResourceName", + "State", + "Category", + "ExternalUri", + "SourceProperties", + "SecurityMarks", + "EventTime", + "CreateTime", + }); + internal_static_google_cloud_securitycenter_v1_Finding_SourcePropertiesEntry_descriptor = + internal_static_google_cloud_securitycenter_v1_Finding_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_securitycenter_v1_Finding_SourcePropertiesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_Finding_SourcePropertiesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.securitycenter.v1.SecurityMarksOuterClass.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingSecurityMarksName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingSecurityMarksName.java new file mode 100644 index 000000000000..a644f8166514 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/FindingSecurityMarksName.java @@ -0,0 +1,208 @@ +/* + * Copyright 2018 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. + */ + +package com.google.cloud.securitycenter.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class FindingSecurityMarksName extends SecuritymarksName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/sources/{source}/findings/{finding}/securityMarks"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String source; + private final String finding; + + public String getOrganization() { + return organization; + } + + public String getSource() { + return source; + } + + public String getFinding() { + return finding; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private FindingSecurityMarksName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + source = Preconditions.checkNotNull(builder.getSource()); + finding = Preconditions.checkNotNull(builder.getFinding()); + } + + public static FindingSecurityMarksName of(String organization, String source, String finding) { + return newBuilder().setOrganization(organization).setSource(source).setFinding(finding).build(); + } + + public static String format(String organization, String source, String finding) { + return newBuilder() + .setOrganization(organization) + .setSource(source) + .setFinding(finding) + .build() + .toString(); + } + + public static FindingSecurityMarksName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "FindingSecurityMarksName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("source"), matchMap.get("finding")); + } + + 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 (FindingSecurityMarksName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldMapBuilder.put("source", source); + fieldMapBuilder.put("finding", finding); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "organization", organization, "source", source, "finding", finding); + } + + /** Builder for FindingSecurityMarksName. */ + public static class Builder { + + private String organization; + private String source; + private String finding; + + public String getOrganization() { + return organization; + } + + public String getSource() { + return source; + } + + public String getFinding() { + return finding; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setSource(String source) { + this.source = source; + return this; + } + + public Builder setFinding(String finding) { + this.finding = finding; + return this; + } + + private Builder() {} + + private Builder(FindingSecurityMarksName findingSecurityMarksName) { + organization = findingSecurityMarksName.organization; + source = findingSecurityMarksName.source; + finding = findingSecurityMarksName.finding; + } + + public FindingSecurityMarksName build() { + return new FindingSecurityMarksName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FindingSecurityMarksName) { + FindingSecurityMarksName that = (FindingSecurityMarksName) o; + return (this.organization.equals(that.organization)) + && (this.source.equals(that.source)) + && (this.finding.equals(that.finding)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= source.hashCode(); + h *= 1000003; + h ^= finding.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetOrganizationSettingsRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetOrganizationSettingsRequest.java new file mode 100644 index 000000000000..b424576af0fe --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetOrganizationSettingsRequest.java @@ -0,0 +1,617 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for getting organization settings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} + */ +public final class GetOrganizationSettingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + GetOrganizationSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetOrganizationSettingsRequest.newBuilder() to construct. + private GetOrganizationSettingsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetOrganizationSettingsRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetOrganizationSettingsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GetOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GetOrganizationSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.class, + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Name of the organization to get organization settings for. Its format is
+   * "organizations/[organization_id]/organizationSettings".
+   * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+   * Name of the organization to get organization settings for. Its format is
+   * "organizations/[organization_id]/organizationSettings".
+   * 
+ * + * string name = 1; + */ + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest other = + (com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest 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.v1.GetOrganizationSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest 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.v1.GetOrganizationSettingsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest 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.v1.GetOrganizationSettingsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + 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.v1.GetOrganizationSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest 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.v1.GetOrganizationSettingsRequest 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; + } + /** + * + * + *
+   * Request message for getting organization settings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GetOrganizationSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GetOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GetOrganizationSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.class, + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GetOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest build() { + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest buildPartial() { + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest result = + new com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest other) { + if (other + == com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Name of the organization to get organization settings for. Its format is
+     * "organizations/[organization_id]/organizationSettings".
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Name of the organization to get organization settings for. Its format is
+     * "organizations/[organization_id]/organizationSettings".
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Name of the organization to get organization settings for. Its format is
+     * "organizations/[organization_id]/organizationSettings".
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the organization to get organization settings for. Its format is
+     * "organizations/[organization_id]/organizationSettings".
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the organization to get organization settings for. Its format is
+     * "organizations/[organization_id]/organizationSettings".
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.GetOrganizationSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + private static final com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest(); + } + + public static com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetOrganizationSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetOrganizationSettingsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetOrganizationSettingsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetOrganizationSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..7fa723622083 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetOrganizationSettingsRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface GetOrganizationSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.GetOrganizationSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the organization to get organization settings for. Its format is
+   * "organizations/[organization_id]/organizationSettings".
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the organization to get organization settings for. Its format is
+   * "organizations/[organization_id]/organizationSettings".
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetSourceRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetSourceRequest.java new file mode 100644 index 000000000000..917d5477ce60 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetSourceRequest.java @@ -0,0 +1,606 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for getting a source.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GetSourceRequest} + */ +public final class GetSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.GetSourceRequest) + GetSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetSourceRequest.newBuilder() to construct. + private GetSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSourceRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetSourceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GetSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GetSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GetSourceRequest.class, + com.google.cloud.securitycenter.v1.GetSourceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Relative resource name of the source. Its format is
+   * "organizations/[organization_id]/source/[source_id]".
+   * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+   * Relative resource name of the source. Its format is
+   * "organizations/[organization_id]/source/[source_id]".
+   * 
+ * + * string name = 1; + */ + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.GetSourceRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.GetSourceRequest other = + (com.google.cloud.securitycenter.v1.GetSourceRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.GetSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GetSourceRequest 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.v1.GetSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GetSourceRequest 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.v1.GetSourceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GetSourceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.GetSourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GetSourceRequest 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.v1.GetSourceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GetSourceRequest 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.v1.GetSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GetSourceRequest 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.v1.GetSourceRequest 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; + } + /** + * + * + *
+   * Request message for getting a source.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GetSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.GetSourceRequest) + com.google.cloud.securitycenter.v1.GetSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GetSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GetSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GetSourceRequest.class, + com.google.cloud.securitycenter.v1.GetSourceRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.GetSourceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GetSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GetSourceRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.GetSourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GetSourceRequest build() { + com.google.cloud.securitycenter.v1.GetSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GetSourceRequest buildPartial() { + com.google.cloud.securitycenter.v1.GetSourceRequest result = + new com.google.cloud.securitycenter.v1.GetSourceRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.GetSourceRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.GetSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.GetSourceRequest other) { + if (other == com.google.cloud.securitycenter.v1.GetSourceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.GetSourceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.GetSourceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Relative resource name of the source. Its format is
+     * "organizations/[organization_id]/source/[source_id]".
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Relative resource name of the source. Its format is
+     * "organizations/[organization_id]/source/[source_id]".
+     * 
+ * + * string name = 1; + */ + 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; + } + } + /** + * + * + *
+     * Relative resource name of the source. Its format is
+     * "organizations/[organization_id]/source/[source_id]".
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Relative resource name of the source. Its format is
+     * "organizations/[organization_id]/source/[source_id]".
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Relative resource name of the source. Its format is
+     * "organizations/[organization_id]/source/[source_id]".
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.GetSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.GetSourceRequest) + private static final com.google.cloud.securitycenter.v1.GetSourceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.GetSourceRequest(); + } + + public static com.google.cloud.securitycenter.v1.GetSourceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSourceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetSourceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GetSourceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetSourceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetSourceRequestOrBuilder.java new file mode 100644 index 000000000000..4a8bd2cdc3ae --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GetSourceRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface GetSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.GetSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Relative resource name of the source. Its format is
+   * "organizations/[organization_id]/source/[source_id]".
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Relative resource name of the source. Its format is
+   * "organizations/[organization_id]/source/[source_id]".
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsRequest.java new file mode 100644 index 000000000000..a6cb10133240 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsRequest.java @@ -0,0 +1,2369 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for grouping by assets.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GroupAssetsRequest} + */ +public final class GroupAssetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.GroupAssetsRequest) + GroupAssetsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroupAssetsRequest.newBuilder() to construct. + private GroupAssetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroupAssetsRequest() { + parent_ = ""; + filter_ = ""; + groupBy_ = ""; + having_ = ""; + pageToken_ = ""; + pageSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GroupAssetsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + groupBy_ = s; + break; + } + case 34: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (compareDuration_ != null) { + subBuilder = compareDuration_.toBuilder(); + } + compareDuration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(compareDuration_); + compareDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + having_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 64: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GroupAssetsRequest.class, + com.google.cloud.securitycenter.v1.GroupAssetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Name of the organization to groupBy. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+   * Name of the organization to groupBy. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + 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 FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GROUP_BY_FIELD_NUMBER = 3; + private volatile java.lang.Object groupBy_; + /** + * + * + *
+   * Expression that defines what assets fields to use for grouping. The string
+   * value should follow SQL syntax: comma separated list of fields. For
+   * example:
+   * "security_center_properties.resource_project,security_center_properties.project".
+   * The following fields are supported when compare_duration is not set:
+   * * security_center_properties.resource_project
+   * * security_center_properties.resource_type
+   * * security_center_properties.resource_parent
+   * The following fields are supported when compare_duration is set:
+   * * security_center_properties.resource_type
+   * 
+ * + * string group_by = 3; + */ + public java.lang.String getGroupBy() { + java.lang.Object ref = groupBy_; + 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(); + groupBy_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines what assets fields to use for grouping. The string
+   * value should follow SQL syntax: comma separated list of fields. For
+   * example:
+   * "security_center_properties.resource_project,security_center_properties.project".
+   * The following fields are supported when compare_duration is not set:
+   * * security_center_properties.resource_project
+   * * security_center_properties.resource_type
+   * * security_center_properties.resource_parent
+   * The following fields are supported when compare_duration is set:
+   * * security_center_properties.resource_type
+   * 
+ * + * string group_by = 3; + */ + public com.google.protobuf.ByteString getGroupByBytes() { + java.lang.Object ref = groupBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + groupBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMPARE_DURATION_FIELD_NUMBER = 4; + private com.google.protobuf.Duration compareDuration_; + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" property is
+   * updated to indicate whether the asset was added, removed, or remained
+   * present during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at reference_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at reference_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and reference_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all assets present at
+   * read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public boolean hasCompareDuration() { + return compareDuration_ != null; + } + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" property is
+   * updated to indicate whether the asset was added, removed, or remained
+   * present during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at reference_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at reference_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and reference_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all assets present at
+   * read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public com.google.protobuf.Duration getCompareDuration() { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" property is
+   * updated to indicate whether the asset was added, removed, or remained
+   * present during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at reference_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at reference_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and reference_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all assets present at
+   * read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + return getCompareDuration(); + } + + public static final int READ_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int HAVING_FIELD_NUMBER = 6; + private volatile java.lang.Object having_; + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'state_change' is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + 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(); + having_ = s; + return s; + } + } + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'state_change' is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 7; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last `GroupAssetsResponse`; indicates
+   * that this is a continuation of a prior `GroupAssets` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 7; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last `GroupAssetsResponse`; indicates
+   * that this is a continuation of a prior `GroupAssets` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 7; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 8; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 8; + */ + public int getPageSize() { + return pageSize_; + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (!getGroupByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, groupBy_); + } + if (compareDuration_ != null) { + output.writeMessage(4, getCompareDuration()); + } + if (readTime_ != null) { + output.writeMessage(5, getReadTime()); + } + if (!getHavingBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, having_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(8, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (!getGroupByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, groupBy_); + } + if (compareDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCompareDuration()); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getReadTime()); + } + if (!getHavingBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, having_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(8, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.GroupAssetsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.GroupAssetsRequest other = + (com.google.cloud.securitycenter.v1.GroupAssetsRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && getFilter().equals(other.getFilter()); + result = result && getGroupBy().equals(other.getGroupBy()); + result = result && (hasCompareDuration() == other.hasCompareDuration()); + if (hasCompareDuration()) { + result = result && getCompareDuration().equals(other.getCompareDuration()); + } + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && getHaving().equals(other.getHaving()); + result = result && getPageToken().equals(other.getPageToken()); + result = result && (getPageSize() == other.getPageSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + GROUP_BY_FIELD_NUMBER; + hash = (53 * hash) + getGroupBy().hashCode(); + if (hasCompareDuration()) { + hash = (37 * hash) + COMPARE_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getCompareDuration().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (37 * hash) + HAVING_FIELD_NUMBER; + hash = (53 * hash) + getHaving().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsRequest 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.v1.GroupAssetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsRequest 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.v1.GroupAssetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsRequest 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.v1.GroupAssetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsRequest 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.v1.GroupAssetsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsRequest 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.v1.GroupAssetsRequest 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; + } + /** + * + * + *
+   * Request message for grouping by assets.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GroupAssetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.GroupAssetsRequest) + com.google.cloud.securitycenter.v1.GroupAssetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GroupAssetsRequest.class, + com.google.cloud.securitycenter.v1.GroupAssetsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.GroupAssetsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + groupBy_ = ""; + + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + having_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupAssetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupAssetsRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.GroupAssetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupAssetsRequest build() { + com.google.cloud.securitycenter.v1.GroupAssetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupAssetsRequest buildPartial() { + com.google.cloud.securitycenter.v1.GroupAssetsRequest result = + new com.google.cloud.securitycenter.v1.GroupAssetsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.groupBy_ = groupBy_; + if (compareDurationBuilder_ == null) { + result.compareDuration_ = compareDuration_; + } else { + result.compareDuration_ = compareDurationBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.having_ = having_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.GroupAssetsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.GroupAssetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.GroupAssetsRequest other) { + if (other == com.google.cloud.securitycenter.v1.GroupAssetsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getGroupBy().isEmpty()) { + groupBy_ = other.groupBy_; + onChanged(); + } + if (other.hasCompareDuration()) { + mergeCompareDuration(other.getCompareDuration()); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (!other.getHaving().isEmpty()) { + having_ = other.having_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.GroupAssetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.GroupAssetsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Name of the organization to groupBy. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Name of the organization to groupBy. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Name of the organization to groupBy. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the organization to groupBy. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the organization to groupBy. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object groupBy_ = ""; + /** + * + * + *
+     * Expression that defines what assets fields to use for grouping. The string
+     * value should follow SQL syntax: comma separated list of fields. For
+     * example:
+     * "security_center_properties.resource_project,security_center_properties.project".
+     * The following fields are supported when compare_duration is not set:
+     * * security_center_properties.resource_project
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_parent
+     * The following fields are supported when compare_duration is set:
+     * * security_center_properties.resource_type
+     * 
+ * + * string group_by = 3; + */ + public java.lang.String getGroupBy() { + java.lang.Object ref = groupBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + groupBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines what assets fields to use for grouping. The string
+     * value should follow SQL syntax: comma separated list of fields. For
+     * example:
+     * "security_center_properties.resource_project,security_center_properties.project".
+     * The following fields are supported when compare_duration is not set:
+     * * security_center_properties.resource_project
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_parent
+     * The following fields are supported when compare_duration is set:
+     * * security_center_properties.resource_type
+     * 
+ * + * string group_by = 3; + */ + public com.google.protobuf.ByteString getGroupByBytes() { + java.lang.Object ref = groupBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + groupBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines what assets fields to use for grouping. The string
+     * value should follow SQL syntax: comma separated list of fields. For
+     * example:
+     * "security_center_properties.resource_project,security_center_properties.project".
+     * The following fields are supported when compare_duration is not set:
+     * * security_center_properties.resource_project
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_parent
+     * The following fields are supported when compare_duration is set:
+     * * security_center_properties.resource_type
+     * 
+ * + * string group_by = 3; + */ + public Builder setGroupBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + groupBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines what assets fields to use for grouping. The string
+     * value should follow SQL syntax: comma separated list of fields. For
+     * example:
+     * "security_center_properties.resource_project,security_center_properties.project".
+     * The following fields are supported when compare_duration is not set:
+     * * security_center_properties.resource_project
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_parent
+     * The following fields are supported when compare_duration is set:
+     * * security_center_properties.resource_type
+     * 
+ * + * string group_by = 3; + */ + public Builder clearGroupBy() { + + groupBy_ = getDefaultInstance().getGroupBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines what assets fields to use for grouping. The string
+     * value should follow SQL syntax: comma separated list of fields. For
+     * example:
+     * "security_center_properties.resource_project,security_center_properties.project".
+     * The following fields are supported when compare_duration is not set:
+     * * security_center_properties.resource_project
+     * * security_center_properties.resource_type
+     * * security_center_properties.resource_parent
+     * The following fields are supported when compare_duration is set:
+     * * security_center_properties.resource_type
+     * 
+ * + * string group_by = 3; + */ + public Builder setGroupByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + groupBy_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Duration compareDuration_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + compareDurationBuilder_; + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public boolean hasCompareDuration() { + return compareDurationBuilder_ != null || compareDuration_ != null; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public com.google.protobuf.Duration getCompareDuration() { + if (compareDurationBuilder_ == null) { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } else { + return compareDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public Builder setCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + compareDuration_ = value; + onChanged(); + } else { + compareDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public Builder setCompareDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (compareDurationBuilder_ == null) { + compareDuration_ = builderForValue.build(); + onChanged(); + } else { + compareDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public Builder mergeCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (compareDuration_ != null) { + compareDuration_ = + com.google.protobuf.Duration.newBuilder(compareDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + compareDuration_ = value; + } + onChanged(); + } else { + compareDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public Builder clearCompareDuration() { + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + onChanged(); + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public com.google.protobuf.Duration.Builder getCompareDurationBuilder() { + + onChanged(); + return getCompareDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + if (compareDurationBuilder_ != null) { + return compareDurationBuilder_.getMessageOrBuilder(); + } else { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" property is
+     * updated to indicate whether the asset was added, removed, or remained
+     * present during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at reference_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at reference_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and reference_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all assets present at
+     * read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getCompareDurationFieldBuilder() { + if (compareDurationBuilder_ == null) { + compareDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCompareDuration(), getParentForChildren(), isClean()); + compareDuration_ = null; + } + return compareDurationBuilder_; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private java.lang.Object having_ = ""; + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'state_change' is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + having_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'state_change' is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'state_change' is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public Builder setHaving(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + having_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'state_change' is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public Builder clearHaving() { + + having_ = getDefaultInstance().getHaving(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'state_change' is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public Builder setHavingBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + having_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `GroupAssetsResponse`; indicates
+     * that this is a continuation of a prior `GroupAssets` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 7; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last `GroupAssetsResponse`; indicates
+     * that this is a continuation of a prior `GroupAssets` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 7; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last `GroupAssetsResponse`; indicates
+     * that this is a continuation of a prior `GroupAssets` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 7; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `GroupAssetsResponse`; indicates
+     * that this is a continuation of a prior `GroupAssets` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 7; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `GroupAssetsResponse`; indicates
+     * that this is a continuation of a prior `GroupAssets` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 7; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 8; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 8; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 8; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.GroupAssetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.GroupAssetsRequest) + private static final com.google.cloud.securitycenter.v1.GroupAssetsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.GroupAssetsRequest(); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroupAssetsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GroupAssetsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupAssetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsRequestOrBuilder.java new file mode 100644 index 000000000000..d213fa6fb270 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsRequestOrBuilder.java @@ -0,0 +1,327 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface GroupAssetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.GroupAssetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the organization to groupBy. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Name of the organization to groupBy. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Expression that defines what assets fields to use for grouping. The string
+   * value should follow SQL syntax: comma separated list of fields. For
+   * example:
+   * "security_center_properties.resource_project,security_center_properties.project".
+   * The following fields are supported when compare_duration is not set:
+   * * security_center_properties.resource_project
+   * * security_center_properties.resource_type
+   * * security_center_properties.resource_parent
+   * The following fields are supported when compare_duration is set:
+   * * security_center_properties.resource_type
+   * 
+ * + * string group_by = 3; + */ + java.lang.String getGroupBy(); + /** + * + * + *
+   * Expression that defines what assets fields to use for grouping. The string
+   * value should follow SQL syntax: comma separated list of fields. For
+   * example:
+   * "security_center_properties.resource_project,security_center_properties.project".
+   * The following fields are supported when compare_duration is not set:
+   * * security_center_properties.resource_project
+   * * security_center_properties.resource_type
+   * * security_center_properties.resource_parent
+   * The following fields are supported when compare_duration is set:
+   * * security_center_properties.resource_type
+   * 
+ * + * string group_by = 3; + */ + com.google.protobuf.ByteString getGroupByBytes(); + + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" property is
+   * updated to indicate whether the asset was added, removed, or remained
+   * present during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at reference_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at reference_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and reference_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all assets present at
+   * read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + boolean hasCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" property is
+   * updated to indicate whether the asset was added, removed, or remained
+   * present during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at reference_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at reference_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and reference_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all assets present at
+   * read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + com.google.protobuf.Duration getCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" property is
+   * updated to indicate whether the asset was added, removed, or remained
+   * present during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at reference_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at reference_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and reference_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all assets present at
+   * read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder(); + + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'state_change' is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + java.lang.String getHaving(); + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'state_change' is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + com.google.protobuf.ByteString getHavingBytes(); + + /** + * + * + *
+   * The value returned by the last `GroupAssetsResponse`; indicates
+   * that this is a continuation of a prior `GroupAssets` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 7; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `GroupAssetsResponse`; indicates
+   * that this is a continuation of a prior `GroupAssets` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 7; + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 8; + */ + int getPageSize(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsResponse.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsResponse.java new file mode 100644 index 000000000000..f73e8559a7c0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsResponse.java @@ -0,0 +1,1492 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Response message for grouping by assets.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GroupAssetsResponse} + */ +public final class GroupAssetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.GroupAssetsResponse) + GroupAssetsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroupAssetsResponse.newBuilder() to construct. + private GroupAssetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroupAssetsResponse() { + groupByResults_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + totalSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GroupAssetsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + groupByResults_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + groupByResults_.add( + input.readMessage( + com.google.cloud.securitycenter.v1.GroupResult.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 32: + { + totalSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + groupByResults_ = java.util.Collections.unmodifiableList(groupByResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GroupAssetsResponse.class, + com.google.cloud.securitycenter.v1.GroupAssetsResponse.Builder.class); + } + + private int bitField0_; + public static final int GROUP_BY_RESULTS_FIELD_NUMBER = 1; + private java.util.List groupByResults_; + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public java.util.List getGroupByResultsList() { + return groupByResults_; + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public java.util.List + getGroupByResultsOrBuilderList() { + return groupByResults_; + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public int getGroupByResultsCount() { + return groupByResults_.size(); + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResult getGroupByResults(int index) { + return groupByResults_.get(index); + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResultOrBuilder getGroupByResultsOrBuilder( + int index) { + return groupByResults_.get(index); + } + + public static final int READ_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 4; + private int totalSize_; + /** + * + * + *
+   * The total number of results matching the query.
+   * 
+ * + * int32 total_size = 4; + */ + public int getTotalSize() { + return totalSize_; + } + + 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 < groupByResults_.size(); i++) { + output.writeMessage(1, groupByResults_.get(i)); + } + if (readTime_ != null) { + output.writeMessage(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + } + if (totalSize_ != 0) { + output.writeInt32(4, totalSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < groupByResults_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, groupByResults_.get(i)); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, totalSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.GroupAssetsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.GroupAssetsResponse other = + (com.google.cloud.securitycenter.v1.GroupAssetsResponse) obj; + + boolean result = true; + result = result && getGroupByResultsList().equals(other.getGroupByResultsList()); + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && getNextPageToken().equals(other.getNextPageToken()); + result = result && (getTotalSize() == other.getTotalSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getGroupByResultsCount() > 0) { + hash = (37 * hash) + GROUP_BY_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getGroupByResultsList().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsResponse 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.v1.GroupAssetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsResponse 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.v1.GroupAssetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsResponse 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.v1.GroupAssetsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsResponse 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.v1.GroupAssetsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsResponse 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.v1.GroupAssetsResponse 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; + } + /** + * + * + *
+   * Response message for grouping by assets.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GroupAssetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.GroupAssetsResponse) + com.google.cloud.securitycenter.v1.GroupAssetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GroupAssetsResponse.class, + com.google.cloud.securitycenter.v1.GroupAssetsResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.GroupAssetsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getGroupByResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (groupByResultsBuilder_ == null) { + groupByResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + groupByResultsBuilder_.clear(); + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + nextPageToken_ = ""; + + totalSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupAssetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupAssetsResponse getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.GroupAssetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupAssetsResponse build() { + com.google.cloud.securitycenter.v1.GroupAssetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupAssetsResponse buildPartial() { + com.google.cloud.securitycenter.v1.GroupAssetsResponse result = + new com.google.cloud.securitycenter.v1.GroupAssetsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (groupByResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + groupByResults_ = java.util.Collections.unmodifiableList(groupByResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.groupByResults_ = groupByResults_; + } else { + result.groupByResults_ = groupByResultsBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.totalSize_ = totalSize_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.GroupAssetsResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1.GroupAssetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.GroupAssetsResponse other) { + if (other == com.google.cloud.securitycenter.v1.GroupAssetsResponse.getDefaultInstance()) + return this; + if (groupByResultsBuilder_ == null) { + if (!other.groupByResults_.isEmpty()) { + if (groupByResults_.isEmpty()) { + groupByResults_ = other.groupByResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGroupByResultsIsMutable(); + groupByResults_.addAll(other.groupByResults_); + } + onChanged(); + } + } else { + if (!other.groupByResults_.isEmpty()) { + if (groupByResultsBuilder_.isEmpty()) { + groupByResultsBuilder_.dispose(); + groupByResultsBuilder_ = null; + groupByResults_ = other.groupByResults_; + bitField0_ = (bitField0_ & ~0x00000001); + groupByResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGroupByResultsFieldBuilder() + : null; + } else { + groupByResultsBuilder_.addAllMessages(other.groupByResults_); + } + } + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.GroupAssetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.GroupAssetsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List groupByResults_ = + java.util.Collections.emptyList(); + + private void ensureGroupByResultsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + groupByResults_ = + new java.util.ArrayList( + groupByResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.GroupResult, + com.google.cloud.securitycenter.v1.GroupResult.Builder, + com.google.cloud.securitycenter.v1.GroupResultOrBuilder> + groupByResultsBuilder_; + + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public java.util.List getGroupByResultsList() { + if (groupByResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(groupByResults_); + } else { + return groupByResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public int getGroupByResultsCount() { + if (groupByResultsBuilder_ == null) { + return groupByResults_.size(); + } else { + return groupByResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResult getGroupByResults(int index) { + if (groupByResultsBuilder_ == null) { + return groupByResults_.get(index); + } else { + return groupByResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder setGroupByResults( + int index, com.google.cloud.securitycenter.v1.GroupResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.set(index, value); + onChanged(); + } else { + groupByResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder setGroupByResults( + int index, com.google.cloud.securitycenter.v1.GroupResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.set(index, builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults(com.google.cloud.securitycenter.v1.GroupResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.add(value); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults( + int index, com.google.cloud.securitycenter.v1.GroupResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.add(index, value); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults( + com.google.cloud.securitycenter.v1.GroupResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.add(builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults( + int index, com.google.cloud.securitycenter.v1.GroupResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.add(index, builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder addAllGroupByResults( + java.lang.Iterable values) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groupByResults_); + onChanged(); + } else { + groupByResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder clearGroupByResults() { + if (groupByResultsBuilder_ == null) { + groupByResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + groupByResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder removeGroupByResults(int index) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.remove(index); + onChanged(); + } else { + groupByResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResult.Builder getGroupByResultsBuilder( + int index) { + return getGroupByResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResultOrBuilder getGroupByResultsOrBuilder( + int index) { + if (groupByResultsBuilder_ == null) { + return groupByResults_.get(index); + } else { + return groupByResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public java.util.List + getGroupByResultsOrBuilderList() { + if (groupByResultsBuilder_ != null) { + return groupByResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(groupByResults_); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResult.Builder addGroupByResultsBuilder() { + return getGroupByResultsFieldBuilder() + .addBuilder(com.google.cloud.securitycenter.v1.GroupResult.getDefaultInstance()); + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResult.Builder addGroupByResultsBuilder( + int index) { + return getGroupByResultsFieldBuilder() + .addBuilder(index, com.google.cloud.securitycenter.v1.GroupResult.getDefaultInstance()); + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public java.util.List + getGroupByResultsBuilderList() { + return getGroupByResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.GroupResult, + com.google.cloud.securitycenter.v1.GroupResult.Builder, + com.google.cloud.securitycenter.v1.GroupResultOrBuilder> + getGroupByResultsFieldBuilder() { + if (groupByResultsBuilder_ == null) { + groupByResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.GroupResult, + com.google.cloud.securitycenter.v1.GroupResult.Builder, + com.google.cloud.securitycenter.v1.GroupResultOrBuilder>( + groupByResults_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + groupByResults_ = null; + } + return groupByResultsBuilder_; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private int totalSize_; + /** + * + * + *
+     * The total number of results matching the query.
+     * 
+ * + * int32 total_size = 4; + */ + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The total number of results matching the query.
+     * 
+ * + * int32 total_size = 4; + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of results matching the query.
+     * 
+ * + * int32 total_size = 4; + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.GroupAssetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.GroupAssetsResponse) + private static final com.google.cloud.securitycenter.v1.GroupAssetsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.GroupAssetsResponse(); + } + + public static com.google.cloud.securitycenter.v1.GroupAssetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroupAssetsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GroupAssetsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupAssetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsResponseOrBuilder.java new file mode 100644 index 000000000000..e5c95b50c821 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupAssetsResponseOrBuilder.java @@ -0,0 +1,137 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface GroupAssetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.GroupAssetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + java.util.List getGroupByResultsList(); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + com.google.cloud.securitycenter.v1.GroupResult getGroupByResults(int index); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + int getGroupByResultsCount(); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + java.util.List + getGroupByResultsOrBuilderList(); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + com.google.cloud.securitycenter.v1.GroupResultOrBuilder getGroupByResultsOrBuilder(int index); + + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * The total number of results matching the query.
+   * 
+ * + * int32 total_size = 4; + */ + int getTotalSize(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsRequest.java new file mode 100644 index 000000000000..35bbf22866a8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsRequest.java @@ -0,0 +1,2350 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for grouping by findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GroupFindingsRequest} + */ +public final class GroupFindingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.GroupFindingsRequest) + GroupFindingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroupFindingsRequest.newBuilder() to construct. + private GroupFindingsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroupFindingsRequest() { + parent_ = ""; + filter_ = ""; + groupBy_ = ""; + having_ = ""; + pageToken_ = ""; + pageSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GroupFindingsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + groupBy_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (compareDuration_ != null) { + subBuilder = compareDuration_.toBuilder(); + } + compareDuration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(compareDuration_); + compareDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + having_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 64: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GroupFindingsRequest.class, + com.google.cloud.securitycenter.v1.GroupFindingsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Name of the source to groupBy. Its format is
+   * "organizations/[organization_id]/sources/[source_id]". To groupBy across
+   * all sources provide a source_id of `-`. For example:
+   * organizations/123/sources/-
+   * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+   * Name of the source to groupBy. Its format is
+   * "organizations/[organization_id]/sources/[source_id]". To groupBy across
+   * all sources provide a source_id of `-`. For example:
+   * organizations/123/sources/-
+   * 
+ * + * string parent = 1; + */ + 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 FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GROUP_BY_FIELD_NUMBER = 3; + private volatile java.lang.Object groupBy_; + /** + * + * + *
+   * Expression that defines what assets fields to use for grouping (including
+   * `state_change`). 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
+   * * state_change
+   * * parent
+   * 
+ * + * string group_by = 3; + */ + public java.lang.String getGroupBy() { + java.lang.Object ref = groupBy_; + 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(); + groupBy_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines what assets fields to use for grouping (including
+   * `state_change`). 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
+   * * state_change
+   * * parent
+   * 
+ * + * string group_by = 3; + */ + public com.google.protobuf.ByteString getGroupByBytes() { + java.lang.Object ref = groupBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + groupBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int COMPARE_DURATION_FIELD_NUMBER = 5; + private com.google.protobuf.Duration compareDuration_; + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" attribute is
+   * updated to indicate whether the finding had its state changed, the
+   * finding's state remained unchanged, or if the finding was added during the
+   * compare_duration period of time that precedes the read_time. This is the
+   * time between (read_time - compare_duration) and read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all findings present
+   * at read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public boolean hasCompareDuration() { + return compareDuration_ != null; + } + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" attribute is
+   * updated to indicate whether the finding had its state changed, the
+   * finding's state remained unchanged, or if the finding was added during the
+   * compare_duration period of time that precedes the read_time. This is the
+   * time between (read_time - compare_duration) and read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all findings present
+   * at read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.Duration getCompareDuration() { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" attribute is
+   * updated to indicate whether the finding had its state changed, the
+   * finding's state remained unchanged, or if the finding was added during the
+   * compare_duration period of time that precedes the read_time. This is the
+   * time between (read_time - compare_duration) and read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all findings present
+   * at read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + return getCompareDuration(); + } + + public static final int HAVING_FIELD_NUMBER = 6; + private volatile java.lang.Object having_; + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'finding.state' and 'state_change'
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + 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(); + having_ = s; + return s; + } + } + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'finding.state' and 'state_change'
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 7; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last `GroupFindingsResponse`; indicates
+   * that this is a continuation of a prior `GroupFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 7; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last `GroupFindingsResponse`; indicates
+   * that this is a continuation of a prior `GroupFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 7; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 8; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 8; + */ + public int getPageSize() { + return pageSize_; + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (!getGroupByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, groupBy_); + } + if (readTime_ != null) { + output.writeMessage(4, getReadTime()); + } + if (compareDuration_ != null) { + output.writeMessage(5, getCompareDuration()); + } + if (!getHavingBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, having_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(8, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (!getGroupByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, groupBy_); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getReadTime()); + } + if (compareDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCompareDuration()); + } + if (!getHavingBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, having_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(8, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.GroupFindingsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.GroupFindingsRequest other = + (com.google.cloud.securitycenter.v1.GroupFindingsRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && getFilter().equals(other.getFilter()); + result = result && getGroupBy().equals(other.getGroupBy()); + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && (hasCompareDuration() == other.hasCompareDuration()); + if (hasCompareDuration()) { + result = result && getCompareDuration().equals(other.getCompareDuration()); + } + result = result && getHaving().equals(other.getHaving()); + result = result && getPageToken().equals(other.getPageToken()); + result = result && (getPageSize() == other.getPageSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + GROUP_BY_FIELD_NUMBER; + hash = (53 * hash) + getGroupBy().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + if (hasCompareDuration()) { + hash = (37 * hash) + COMPARE_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getCompareDuration().hashCode(); + } + hash = (37 * hash) + HAVING_FIELD_NUMBER; + hash = (53 * hash) + getHaving().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsRequest 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.v1.GroupFindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsRequest 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.v1.GroupFindingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsRequest 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.v1.GroupFindingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsRequest 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.v1.GroupFindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsRequest 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.v1.GroupFindingsRequest 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; + } + /** + * + * + *
+   * Request message for grouping by findings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GroupFindingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.GroupFindingsRequest) + com.google.cloud.securitycenter.v1.GroupFindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GroupFindingsRequest.class, + com.google.cloud.securitycenter.v1.GroupFindingsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.GroupFindingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + groupBy_ = ""; + + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + having_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupFindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupFindingsRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.GroupFindingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupFindingsRequest build() { + com.google.cloud.securitycenter.v1.GroupFindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupFindingsRequest buildPartial() { + com.google.cloud.securitycenter.v1.GroupFindingsRequest result = + new com.google.cloud.securitycenter.v1.GroupFindingsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.groupBy_ = groupBy_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + if (compareDurationBuilder_ == null) { + result.compareDuration_ = compareDuration_; + } else { + result.compareDuration_ = compareDurationBuilder_.build(); + } + result.having_ = having_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.GroupFindingsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.GroupFindingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.GroupFindingsRequest other) { + if (other == com.google.cloud.securitycenter.v1.GroupFindingsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getGroupBy().isEmpty()) { + groupBy_ = other.groupBy_; + onChanged(); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (other.hasCompareDuration()) { + mergeCompareDuration(other.getCompareDuration()); + } + if (!other.getHaving().isEmpty()) { + having_ = other.having_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.GroupFindingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.GroupFindingsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Name of the source to groupBy. Its format is
+     * "organizations/[organization_id]/sources/[source_id]". To groupBy across
+     * all sources provide a source_id of `-`. For example:
+     * organizations/123/sources/-
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Name of the source to groupBy. Its format is
+     * "organizations/[organization_id]/sources/[source_id]". To groupBy across
+     * all sources provide a source_id of `-`. For example:
+     * organizations/123/sources/-
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Name of the source to groupBy. Its format is
+     * "organizations/[organization_id]/sources/[source_id]". To groupBy across
+     * all sources provide a source_id of `-`. For example:
+     * organizations/123/sources/-
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the source to groupBy. Its format is
+     * "organizations/[organization_id]/sources/[source_id]". To groupBy across
+     * all sources provide a source_id of `-`. For example:
+     * organizations/123/sources/-
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the source to groupBy. Its format is
+     * "organizations/[organization_id]/sources/[source_id]". To groupBy across
+     * all sources provide a source_id of `-`. For example:
+     * organizations/123/sources/-
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object groupBy_ = ""; + /** + * + * + *
+     * Expression that defines what assets fields to use for grouping (including
+     * `state_change`). 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
+     * * state_change
+     * * parent
+     * 
+ * + * string group_by = 3; + */ + public java.lang.String getGroupBy() { + java.lang.Object ref = groupBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + groupBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines what assets fields to use for grouping (including
+     * `state_change`). 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
+     * * state_change
+     * * parent
+     * 
+ * + * string group_by = 3; + */ + public com.google.protobuf.ByteString getGroupByBytes() { + java.lang.Object ref = groupBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + groupBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines what assets fields to use for grouping (including
+     * `state_change`). 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
+     * * state_change
+     * * parent
+     * 
+ * + * string group_by = 3; + */ + public Builder setGroupBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + groupBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines what assets fields to use for grouping (including
+     * `state_change`). 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
+     * * state_change
+     * * parent
+     * 
+ * + * string group_by = 3; + */ + public Builder clearGroupBy() { + + groupBy_ = getDefaultInstance().getGroupBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines what assets fields to use for grouping (including
+     * `state_change`). 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
+     * * state_change
+     * * parent
+     * 
+ * + * string group_by = 3; + */ + public Builder setGroupByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + groupBy_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private com.google.protobuf.Duration compareDuration_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + compareDurationBuilder_; + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public boolean hasCompareDuration() { + return compareDurationBuilder_ != null || compareDuration_ != null; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.Duration getCompareDuration() { + if (compareDurationBuilder_ == null) { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } else { + return compareDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder setCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + compareDuration_ = value; + onChanged(); + } else { + compareDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder setCompareDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (compareDurationBuilder_ == null) { + compareDuration_ = builderForValue.build(); + onChanged(); + } else { + compareDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder mergeCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (compareDuration_ != null) { + compareDuration_ = + com.google.protobuf.Duration.newBuilder(compareDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + compareDuration_ = value; + } + onChanged(); + } else { + compareDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder clearCompareDuration() { + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + onChanged(); + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.Duration.Builder getCompareDurationBuilder() { + + onChanged(); + return getCompareDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + if (compareDurationBuilder_ != null) { + return compareDurationBuilder_.getMessageOrBuilder(); + } else { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + } + /** + * + * + *
+     * When compare_duration is set, the GroupResult's "state_change" attribute is
+     * updated to indicate whether the finding had its state changed, the
+     * finding's state remained unchanged, or if the finding was added during the
+     * compare_duration period of time that precedes the read_time. This is the
+     * time between (read_time - compare_duration) and read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all findings present
+     * at read_time.
+     * If this field is set then `state_change` must be a specified field in
+     * `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getCompareDurationFieldBuilder() { + if (compareDurationBuilder_ == null) { + compareDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCompareDuration(), getParentForChildren(), isClean()); + compareDuration_ = null; + } + return compareDurationBuilder_; + } + + private java.lang.Object having_ = ""; + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'finding.state' and 'state_change'
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + having_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'finding.state' and 'state_change'
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'finding.state' and 'state_change'
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public Builder setHaving(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + having_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'finding.state' and 'state_change'
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public Builder clearHaving() { + + having_ = getDefaultInstance().getHaving(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'finding.state' and 'state_change'
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public Builder setHavingBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + having_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `GroupFindingsResponse`; indicates
+     * that this is a continuation of a prior `GroupFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 7; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last `GroupFindingsResponse`; indicates
+     * that this is a continuation of a prior `GroupFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 7; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last `GroupFindingsResponse`; indicates
+     * that this is a continuation of a prior `GroupFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 7; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `GroupFindingsResponse`; indicates
+     * that this is a continuation of a prior `GroupFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 7; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `GroupFindingsResponse`; indicates
+     * that this is a continuation of a prior `GroupFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 7; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 8; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 8; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 8; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.GroupFindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.GroupFindingsRequest) + private static final com.google.cloud.securitycenter.v1.GroupFindingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.GroupFindingsRequest(); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroupFindingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GroupFindingsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupFindingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsRequestOrBuilder.java new file mode 100644 index 000000000000..7f6ed23a6616 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsRequestOrBuilder.java @@ -0,0 +1,322 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface GroupFindingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.GroupFindingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the source to groupBy. Its format is
+   * "organizations/[organization_id]/sources/[source_id]". To groupBy across
+   * all sources provide a source_id of `-`. For example:
+   * organizations/123/sources/-
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Name of the source to groupBy. Its format is
+   * "organizations/[organization_id]/sources/[source_id]". To groupBy across
+   * all sources provide a source_id of `-`. For example:
+   * organizations/123/sources/-
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Expression that defines what assets fields to use for grouping (including
+   * `state_change`). 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
+   * * state_change
+   * * parent
+   * 
+ * + * string group_by = 3; + */ + java.lang.String getGroupBy(); + /** + * + * + *
+   * Expression that defines what assets fields to use for grouping (including
+   * `state_change`). 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
+   * * state_change
+   * * parent
+   * 
+ * + * string group_by = 3; + */ + com.google.protobuf.ByteString getGroupByBytes(); + + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" attribute is
+   * updated to indicate whether the finding had its state changed, the
+   * finding's state remained unchanged, or if the finding was added during the
+   * compare_duration period of time that precedes the read_time. This is the
+   * time between (read_time - compare_duration) and read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all findings present
+   * at read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + boolean hasCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" attribute is
+   * updated to indicate whether the finding had its state changed, the
+   * finding's state remained unchanged, or if the finding was added during the
+   * compare_duration period of time that precedes the read_time. This is the
+   * time between (read_time - compare_duration) and read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all findings present
+   * at read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + com.google.protobuf.Duration getCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the GroupResult's "state_change" attribute is
+   * updated to indicate whether the finding had its state changed, the
+   * finding's state remained unchanged, or if the finding was added during the
+   * compare_duration period of time that precedes the read_time. This is the
+   * time between (read_time - compare_duration) and read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all findings present
+   * at read_time.
+   * If this field is set then `state_change` must be a specified field in
+   * `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder(); + + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'finding.state' and 'state_change'
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + java.lang.String getHaving(); + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'finding.state' and 'state_change'
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + com.google.protobuf.ByteString getHavingBytes(); + + /** + * + * + *
+   * The value returned by the last `GroupFindingsResponse`; indicates
+   * that this is a continuation of a prior `GroupFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 7; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `GroupFindingsResponse`; indicates
+   * that this is a continuation of a prior `GroupFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 7; + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 8; + */ + int getPageSize(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsResponse.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsResponse.java new file mode 100644 index 000000000000..1d75196fe8a2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsResponse.java @@ -0,0 +1,1492 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Response message for group by findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GroupFindingsResponse} + */ +public final class GroupFindingsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.GroupFindingsResponse) + GroupFindingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroupFindingsResponse.newBuilder() to construct. + private GroupFindingsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroupFindingsResponse() { + groupByResults_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + totalSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GroupFindingsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + groupByResults_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + groupByResults_.add( + input.readMessage( + com.google.cloud.securitycenter.v1.GroupResult.parser(), extensionRegistry)); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 32: + { + totalSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + groupByResults_ = java.util.Collections.unmodifiableList(groupByResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GroupFindingsResponse.class, + com.google.cloud.securitycenter.v1.GroupFindingsResponse.Builder.class); + } + + private int bitField0_; + public static final int GROUP_BY_RESULTS_FIELD_NUMBER = 1; + private java.util.List groupByResults_; + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public java.util.List getGroupByResultsList() { + return groupByResults_; + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public java.util.List + getGroupByResultsOrBuilderList() { + return groupByResults_; + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public int getGroupByResultsCount() { + return groupByResults_.size(); + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResult getGroupByResults(int index) { + return groupByResults_.get(index); + } + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResultOrBuilder getGroupByResultsOrBuilder( + int index) { + return groupByResults_.get(index); + } + + public static final int READ_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 4; + private int totalSize_; + /** + * + * + *
+   * The total number of results matching the query.
+   * 
+ * + * int32 total_size = 4; + */ + public int getTotalSize() { + return totalSize_; + } + + 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 < groupByResults_.size(); i++) { + output.writeMessage(1, groupByResults_.get(i)); + } + if (readTime_ != null) { + output.writeMessage(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + } + if (totalSize_ != 0) { + output.writeInt32(4, totalSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < groupByResults_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, groupByResults_.get(i)); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, totalSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.GroupFindingsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.GroupFindingsResponse other = + (com.google.cloud.securitycenter.v1.GroupFindingsResponse) obj; + + boolean result = true; + result = result && getGroupByResultsList().equals(other.getGroupByResultsList()); + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && getNextPageToken().equals(other.getNextPageToken()); + result = result && (getTotalSize() == other.getTotalSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getGroupByResultsCount() > 0) { + hash = (37 * hash) + GROUP_BY_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getGroupByResultsList().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsResponse 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.v1.GroupFindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsResponse 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.v1.GroupFindingsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsResponse 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.v1.GroupFindingsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsResponse 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.v1.GroupFindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsResponse 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.v1.GroupFindingsResponse 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; + } + /** + * + * + *
+   * Response message for group by findings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GroupFindingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.GroupFindingsResponse) + com.google.cloud.securitycenter.v1.GroupFindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GroupFindingsResponse.class, + com.google.cloud.securitycenter.v1.GroupFindingsResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.GroupFindingsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getGroupByResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (groupByResultsBuilder_ == null) { + groupByResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + groupByResultsBuilder_.clear(); + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + nextPageToken_ = ""; + + totalSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupFindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupFindingsResponse getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.GroupFindingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupFindingsResponse build() { + com.google.cloud.securitycenter.v1.GroupFindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupFindingsResponse buildPartial() { + com.google.cloud.securitycenter.v1.GroupFindingsResponse result = + new com.google.cloud.securitycenter.v1.GroupFindingsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (groupByResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + groupByResults_ = java.util.Collections.unmodifiableList(groupByResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.groupByResults_ = groupByResults_; + } else { + result.groupByResults_ = groupByResultsBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.totalSize_ = totalSize_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.GroupFindingsResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1.GroupFindingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.GroupFindingsResponse other) { + if (other == com.google.cloud.securitycenter.v1.GroupFindingsResponse.getDefaultInstance()) + return this; + if (groupByResultsBuilder_ == null) { + if (!other.groupByResults_.isEmpty()) { + if (groupByResults_.isEmpty()) { + groupByResults_ = other.groupByResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGroupByResultsIsMutable(); + groupByResults_.addAll(other.groupByResults_); + } + onChanged(); + } + } else { + if (!other.groupByResults_.isEmpty()) { + if (groupByResultsBuilder_.isEmpty()) { + groupByResultsBuilder_.dispose(); + groupByResultsBuilder_ = null; + groupByResults_ = other.groupByResults_; + bitField0_ = (bitField0_ & ~0x00000001); + groupByResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGroupByResultsFieldBuilder() + : null; + } else { + groupByResultsBuilder_.addAllMessages(other.groupByResults_); + } + } + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.GroupFindingsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.GroupFindingsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List groupByResults_ = + java.util.Collections.emptyList(); + + private void ensureGroupByResultsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + groupByResults_ = + new java.util.ArrayList( + groupByResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.GroupResult, + com.google.cloud.securitycenter.v1.GroupResult.Builder, + com.google.cloud.securitycenter.v1.GroupResultOrBuilder> + groupByResultsBuilder_; + + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public java.util.List getGroupByResultsList() { + if (groupByResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(groupByResults_); + } else { + return groupByResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public int getGroupByResultsCount() { + if (groupByResultsBuilder_ == null) { + return groupByResults_.size(); + } else { + return groupByResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResult getGroupByResults(int index) { + if (groupByResultsBuilder_ == null) { + return groupByResults_.get(index); + } else { + return groupByResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder setGroupByResults( + int index, com.google.cloud.securitycenter.v1.GroupResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.set(index, value); + onChanged(); + } else { + groupByResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder setGroupByResults( + int index, com.google.cloud.securitycenter.v1.GroupResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.set(index, builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults(com.google.cloud.securitycenter.v1.GroupResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.add(value); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults( + int index, com.google.cloud.securitycenter.v1.GroupResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.add(index, value); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults( + com.google.cloud.securitycenter.v1.GroupResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.add(builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults( + int index, com.google.cloud.securitycenter.v1.GroupResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.add(index, builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder addAllGroupByResults( + java.lang.Iterable values) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groupByResults_); + onChanged(); + } else { + groupByResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder clearGroupByResults() { + if (groupByResultsBuilder_ == null) { + groupByResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + groupByResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public Builder removeGroupByResults(int index) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.remove(index); + onChanged(); + } else { + groupByResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResult.Builder getGroupByResultsBuilder( + int index) { + return getGroupByResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResultOrBuilder getGroupByResultsOrBuilder( + int index) { + if (groupByResultsBuilder_ == null) { + return groupByResults_.get(index); + } else { + return groupByResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public java.util.List + getGroupByResultsOrBuilderList() { + if (groupByResultsBuilder_ != null) { + return groupByResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(groupByResults_); + } + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResult.Builder addGroupByResultsBuilder() { + return getGroupByResultsFieldBuilder() + .addBuilder(com.google.cloud.securitycenter.v1.GroupResult.getDefaultInstance()); + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1.GroupResult.Builder addGroupByResultsBuilder( + int index) { + return getGroupByResultsFieldBuilder() + .addBuilder(index, com.google.cloud.securitycenter.v1.GroupResult.getDefaultInstance()); + } + /** + * + * + *
+     * Group results. There exists an element for each existing unique
+     * combination of property/values. The element contains a count for the number
+     * of times those specific property/values appear.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + public java.util.List + getGroupByResultsBuilderList() { + return getGroupByResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.GroupResult, + com.google.cloud.securitycenter.v1.GroupResult.Builder, + com.google.cloud.securitycenter.v1.GroupResultOrBuilder> + getGroupByResultsFieldBuilder() { + if (groupByResultsBuilder_ == null) { + groupByResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.GroupResult, + com.google.cloud.securitycenter.v1.GroupResult.Builder, + com.google.cloud.securitycenter.v1.GroupResultOrBuilder>( + groupByResults_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + groupByResults_ = null; + } + return groupByResultsBuilder_; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used for executing the groupBy request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private int totalSize_; + /** + * + * + *
+     * The total number of results matching the query.
+     * 
+ * + * int32 total_size = 4; + */ + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The total number of results matching the query.
+     * 
+ * + * int32 total_size = 4; + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of results matching the query.
+     * 
+ * + * int32 total_size = 4; + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.GroupFindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.GroupFindingsResponse) + private static final com.google.cloud.securitycenter.v1.GroupFindingsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.GroupFindingsResponse(); + } + + public static com.google.cloud.securitycenter.v1.GroupFindingsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroupFindingsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GroupFindingsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupFindingsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsResponseOrBuilder.java new file mode 100644 index 000000000000..89a012a7db0d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupFindingsResponseOrBuilder.java @@ -0,0 +1,137 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface GroupFindingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.GroupFindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + java.util.List getGroupByResultsList(); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + com.google.cloud.securitycenter.v1.GroupResult getGroupByResults(int index); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + int getGroupByResultsCount(); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + java.util.List + getGroupByResultsOrBuilderList(); + /** + * + * + *
+   * Group results. There exists an element for each existing unique
+   * combination of property/values. The element contains a count for the number
+   * of times those specific property/values appear.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.GroupResult group_by_results = 1; + */ + com.google.cloud.securitycenter.v1.GroupResultOrBuilder getGroupByResultsOrBuilder(int index); + + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used for executing the groupBy request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * The total number of results matching the query.
+   * 
+ * + * int32 total_size = 4; + */ + int getTotalSize(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupResult.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupResult.java new file mode 100644 index 000000000000..10bb48d35108 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupResult.java @@ -0,0 +1,847 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Result containing the properties and count of a groupBy request.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GroupResult} + */ +public final class GroupResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.GroupResult) + GroupResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use GroupResult.newBuilder() to construct. + private GroupResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GroupResult() { + count_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GroupResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + properties_ = + com.google.protobuf.MapField.newMapField( + PropertiesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + properties__ = + input.readMessage( + PropertiesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + properties_.getMutableMap().put(properties__.getKey(), properties__.getValue()); + break; + } + case 16: + { + count_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GroupResult.class, + com.google.cloud.securitycenter.v1.GroupResult.Builder.class); + } + + private int bitField0_; + public static final int PROPERTIES_FIELD_NUMBER = 1; + + private static final class PropertiesDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupResult_PropertiesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.protobuf.Value.getDefaultInstance()); + } + + private com.google.protobuf.MapField properties_; + + private com.google.protobuf.MapField + internalGetProperties() { + if (properties_ == null) { + return com.google.protobuf.MapField.emptyMapField(PropertiesDefaultEntryHolder.defaultEntry); + } + return properties_; + } + + public int getPropertiesCount() { + return internalGetProperties().getMap().size(); + } + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public boolean containsProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetProperties().getMap().containsKey(key); + } + /** Use {@link #getPropertiesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getProperties() { + return getPropertiesMap(); + } + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public java.util.Map getPropertiesMap() { + return internalGetProperties().getMap(); + } + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public com.google.protobuf.Value getPropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public com.google.protobuf.Value getPropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int COUNT_FIELD_NUMBER = 2; + private long count_; + /** + * + * + *
+   * Total count of resources for the given properties.
+   * 
+ * + * int64 count = 2; + */ + public long getCount() { + return count_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetProperties(), PropertiesDefaultEntryHolder.defaultEntry, 1); + if (count_ != 0L) { + output.writeInt64(2, count_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetProperties().getMap().entrySet()) { + com.google.protobuf.MapEntry properties__ = + PropertiesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, properties__); + } + if (count_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, count_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.GroupResult)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.GroupResult other = + (com.google.cloud.securitycenter.v1.GroupResult) obj; + + boolean result = true; + result = result && internalGetProperties().equals(other.internalGetProperties()); + result = result && (getCount() == other.getCount()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetProperties().getMap().isEmpty()) { + hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + internalGetProperties().hashCode(); + } + hash = (37 * hash) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.GroupResult parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupResult 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.v1.GroupResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupResult 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.v1.GroupResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.GroupResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.GroupResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupResult 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.v1.GroupResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupResult 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.v1.GroupResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.GroupResult 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.v1.GroupResult 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; + } + /** + * + * + *
+   * Result containing the properties and count of a groupBy request.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.GroupResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.GroupResult) + com.google.cloud.securitycenter.v1.GroupResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupResult_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableProperties(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.GroupResult.class, + com.google.cloud.securitycenter.v1.GroupResult.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.GroupResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableProperties().clear(); + count_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_GroupResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupResult getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.GroupResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupResult build() { + com.google.cloud.securitycenter.v1.GroupResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupResult buildPartial() { + com.google.cloud.securitycenter.v1.GroupResult result = + new com.google.cloud.securitycenter.v1.GroupResult(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.properties_ = internalGetProperties(); + result.properties_.makeImmutable(); + result.count_ = count_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.GroupResult) { + return mergeFrom((com.google.cloud.securitycenter.v1.GroupResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.GroupResult other) { + if (other == com.google.cloud.securitycenter.v1.GroupResult.getDefaultInstance()) return this; + internalGetMutableProperties().mergeFrom(other.internalGetProperties()); + if (other.getCount() != 0L) { + setCount(other.getCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.GroupResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1.GroupResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField properties_; + + private com.google.protobuf.MapField + internalGetProperties() { + if (properties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + PropertiesDefaultEntryHolder.defaultEntry); + } + return properties_; + } + + private com.google.protobuf.MapField + internalGetMutableProperties() { + onChanged(); + ; + if (properties_ == null) { + properties_ = + com.google.protobuf.MapField.newMapField(PropertiesDefaultEntryHolder.defaultEntry); + } + if (!properties_.isMutable()) { + properties_ = properties_.copy(); + } + return properties_; + } + + public int getPropertiesCount() { + return internalGetProperties().getMap().size(); + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public boolean containsProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetProperties().getMap().containsKey(key); + } + /** Use {@link #getPropertiesMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getProperties() { + return getPropertiesMap(); + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public java.util.Map getPropertiesMap() { + return internalGetProperties().getMap(); + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public com.google.protobuf.Value getPropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public com.google.protobuf.Value getPropertiesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearProperties() { + internalGetMutableProperties().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public Builder removeProperties(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableProperties().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableProperties() { + return internalGetMutableProperties().getMutableMap(); + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public Builder putProperties(java.lang.String key, com.google.protobuf.Value value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableProperties().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Properties matching the groupBy fields in the request.
+     * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + public Builder putAllProperties( + java.util.Map values) { + internalGetMutableProperties().getMutableMap().putAll(values); + return this; + } + + private long count_; + /** + * + * + *
+     * Total count of resources for the given properties.
+     * 
+ * + * int64 count = 2; + */ + public long getCount() { + return count_; + } + /** + * + * + *
+     * Total count of resources for the given properties.
+     * 
+ * + * int64 count = 2; + */ + public Builder setCount(long value) { + + count_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Total count of resources for the given properties.
+     * 
+ * + * int64 count = 2; + */ + public Builder clearCount() { + + count_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.GroupResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.GroupResult) + private static final com.google.cloud.securitycenter.v1.GroupResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.GroupResult(); + } + + public static com.google.cloud.securitycenter.v1.GroupResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GroupResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GroupResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.GroupResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupResultOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupResultOrBuilder.java new file mode 100644 index 000000000000..fbdd393c5a4d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/GroupResultOrBuilder.java @@ -0,0 +1,76 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface GroupResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.GroupResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + int getPropertiesCount(); + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + boolean containsProperties(java.lang.String key); + /** Use {@link #getPropertiesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getProperties(); + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + java.util.Map getPropertiesMap(); + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + com.google.protobuf.Value getPropertiesOrDefault( + java.lang.String key, com.google.protobuf.Value defaultValue); + /** + * + * + *
+   * Properties matching the groupBy fields in the request.
+   * 
+ * + * map<string, .google.protobuf.Value> properties = 1; + */ + com.google.protobuf.Value getPropertiesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Total count of resources for the given properties.
+   * 
+ * + * int64 count = 2; + */ + long getCount(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsRequest.java new file mode 100644 index 000000000000..89f6093979cf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsRequest.java @@ -0,0 +1,2623 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for listing assets.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListAssetsRequest} + */ +public final class ListAssetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.ListAssetsRequest) + ListAssetsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAssetsRequest.newBuilder() to construct. + private ListAssetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAssetsRequest() { + parent_ = ""; + filter_ = ""; + orderBy_ = ""; + having_ = ""; + pageToken_ = ""; + pageSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAssetsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (compareDuration_ != null) { + subBuilder = compareDuration_.toBuilder(); + } + compareDuration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(compareDuration_); + compareDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + having_ = s; + break; + } + case 58: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (fieldMask_ != null) { + subBuilder = fieldMask_.toBuilder(); + } + fieldMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fieldMask_); + fieldMask_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 72: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListAssetsRequest.class, + com.google.cloud.securitycenter.v1.ListAssetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Name of the organization assets should belong to. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+   * Name of the organization assets should belong to. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + 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 FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 3; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,resource_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,resource_properties.a_property" and "
+   * name     desc  ,   resource_properties.a_property  " are equivalent.
+   * 
+ * + * string order_by = 3; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,resource_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,resource_properties.a_property" and "
+   * name     desc  ,   resource_properties.a_property  " are equivalent.
+   * 
+ * + * string order_by = 3; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int COMPARE_DURATION_FIELD_NUMBER = 5; + private com.google.protobuf.Duration compareDuration_; + /** + * + * + *
+   * When compare_duration is set, the ListAssetsResult's "state_change"
+   * attribute is updated to indicate whether the asset was added, removed, or
+   * remained present during the compare_duration period of time that precedes
+   * the read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at read_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at read_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all assets present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public boolean hasCompareDuration() { + return compareDuration_ != null; + } + /** + * + * + *
+   * When compare_duration is set, the ListAssetsResult's "state_change"
+   * attribute is updated to indicate whether the asset was added, removed, or
+   * remained present during the compare_duration period of time that precedes
+   * the read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at read_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at read_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all assets present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.Duration getCompareDuration() { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + /** + * + * + *
+   * When compare_duration is set, the ListAssetsResult's "state_change"
+   * attribute is updated to indicate whether the asset was added, removed, or
+   * remained present during the compare_duration period of time that precedes
+   * the read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at read_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at read_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all assets present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + return getCompareDuration(); + } + + public static final int HAVING_FIELD_NUMBER = 6; + private volatile java.lang.Object having_; + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'state_change' is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + 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(); + having_ = s; + return s; + } + } + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'state_change' is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIELD_MASK_FIELD_NUMBER = 7; + private com.google.protobuf.FieldMask fieldMask_; + /** + * + * + *
+   * Optional.
+   * A field mask to specify the ListAssetsResult fields to be listed in the
+   * response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public boolean hasFieldMask() { + return fieldMask_ != null; + } + /** + * + * + *
+   * Optional.
+   * A field mask to specify the ListAssetsResult fields to be listed in the
+   * response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public com.google.protobuf.FieldMask getFieldMask() { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + /** + * + * + *
+   * Optional.
+   * A field mask to specify the ListAssetsResult fields to be listed in the
+   * response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + return getFieldMask(); + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 8; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last `ListAssetsResponse`; indicates
+   * that this is a continuation of a prior `ListAssets` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last `ListAssetsResponse`; indicates
+   * that this is a continuation of a prior `ListAssets` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 9; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 9; + */ + public int getPageSize() { + return pageSize_; + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, orderBy_); + } + if (readTime_ != null) { + output.writeMessage(4, getReadTime()); + } + if (compareDuration_ != null) { + output.writeMessage(5, getCompareDuration()); + } + if (!getHavingBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, having_); + } + if (fieldMask_ != null) { + output.writeMessage(7, getFieldMask()); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(9, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, orderBy_); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getReadTime()); + } + if (compareDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCompareDuration()); + } + if (!getHavingBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, having_); + } + if (fieldMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getFieldMask()); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.ListAssetsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.ListAssetsRequest other = + (com.google.cloud.securitycenter.v1.ListAssetsRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && getFilter().equals(other.getFilter()); + result = result && getOrderBy().equals(other.getOrderBy()); + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && (hasCompareDuration() == other.hasCompareDuration()); + if (hasCompareDuration()) { + result = result && getCompareDuration().equals(other.getCompareDuration()); + } + result = result && getHaving().equals(other.getHaving()); + result = result && (hasFieldMask() == other.hasFieldMask()); + if (hasFieldMask()) { + result = result && getFieldMask().equals(other.getFieldMask()); + } + result = result && getPageToken().equals(other.getPageToken()); + result = result && (getPageSize() == other.getPageSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + if (hasCompareDuration()) { + hash = (37 * hash) + COMPARE_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getCompareDuration().hashCode(); + } + hash = (37 * hash) + HAVING_FIELD_NUMBER; + hash = (53 * hash) + getHaving().hashCode(); + if (hasFieldMask()) { + hash = (37 * hash) + FIELD_MASK_FIELD_NUMBER; + hash = (53 * hash) + getFieldMask().hashCode(); + } + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.ListAssetsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsRequest 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.v1.ListAssetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsRequest 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.v1.ListAssetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsRequest 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.v1.ListAssetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsRequest 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.v1.ListAssetsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsRequest 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.v1.ListAssetsRequest 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; + } + /** + * + * + *
+   * Request message for listing assets.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListAssetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.ListAssetsRequest) + com.google.cloud.securitycenter.v1.ListAssetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListAssetsRequest.class, + com.google.cloud.securitycenter.v1.ListAssetsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.ListAssetsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + having_ = ""; + + if (fieldMaskBuilder_ == null) { + fieldMask_ = null; + } else { + fieldMask_ = null; + fieldMaskBuilder_ = null; + } + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListAssetsRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.ListAssetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListAssetsRequest build() { + com.google.cloud.securitycenter.v1.ListAssetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListAssetsRequest buildPartial() { + com.google.cloud.securitycenter.v1.ListAssetsRequest result = + new com.google.cloud.securitycenter.v1.ListAssetsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + if (compareDurationBuilder_ == null) { + result.compareDuration_ = compareDuration_; + } else { + result.compareDuration_ = compareDurationBuilder_.build(); + } + result.having_ = having_; + if (fieldMaskBuilder_ == null) { + result.fieldMask_ = fieldMask_; + } else { + result.fieldMask_ = fieldMaskBuilder_.build(); + } + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.ListAssetsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.ListAssetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.ListAssetsRequest other) { + if (other == com.google.cloud.securitycenter.v1.ListAssetsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (other.hasCompareDuration()) { + mergeCompareDuration(other.getCompareDuration()); + } + if (!other.getHaving().isEmpty()) { + having_ = other.having_; + onChanged(); + } + if (other.hasFieldMask()) { + mergeFieldMask(other.getFieldMask()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.ListAssetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.ListAssetsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Name of the organization assets should belong to. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Name of the organization assets should belong to. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Name of the organization assets should belong to. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the organization assets should belong to. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the organization assets should belong to. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across assets.
+     * The expression is a list of zero or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. The fields map to those
+     * defined in the Asset resource. Examples include:
+     * * name
+     * * security_center_properties.resource_name
+     * * resource_properties.a_property
+     * * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `resource_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,resource_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,resource_properties.a_property" and "
+     * name     desc  ,   resource_properties.a_property  " are equivalent.
+     * 
+ * + * string order_by = 3; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,resource_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,resource_properties.a_property" and "
+     * name     desc  ,   resource_properties.a_property  " are equivalent.
+     * 
+ * + * string order_by = 3; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,resource_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,resource_properties.a_property" and "
+     * name     desc  ,   resource_properties.a_property  " are equivalent.
+     * 
+ * + * string order_by = 3; + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,resource_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,resource_properties.a_property" and "
+     * name     desc  ,   resource_properties.a_property  " are equivalent.
+     * 
+ * + * string order_by = 3; + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,resource_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,resource_properties.a_property" and "
+     * name     desc  ,   resource_properties.a_property  " are equivalent.
+     * 
+ * + * string order_by = 3; + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used as a reference point when filtering assets. The filter is limited
+     * to assets existing at the supplied time and their values are those at that
+     * specific time. Absence of this field will default to the API's version of
+     * NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private com.google.protobuf.Duration compareDuration_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + compareDurationBuilder_; + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public boolean hasCompareDuration() { + return compareDurationBuilder_ != null || compareDuration_ != null; + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.Duration getCompareDuration() { + if (compareDurationBuilder_ == null) { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } else { + return compareDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder setCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + compareDuration_ = value; + onChanged(); + } else { + compareDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder setCompareDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (compareDurationBuilder_ == null) { + compareDuration_ = builderForValue.build(); + onChanged(); + } else { + compareDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder mergeCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (compareDuration_ != null) { + compareDuration_ = + com.google.protobuf.Duration.newBuilder(compareDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + compareDuration_ = value; + } + onChanged(); + } else { + compareDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder clearCompareDuration() { + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + onChanged(); + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.Duration.Builder getCompareDurationBuilder() { + + onChanged(); + return getCompareDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + if (compareDurationBuilder_ != null) { + return compareDurationBuilder_.getMessageOrBuilder(); + } else { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + } + /** + * + * + *
+     * When compare_duration is set, the ListAssetsResult's "state_change"
+     * attribute is updated to indicate whether the asset was added, removed, or
+     * remained present during the compare_duration period of time that precedes
+     * the read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence of the asset at the
+     * two points in time. Intermediate state changes between the two times don't
+     * affect the result. For example, the results aren't affected if the asset is
+     * removed and re-created again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "ADDED":   indicates that the asset was not present at the start of
+     *                compare_duration, but present at read_time.
+     * * "REMOVED": indicates that the asset was present at the start of
+     *                compare_duration, but not present at read_time.
+     * * "ACTIVE":  indicates that the asset was present at both the
+     *                start and the end of the time period defined by
+     *                compare_duration and read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED",  which will be the state_change set for all assets present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getCompareDurationFieldBuilder() { + if (compareDurationBuilder_ == null) { + compareDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCompareDuration(), getParentForChildren(), isClean()); + compareDuration_ = null; + } + return compareDurationBuilder_; + } + + private java.lang.Object having_ = ""; + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'state_change' is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + having_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'state_change' is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'state_change' is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public Builder setHaving(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + having_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'state_change' is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public Builder clearHaving() { + + having_ = getDefaultInstance().getHaving(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'state_change' is supported and
+     * requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public Builder setHavingBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + having_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask fieldMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + fieldMaskBuilder_; + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public boolean hasFieldMask() { + return fieldMaskBuilder_ != null || fieldMask_ != null; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public com.google.protobuf.FieldMask getFieldMask() { + if (fieldMaskBuilder_ == null) { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } else { + return fieldMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public Builder setFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fieldMask_ = value; + onChanged(); + } else { + fieldMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public Builder setFieldMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (fieldMaskBuilder_ == null) { + fieldMask_ = builderForValue.build(); + onChanged(); + } else { + fieldMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public Builder mergeFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (fieldMask_ != null) { + fieldMask_ = + com.google.protobuf.FieldMask.newBuilder(fieldMask_).mergeFrom(value).buildPartial(); + } else { + fieldMask_ = value; + } + onChanged(); + } else { + fieldMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public Builder clearFieldMask() { + if (fieldMaskBuilder_ == null) { + fieldMask_ = null; + onChanged(); + } else { + fieldMask_ = null; + fieldMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public com.google.protobuf.FieldMask.Builder getFieldMaskBuilder() { + + onChanged(); + return getFieldMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + if (fieldMaskBuilder_ != null) { + return fieldMaskBuilder_.getMessageOrBuilder(); + } else { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the ListAssetsResult fields to be listed in the
+     * response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getFieldMaskFieldBuilder() { + if (fieldMaskBuilder_ == null) { + fieldMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getFieldMask(), getParentForChildren(), isClean()); + fieldMask_ = null; + } + return fieldMaskBuilder_; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `ListAssetsResponse`; indicates
+     * that this is a continuation of a prior `ListAssets` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListAssetsResponse`; indicates
+     * that this is a continuation of a prior `ListAssets` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListAssetsResponse`; indicates
+     * that this is a continuation of a prior `ListAssets` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListAssetsResponse`; indicates
+     * that this is a continuation of a prior `ListAssets` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListAssetsResponse`; indicates
+     * that this is a continuation of a prior `ListAssets` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 9; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 9; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 9; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.ListAssetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.ListAssetsRequest) + private static final com.google.cloud.securitycenter.v1.ListAssetsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.ListAssetsRequest(); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAssetsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAssetsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListAssetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsRequestOrBuilder.java new file mode 100644 index 000000000000..f66ea585751b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsRequestOrBuilder.java @@ -0,0 +1,357 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface ListAssetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.ListAssetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the organization assets should belong to. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Name of the organization assets should belong to. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Expression that defines the filter to apply across assets.
+   * The expression is a list of zero or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. The fields map to those
+   * defined in the Asset resource. Examples include:
+   * * name
+   * * security_center_properties.resource_name
+   * * resource_properties.a_property
+   * * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `resource_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,resource_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,resource_properties.a_property" and "
+   * name     desc  ,   resource_properties.a_property  " are equivalent.
+   * 
+ * + * string order_by = 3; + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,resource_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,resource_properties.a_property" and "
+   * name     desc  ,   resource_properties.a_property  " are equivalent.
+   * 
+ * + * string order_by = 3; + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering assets. The filter is limited
+   * to assets existing at the supplied time and their values are those at that
+   * specific time. Absence of this field will default to the API's version of
+   * NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * When compare_duration is set, the ListAssetsResult's "state_change"
+   * attribute is updated to indicate whether the asset was added, removed, or
+   * remained present during the compare_duration period of time that precedes
+   * the read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at read_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at read_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all assets present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + boolean hasCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the ListAssetsResult's "state_change"
+   * attribute is updated to indicate whether the asset was added, removed, or
+   * remained present during the compare_duration period of time that precedes
+   * the read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at read_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at read_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all assets present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + com.google.protobuf.Duration getCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the ListAssetsResult's "state_change"
+   * attribute is updated to indicate whether the asset was added, removed, or
+   * remained present during the compare_duration period of time that precedes
+   * the read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence of the asset at the
+   * two points in time. Intermediate state changes between the two times don't
+   * affect the result. For example, the results aren't affected if the asset is
+   * removed and re-created again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "ADDED":   indicates that the asset was not present at the start of
+   *                compare_duration, but present at read_time.
+   * * "REMOVED": indicates that the asset was present at the start of
+   *                compare_duration, but not present at read_time.
+   * * "ACTIVE":  indicates that the asset was present at both the
+   *                start and the end of the time period defined by
+   *                compare_duration and read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED",  which will be the state_change set for all assets present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder(); + + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'state_change' is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + java.lang.String getHaving(); + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'state_change' is supported and
+   * requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + com.google.protobuf.ByteString getHavingBytes(); + + /** + * + * + *
+   * Optional.
+   * A field mask to specify the ListAssetsResult fields to be listed in the
+   * response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + boolean hasFieldMask(); + /** + * + * + *
+   * Optional.
+   * A field mask to specify the ListAssetsResult fields to be listed in the
+   * response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + com.google.protobuf.FieldMask getFieldMask(); + /** + * + * + *
+   * Optional.
+   * A field mask to specify the ListAssetsResult fields to be listed in the
+   * response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder(); + + /** + * + * + *
+   * The value returned by the last `ListAssetsResponse`; indicates
+   * that this is a continuation of a prior `ListAssets` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `ListAssetsResponse`; indicates
+   * that this is a continuation of a prior `ListAssets` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 9; + */ + int getPageSize(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsResponse.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsResponse.java new file mode 100644 index 000000000000..399224aa67ec --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsResponse.java @@ -0,0 +1,2638 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Response message for listing assets.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListAssetsResponse} + */ +public final class ListAssetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.ListAssetsResponse) + ListAssetsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAssetsResponse.newBuilder() to construct. + private ListAssetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAssetsResponse() { + listAssetsResults_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + totalSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAssetsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + listAssetsResults_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult>(); + mutable_bitField0_ |= 0x00000001; + } + listAssetsResults_.add( + input.readMessage( + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + .parser(), + extensionRegistry)); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 32: + { + totalSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + listAssetsResults_ = java.util.Collections.unmodifiableList(listAssetsResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListAssetsResponse.class, + com.google.cloud.securitycenter.v1.ListAssetsResponse.Builder.class); + } + + public interface ListAssetsResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + boolean hasAsset(); + /** + * + * + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + com.google.cloud.securitycenter.v1.Asset getAsset(); + /** + * + * + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + com.google.cloud.securitycenter.v1.AssetOrBuilder getAssetOrBuilder(); + + /** + * + * + *
+     * State change of the asset between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + */ + int getStateChangeValue(); + /** + * + * + *
+     * State change of the asset between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + */ + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + getStateChange(); + } + /** + * + * + *
+   * Result containing the Asset and its State.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} + */ + public static final class ListAssetsResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) + ListAssetsResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAssetsResult.newBuilder() to construct. + private ListAssetsResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAssetsResult() { + stateChange_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAssetsResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1.Asset.Builder subBuilder = null; + if (asset_ != null) { + subBuilder = asset_.toBuilder(); + } + asset_ = + input.readMessage( + com.google.cloud.securitycenter.v1.Asset.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(asset_); + asset_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + int rawValue = input.readEnum(); + + stateChange_ = rawValue; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_ListAssetsResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_ListAssetsResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.class, + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.Builder.class); + } + + /** + * + * + *
+     * The change in state of the asset.
+     * When querying across two points in time this describes
+     * the change between the two points: ADDED, REMOVED, or ACTIVE.
+     * If there was no compare_duration supplied in the request the state change
+     * will be: UNUSED
+     * 
+ * + * Protobuf enum {@code + * google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange} + */ + public enum StateChange implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * State change is unused, this is the canonical default for this enum.
+       * 
+ * + * UNUSED = 0; + */ + UNUSED(0), + /** + * + * + *
+       * Asset was added between the points in time.
+       * 
+ * + * ADDED = 1; + */ + ADDED(1), + /** + * + * + *
+       * Asset was removed between the points in time.
+       * 
+ * + * REMOVED = 2; + */ + REMOVED(2), + /** + * + * + *
+       * Asset was present at both point(s) in time.
+       * 
+ * + * ACTIVE = 3; + */ + ACTIVE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * State change is unused, this is the canonical default for this enum.
+       * 
+ * + * UNUSED = 0; + */ + public static final int UNUSED_VALUE = 0; + /** + * + * + *
+       * Asset was added between the points in time.
+       * 
+ * + * ADDED = 1; + */ + public static final int ADDED_VALUE = 1; + /** + * + * + *
+       * Asset was removed between the points in time.
+       * 
+ * + * REMOVED = 2; + */ + public static final int REMOVED_VALUE = 2; + /** + * + * + *
+       * Asset was present at both point(s) in time.
+       * 
+ * + * ACTIVE = 3; + */ + public static final int ACTIVE_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; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static StateChange valueOf(int value) { + return forNumber(value); + } + + public static StateChange forNumber(int value) { + switch (value) { + case 0: + return UNUSED; + case 1: + return ADDED; + case 2: + return REMOVED; + case 3: + return ACTIVE; + 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 StateChange findValueByNumber(int number) { + return StateChange.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.v1.ListAssetsResponse.ListAssetsResult + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final StateChange[] VALUES = values(); + + public static StateChange 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 StateChange(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange) + } + + public static final int ASSET_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1.Asset asset_; + /** + * + * + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + public boolean hasAsset() { + return asset_ != null; + } + /** + * + * + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1.Asset getAsset() { + return asset_ == null + ? com.google.cloud.securitycenter.v1.Asset.getDefaultInstance() + : asset_; + } + /** + * + * + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1.AssetOrBuilder getAssetOrBuilder() { + return getAsset(); + } + + public static final int STATE_CHANGE_FIELD_NUMBER = 2; + private int stateChange_; + /** + * + * + *
+     * State change of the asset between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + */ + public int getStateChangeValue() { + return stateChange_; + } + /** + * + * + *
+     * State change of the asset between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + */ + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + getStateChange() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange result = + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + .valueOf(stateChange_); + return result == null + ? com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + .UNRECOGNIZED + : result; + } + + 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 (asset_ != null) { + output.writeMessage(1, getAsset()); + } + if (stateChange_ + != com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + .UNUSED.getNumber()) { + output.writeEnum(2, stateChange_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (asset_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAsset()); + } + if (stateChange_ + != com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + .UNUSED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, stateChange_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult other = + (com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) obj; + + boolean result = true; + result = result && (hasAsset() == other.hasAsset()); + if (hasAsset()) { + result = result && getAsset().equals(other.getAsset()); + } + result = result && stateChange_ == other.stateChange_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAsset()) { + hash = (37 * hash) + ASSET_FIELD_NUMBER; + hash = (53 * hash) + getAsset().hashCode(); + } + hash = (37 * hash) + STATE_CHANGE_FIELD_NUMBER; + hash = (53 * hash) + stateChange_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult 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.v1.ListAssetsResponse.ListAssetsResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult 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.v1.ListAssetsResponse.ListAssetsResult parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult 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.v1.ListAssetsResponse.ListAssetsResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + 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.v1.ListAssetsResponse.ListAssetsResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult 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.v1.ListAssetsResponse.ListAssetsResult 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; + } + /** + * + * + *
+     * Result containing the Asset and its State.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_ListAssetsResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_ListAssetsResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.class, + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (assetBuilder_ == null) { + asset_ = null; + } else { + asset_ = null; + assetBuilder_ = null; + } + stateChange_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_ListAssetsResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult build() { + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult buildPartial() { + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult result = + new com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(this); + if (assetBuilder_ == null) { + result.asset_ = asset_; + } else { + result.asset_ = assetBuilder_.build(); + } + result.stateChange_ = stateChange_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) { + return mergeFrom( + (com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult other) { + if (other + == com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + .getDefaultInstance()) return this; + if (other.hasAsset()) { + mergeAsset(other.getAsset()); + } + if (other.stateChange_ != 0) { + setStateChangeValue(other.getStateChangeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1.Asset asset_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Asset, + com.google.cloud.securitycenter.v1.Asset.Builder, + com.google.cloud.securitycenter.v1.AssetOrBuilder> + assetBuilder_; + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + public boolean hasAsset() { + return assetBuilder_ != null || asset_ != null; + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1.Asset getAsset() { + if (assetBuilder_ == null) { + return asset_ == null + ? com.google.cloud.securitycenter.v1.Asset.getDefaultInstance() + : asset_; + } else { + return assetBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + public Builder setAsset(com.google.cloud.securitycenter.v1.Asset value) { + if (assetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + asset_ = value; + onChanged(); + } else { + assetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + public Builder setAsset(com.google.cloud.securitycenter.v1.Asset.Builder builderForValue) { + if (assetBuilder_ == null) { + asset_ = builderForValue.build(); + onChanged(); + } else { + assetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + public Builder mergeAsset(com.google.cloud.securitycenter.v1.Asset value) { + if (assetBuilder_ == null) { + if (asset_ != null) { + asset_ = + com.google.cloud.securitycenter.v1.Asset.newBuilder(asset_) + .mergeFrom(value) + .buildPartial(); + } else { + asset_ = value; + } + onChanged(); + } else { + assetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + public Builder clearAsset() { + if (assetBuilder_ == null) { + asset_ = null; + onChanged(); + } else { + asset_ = null; + assetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1.Asset.Builder getAssetBuilder() { + + onChanged(); + return getAssetFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1.AssetOrBuilder getAssetOrBuilder() { + if (assetBuilder_ != null) { + return assetBuilder_.getMessageOrBuilder(); + } else { + return asset_ == null + ? com.google.cloud.securitycenter.v1.Asset.getDefaultInstance() + : asset_; + } + } + /** + * + * + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Asset asset = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Asset, + com.google.cloud.securitycenter.v1.Asset.Builder, + com.google.cloud.securitycenter.v1.AssetOrBuilder> + getAssetFieldBuilder() { + if (assetBuilder_ == null) { + assetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Asset, + com.google.cloud.securitycenter.v1.Asset.Builder, + com.google.cloud.securitycenter.v1.AssetOrBuilder>( + getAsset(), getParentForChildren(), isClean()); + asset_ = null; + } + return assetBuilder_; + } + + private int stateChange_ = 0; + /** + * + * + *
+       * State change of the asset between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + */ + public int getStateChangeValue() { + return stateChange_; + } + /** + * + * + *
+       * State change of the asset between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + */ + public Builder setStateChangeValue(int value) { + stateChange_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * State change of the asset between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + */ + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + getStateChange() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange result = + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + .valueOf(stateChange_); + return result == null + ? com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * State change of the asset between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + */ + public Builder setStateChange( + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange + value) { + if (value == null) { + throw new NullPointerException(); + } + + stateChange_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * State change of the asset between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange state_change = 2; + * + */ + public Builder clearStateChange() { + + stateChange_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.ListAssetsResponse.ListAssetsResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult) + private static final com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult(); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAssetsResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAssetsResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int LIST_ASSETS_RESULTS_FIELD_NUMBER = 1; + private java.util.List + listAssetsResults_; + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public java.util.List + getListAssetsResultsList() { + return listAssetsResults_; + } + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResultOrBuilder> + getListAssetsResultsOrBuilderList() { + return listAssetsResults_; + } + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public int getListAssetsResultsCount() { + return listAssetsResults_.size(); + } + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + getListAssetsResults(int index) { + return listAssetsResults_.get(index); + } + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResultOrBuilder + getListAssetsResultsOrBuilder(int index) { + return listAssetsResults_.get(index); + } + + public static final int READ_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 4; + private int totalSize_; + /** + * + * + *
+   * The total number of assets matching the query.
+   * 
+ * + * int32 total_size = 4; + */ + public int getTotalSize() { + return totalSize_; + } + + 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 < listAssetsResults_.size(); i++) { + output.writeMessage(1, listAssetsResults_.get(i)); + } + if (readTime_ != null) { + output.writeMessage(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + } + if (totalSize_ != 0) { + output.writeInt32(4, totalSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < listAssetsResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, listAssetsResults_.get(i)); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, totalSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.ListAssetsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.ListAssetsResponse other = + (com.google.cloud.securitycenter.v1.ListAssetsResponse) obj; + + boolean result = true; + result = result && getListAssetsResultsList().equals(other.getListAssetsResultsList()); + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && getNextPageToken().equals(other.getNextPageToken()); + result = result && (getTotalSize() == other.getTotalSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getListAssetsResultsCount() > 0) { + hash = (37 * hash) + LIST_ASSETS_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getListAssetsResultsList().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse 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.v1.ListAssetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse 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.v1.ListAssetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse 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.v1.ListAssetsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse 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.v1.ListAssetsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse 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.v1.ListAssetsResponse 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; + } + /** + * + * + *
+   * Response message for listing assets.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListAssetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.ListAssetsResponse) + com.google.cloud.securitycenter.v1.ListAssetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListAssetsResponse.class, + com.google.cloud.securitycenter.v1.ListAssetsResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.ListAssetsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getListAssetsResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (listAssetsResultsBuilder_ == null) { + listAssetsResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + listAssetsResultsBuilder_.clear(); + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + nextPageToken_ = ""; + + totalSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListAssetsResponse getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.ListAssetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListAssetsResponse build() { + com.google.cloud.securitycenter.v1.ListAssetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListAssetsResponse buildPartial() { + com.google.cloud.securitycenter.v1.ListAssetsResponse result = + new com.google.cloud.securitycenter.v1.ListAssetsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (listAssetsResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + listAssetsResults_ = java.util.Collections.unmodifiableList(listAssetsResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.listAssetsResults_ = listAssetsResults_; + } else { + result.listAssetsResults_ = listAssetsResultsBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.totalSize_ = totalSize_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.ListAssetsResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1.ListAssetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.ListAssetsResponse other) { + if (other == com.google.cloud.securitycenter.v1.ListAssetsResponse.getDefaultInstance()) + return this; + if (listAssetsResultsBuilder_ == null) { + if (!other.listAssetsResults_.isEmpty()) { + if (listAssetsResults_.isEmpty()) { + listAssetsResults_ = other.listAssetsResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureListAssetsResultsIsMutable(); + listAssetsResults_.addAll(other.listAssetsResults_); + } + onChanged(); + } + } else { + if (!other.listAssetsResults_.isEmpty()) { + if (listAssetsResultsBuilder_.isEmpty()) { + listAssetsResultsBuilder_.dispose(); + listAssetsResultsBuilder_ = null; + listAssetsResults_ = other.listAssetsResults_; + bitField0_ = (bitField0_ & ~0x00000001); + listAssetsResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getListAssetsResultsFieldBuilder() + : null; + } else { + listAssetsResultsBuilder_.addAllMessages(other.listAssetsResults_); + } + } + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.ListAssetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.ListAssetsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + listAssetsResults_ = java.util.Collections.emptyList(); + + private void ensureListAssetsResultsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + listAssetsResults_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult>( + listAssetsResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult, + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.Builder, + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResultOrBuilder> + listAssetsResultsBuilder_; + + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public java.util.List + getListAssetsResultsList() { + if (listAssetsResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(listAssetsResults_); + } else { + return listAssetsResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public int getListAssetsResultsCount() { + if (listAssetsResultsBuilder_ == null) { + return listAssetsResults_.size(); + } else { + return listAssetsResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + getListAssetsResults(int index) { + if (listAssetsResultsBuilder_ == null) { + return listAssetsResults_.get(index); + } else { + return listAssetsResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder setListAssetsResults( + int index, com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult value) { + if (listAssetsResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListAssetsResultsIsMutable(); + listAssetsResults_.set(index, value); + onChanged(); + } else { + listAssetsResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder setListAssetsResults( + int index, + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.Builder + builderForValue) { + if (listAssetsResultsBuilder_ == null) { + ensureListAssetsResultsIsMutable(); + listAssetsResults_.set(index, builderForValue.build()); + onChanged(); + } else { + listAssetsResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder addListAssetsResults( + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult value) { + if (listAssetsResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListAssetsResultsIsMutable(); + listAssetsResults_.add(value); + onChanged(); + } else { + listAssetsResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder addListAssetsResults( + int index, com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult value) { + if (listAssetsResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListAssetsResultsIsMutable(); + listAssetsResults_.add(index, value); + onChanged(); + } else { + listAssetsResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder addListAssetsResults( + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.Builder + builderForValue) { + if (listAssetsResultsBuilder_ == null) { + ensureListAssetsResultsIsMutable(); + listAssetsResults_.add(builderForValue.build()); + onChanged(); + } else { + listAssetsResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder addListAssetsResults( + int index, + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.Builder + builderForValue) { + if (listAssetsResultsBuilder_ == null) { + ensureListAssetsResultsIsMutable(); + listAssetsResults_.add(index, builderForValue.build()); + onChanged(); + } else { + listAssetsResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder addAllListAssetsResults( + java.lang.Iterable< + ? extends com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult> + values) { + if (listAssetsResultsBuilder_ == null) { + ensureListAssetsResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, listAssetsResults_); + onChanged(); + } else { + listAssetsResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder clearListAssetsResults() { + if (listAssetsResultsBuilder_ == null) { + listAssetsResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + listAssetsResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public Builder removeListAssetsResults(int index) { + if (listAssetsResultsBuilder_ == null) { + ensureListAssetsResultsIsMutable(); + listAssetsResults_.remove(index); + onChanged(); + } else { + listAssetsResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.Builder + getListAssetsResultsBuilder(int index) { + return getListAssetsResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResultOrBuilder + getListAssetsResultsOrBuilder(int index) { + if (listAssetsResultsBuilder_ == null) { + return listAssetsResults_.get(index); + } else { + return listAssetsResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResultOrBuilder> + getListAssetsResultsOrBuilderList() { + if (listAssetsResultsBuilder_ != null) { + return listAssetsResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(listAssetsResults_); + } + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.Builder + addListAssetsResultsBuilder() { + return getListAssetsResultsFieldBuilder() + .addBuilder( + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.Builder + addListAssetsResultsBuilder(int index) { + return getListAssetsResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Assets matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + public java.util.List< + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.Builder> + getListAssetsResultsBuilderList() { + return getListAssetsResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult, + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.Builder, + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResultOrBuilder> + getListAssetsResultsFieldBuilder() { + if (listAssetsResultsBuilder_ == null) { + listAssetsResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult, + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.Builder, + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResultOrBuilder>( + listAssetsResults_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + listAssetsResults_ = null; + } + return listAssetsResultsBuilder_; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private int totalSize_; + /** + * + * + *
+     * The total number of assets matching the query.
+     * 
+ * + * int32 total_size = 4; + */ + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The total number of assets matching the query.
+     * 
+ * + * int32 total_size = 4; + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of assets matching the query.
+     * 
+ * + * int32 total_size = 4; + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.ListAssetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.ListAssetsResponse) + private static final com.google.cloud.securitycenter.v1.ListAssetsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.ListAssetsResponse(); + } + + public static com.google.cloud.securitycenter.v1.ListAssetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAssetsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAssetsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListAssetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsResponseOrBuilder.java new file mode 100644 index 000000000000..494f98a791ef --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsResponseOrBuilder.java @@ -0,0 +1,141 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface ListAssetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.ListAssetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + java.util.List + getListAssetsResultsList(); + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult getListAssetsResults( + int index); + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + int getListAssetsResultsCount(); + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + java.util.List< + ? extends com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResultOrBuilder> + getListAssetsResultsOrBuilderList(); + /** + * + * + *
+   * Assets matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + * + */ + com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResultOrBuilder + getListAssetsResultsOrBuilder(int index); + + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * The total number of assets matching the query.
+   * 
+ * + * int32 total_size = 4; + */ + int getTotalSize(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsRequest.java new file mode 100644 index 000000000000..0987f9b8273a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsRequest.java @@ -0,0 +1,2612 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for listing findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListFindingsRequest} + */ +public final class ListFindingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.ListFindingsRequest) + ListFindingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFindingsRequest.newBuilder() to construct. + private ListFindingsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFindingsRequest() { + parent_ = ""; + filter_ = ""; + orderBy_ = ""; + having_ = ""; + pageToken_ = ""; + pageSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFindingsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (compareDuration_ != null) { + subBuilder = compareDuration_.toBuilder(); + } + compareDuration_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(compareDuration_); + compareDuration_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + having_ = s; + break; + } + case 58: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (fieldMask_ != null) { + subBuilder = fieldMask_.toBuilder(); + } + fieldMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fieldMask_); + fieldMask_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 72: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListFindingsRequest.class, + com.google.cloud.securitycenter.v1.ListFindingsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Name of the source the findings belong to. Its format is
+   * "organizations/[organization_id]/sources/[source_id]". To list across all
+   * sources provide a source_id of `-`. For example:
+   * organizations/123/sources/-
+   * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+   * Name of the source the findings belong to. Its format is
+   * "organizations/[organization_id]/sources/[source_id]". To list across all
+   * sources provide a source_id of `-`. For example:
+   * organizations/123/sources/-
+   * 
+ * + * string parent = 1; + */ + 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 FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 3; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,source_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,source_properties.a_property" and "
+   * name     desc  ,   source_properties.a_property  " are equivalent.
+   * 
+ * + * string order_by = 3; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,source_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,source_properties.a_property" and "
+   * name     desc  ,   source_properties.a_property  " are equivalent.
+   * 
+ * + * string order_by = 3; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int READ_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int COMPARE_DURATION_FIELD_NUMBER = 5; + private com.google.protobuf.Duration compareDuration_; + /** + * + * + *
+   * When compare_duration is set, the ListFindingsResult's "state_change"
+   * attribute is updated to indicate whether the finding had its state changed,
+   * the finding's state remained unchanged, or if the finding was added in any
+   * state during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all findings present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public boolean hasCompareDuration() { + return compareDuration_ != null; + } + /** + * + * + *
+   * When compare_duration is set, the ListFindingsResult's "state_change"
+   * attribute is updated to indicate whether the finding had its state changed,
+   * the finding's state remained unchanged, or if the finding was added in any
+   * state during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all findings present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.Duration getCompareDuration() { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + /** + * + * + *
+   * When compare_duration is set, the ListFindingsResult's "state_change"
+   * attribute is updated to indicate whether the finding had its state changed,
+   * the finding's state remained unchanged, or if the finding was added in any
+   * state during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all findings present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + return getCompareDuration(); + } + + public static final int HAVING_FIELD_NUMBER = 6; + private volatile java.lang.Object having_; + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'finding.state' and 'state_change'
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + 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(); + having_ = s; + return s; + } + } + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'finding.state' and 'state_change'
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIELD_MASK_FIELD_NUMBER = 7; + private com.google.protobuf.FieldMask fieldMask_; + /** + * + * + *
+   * Optional.
+   * A field mask to specify the Finding fields to be listed in the response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public boolean hasFieldMask() { + return fieldMask_ != null; + } + /** + * + * + *
+   * Optional.
+   * A field mask to specify the Finding fields to be listed in the response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public com.google.protobuf.FieldMask getFieldMask() { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + /** + * + * + *
+   * Optional.
+   * A field mask to specify the Finding fields to be listed in the response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + return getFieldMask(); + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 8; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last `ListFindingsResponse`; indicates
+   * that this is a continuation of a prior `ListFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last `ListFindingsResponse`; indicates
+   * that this is a continuation of a prior `ListFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 9; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 9; + */ + public int getPageSize() { + return pageSize_; + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, orderBy_); + } + if (readTime_ != null) { + output.writeMessage(4, getReadTime()); + } + if (compareDuration_ != null) { + output.writeMessage(5, getCompareDuration()); + } + if (!getHavingBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, having_); + } + if (fieldMask_ != null) { + output.writeMessage(7, getFieldMask()); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(9, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, orderBy_); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getReadTime()); + } + if (compareDuration_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCompareDuration()); + } + if (!getHavingBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, having_); + } + if (fieldMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getFieldMask()); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.ListFindingsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.ListFindingsRequest other = + (com.google.cloud.securitycenter.v1.ListFindingsRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && getFilter().equals(other.getFilter()); + result = result && getOrderBy().equals(other.getOrderBy()); + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && (hasCompareDuration() == other.hasCompareDuration()); + if (hasCompareDuration()) { + result = result && getCompareDuration().equals(other.getCompareDuration()); + } + result = result && getHaving().equals(other.getHaving()); + result = result && (hasFieldMask() == other.hasFieldMask()); + if (hasFieldMask()) { + result = result && getFieldMask().equals(other.getFieldMask()); + } + result = result && getPageToken().equals(other.getPageToken()); + result = result && (getPageSize() == other.getPageSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + if (hasCompareDuration()) { + hash = (37 * hash) + COMPARE_DURATION_FIELD_NUMBER; + hash = (53 * hash) + getCompareDuration().hashCode(); + } + hash = (37 * hash) + HAVING_FIELD_NUMBER; + hash = (53 * hash) + getHaving().hashCode(); + if (hasFieldMask()) { + hash = (37 * hash) + FIELD_MASK_FIELD_NUMBER; + hash = (53 * hash) + getFieldMask().hashCode(); + } + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.ListFindingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsRequest 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.v1.ListFindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsRequest 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.v1.ListFindingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsRequest 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.v1.ListFindingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsRequest 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.v1.ListFindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsRequest 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.v1.ListFindingsRequest 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; + } + /** + * + * + *
+   * Request message for listing findings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListFindingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.ListFindingsRequest) + com.google.cloud.securitycenter.v1.ListFindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListFindingsRequest.class, + com.google.cloud.securitycenter.v1.ListFindingsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.ListFindingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + having_ = ""; + + if (fieldMaskBuilder_ == null) { + fieldMask_ = null; + } else { + fieldMask_ = null; + fieldMaskBuilder_ = null; + } + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListFindingsRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.ListFindingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListFindingsRequest build() { + com.google.cloud.securitycenter.v1.ListFindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListFindingsRequest buildPartial() { + com.google.cloud.securitycenter.v1.ListFindingsRequest result = + new com.google.cloud.securitycenter.v1.ListFindingsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + if (compareDurationBuilder_ == null) { + result.compareDuration_ = compareDuration_; + } else { + result.compareDuration_ = compareDurationBuilder_.build(); + } + result.having_ = having_; + if (fieldMaskBuilder_ == null) { + result.fieldMask_ = fieldMask_; + } else { + result.fieldMask_ = fieldMaskBuilder_.build(); + } + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.ListFindingsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.ListFindingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.ListFindingsRequest other) { + if (other == com.google.cloud.securitycenter.v1.ListFindingsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (other.hasCompareDuration()) { + mergeCompareDuration(other.getCompareDuration()); + } + if (!other.getHaving().isEmpty()) { + having_ = other.having_; + onChanged(); + } + if (other.hasFieldMask()) { + mergeFieldMask(other.getFieldMask()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.ListFindingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.ListFindingsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Name of the source the findings belong to. Its format is
+     * "organizations/[organization_id]/sources/[source_id]". To list across all
+     * sources provide a source_id of `-`. For example:
+     * organizations/123/sources/-
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Name of the source the findings belong to. Its format is
+     * "organizations/[organization_id]/sources/[source_id]". To list across all
+     * sources provide a source_id of `-`. For example:
+     * organizations/123/sources/-
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Name of the source the findings belong to. Its format is
+     * "organizations/[organization_id]/sources/[source_id]". To list across all
+     * sources provide a source_id of `-`. For example:
+     * organizations/123/sources/-
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the source the findings belong to. Its format is
+     * "organizations/[organization_id]/sources/[source_id]". To list across all
+     * sources provide a source_id of `-`. For example:
+     * organizations/123/sources/-
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the source the findings belong to. Its format is
+     * "organizations/[organization_id]/sources/[source_id]". To list across all
+     * sources provide a source_id of `-`. For example:
+     * organizations/123/sources/-
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines the filter to apply across findings.
+     * The expression is a list of one or more restrictions combined via logical
+     * operators `AND` and `OR`.
+     * Parentheses are supported, and `OR` has higher precedence than `AND`.
+     * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+     * character in front of them to indicate negation. Examples include:
+     *  * name
+     *  * source_properties.a_property
+     *  * security_marks.marks.marka
+     * The supported operators are:
+     * * `=` for all value types.
+     * * `>`, `<`, `>=`, `<=` for integer values.
+     * * `:`, meaning substring matching, for strings.
+     * The supported value types are:
+     * * string literals in quotes.
+     * * integer literals without quotes.
+     * * boolean literals `true` and `false` without quotes.
+     * For example, `source_properties.size = 100` is a valid filter string.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,source_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,source_properties.a_property" and "
+     * name     desc  ,   source_properties.a_property  " are equivalent.
+     * 
+ * + * string order_by = 3; + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,source_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,source_properties.a_property" and "
+     * name     desc  ,   source_properties.a_property  " are equivalent.
+     * 
+ * + * string order_by = 3; + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,source_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,source_properties.a_property" and "
+     * name     desc  ,   source_properties.a_property  " are equivalent.
+     * 
+ * + * string order_by = 3; + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,source_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,source_properties.a_property" and "
+     * name     desc  ,   source_properties.a_property  " are equivalent.
+     * 
+ * + * string order_by = 3; + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Expression that defines what fields and order to use for sorting. The
+     * string value should follow SQL syntax: comma separated list of fields. For
+     * example: "name,resource_properties.a_property". The default sorting order
+     * is ascending. To specify descending order for a field, a suffix " desc"
+     * should be appended to the field name. For example: "name
+     * desc,source_properties.a_property". Redundant space characters in the
+     * syntax are insignificant. "name desc,source_properties.a_property" and "
+     * name     desc  ,   source_properties.a_property  " are equivalent.
+     * 
+ * + * string order_by = 3; + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used as a reference point when filtering findings. The filter is
+     * limited to findings existing at the supplied time and their values are
+     * those at that specific time. Absence of this field will default to the
+     * API's version of NOW.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private com.google.protobuf.Duration compareDuration_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + compareDurationBuilder_; + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public boolean hasCompareDuration() { + return compareDurationBuilder_ != null || compareDuration_ != null; + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.Duration getCompareDuration() { + if (compareDurationBuilder_ == null) { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } else { + return compareDurationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder setCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + compareDuration_ = value; + onChanged(); + } else { + compareDurationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder setCompareDuration(com.google.protobuf.Duration.Builder builderForValue) { + if (compareDurationBuilder_ == null) { + compareDuration_ = builderForValue.build(); + onChanged(); + } else { + compareDurationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder mergeCompareDuration(com.google.protobuf.Duration value) { + if (compareDurationBuilder_ == null) { + if (compareDuration_ != null) { + compareDuration_ = + com.google.protobuf.Duration.newBuilder(compareDuration_) + .mergeFrom(value) + .buildPartial(); + } else { + compareDuration_ = value; + } + onChanged(); + } else { + compareDurationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public Builder clearCompareDuration() { + if (compareDurationBuilder_ == null) { + compareDuration_ = null; + onChanged(); + } else { + compareDuration_ = null; + compareDurationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.Duration.Builder getCompareDurationBuilder() { + + onChanged(); + return getCompareDurationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + if (compareDurationBuilder_ != null) { + return compareDurationBuilder_.getMessageOrBuilder(); + } else { + return compareDuration_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : compareDuration_; + } + } + /** + * + * + *
+     * When compare_duration is set, the ListFindingsResult's "state_change"
+     * attribute is updated to indicate whether the finding had its state changed,
+     * the finding's state remained unchanged, or if the finding was added in any
+     * state during the compare_duration period of time that precedes the
+     * read_time. This is the time between (read_time - compare_duration) and
+     * read_time.
+     * The state_change value is derived based on the presence and state of the
+     * finding at the two points in time. Intermediate state changes between the
+     * two times don't affect the result. For example, the results aren't affected
+     * if the finding is made inactive and then active again.
+     * Possible "state_change" values when compare_duration is specified:
+     * * "CHANGED":   indicates that the finding was present at the start of
+     *                  compare_duration, but changed its state at read_time.
+     * * "UNCHANGED": indicates that the finding was present at the start of
+     *                  compare_duration and did not change state at read_time.
+     * * "ADDED":     indicates that the finding was not present at the start
+     *                  of compare_duration, but was present at read_time.
+     * If compare_duration is not specified, then the only possible state_change
+     * is "UNUSED", which will be the state_change set for all findings present at
+     * read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getCompareDurationFieldBuilder() { + if (compareDurationBuilder_ == null) { + compareDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getCompareDuration(), getParentForChildren(), isClean()); + compareDuration_ = null; + } + return compareDurationBuilder_; + } + + private java.lang.Object having_ = ""; + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'finding.state' and 'state_change'
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public java.lang.String getHaving() { + java.lang.Object ref = having_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + having_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'finding.state' and 'state_change'
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public com.google.protobuf.ByteString getHavingBytes() { + java.lang.Object ref = having_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + having_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'finding.state' and 'state_change'
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public Builder setHaving(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + having_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'finding.state' and 'state_change'
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public Builder clearHaving() { + + having_ = getDefaultInstance().getHaving(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter that specifies what fields to further filter on *after* the query
+     * filter has been executed. Currently only 'finding.state' and 'state_change'
+     * are supported and requires compare_duration to be specified.
+     * 
+ * + * string having = 6; + */ + public Builder setHavingBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + having_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask fieldMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + fieldMaskBuilder_; + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public boolean hasFieldMask() { + return fieldMaskBuilder_ != null || fieldMask_ != null; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public com.google.protobuf.FieldMask getFieldMask() { + if (fieldMaskBuilder_ == null) { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } else { + return fieldMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public Builder setFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fieldMask_ = value; + onChanged(); + } else { + fieldMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public Builder setFieldMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (fieldMaskBuilder_ == null) { + fieldMask_ = builderForValue.build(); + onChanged(); + } else { + fieldMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public Builder mergeFieldMask(com.google.protobuf.FieldMask value) { + if (fieldMaskBuilder_ == null) { + if (fieldMask_ != null) { + fieldMask_ = + com.google.protobuf.FieldMask.newBuilder(fieldMask_).mergeFrom(value).buildPartial(); + } else { + fieldMask_ = value; + } + onChanged(); + } else { + fieldMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public Builder clearFieldMask() { + if (fieldMaskBuilder_ == null) { + fieldMask_ = null; + onChanged(); + } else { + fieldMask_ = null; + fieldMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public com.google.protobuf.FieldMask.Builder getFieldMaskBuilder() { + + onChanged(); + return getFieldMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + if (fieldMaskBuilder_ != null) { + return fieldMaskBuilder_.getMessageOrBuilder(); + } else { + return fieldMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : fieldMask_; + } + } + /** + * + * + *
+     * Optional.
+     * A field mask to specify the Finding fields to be listed in the response.
+     * An empty field mask will list all fields.
+     * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getFieldMaskFieldBuilder() { + if (fieldMaskBuilder_ == null) { + fieldMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getFieldMask(), getParentForChildren(), isClean()); + fieldMask_ = null; + } + return fieldMaskBuilder_; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `ListFindingsResponse`; indicates
+     * that this is a continuation of a prior `ListFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListFindingsResponse`; indicates
+     * that this is a continuation of a prior `ListFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListFindingsResponse`; indicates
+     * that this is a continuation of a prior `ListFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListFindingsResponse`; indicates
+     * that this is a continuation of a prior `ListFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListFindingsResponse`; indicates
+     * that this is a continuation of a prior `ListFindings` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 8; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 9; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 9; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 9; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.ListFindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.ListFindingsRequest) + private static final com.google.cloud.securitycenter.v1.ListFindingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.ListFindingsRequest(); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFindingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFindingsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListFindingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsRequestOrBuilder.java new file mode 100644 index 000000000000..77f4daefa6c5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsRequestOrBuilder.java @@ -0,0 +1,354 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface ListFindingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.ListFindingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the source the findings belong to. Its format is
+   * "organizations/[organization_id]/sources/[source_id]". To list across all
+   * sources provide a source_id of `-`. For example:
+   * organizations/123/sources/-
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Name of the source the findings belong to. Its format is
+   * "organizations/[organization_id]/sources/[source_id]". To list across all
+   * sources provide a source_id of `-`. For example:
+   * organizations/123/sources/-
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Expression that defines the filter to apply across findings.
+   * The expression is a list of one or more restrictions combined via logical
+   * operators `AND` and `OR`.
+   * Parentheses are supported, and `OR` has higher precedence than `AND`.
+   * Restrictions have the form `<field> <operator> <value>` and may have a `-`
+   * character in front of them to indicate negation. Examples include:
+   *  * name
+   *  * source_properties.a_property
+   *  * security_marks.marks.marka
+   * The supported operators are:
+   * * `=` for all value types.
+   * * `>`, `<`, `>=`, `<=` for integer values.
+   * * `:`, meaning substring matching, for strings.
+   * The supported value types are:
+   * * string literals in quotes.
+   * * integer literals without quotes.
+   * * boolean literals `true` and `false` without quotes.
+   * For example, `source_properties.size = 100` is a valid filter string.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,source_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,source_properties.a_property" and "
+   * name     desc  ,   source_properties.a_property  " are equivalent.
+   * 
+ * + * string order_by = 3; + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Expression that defines what fields and order to use for sorting. The
+   * string value should follow SQL syntax: comma separated list of fields. For
+   * example: "name,resource_properties.a_property". The default sorting order
+   * is ascending. To specify descending order for a field, a suffix " desc"
+   * should be appended to the field name. For example: "name
+   * desc,source_properties.a_property". Redundant space characters in the
+   * syntax are insignificant. "name desc,source_properties.a_property" and "
+   * name     desc  ,   source_properties.a_property  " are equivalent.
+   * 
+ * + * string order_by = 3; + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used as a reference point when filtering findings. The filter is
+   * limited to findings existing at the supplied time and their values are
+   * those at that specific time. Absence of this field will default to the
+   * API's version of NOW.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * When compare_duration is set, the ListFindingsResult's "state_change"
+   * attribute is updated to indicate whether the finding had its state changed,
+   * the finding's state remained unchanged, or if the finding was added in any
+   * state during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all findings present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + boolean hasCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the ListFindingsResult's "state_change"
+   * attribute is updated to indicate whether the finding had its state changed,
+   * the finding's state remained unchanged, or if the finding was added in any
+   * state during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all findings present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + com.google.protobuf.Duration getCompareDuration(); + /** + * + * + *
+   * When compare_duration is set, the ListFindingsResult's "state_change"
+   * attribute is updated to indicate whether the finding had its state changed,
+   * the finding's state remained unchanged, or if the finding was added in any
+   * state during the compare_duration period of time that precedes the
+   * read_time. This is the time between (read_time - compare_duration) and
+   * read_time.
+   * The state_change value is derived based on the presence and state of the
+   * finding at the two points in time. Intermediate state changes between the
+   * two times don't affect the result. For example, the results aren't affected
+   * if the finding is made inactive and then active again.
+   * Possible "state_change" values when compare_duration is specified:
+   * * "CHANGED":   indicates that the finding was present at the start of
+   *                  compare_duration, but changed its state at read_time.
+   * * "UNCHANGED": indicates that the finding was present at the start of
+   *                  compare_duration and did not change state at read_time.
+   * * "ADDED":     indicates that the finding was not present at the start
+   *                  of compare_duration, but was present at read_time.
+   * If compare_duration is not specified, then the only possible state_change
+   * is "UNUSED", which will be the state_change set for all findings present at
+   * read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder(); + + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'finding.state' and 'state_change'
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + java.lang.String getHaving(); + /** + * + * + *
+   * Filter that specifies what fields to further filter on *after* the query
+   * filter has been executed. Currently only 'finding.state' and 'state_change'
+   * are supported and requires compare_duration to be specified.
+   * 
+ * + * string having = 6; + */ + com.google.protobuf.ByteString getHavingBytes(); + + /** + * + * + *
+   * Optional.
+   * A field mask to specify the Finding fields to be listed in the response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + boolean hasFieldMask(); + /** + * + * + *
+   * Optional.
+   * A field mask to specify the Finding fields to be listed in the response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + com.google.protobuf.FieldMask getFieldMask(); + /** + * + * + *
+   * Optional.
+   * A field mask to specify the Finding fields to be listed in the response.
+   * An empty field mask will list all fields.
+   * 
+ * + * .google.protobuf.FieldMask field_mask = 7; + */ + com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder(); + + /** + * + * + *
+   * The value returned by the last `ListFindingsResponse`; indicates
+   * that this is a continuation of a prior `ListFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `ListFindingsResponse`; indicates
+   * that this is a continuation of a prior `ListFindings` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 8; + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 9; + */ + int getPageSize(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsResponse.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsResponse.java new file mode 100644 index 000000000000..34c9ca9b3abc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsResponse.java @@ -0,0 +1,2687 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Response message for listing findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListFindingsResponse} + */ +public final class ListFindingsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.ListFindingsResponse) + ListFindingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFindingsResponse.newBuilder() to construct. + private ListFindingsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFindingsResponse() { + listFindingsResults_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + totalSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFindingsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + listFindingsResults_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v1.ListFindingsResponse + .ListFindingsResult>(); + mutable_bitField0_ |= 0x00000001; + } + listFindingsResults_.add( + input.readMessage( + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + .parser(), + extensionRegistry)); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 32: + { + totalSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + listFindingsResults_ = java.util.Collections.unmodifiableList(listFindingsResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListFindingsResponse.class, + com.google.cloud.securitycenter.v1.ListFindingsResponse.Builder.class); + } + + public interface ListFindingsResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Finding matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + boolean hasFinding(); + /** + * + * + *
+     * Finding matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + com.google.cloud.securitycenter.v1.Finding getFinding(); + /** + * + * + *
+     * Finding matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + com.google.cloud.securitycenter.v1.FindingOrBuilder getFindingOrBuilder(); + + /** + * + * + *
+     * State change of the finding between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + */ + int getStateChangeValue(); + /** + * + * + *
+     * State change of the finding between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + */ + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + getStateChange(); + } + /** + * + * + *
+   * Result containing the Finding and its StateChange.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} + */ + public static final class ListFindingsResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) + ListFindingsResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFindingsResult.newBuilder() to construct. + private ListFindingsResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFindingsResult() { + stateChange_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFindingsResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1.Finding.Builder subBuilder = null; + if (finding_ != null) { + subBuilder = finding_.toBuilder(); + } + finding_ = + input.readMessage( + com.google.cloud.securitycenter.v1.Finding.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(finding_); + finding_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + int rawValue = input.readEnum(); + + stateChange_ = rawValue; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_ListFindingsResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_ListFindingsResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.class, + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Builder + .class); + } + + /** + * + * + *
+     * The change in state of the finding.
+     * When querying across two points in time this describes
+     * the change in the finding between the two points: CHANGED, UNCHANGED,
+     * ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that
+     * the finding at timestamp does not match the filter specified, but it did
+     * at timestamp - compare_duration. If there was no compare_duration
+     * supplied in the request the state change will be: UNUSED
+     * 
+ * + * Protobuf enum {@code + * google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange} + */ + public enum StateChange implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * State change is unused, this is the canonical default for this enum.
+       * 
+ * + * UNUSED = 0; + */ + UNUSED(0), + /** + * + * + *
+       * The finding has changed state in some way between the points in time
+       * and existed at both points.
+       * 
+ * + * CHANGED = 1; + */ + CHANGED(1), + /** + * + * + *
+       * The finding has not changed state between the points in time and
+       * existed at both points.
+       * 
+ * + * UNCHANGED = 2; + */ + UNCHANGED(2), + /** + * + * + *
+       * The finding was created between the points in time.
+       * 
+ * + * ADDED = 3; + */ + ADDED(3), + /** + * + * + *
+       * The finding at timestamp does not match the filter specified, but it
+       * did at timestamp - compare_duration.
+       * 
+ * + * REMOVED = 4; + */ + REMOVED(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * State change is unused, this is the canonical default for this enum.
+       * 
+ * + * UNUSED = 0; + */ + public static final int UNUSED_VALUE = 0; + /** + * + * + *
+       * The finding has changed state in some way between the points in time
+       * and existed at both points.
+       * 
+ * + * CHANGED = 1; + */ + public static final int CHANGED_VALUE = 1; + /** + * + * + *
+       * The finding has not changed state between the points in time and
+       * existed at both points.
+       * 
+ * + * UNCHANGED = 2; + */ + public static final int UNCHANGED_VALUE = 2; + /** + * + * + *
+       * The finding was created between the points in time.
+       * 
+ * + * ADDED = 3; + */ + public static final int ADDED_VALUE = 3; + /** + * + * + *
+       * The finding at timestamp does not match the filter specified, but it
+       * did at timestamp - compare_duration.
+       * 
+ * + * REMOVED = 4; + */ + public static final int REMOVED_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static StateChange valueOf(int value) { + return forNumber(value); + } + + public static StateChange forNumber(int value) { + switch (value) { + case 0: + return UNUSED; + case 1: + return CHANGED; + case 2: + return UNCHANGED; + case 3: + return ADDED; + case 4: + return REMOVED; + 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 StateChange findValueByNumber(int number) { + return StateChange.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.v1.ListFindingsResponse.ListFindingsResult + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final StateChange[] VALUES = values(); + + public static StateChange 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 StateChange(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange) + } + + public static final int FINDING_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1.Finding finding_; + /** + * + * + *
+     * Finding matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public boolean hasFinding() { + return finding_ != null; + } + /** + * + * + *
+     * Finding matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1.Finding getFinding() { + return finding_ == null + ? com.google.cloud.securitycenter.v1.Finding.getDefaultInstance() + : finding_; + } + /** + * + * + *
+     * Finding matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1.FindingOrBuilder getFindingOrBuilder() { + return getFinding(); + } + + public static final int STATE_CHANGE_FIELD_NUMBER = 2; + private int stateChange_; + /** + * + * + *
+     * State change of the finding between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + */ + public int getStateChangeValue() { + return stateChange_; + } + /** + * + * + *
+     * State change of the finding between the points in time.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + */ + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + getStateChange() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + result = + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + .valueOf(stateChange_); + return result == null + ? com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + .UNRECOGNIZED + : result; + } + + 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 (finding_ != null) { + output.writeMessage(1, getFinding()); + } + if (stateChange_ + != com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + .UNUSED.getNumber()) { + output.writeEnum(2, stateChange_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (finding_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFinding()); + } + if (stateChange_ + != com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + .UNUSED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, stateChange_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult other = + (com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) obj; + + boolean result = true; + result = result && (hasFinding() == other.hasFinding()); + if (hasFinding()) { + result = result && getFinding().equals(other.getFinding()); + } + result = result && stateChange_ == other.stateChange_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFinding()) { + hash = (37 * hash) + FINDING_FIELD_NUMBER; + hash = (53 * hash) + getFinding().hashCode(); + } + hash = (37 * hash) + STATE_CHANGE_FIELD_NUMBER; + hash = (53 * hash) + stateChange_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + 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.v1.ListFindingsResponse.ListFindingsResult + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + 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.v1.ListFindingsResponse.ListFindingsResult + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + 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.v1.ListFindingsResponse.ListFindingsResult + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + 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.v1.ListFindingsResponse.ListFindingsResult + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + 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.v1.ListFindingsResponse.ListFindingsResult 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; + } + /** + * + * + *
+     * Result containing the Finding and its StateChange.
+     * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_ListFindingsResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_ListFindingsResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.class, + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (findingBuilder_ == null) { + finding_ = null; + } else { + finding_ = null; + findingBuilder_ = null; + } + stateChange_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_ListFindingsResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult build() { + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + buildPartial() { + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult result = + new com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(this); + if (findingBuilder_ == null) { + result.finding_ = finding_; + } else { + result.finding_ = findingBuilder_.build(); + } + result.stateChange_ = stateChange_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) { + return mergeFrom( + (com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult other) { + if (other + == com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + .getDefaultInstance()) return this; + if (other.hasFinding()) { + mergeFinding(other.getFinding()); + } + if (other.stateChange_ != 0) { + setStateChangeValue(other.getStateChangeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1.Finding finding_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Finding, + com.google.cloud.securitycenter.v1.Finding.Builder, + com.google.cloud.securitycenter.v1.FindingOrBuilder> + findingBuilder_; + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public boolean hasFinding() { + return findingBuilder_ != null || finding_ != null; + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1.Finding getFinding() { + if (findingBuilder_ == null) { + return finding_ == null + ? com.google.cloud.securitycenter.v1.Finding.getDefaultInstance() + : finding_; + } else { + return findingBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public Builder setFinding(com.google.cloud.securitycenter.v1.Finding value) { + if (findingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finding_ = value; + onChanged(); + } else { + findingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public Builder setFinding( + com.google.cloud.securitycenter.v1.Finding.Builder builderForValue) { + if (findingBuilder_ == null) { + finding_ = builderForValue.build(); + onChanged(); + } else { + findingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public Builder mergeFinding(com.google.cloud.securitycenter.v1.Finding value) { + if (findingBuilder_ == null) { + if (finding_ != null) { + finding_ = + com.google.cloud.securitycenter.v1.Finding.newBuilder(finding_) + .mergeFrom(value) + .buildPartial(); + } else { + finding_ = value; + } + onChanged(); + } else { + findingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public Builder clearFinding() { + if (findingBuilder_ == null) { + finding_ = null; + onChanged(); + } else { + finding_ = null; + findingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1.Finding.Builder getFindingBuilder() { + + onChanged(); + return getFindingFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1.FindingOrBuilder getFindingOrBuilder() { + if (findingBuilder_ != null) { + return findingBuilder_.getMessageOrBuilder(); + } else { + return finding_ == null + ? com.google.cloud.securitycenter.v1.Finding.getDefaultInstance() + : finding_; + } + } + /** + * + * + *
+       * Finding matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Finding, + com.google.cloud.securitycenter.v1.Finding.Builder, + com.google.cloud.securitycenter.v1.FindingOrBuilder> + getFindingFieldBuilder() { + if (findingBuilder_ == null) { + findingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Finding, + com.google.cloud.securitycenter.v1.Finding.Builder, + com.google.cloud.securitycenter.v1.FindingOrBuilder>( + getFinding(), getParentForChildren(), isClean()); + finding_ = null; + } + return findingBuilder_; + } + + private int stateChange_ = 0; + /** + * + * + *
+       * State change of the finding between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + */ + public int getStateChangeValue() { + return stateChange_; + } + /** + * + * + *
+       * State change of the finding between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + */ + public Builder setStateChangeValue(int value) { + stateChange_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * State change of the finding between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + */ + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + getStateChange() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + result = + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + .StateChange.valueOf(stateChange_); + return result == null + ? com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * State change of the finding between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + */ + public Builder setStateChange( + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange + value) { + if (value == null) { + throw new NullPointerException(); + } + + stateChange_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * State change of the finding between the points in time.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange state_change = 2; + * + */ + public Builder clearStateChange() { + + stateChange_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.ListFindingsResponse.ListFindingsResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult) + private static final com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult(); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFindingsResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFindingsResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int LIST_FINDINGS_RESULTS_FIELD_NUMBER = 1; + private java.util.List + listFindingsResults_; + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public java.util.List + getListFindingsResultsList() { + return listFindingsResults_; + } + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResultOrBuilder> + getListFindingsResultsOrBuilderList() { + return listFindingsResults_; + } + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public int getListFindingsResultsCount() { + return listFindingsResults_.size(); + } + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + getListFindingsResults(int index) { + return listFindingsResults_.get(index); + } + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResultOrBuilder + getListFindingsResultsOrBuilder(int index) { + return listFindingsResults_.get(index); + } + + public static final int READ_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOTAL_SIZE_FIELD_NUMBER = 4; + private int totalSize_; + /** + * + * + *
+   * The total number of findings matching the query.
+   * 
+ * + * int32 total_size = 4; + */ + public int getTotalSize() { + return totalSize_; + } + + 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 < listFindingsResults_.size(); i++) { + output.writeMessage(1, listFindingsResults_.get(i)); + } + if (readTime_ != null) { + output.writeMessage(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + } + if (totalSize_ != 0) { + output.writeInt32(4, totalSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < listFindingsResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, listFindingsResults_.get(i)); + } + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadTime()); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); + } + if (totalSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, totalSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.ListFindingsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.ListFindingsResponse other = + (com.google.cloud.securitycenter.v1.ListFindingsResponse) obj; + + boolean result = true; + result = result && getListFindingsResultsList().equals(other.getListFindingsResultsList()); + result = result && (hasReadTime() == other.hasReadTime()); + if (hasReadTime()) { + result = result && getReadTime().equals(other.getReadTime()); + } + result = result && getNextPageToken().equals(other.getNextPageToken()); + result = result && (getTotalSize() == other.getTotalSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getListFindingsResultsCount() > 0) { + hash = (37 * hash) + LIST_FINDINGS_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getListFindingsResultsList().hashCode(); + } + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (37 * hash) + TOTAL_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getTotalSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse 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.v1.ListFindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse 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.v1.ListFindingsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse 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.v1.ListFindingsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse 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.v1.ListFindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse 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.v1.ListFindingsResponse 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; + } + /** + * + * + *
+   * Response message for listing findings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListFindingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.ListFindingsResponse) + com.google.cloud.securitycenter.v1.ListFindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListFindingsResponse.class, + com.google.cloud.securitycenter.v1.ListFindingsResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.ListFindingsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getListFindingsResultsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (listFindingsResultsBuilder_ == null) { + listFindingsResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + listFindingsResultsBuilder_.clear(); + } + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + nextPageToken_ = ""; + + totalSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListFindingsResponse getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.ListFindingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListFindingsResponse build() { + com.google.cloud.securitycenter.v1.ListFindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListFindingsResponse buildPartial() { + com.google.cloud.securitycenter.v1.ListFindingsResponse result = + new com.google.cloud.securitycenter.v1.ListFindingsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (listFindingsResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + listFindingsResults_ = java.util.Collections.unmodifiableList(listFindingsResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.listFindingsResults_ = listFindingsResults_; + } else { + result.listFindingsResults_ = listFindingsResultsBuilder_.build(); + } + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.totalSize_ = totalSize_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.ListFindingsResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1.ListFindingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.ListFindingsResponse other) { + if (other == com.google.cloud.securitycenter.v1.ListFindingsResponse.getDefaultInstance()) + return this; + if (listFindingsResultsBuilder_ == null) { + if (!other.listFindingsResults_.isEmpty()) { + if (listFindingsResults_.isEmpty()) { + listFindingsResults_ = other.listFindingsResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureListFindingsResultsIsMutable(); + listFindingsResults_.addAll(other.listFindingsResults_); + } + onChanged(); + } + } else { + if (!other.listFindingsResults_.isEmpty()) { + if (listFindingsResultsBuilder_.isEmpty()) { + listFindingsResultsBuilder_.dispose(); + listFindingsResultsBuilder_ = null; + listFindingsResults_ = other.listFindingsResults_; + bitField0_ = (bitField0_ & ~0x00000001); + listFindingsResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getListFindingsResultsFieldBuilder() + : null; + } else { + listFindingsResultsBuilder_.addAllMessages(other.listFindingsResults_); + } + } + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (other.getTotalSize() != 0) { + setTotalSize(other.getTotalSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.ListFindingsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.ListFindingsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult> + listFindingsResults_ = java.util.Collections.emptyList(); + + private void ensureListFindingsResultsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + listFindingsResults_ = + new java.util.ArrayList< + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult>( + listFindingsResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult, + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Builder, + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResultOrBuilder> + listFindingsResultsBuilder_; + + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public java.util.List< + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult> + getListFindingsResultsList() { + if (listFindingsResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(listFindingsResults_); + } else { + return listFindingsResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public int getListFindingsResultsCount() { + if (listFindingsResultsBuilder_ == null) { + return listFindingsResults_.size(); + } else { + return listFindingsResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + getListFindingsResults(int index) { + if (listFindingsResultsBuilder_ == null) { + return listFindingsResults_.get(index); + } else { + return listFindingsResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder setListFindingsResults( + int index, + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult value) { + if (listFindingsResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListFindingsResultsIsMutable(); + listFindingsResults_.set(index, value); + onChanged(); + } else { + listFindingsResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder setListFindingsResults( + int index, + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Builder + builderForValue) { + if (listFindingsResultsBuilder_ == null) { + ensureListFindingsResultsIsMutable(); + listFindingsResults_.set(index, builderForValue.build()); + onChanged(); + } else { + listFindingsResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder addListFindingsResults( + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult value) { + if (listFindingsResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListFindingsResultsIsMutable(); + listFindingsResults_.add(value); + onChanged(); + } else { + listFindingsResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder addListFindingsResults( + int index, + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult value) { + if (listFindingsResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureListFindingsResultsIsMutable(); + listFindingsResults_.add(index, value); + onChanged(); + } else { + listFindingsResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder addListFindingsResults( + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Builder + builderForValue) { + if (listFindingsResultsBuilder_ == null) { + ensureListFindingsResultsIsMutable(); + listFindingsResults_.add(builderForValue.build()); + onChanged(); + } else { + listFindingsResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder addListFindingsResults( + int index, + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Builder + builderForValue) { + if (listFindingsResultsBuilder_ == null) { + ensureListFindingsResultsIsMutable(); + listFindingsResults_.add(index, builderForValue.build()); + onChanged(); + } else { + listFindingsResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder addAllListFindingsResults( + java.lang.Iterable< + ? extends + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult> + values) { + if (listFindingsResultsBuilder_ == null) { + ensureListFindingsResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, listFindingsResults_); + onChanged(); + } else { + listFindingsResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder clearListFindingsResults() { + if (listFindingsResultsBuilder_ == null) { + listFindingsResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + listFindingsResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public Builder removeListFindingsResults(int index) { + if (listFindingsResultsBuilder_ == null) { + ensureListFindingsResultsIsMutable(); + listFindingsResults_.remove(index); + onChanged(); + } else { + listFindingsResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Builder + getListFindingsResultsBuilder(int index) { + return getListFindingsResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResultOrBuilder + getListFindingsResultsOrBuilder(int index) { + if (listFindingsResultsBuilder_ == null) { + return listFindingsResults_.get(index); + } else { + return listFindingsResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResultOrBuilder> + getListFindingsResultsOrBuilderList() { + if (listFindingsResultsBuilder_ != null) { + return listFindingsResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(listFindingsResults_); + } + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Builder + addListFindingsResultsBuilder() { + return getListFindingsResultsFieldBuilder() + .addBuilder( + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Builder + addListFindingsResultsBuilder(int index) { + return getListFindingsResultsFieldBuilder() + .addBuilder( + index, + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult + .getDefaultInstance()); + } + /** + * + * + *
+     * Findings matching the list request.
+     * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + public java.util.List< + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Builder> + getListFindingsResultsBuilderList() { + return getListFindingsResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult, + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Builder, + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResultOrBuilder> + getListFindingsResultsFieldBuilder() { + if (listFindingsResultsBuilder_ == null) { + listFindingsResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult, + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Builder, + com.google.cloud.securitycenter.v1.ListFindingsResponse + .ListFindingsResultOrBuilder>( + listFindingsResults_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + listFindingsResults_ = null; + } + return listFindingsResultsBuilder_; + } + + private com.google.protobuf.Timestamp readTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time used for executing the list request.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 3; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private int totalSize_; + /** + * + * + *
+     * The total number of findings matching the query.
+     * 
+ * + * int32 total_size = 4; + */ + public int getTotalSize() { + return totalSize_; + } + /** + * + * + *
+     * The total number of findings matching the query.
+     * 
+ * + * int32 total_size = 4; + */ + public Builder setTotalSize(int value) { + + totalSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of findings matching the query.
+     * 
+ * + * int32 total_size = 4; + */ + public Builder clearTotalSize() { + + totalSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.ListFindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.ListFindingsResponse) + private static final com.google.cloud.securitycenter.v1.ListFindingsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.ListFindingsResponse(); + } + + public static com.google.cloud.securitycenter.v1.ListFindingsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFindingsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFindingsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListFindingsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsResponseOrBuilder.java new file mode 100644 index 000000000000..f09ff9b67992 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsResponseOrBuilder.java @@ -0,0 +1,142 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface ListFindingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.ListFindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + java.util.List + getListFindingsResultsList(); + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult getListFindingsResults( + int index); + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + int getListFindingsResultsCount(); + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResultOrBuilder> + getListFindingsResultsOrBuilderList(); + /** + * + * + *
+   * Findings matching the list request.
+   * 
+ * + * + * repeated .google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult list_findings_results = 1; + * + */ + com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResultOrBuilder + getListFindingsResultsOrBuilder(int index); + + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time used for executing the list request.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 3; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * The total number of findings matching the query.
+   * 
+ * + * int32 total_size = 4; + */ + int getTotalSize(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesRequest.java new file mode 100644 index 000000000000..5b3e6ad16115 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesRequest.java @@ -0,0 +1,866 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for listing sources.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListSourcesRequest} + */ +public final class ListSourcesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.ListSourcesRequest) + ListSourcesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSourcesRequest.newBuilder() to construct. + private ListSourcesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSourcesRequest() { + parent_ = ""; + pageToken_ = ""; + pageSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSourcesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 56: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListSourcesRequest.class, + com.google.cloud.securitycenter.v1.ListSourcesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Resource name of the parent of sources to list. Its format should be
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+   * Resource name of the parent of sources to list. Its format should be
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + 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 PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last `ListSourcesResponse`; indicates
+   * that this is a continuation of a prior `ListSources` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 2; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last `ListSourcesResponse`; indicates
+   * that this is a continuation of a prior `ListSources` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 2; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 7; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 7; + */ + public int getPageSize() { + return pageSize_; + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(7, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.ListSourcesRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.ListSourcesRequest other = + (com.google.cloud.securitycenter.v1.ListSourcesRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && getPageToken().equals(other.getPageToken()); + result = result && (getPageSize() == other.getPageSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.ListSourcesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesRequest 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.v1.ListSourcesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesRequest 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.v1.ListSourcesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesRequest 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.v1.ListSourcesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesRequest 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.v1.ListSourcesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesRequest 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.v1.ListSourcesRequest 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; + } + /** + * + * + *
+   * Request message for listing sources.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListSourcesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.ListSourcesRequest) + com.google.cloud.securitycenter.v1.ListSourcesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListSourcesRequest.class, + com.google.cloud.securitycenter.v1.ListSourcesRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.ListSourcesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListSourcesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListSourcesRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.ListSourcesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListSourcesRequest build() { + com.google.cloud.securitycenter.v1.ListSourcesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListSourcesRequest buildPartial() { + com.google.cloud.securitycenter.v1.ListSourcesRequest result = + new com.google.cloud.securitycenter.v1.ListSourcesRequest(this); + result.parent_ = parent_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.ListSourcesRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.ListSourcesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.ListSourcesRequest other) { + if (other == com.google.cloud.securitycenter.v1.ListSourcesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.ListSourcesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.ListSourcesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Resource name of the parent of sources to list. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Resource name of the parent of sources to list. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Resource name of the parent of sources to list. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the parent of sources to list. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the parent of sources to list. Its format should be
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last `ListSourcesResponse`; indicates
+     * that this is a continuation of a prior `ListSources` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListSourcesResponse`; indicates
+     * that this is a continuation of a prior `ListSources` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last `ListSourcesResponse`; indicates
+     * that this is a continuation of a prior `ListSources` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListSourcesResponse`; indicates
+     * that this is a continuation of a prior `ListSources` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last `ListSourcesResponse`; indicates
+     * that this is a continuation of a prior `ListSources` call, and
+     * that the system should return the next page of data.
+     * 
+ * + * string page_token = 2; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 7; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 7; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of results to return in a single response. Default is
+     * 10, minimum is 1, maximum is 1000.
+     * 
+ * + * int32 page_size = 7; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.ListSourcesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.ListSourcesRequest) + private static final com.google.cloud.securitycenter.v1.ListSourcesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.ListSourcesRequest(); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSourcesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSourcesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListSourcesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesRequestOrBuilder.java new file mode 100644 index 000000000000..16ee4ca7374d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesRequestOrBuilder.java @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface ListSourcesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.ListSourcesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the parent of sources to list. Its format should be
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Resource name of the parent of sources to list. Its format should be
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The value returned by the last `ListSourcesResponse`; indicates
+   * that this is a continuation of a prior `ListSources` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 2; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last `ListSourcesResponse`; indicates
+   * that this is a continuation of a prior `ListSources` call, and
+   * that the system should return the next page of data.
+   * 
+ * + * string page_token = 2; + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of results to return in a single response. Default is
+   * 10, minimum is 1, maximum is 1000.
+   * 
+ * + * int32 page_size = 7; + */ + int getPageSize(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesResponse.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesResponse.java new file mode 100644 index 000000000000..952930fa2f2f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesResponse.java @@ -0,0 +1,1099 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Response message for listing sources.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListSourcesResponse} + */ +public final class ListSourcesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.ListSourcesResponse) + ListSourcesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListSourcesResponse.newBuilder() to construct. + private ListSourcesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSourcesResponse() { + sources_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSourcesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + sources_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + sources_.add( + input.readMessage( + com.google.cloud.securitycenter.v1.Source.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + sources_ = java.util.Collections.unmodifiableList(sources_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListSourcesResponse.class, + com.google.cloud.securitycenter.v1.ListSourcesResponse.Builder.class); + } + + private int bitField0_; + public static final int SOURCES_FIELD_NUMBER = 1; + private java.util.List sources_; + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public java.util.List getSourcesList() { + return sources_; + } + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public java.util.List + getSourcesOrBuilderList() { + return sources_; + } + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public int getSourcesCount() { + return sources_.size(); + } + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1.Source getSources(int index) { + return sources_.get(index); + } + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1.SourceOrBuilder getSourcesOrBuilder(int index) { + return sources_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < sources_.size(); i++) { + output.writeMessage(1, sources_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < sources_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, sources_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.ListSourcesResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.ListSourcesResponse other = + (com.google.cloud.securitycenter.v1.ListSourcesResponse) obj; + + boolean result = true; + result = result && getSourcesList().equals(other.getSourcesList()); + result = result && getNextPageToken().equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSourcesCount() > 0) { + hash = (37 * hash) + SOURCES_FIELD_NUMBER; + hash = (53 * hash) + getSourcesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.ListSourcesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesResponse 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.v1.ListSourcesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesResponse 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.v1.ListSourcesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesResponse 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.v1.ListSourcesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesResponse 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.v1.ListSourcesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesResponse 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.v1.ListSourcesResponse 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; + } + /** + * + * + *
+   * Response message for listing sources.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.ListSourcesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.ListSourcesResponse) + com.google.cloud.securitycenter.v1.ListSourcesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.ListSourcesResponse.class, + com.google.cloud.securitycenter.v1.ListSourcesResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.ListSourcesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSourcesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (sourcesBuilder_ == null) { + sources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + sourcesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_ListSourcesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListSourcesResponse getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.ListSourcesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListSourcesResponse build() { + com.google.cloud.securitycenter.v1.ListSourcesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListSourcesResponse buildPartial() { + com.google.cloud.securitycenter.v1.ListSourcesResponse result = + new com.google.cloud.securitycenter.v1.ListSourcesResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (sourcesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + sources_ = java.util.Collections.unmodifiableList(sources_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sources_ = sources_; + } else { + result.sources_ = sourcesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.ListSourcesResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1.ListSourcesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.ListSourcesResponse other) { + if (other == com.google.cloud.securitycenter.v1.ListSourcesResponse.getDefaultInstance()) + return this; + if (sourcesBuilder_ == null) { + if (!other.sources_.isEmpty()) { + if (sources_.isEmpty()) { + sources_ = other.sources_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSourcesIsMutable(); + sources_.addAll(other.sources_); + } + onChanged(); + } + } else { + if (!other.sources_.isEmpty()) { + if (sourcesBuilder_.isEmpty()) { + sourcesBuilder_.dispose(); + sourcesBuilder_ = null; + sources_ = other.sources_; + bitField0_ = (bitField0_ & ~0x00000001); + sourcesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSourcesFieldBuilder() + : null; + } else { + sourcesBuilder_.addAllMessages(other.sources_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.ListSourcesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.ListSourcesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List sources_ = + java.util.Collections.emptyList(); + + private void ensureSourcesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + sources_ = new java.util.ArrayList(sources_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.Source, + com.google.cloud.securitycenter.v1.Source.Builder, + com.google.cloud.securitycenter.v1.SourceOrBuilder> + sourcesBuilder_; + + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public java.util.List getSourcesList() { + if (sourcesBuilder_ == null) { + return java.util.Collections.unmodifiableList(sources_); + } else { + return sourcesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public int getSourcesCount() { + if (sourcesBuilder_ == null) { + return sources_.size(); + } else { + return sourcesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1.Source getSources(int index) { + if (sourcesBuilder_ == null) { + return sources_.get(index); + } else { + return sourcesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public Builder setSources(int index, com.google.cloud.securitycenter.v1.Source value) { + if (sourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourcesIsMutable(); + sources_.set(index, value); + onChanged(); + } else { + sourcesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public Builder setSources( + int index, com.google.cloud.securitycenter.v1.Source.Builder builderForValue) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + sources_.set(index, builderForValue.build()); + onChanged(); + } else { + sourcesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public Builder addSources(com.google.cloud.securitycenter.v1.Source value) { + if (sourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourcesIsMutable(); + sources_.add(value); + onChanged(); + } else { + sourcesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public Builder addSources(int index, com.google.cloud.securitycenter.v1.Source value) { + if (sourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourcesIsMutable(); + sources_.add(index, value); + onChanged(); + } else { + sourcesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public Builder addSources(com.google.cloud.securitycenter.v1.Source.Builder builderForValue) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + sources_.add(builderForValue.build()); + onChanged(); + } else { + sourcesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public Builder addSources( + int index, com.google.cloud.securitycenter.v1.Source.Builder builderForValue) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + sources_.add(index, builderForValue.build()); + onChanged(); + } else { + sourcesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public Builder addAllSources( + java.lang.Iterable values) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sources_); + onChanged(); + } else { + sourcesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public Builder clearSources() { + if (sourcesBuilder_ == null) { + sources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sourcesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public Builder removeSources(int index) { + if (sourcesBuilder_ == null) { + ensureSourcesIsMutable(); + sources_.remove(index); + onChanged(); + } else { + sourcesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1.Source.Builder getSourcesBuilder(int index) { + return getSourcesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1.SourceOrBuilder getSourcesOrBuilder(int index) { + if (sourcesBuilder_ == null) { + return sources_.get(index); + } else { + return sourcesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public java.util.List + getSourcesOrBuilderList() { + if (sourcesBuilder_ != null) { + return sourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sources_); + } + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1.Source.Builder addSourcesBuilder() { + return getSourcesFieldBuilder() + .addBuilder(com.google.cloud.securitycenter.v1.Source.getDefaultInstance()); + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1.Source.Builder addSourcesBuilder(int index) { + return getSourcesFieldBuilder() + .addBuilder(index, com.google.cloud.securitycenter.v1.Source.getDefaultInstance()); + } + /** + * + * + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + public java.util.List + getSourcesBuilderList() { + return getSourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.Source, + com.google.cloud.securitycenter.v1.Source.Builder, + com.google.cloud.securitycenter.v1.SourceOrBuilder> + getSourcesFieldBuilder() { + if (sourcesBuilder_ == null) { + sourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1.Source, + com.google.cloud.securitycenter.v1.Source.Builder, + com.google.cloud.securitycenter.v1.SourceOrBuilder>( + sources_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + sources_ = null; + } + return sourcesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.ListSourcesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.ListSourcesResponse) + private static final com.google.cloud.securitycenter.v1.ListSourcesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.ListSourcesResponse(); + } + + public static com.google.cloud.securitycenter.v1.ListSourcesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSourcesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSourcesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.ListSourcesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesResponseOrBuilder.java new file mode 100644 index 000000000000..6c38c6db2712 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListSourcesResponseOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface ListSourcesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.ListSourcesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + java.util.List getSourcesList(); + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + com.google.cloud.securitycenter.v1.Source getSources(int index); + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + int getSourcesCount(); + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + java.util.List + getSourcesOrBuilderList(); + /** + * + * + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1.Source sources = 1; + */ + com.google.cloud.securitycenter.v1.SourceOrBuilder getSourcesOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationName.java new file mode 100644 index 000000000000..d7ca6ceebe27 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationName.java @@ -0,0 +1,160 @@ +/* + * Copyright 2018 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. + */ + +package com.google.cloud.securitycenter.v1; + +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; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OrganizationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}"); + + private volatile Map fieldValuesMap; + + private final String organization; + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private OrganizationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + } + + public static OrganizationName of(String organization) { + return newBuilder().setOrganization(organization).build(); + } + + public static String format(String organization) { + return newBuilder().setOrganization(organization).build().toString(); + } + + public static OrganizationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "OrganizationName.parse: formattedString not in valid format"); + return of(matchMap.get("organization")); + } + + 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 (OrganizationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization); + } + + /** Builder for OrganizationName. */ + public static class Builder { + + private String organization; + + public String getOrganization() { + return organization; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + private Builder() {} + + private Builder(OrganizationName organizationName) { + organization = organizationName.organization; + } + + public OrganizationName build() { + return new OrganizationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OrganizationName) { + OrganizationName that = (OrganizationName) o; + return (this.organization.equals(that.organization)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettings.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettings.java new file mode 100644 index 000000000000..efc44c91a4d0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettings.java @@ -0,0 +1,2140 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/organization_settings.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * User specified settings that are attached to the Cloud Security Command
+ * Center (Cloud SCC) organization.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.OrganizationSettings} + */ +public final class OrganizationSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.OrganizationSettings) + OrganizationSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use OrganizationSettings.newBuilder() to construct. + private OrganizationSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OrganizationSettings() { + name_ = ""; + enableAssetDiscovery_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OrganizationSettings( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + enableAssetDiscovery_ = input.readBool(); + break; + } + case 26: + { + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.Builder + subBuilder = null; + if (assetDiscoveryConfig_ != null) { + subBuilder = assetDiscoveryConfig_.toBuilder(); + } + assetDiscoveryConfig_ = + input.readMessage( + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(assetDiscoveryConfig_); + assetDiscoveryConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1_OrganizationSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1_OrganizationSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.OrganizationSettings.class, + com.google.cloud.securitycenter.v1.OrganizationSettings.Builder.class); + } + + public interface AssetDiscoveryConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + */ + java.util.List getProjectIdsList(); + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + */ + int getProjectIdsCount(); + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + */ + java.lang.String getProjectIds(int index); + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + */ + com.google.protobuf.ByteString getProjectIdsBytes(int index); + + /** + * + * + *
+     * The mode to use for filtering asset discovery.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + */ + int getInclusionModeValue(); + /** + * + * + *
+     * The mode to use for filtering asset discovery.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + */ + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + getInclusionMode(); + } + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} + */ + public static final class AssetDiscoveryConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) + AssetDiscoveryConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use AssetDiscoveryConfig.newBuilder() to construct. + private AssetDiscoveryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AssetDiscoveryConfig() { + projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + inclusionMode_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AssetDiscoveryConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + projectIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + projectIds_.add(s); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + inclusionMode_ = rawValue; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + projectIds_ = projectIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1_OrganizationSettings_AssetDiscoveryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1_OrganizationSettings_AssetDiscoveryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.class, + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.Builder + .class); + } + + /** + * + * + *
+     * The mode of inclusion when running Asset Discovery.
+     * Asset discovery can be limited by explicitly identifying projects to be
+     * included or excluded. If INCLUDE_ONLY is set, then only those projects
+     * within the organization and their children are discovered during asset
+     * discovery. If EXCLUDE is set, then projects that don't match those
+     * projects are discovered during asset discovery. If neither are set, then
+     * all projects within the organization are discovered during asset
+     * discovery.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode} + */ + public enum InclusionMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified. Setting the mode with this value will disable
+       * inclusion/exclusion filtering for Asset Discovery.
+       * 
+ * + * INCLUSION_MODE_UNSPECIFIED = 0; + */ + INCLUSION_MODE_UNSPECIFIED(0), + /** + * + * + *
+       * Asset Discovery will capture only the resources within the projects
+       * specified. All other resources will be ignored.
+       * 
+ * + * INCLUDE_ONLY = 1; + */ + INCLUDE_ONLY(1), + /** + * + * + *
+       * Asset Discovery will ignore all resources under the projects specified.
+       * All other resources will be retrieved.
+       * 
+ * + * EXCLUDE = 2; + */ + EXCLUDE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified. Setting the mode with this value will disable
+       * inclusion/exclusion filtering for Asset Discovery.
+       * 
+ * + * INCLUSION_MODE_UNSPECIFIED = 0; + */ + public static final int INCLUSION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Asset Discovery will capture only the resources within the projects
+       * specified. All other resources will be ignored.
+       * 
+ * + * INCLUDE_ONLY = 1; + */ + public static final int INCLUDE_ONLY_VALUE = 1; + /** + * + * + *
+       * Asset Discovery will ignore all resources under the projects specified.
+       * All other resources will be retrieved.
+       * 
+ * + * EXCLUDE = 2; + */ + public static final int EXCLUDE_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static InclusionMode valueOf(int value) { + return forNumber(value); + } + + public static InclusionMode forNumber(int value) { + switch (value) { + case 0: + return INCLUSION_MODE_UNSPECIFIED; + case 1: + return INCLUDE_ONLY; + case 2: + return EXCLUDE; + 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 InclusionMode findValueByNumber(int number) { + return InclusionMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.v1.OrganizationSettings.AssetDiscoveryConfig + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final InclusionMode[] VALUES = values(); + + public static InclusionMode 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 InclusionMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode) + } + + private int bitField0_; + public static final int PROJECT_IDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList projectIds_; + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + */ + public com.google.protobuf.ProtocolStringList getProjectIdsList() { + return projectIds_; + } + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + */ + public int getProjectIdsCount() { + return projectIds_.size(); + } + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + */ + public java.lang.String getProjectIds(int index) { + return projectIds_.get(index); + } + /** + * + * + *
+     * The project ids to use for filtering asset discovery.
+     * 
+ * + * repeated string project_ids = 1; + */ + public com.google.protobuf.ByteString getProjectIdsBytes(int index) { + return projectIds_.getByteString(index); + } + + public static final int INCLUSION_MODE_FIELD_NUMBER = 2; + private int inclusionMode_; + /** + * + * + *
+     * The mode to use for filtering asset discovery.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + */ + public int getInclusionModeValue() { + return inclusionMode_; + } + /** + * + * + *
+     * The mode to use for filtering asset discovery.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + */ + public com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode + getInclusionMode() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + result = + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode.valueOf(inclusionMode_); + return result == null + ? com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode.UNRECOGNIZED + : result; + } + + 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 < projectIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectIds_.getRaw(i)); + } + if (inclusionMode_ + != com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode.INCLUSION_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, inclusionMode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < projectIds_.size(); i++) { + dataSize += computeStringSizeNoTag(projectIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getProjectIdsList().size(); + } + if (inclusionMode_ + != com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode.INCLUSION_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, inclusionMode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig other = + (com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) obj; + + boolean result = true; + result = result && getProjectIdsList().equals(other.getProjectIdsList()); + result = result && inclusionMode_ == other.inclusionMode_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProjectIdsCount() > 0) { + hash = (37 * hash) + PROJECT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getProjectIdsList().hashCode(); + } + hash = (37 * hash) + INCLUSION_MODE_FIELD_NUMBER; + hash = (53 * hash) + inclusionMode_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + 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.v1.OrganizationSettings.AssetDiscoveryConfig + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + 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.v1.OrganizationSettings.AssetDiscoveryConfig + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + 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.v1.OrganizationSettings.AssetDiscoveryConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + 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.v1.OrganizationSettings.AssetDiscoveryConfig + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + 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.v1.OrganizationSettings.AssetDiscoveryConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * Protobuf type {@code + * google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1_OrganizationSettings_AssetDiscoveryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1_OrganizationSettings_AssetDiscoveryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.class, + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.Builder + .class); + } + + // Construct using + // com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + inclusionMode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1_OrganizationSettings_AssetDiscoveryConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig build() { + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + buildPartial() { + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig result = + new com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + projectIds_ = projectIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.projectIds_ = projectIds_; + result.inclusionMode_ = inclusionMode_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) { + return mergeFrom( + (com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig other) { + if (other + == com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .getDefaultInstance()) return this; + if (!other.projectIds_.isEmpty()) { + if (projectIds_.isEmpty()) { + projectIds_ = other.projectIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProjectIdsIsMutable(); + projectIds_.addAll(other.projectIds_); + } + onChanged(); + } + if (other.inclusionMode_ != 0) { + setInclusionModeValue(other.getInclusionModeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList projectIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureProjectIdsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + projectIds_ = new com.google.protobuf.LazyStringArrayList(projectIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + */ + public com.google.protobuf.ProtocolStringList getProjectIdsList() { + return projectIds_.getUnmodifiableView(); + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + */ + public int getProjectIdsCount() { + return projectIds_.size(); + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + */ + public java.lang.String getProjectIds(int index) { + return projectIds_.get(index); + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + */ + public com.google.protobuf.ByteString getProjectIdsBytes(int index) { + return projectIds_.getByteString(index); + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + */ + public Builder setProjectIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProjectIdsIsMutable(); + projectIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + */ + public Builder addProjectIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProjectIdsIsMutable(); + projectIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + */ + public Builder addAllProjectIds(java.lang.Iterable values) { + ensureProjectIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, projectIds_); + onChanged(); + return this; + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + */ + public Builder clearProjectIds() { + projectIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The project ids to use for filtering asset discovery.
+       * 
+ * + * repeated string project_ids = 1; + */ + public Builder addProjectIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureProjectIdsIsMutable(); + projectIds_.add(value); + onChanged(); + return this; + } + + private int inclusionMode_ = 0; + /** + * + * + *
+       * The mode to use for filtering asset discovery.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + */ + public int getInclusionModeValue() { + return inclusionMode_; + } + /** + * + * + *
+       * The mode to use for filtering asset discovery.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + */ + public Builder setInclusionModeValue(int value) { + inclusionMode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The mode to use for filtering asset discovery.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + */ + public com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode + getInclusionMode() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + result = + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode.valueOf(inclusionMode_); + return result == null + ? com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .InclusionMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The mode to use for filtering asset discovery.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + */ + public Builder setInclusionMode( + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode + value) { + if (value == null) { + throw new NullPointerException(); + } + + inclusionMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The mode to use for filtering asset discovery.
+       * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + * + */ + public Builder clearInclusionMode() { + + inclusionMode_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.OrganizationSettings.AssetDiscoveryConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig) + private static final com.google.cloud.securitycenter.v1.OrganizationSettings + .AssetDiscoveryConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig(); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AssetDiscoveryConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AssetDiscoveryConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The relative resource name of the settings. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/organizationSettings".
+   * 
+ * + * string name = 1; + */ + 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 relative resource name of the settings. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/organizationSettings".
+   * 
+ * + * string name = 1; + */ + 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 ENABLE_ASSET_DISCOVERY_FIELD_NUMBER = 2; + private boolean enableAssetDiscovery_; + /** + * + * + *
+   * A flag that indicates if Asset Discovery should be enabled. If the flag is
+   * set to `true`, then discovery of assets will occur. If it is set to `false,
+   * all historical assets will remain, but discovery of future assets will not
+   * occur.
+   * 
+ * + * bool enable_asset_discovery = 2; + */ + public boolean getEnableAssetDiscovery() { + return enableAssetDiscovery_; + } + + public static final int ASSET_DISCOVERY_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + assetDiscoveryConfig_; + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public boolean hasAssetDiscoveryConfig() { + return assetDiscoveryConfig_ != null; + } + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + getAssetDiscoveryConfig() { + return assetDiscoveryConfig_ == null + ? com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .getDefaultInstance() + : assetDiscoveryConfig_; + } + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfigOrBuilder + getAssetDiscoveryConfigOrBuilder() { + return getAssetDiscoveryConfig(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (enableAssetDiscovery_ != false) { + output.writeBool(2, enableAssetDiscovery_); + } + if (assetDiscoveryConfig_ != null) { + output.writeMessage(3, getAssetDiscoveryConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (enableAssetDiscovery_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, enableAssetDiscovery_); + } + if (assetDiscoveryConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAssetDiscoveryConfig()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.OrganizationSettings)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.OrganizationSettings other = + (com.google.cloud.securitycenter.v1.OrganizationSettings) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && (getEnableAssetDiscovery() == other.getEnableAssetDiscovery()); + result = result && (hasAssetDiscoveryConfig() == other.hasAssetDiscoveryConfig()); + if (hasAssetDiscoveryConfig()) { + result = result && getAssetDiscoveryConfig().equals(other.getAssetDiscoveryConfig()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + ENABLE_ASSET_DISCOVERY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableAssetDiscovery()); + if (hasAssetDiscoveryConfig()) { + hash = (37 * hash) + ASSET_DISCOVERY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAssetDiscoveryConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings 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.v1.OrganizationSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings 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.v1.OrganizationSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings 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.v1.OrganizationSettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings 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.v1.OrganizationSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings 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.v1.OrganizationSettings 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; + } + /** + * + * + *
+   * User specified settings that are attached to the Cloud Security Command
+   * Center (Cloud SCC) organization.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.OrganizationSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.OrganizationSettings) + com.google.cloud.securitycenter.v1.OrganizationSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1_OrganizationSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1_OrganizationSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.OrganizationSettings.class, + com.google.cloud.securitycenter.v1.OrganizationSettings.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.OrganizationSettings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + enableAssetDiscovery_ = false; + + if (assetDiscoveryConfigBuilder_ == null) { + assetDiscoveryConfig_ = null; + } else { + assetDiscoveryConfig_ = null; + assetDiscoveryConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.OrganizationSettingsOuterClass + .internal_static_google_cloud_securitycenter_v1_OrganizationSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.OrganizationSettings getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.OrganizationSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.OrganizationSettings build() { + com.google.cloud.securitycenter.v1.OrganizationSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.OrganizationSettings buildPartial() { + com.google.cloud.securitycenter.v1.OrganizationSettings result = + new com.google.cloud.securitycenter.v1.OrganizationSettings(this); + result.name_ = name_; + result.enableAssetDiscovery_ = enableAssetDiscovery_; + if (assetDiscoveryConfigBuilder_ == null) { + result.assetDiscoveryConfig_ = assetDiscoveryConfig_; + } else { + result.assetDiscoveryConfig_ = assetDiscoveryConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.OrganizationSettings) { + return mergeFrom((com.google.cloud.securitycenter.v1.OrganizationSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.OrganizationSettings other) { + if (other == com.google.cloud.securitycenter.v1.OrganizationSettings.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getEnableAssetDiscovery() != false) { + setEnableAssetDiscovery(other.getEnableAssetDiscovery()); + } + if (other.hasAssetDiscoveryConfig()) { + mergeAssetDiscoveryConfig(other.getAssetDiscoveryConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.OrganizationSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.OrganizationSettings) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The relative resource name of the settings. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/organizationSettings".
+     * 
+ * + * string name = 1; + */ + 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 relative resource name of the settings. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/organizationSettings".
+     * 
+ * + * string name = 1; + */ + 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 relative resource name of the settings. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/organizationSettings".
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the settings. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/organizationSettings".
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the settings. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/organizationSettings".
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private boolean enableAssetDiscovery_; + /** + * + * + *
+     * A flag that indicates if Asset Discovery should be enabled. If the flag is
+     * set to `true`, then discovery of assets will occur. If it is set to `false,
+     * all historical assets will remain, but discovery of future assets will not
+     * occur.
+     * 
+ * + * bool enable_asset_discovery = 2; + */ + public boolean getEnableAssetDiscovery() { + return enableAssetDiscovery_; + } + /** + * + * + *
+     * A flag that indicates if Asset Discovery should be enabled. If the flag is
+     * set to `true`, then discovery of assets will occur. If it is set to `false,
+     * all historical assets will remain, but discovery of future assets will not
+     * occur.
+     * 
+ * + * bool enable_asset_discovery = 2; + */ + public Builder setEnableAssetDiscovery(boolean value) { + + enableAssetDiscovery_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A flag that indicates if Asset Discovery should be enabled. If the flag is
+     * set to `true`, then discovery of assets will occur. If it is set to `false,
+     * all historical assets will remain, but discovery of future assets will not
+     * occur.
+     * 
+ * + * bool enable_asset_discovery = 2; + */ + public Builder clearEnableAssetDiscovery() { + + enableAssetDiscovery_ = false; + onChanged(); + return this; + } + + private com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + assetDiscoveryConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig, + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.Builder, + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfigOrBuilder> + assetDiscoveryConfigBuilder_; + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public boolean hasAssetDiscoveryConfig() { + return assetDiscoveryConfigBuilder_ != null || assetDiscoveryConfig_ != null; + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + getAssetDiscoveryConfig() { + if (assetDiscoveryConfigBuilder_ == null) { + return assetDiscoveryConfig_ == null + ? com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .getDefaultInstance() + : assetDiscoveryConfig_; + } else { + return assetDiscoveryConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public Builder setAssetDiscoveryConfig( + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig value) { + if (assetDiscoveryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + assetDiscoveryConfig_ = value; + onChanged(); + } else { + assetDiscoveryConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public Builder setAssetDiscoveryConfig( + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.Builder + builderForValue) { + if (assetDiscoveryConfigBuilder_ == null) { + assetDiscoveryConfig_ = builderForValue.build(); + onChanged(); + } else { + assetDiscoveryConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public Builder mergeAssetDiscoveryConfig( + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig value) { + if (assetDiscoveryConfigBuilder_ == null) { + if (assetDiscoveryConfig_ != null) { + assetDiscoveryConfig_ = + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .newBuilder(assetDiscoveryConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + assetDiscoveryConfig_ = value; + } + onChanged(); + } else { + assetDiscoveryConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public Builder clearAssetDiscoveryConfig() { + if (assetDiscoveryConfigBuilder_ == null) { + assetDiscoveryConfig_ = null; + onChanged(); + } else { + assetDiscoveryConfig_ = null; + assetDiscoveryConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.Builder + getAssetDiscoveryConfigBuilder() { + + onChanged(); + return getAssetDiscoveryConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + public com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfigOrBuilder + getAssetDiscoveryConfigOrBuilder() { + if (assetDiscoveryConfigBuilder_ != null) { + return assetDiscoveryConfigBuilder_.getMessageOrBuilder(); + } else { + return assetDiscoveryConfig_ == null + ? com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .getDefaultInstance() + : assetDiscoveryConfig_; + } + } + /** + * + * + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig, + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.Builder, + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfigOrBuilder> + getAssetDiscoveryConfigFieldBuilder() { + if (assetDiscoveryConfigBuilder_ == null) { + assetDiscoveryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig, + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + .Builder, + com.google.cloud.securitycenter.v1.OrganizationSettings + .AssetDiscoveryConfigOrBuilder>( + getAssetDiscoveryConfig(), getParentForChildren(), isClean()); + assetDiscoveryConfig_ = null; + } + return assetDiscoveryConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.OrganizationSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.OrganizationSettings) + private static final com.google.cloud.securitycenter.v1.OrganizationSettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.OrganizationSettings(); + } + + public static com.google.cloud.securitycenter.v1.OrganizationSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OrganizationSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OrganizationSettings(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.OrganizationSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettingsName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettingsName.java new file mode 100644 index 000000000000..7c2b4cda4eda --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettingsName.java @@ -0,0 +1,160 @@ +/* + * Copyright 2018 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. + */ + +package com.google.cloud.securitycenter.v1; + +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; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OrganizationSettingsName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/organizationSettings"); + + private volatile Map fieldValuesMap; + + private final String organization; + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private OrganizationSettingsName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + } + + public static OrganizationSettingsName of(String organization) { + return newBuilder().setOrganization(organization).build(); + } + + public static String format(String organization) { + return newBuilder().setOrganization(organization).build().toString(); + } + + public static OrganizationSettingsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "OrganizationSettingsName.parse: formattedString not in valid format"); + return of(matchMap.get("organization")); + } + + 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 (OrganizationSettingsName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization); + } + + /** Builder for OrganizationSettingsName. */ + public static class Builder { + + private String organization; + + public String getOrganization() { + return organization; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + private Builder() {} + + private Builder(OrganizationSettingsName organizationSettingsName) { + organization = organizationSettingsName.organization; + } + + public OrganizationSettingsName build() { + return new OrganizationSettingsName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OrganizationSettingsName) { + OrganizationSettingsName that = (OrganizationSettingsName) o; + return (this.organization.equals(that.organization)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettingsOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettingsOrBuilder.java new file mode 100644 index 000000000000..3414ac9d8917 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettingsOrBuilder.java @@ -0,0 +1,90 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/organization_settings.proto + +package com.google.cloud.securitycenter.v1; + +public interface OrganizationSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.OrganizationSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The relative resource name of the settings. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/organizationSettings".
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The relative resource name of the settings. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/organizationSettings".
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * A flag that indicates if Asset Discovery should be enabled. If the flag is
+   * set to `true`, then discovery of assets will occur. If it is set to `false,
+   * all historical assets will remain, but discovery of future assets will not
+   * occur.
+   * 
+ * + * bool enable_asset_discovery = 2; + */ + boolean getEnableAssetDiscovery(); + + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + boolean hasAssetDiscoveryConfig(); + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig + getAssetDiscoveryConfig(); + /** + * + * + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * + * .google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + * + */ + com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfigOrBuilder + getAssetDiscoveryConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettingsOuterClass.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettingsOuterClass.java new file mode 100644 index 000000000000..b207cead2503 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettingsOuterClass.java @@ -0,0 +1,86 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/organization_settings.proto + +package com.google.cloud.securitycenter.v1; + +public final class OrganizationSettingsOuterClass { + private OrganizationSettingsOuterClass() {} + + 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_v1_OrganizationSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_OrganizationSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_OrganizationSettings_AssetDiscoveryConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_OrganizationSettings_AssetDiscoveryConfig_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/v1/organiz" + + "ation_settings.proto\022\036google.cloud.secur" + + "itycenter.v1\032\034google/api/annotations.pro" + + "to\"\252\003\n\024OrganizationSettings\022\014\n\004name\030\001 \001(" + + "\t\022\036\n\026enable_asset_discovery\030\002 \001(\010\022i\n\026ass" + + "et_discovery_config\030\003 \001(\0132I.google.cloud" + + ".securitycenter.v1.OrganizationSettings." + + "AssetDiscoveryConfig\032\354\001\n\024AssetDiscoveryC" + + "onfig\022\023\n\013project_ids\030\001 \003(\t\022o\n\016inclusion_" + + "mode\030\002 \001(\0162W.google.cloud.securitycenter" + + ".v1.OrganizationSettings.AssetDiscoveryC" + + "onfig.InclusionMode\"N\n\rInclusionMode\022\036\n\032" + + "INCLUSION_MODE_UNSPECIFIED\020\000\022\020\n\014INCLUDE_" + + "ONLY\020\001\022\013\n\007EXCLUDE\020\002J\004\010\004\020\005J\004\010\005\020\006Bt\n\"com.g" + + "oogle.cloud.securitycenter.v1P\001ZLgoogle." + + "golang.org/genproto/googleapis/cloud/sec" + + "uritycenter/v1;securitycenterb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_securitycenter_v1_OrganizationSettings_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1_OrganizationSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_OrganizationSettings_descriptor, + new java.lang.String[] { + "Name", "EnableAssetDiscovery", "AssetDiscoveryConfig", + }); + internal_static_google_cloud_securitycenter_v1_OrganizationSettings_AssetDiscoveryConfig_descriptor = + internal_static_google_cloud_securitycenter_v1_OrganizationSettings_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1_OrganizationSettings_AssetDiscoveryConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_OrganizationSettings_AssetDiscoveryConfig_descriptor, + new java.lang.String[] { + "ProjectIds", "InclusionMode", + }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSourcesName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSourcesName.java new file mode 100644 index 000000000000..bb919d8360c5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSourcesName.java @@ -0,0 +1,160 @@ +/* + * Copyright 2018 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. + */ + +package com.google.cloud.securitycenter.v1; + +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; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OrganizationSourcesName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/sources/-"); + + private volatile Map fieldValuesMap; + + private final String organization; + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private OrganizationSourcesName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + } + + public static OrganizationSourcesName of(String organization) { + return newBuilder().setOrganization(organization).build(); + } + + public static String format(String organization) { + return newBuilder().setOrganization(organization).build().toString(); + } + + public static OrganizationSourcesName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "OrganizationSourcesName.parse: formattedString not in valid format"); + return of(matchMap.get("organization")); + } + + 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 (OrganizationSourcesName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization); + } + + /** Builder for OrganizationSourcesName. */ + public static class Builder { + + private String organization; + + public String getOrganization() { + return organization; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + private Builder() {} + + private Builder(OrganizationSourcesName organizationSourcesName) { + organization = organizationSourcesName.organization; + } + + public OrganizationSourcesName build() { + return new OrganizationSourcesName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OrganizationSourcesName) { + OrganizationSourcesName that = (OrganizationSourcesName) o; + return (this.organization.equals(that.organization)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/RunAssetDiscoveryRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/RunAssetDiscoveryRequest.java new file mode 100644 index 000000000000..6ed8a96581aa --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/RunAssetDiscoveryRequest.java @@ -0,0 +1,607 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for running asset discovery for an organization.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} + */ +public final class RunAssetDiscoveryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) + RunAssetDiscoveryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RunAssetDiscoveryRequest.newBuilder() to construct. + private RunAssetDiscoveryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RunAssetDiscoveryRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RunAssetDiscoveryRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_RunAssetDiscoveryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_RunAssetDiscoveryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.class, + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Name of the organization to run asset discovery for. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+   * Name of the organization to run asset discovery for. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + 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; + } + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest other = + (com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) obj; + + boolean result = true; + result = result && getParent().equals(other.getParent()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest 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.v1.RunAssetDiscoveryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest 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.v1.RunAssetDiscoveryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest 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.v1.RunAssetDiscoveryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest 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.v1.RunAssetDiscoveryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest 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.v1.RunAssetDiscoveryRequest 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; + } + /** + * + * + *
+   * Request message for running asset discovery for an organization.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.RunAssetDiscoveryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_RunAssetDiscoveryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_RunAssetDiscoveryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.class, + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_RunAssetDiscoveryRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest build() { + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest buildPartial() { + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest result = + new com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest(this); + result.parent_ = parent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest other) { + if (other == com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Name of the organization to run asset discovery for. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Name of the organization to run asset discovery for. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + 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; + } + } + /** + * + * + *
+     * Name of the organization to run asset discovery for. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the organization to run asset discovery for. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the organization to run asset discovery for. Its format is
+     * "organizations/[organization_id]".
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.RunAssetDiscoveryRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) + private static final com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest(); + } + + public static com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RunAssetDiscoveryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RunAssetDiscoveryRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/RunAssetDiscoveryRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/RunAssetDiscoveryRequestOrBuilder.java new file mode 100644 index 000000000000..af7c129b2b32 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/RunAssetDiscoveryRequestOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface RunAssetDiscoveryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.RunAssetDiscoveryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the organization to run asset discovery for. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Name of the organization to run asset discovery for. Its format is
+   * "organizations/[organization_id]".
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityMarks.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityMarks.java new file mode 100644 index 000000000000..d49a7015afdc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityMarks.java @@ -0,0 +1,1013 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/security_marks.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * User specified security marks that are attached to the parent Cloud Security
+ * Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud
+ * SCC organization -- they can be modified and viewed by all users who have
+ * proper permissions on the organization.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.SecurityMarks} + */ +public final class SecurityMarks extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.SecurityMarks) + SecurityMarksOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecurityMarks.newBuilder() to construct. + private SecurityMarks(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecurityMarks() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecurityMarks( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + marks_ = + com.google.protobuf.MapField.newMapField(MarksDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry marks__ = + input.readMessage( + MarksDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + marks_.getMutableMap().put(marks__.getKey(), marks__.getValue()); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecurityMarksOuterClass + .internal_static_google_cloud_securitycenter_v1_SecurityMarks_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetMarks(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecurityMarksOuterClass + .internal_static_google_cloud_securitycenter_v1_SecurityMarks_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.SecurityMarks.class, + com.google.cloud.securitycenter.v1.SecurityMarks.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The relative resource name of the SecurityMarks. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Examples:
+   * "organizations/123/assets/456/securityMarks"
+   * "organizations/123/sources/456/findings/789/securityMarks".
+   * 
+ * + * string name = 1; + */ + 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 relative resource name of the SecurityMarks. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Examples:
+   * "organizations/123/assets/456/securityMarks"
+   * "organizations/123/sources/456/findings/789/securityMarks".
+   * 
+ * + * string name = 1; + */ + 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 MARKS_FIELD_NUMBER = 2; + + private static final class MarksDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.securitycenter.v1.SecurityMarksOuterClass + .internal_static_google_cloud_securitycenter_v1_SecurityMarks_MarksEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField marks_; + + private com.google.protobuf.MapField internalGetMarks() { + if (marks_ == null) { + return com.google.protobuf.MapField.emptyMapField(MarksDefaultEntryHolder.defaultEntry); + } + return marks_; + } + + public int getMarksCount() { + return internalGetMarks().getMap().size(); + } + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   - Keys and values are treated as case insensitive
+   *   - Keys must be between 1 - 256 characters (inclusive)
+   *   - Keys must be letters, numbers, underscores, or dashes
+   *   - Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + public boolean containsMarks(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMarks().getMap().containsKey(key); + } + /** Use {@link #getMarksMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getMarks() { + return getMarksMap(); + } + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   - Keys and values are treated as case insensitive
+   *   - Keys must be between 1 - 256 characters (inclusive)
+   *   - Keys must be letters, numbers, underscores, or dashes
+   *   - Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + public java.util.Map getMarksMap() { + return internalGetMarks().getMap(); + } + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   - Keys and values are treated as case insensitive
+   *   - Keys must be between 1 - 256 characters (inclusive)
+   *   - Keys must be letters, numbers, underscores, or dashes
+   *   - Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + public java.lang.String getMarksOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMarks().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   - Keys and values are treated as case insensitive
+   *   - Keys must be between 1 - 256 characters (inclusive)
+   *   - Keys must be letters, numbers, underscores, or dashes
+   *   - Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + public java.lang.String getMarksOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMarks().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMarks(), MarksDefaultEntryHolder.defaultEntry, 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (java.util.Map.Entry entry : + internalGetMarks().getMap().entrySet()) { + com.google.protobuf.MapEntry marks__ = + MarksDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, marks__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.SecurityMarks)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.SecurityMarks other = + (com.google.cloud.securitycenter.v1.SecurityMarks) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && internalGetMarks().equals(other.internalGetMarks()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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(); + if (!internalGetMarks().getMap().isEmpty()) { + hash = (37 * hash) + MARKS_FIELD_NUMBER; + hash = (53 * hash) + internalGetMarks().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.SecurityMarks parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.SecurityMarks 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.v1.SecurityMarks parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.SecurityMarks 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.v1.SecurityMarks parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.SecurityMarks parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.SecurityMarks parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.SecurityMarks 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.v1.SecurityMarks parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.SecurityMarks 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.v1.SecurityMarks parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.SecurityMarks 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.v1.SecurityMarks 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; + } + /** + * + * + *
+   * User specified security marks that are attached to the parent Cloud Security
+   * Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud
+   * SCC organization -- they can be modified and viewed by all users who have
+   * proper permissions on the organization.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.SecurityMarks} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.SecurityMarks) + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecurityMarksOuterClass + .internal_static_google_cloud_securitycenter_v1_SecurityMarks_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetMarks(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableMarks(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecurityMarksOuterClass + .internal_static_google_cloud_securitycenter_v1_SecurityMarks_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.SecurityMarks.class, + com.google.cloud.securitycenter.v1.SecurityMarks.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.SecurityMarks.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + internalGetMutableMarks().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecurityMarksOuterClass + .internal_static_google_cloud_securitycenter_v1_SecurityMarks_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.SecurityMarks getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.SecurityMarks.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.SecurityMarks build() { + com.google.cloud.securitycenter.v1.SecurityMarks result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.SecurityMarks buildPartial() { + com.google.cloud.securitycenter.v1.SecurityMarks result = + new com.google.cloud.securitycenter.v1.SecurityMarks(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + result.marks_ = internalGetMarks(); + result.marks_.makeImmutable(); + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.SecurityMarks) { + return mergeFrom((com.google.cloud.securitycenter.v1.SecurityMarks) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.SecurityMarks other) { + if (other == com.google.cloud.securitycenter.v1.SecurityMarks.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + internalGetMutableMarks().mergeFrom(other.internalGetMarks()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.SecurityMarks parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1.SecurityMarks) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The relative resource name of the SecurityMarks. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Examples:
+     * "organizations/123/assets/456/securityMarks"
+     * "organizations/123/sources/456/findings/789/securityMarks".
+     * 
+ * + * string name = 1; + */ + 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 relative resource name of the SecurityMarks. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Examples:
+     * "organizations/123/assets/456/securityMarks"
+     * "organizations/123/sources/456/findings/789/securityMarks".
+     * 
+ * + * string name = 1; + */ + 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 relative resource name of the SecurityMarks. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Examples:
+     * "organizations/123/assets/456/securityMarks"
+     * "organizations/123/sources/456/findings/789/securityMarks".
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the SecurityMarks. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Examples:
+     * "organizations/123/assets/456/securityMarks"
+     * "organizations/123/sources/456/findings/789/securityMarks".
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the SecurityMarks. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Examples:
+     * "organizations/123/assets/456/securityMarks"
+     * "organizations/123/sources/456/findings/789/securityMarks".
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField marks_; + + private com.google.protobuf.MapField internalGetMarks() { + if (marks_ == null) { + return com.google.protobuf.MapField.emptyMapField(MarksDefaultEntryHolder.defaultEntry); + } + return marks_; + } + + private com.google.protobuf.MapField + internalGetMutableMarks() { + onChanged(); + ; + if (marks_ == null) { + marks_ = com.google.protobuf.MapField.newMapField(MarksDefaultEntryHolder.defaultEntry); + } + if (!marks_.isMutable()) { + marks_ = marks_.copy(); + } + return marks_; + } + + public int getMarksCount() { + return internalGetMarks().getMap().size(); + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   - Keys and values are treated as case insensitive
+     *   - Keys must be between 1 - 256 characters (inclusive)
+     *   - Keys must be letters, numbers, underscores, or dashes
+     *   - Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public boolean containsMarks(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMarks().getMap().containsKey(key); + } + /** Use {@link #getMarksMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getMarks() { + return getMarksMap(); + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   - Keys and values are treated as case insensitive
+     *   - Keys must be between 1 - 256 characters (inclusive)
+     *   - Keys must be letters, numbers, underscores, or dashes
+     *   - Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public java.util.Map getMarksMap() { + return internalGetMarks().getMap(); + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   - Keys and values are treated as case insensitive
+     *   - Keys must be between 1 - 256 characters (inclusive)
+     *   - Keys must be letters, numbers, underscores, or dashes
+     *   - Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public java.lang.String getMarksOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMarks().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   - Keys and values are treated as case insensitive
+     *   - Keys must be between 1 - 256 characters (inclusive)
+     *   - Keys must be letters, numbers, underscores, or dashes
+     *   - Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public java.lang.String getMarksOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMarks().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMarks() { + internalGetMutableMarks().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   - Keys and values are treated as case insensitive
+     *   - Keys must be between 1 - 256 characters (inclusive)
+     *   - Keys must be letters, numbers, underscores, or dashes
+     *   - Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public Builder removeMarks(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMarks().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableMarks() { + return internalGetMutableMarks().getMutableMap(); + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   - Keys and values are treated as case insensitive
+     *   - Keys must be between 1 - 256 characters (inclusive)
+     *   - Keys must be letters, numbers, underscores, or dashes
+     *   - Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public Builder putMarks(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMarks().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Mutable user specified security marks belonging to the parent resource.
+     * Constraints are as follows:
+     *   - Keys and values are treated as case insensitive
+     *   - Keys must be between 1 - 256 characters (inclusive)
+     *   - Keys must be letters, numbers, underscores, or dashes
+     *   - Values have leading and trailing whitespace trimmed, remaining
+     *     characters must be between 1 - 4096 characters (inclusive)
+     * 
+ * + * map<string, string> marks = 2; + */ + public Builder putAllMarks(java.util.Map values) { + internalGetMutableMarks().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.SecurityMarks) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.SecurityMarks) + private static final com.google.cloud.securitycenter.v1.SecurityMarks DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.SecurityMarks(); + } + + public static com.google.cloud.securitycenter.v1.SecurityMarks getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecurityMarks parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecurityMarks(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.SecurityMarks getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityMarksOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityMarksOrBuilder.java new file mode 100644 index 000000000000..eddcf5950cc8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityMarksOrBuilder.java @@ -0,0 +1,123 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/security_marks.proto + +package com.google.cloud.securitycenter.v1; + +public interface SecurityMarksOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.SecurityMarks) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The relative resource name of the SecurityMarks. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Examples:
+   * "organizations/123/assets/456/securityMarks"
+   * "organizations/123/sources/456/findings/789/securityMarks".
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The relative resource name of the SecurityMarks. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Examples:
+   * "organizations/123/assets/456/securityMarks"
+   * "organizations/123/sources/456/findings/789/securityMarks".
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   - Keys and values are treated as case insensitive
+   *   - Keys must be between 1 - 256 characters (inclusive)
+   *   - Keys must be letters, numbers, underscores, or dashes
+   *   - Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + int getMarksCount(); + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   - Keys and values are treated as case insensitive
+   *   - Keys must be between 1 - 256 characters (inclusive)
+   *   - Keys must be letters, numbers, underscores, or dashes
+   *   - Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + boolean containsMarks(java.lang.String key); + /** Use {@link #getMarksMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMarks(); + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   - Keys and values are treated as case insensitive
+   *   - Keys must be between 1 - 256 characters (inclusive)
+   *   - Keys must be letters, numbers, underscores, or dashes
+   *   - Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + java.util.Map getMarksMap(); + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   - Keys and values are treated as case insensitive
+   *   - Keys must be between 1 - 256 characters (inclusive)
+   *   - Keys must be letters, numbers, underscores, or dashes
+   *   - Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + java.lang.String getMarksOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Mutable user specified security marks belonging to the parent resource.
+   * Constraints are as follows:
+   *   - Keys and values are treated as case insensitive
+   *   - Keys must be between 1 - 256 characters (inclusive)
+   *   - Keys must be letters, numbers, underscores, or dashes
+   *   - Values have leading and trailing whitespace trimmed, remaining
+   *     characters must be between 1 - 4096 characters (inclusive)
+   * 
+ * + * map<string, string> marks = 2; + */ + java.lang.String getMarksOrThrow(java.lang.String key); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityMarksOuterClass.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityMarksOuterClass.java new file mode 100644 index 000000000000..214907fe85f3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecurityMarksOuterClass.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/security_marks.proto + +package com.google.cloud.securitycenter.v1; + +public final class SecurityMarksOuterClass { + private SecurityMarksOuterClass() {} + + 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_v1_SecurityMarks_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_SecurityMarks_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_SecurityMarks_MarksEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_SecurityMarks_MarksEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/securitycenter/v1/securit" + + "y_marks.proto\022\036google.cloud.securitycent" + + "er.v1\032\034google/api/annotations.proto\"\224\001\n\r" + + "SecurityMarks\022\014\n\004name\030\001 \001(\t\022G\n\005marks\030\002 \003" + + "(\01328.google.cloud.securitycenter.v1.Secu" + + "rityMarks.MarksEntry\032,\n\nMarksEntry\022\013\n\003ke" + + "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001Bt\n\"com.google" + + ".cloud.securitycenter.v1P\001ZLgoogle.golan" + + "g.org/genproto/googleapis/cloud/security" + + "center/v1;securitycenterb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_securitycenter_v1_SecurityMarks_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1_SecurityMarks_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_SecurityMarks_descriptor, + new java.lang.String[] { + "Name", "Marks", + }); + internal_static_google_cloud_securitycenter_v1_SecurityMarks_MarksEntry_descriptor = + internal_static_google_cloud_securitycenter_v1_SecurityMarks_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1_SecurityMarks_MarksEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_SecurityMarks_MarksEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecuritycenterService.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecuritycenterService.java new file mode 100644 index 000000000000..b8c7ec2b685c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecuritycenterService.java @@ -0,0 +1,596 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public final class SecuritycenterService { + private SecuritycenterService() {} + + 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_v1_CreateFindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_CreateFindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_CreateSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_CreateSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_GetOrganizationSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_GetOrganizationSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_GetSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_GetSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_GroupAssetsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_GroupAssetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_GroupAssetsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_GroupAssetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_GroupFindingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_GroupFindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_GroupFindingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_GroupFindingsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_GroupResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_GroupResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_GroupResult_PropertiesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_GroupResult_PropertiesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_ListSourcesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_ListSourcesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_ListSourcesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_ListSourcesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_ListAssetsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_ListAssetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_ListAssetsResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_ListAssetsResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_ListFindingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_ListFindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_ListFindingsResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_ListFindingsResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_SetFindingStateRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_SetFindingStateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_RunAssetDiscoveryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_RunAssetDiscoveryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_UpdateFindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_UpdateFindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_UpdateOrganizationSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_UpdateOrganizationSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_UpdateSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_UpdateSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1_UpdateSecurityMarksRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_UpdateSecurityMarksRequest_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/v1/securit" + + "ycenter_service.proto\022\036google.cloud.secu" + + "ritycenter.v1\032\034google/api/annotations.pr" + + "oto\032*google/cloud/securitycenter/v1/asse" + + "t.proto\032,google/cloud/securitycenter/v1/" + + "finding.proto\032:google/cloud/securitycent" + + "er/v1/organization_settings.proto\0323googl" + + "e/cloud/securitycenter/v1/security_marks" + + ".proto\032+google/cloud/securitycenter/v1/s" + + "ource.proto\032\036google/iam/v1/iam_policy.pr" + + "oto\032\032google/iam/v1/policy.proto\032#google/" + + "longrunning/operations.proto\032\036google/pro" + + "tobuf/duration.proto\032\033google/protobuf/em" + + "pty.proto\032 google/protobuf/field_mask.pr" + + "oto\032\034google/protobuf/struct.proto\032\037googl" + + "e/protobuf/timestamp.proto\"t\n\024CreateFind" + + "ingRequest\022\016\n\006parent\030\001 \001(\t\022\022\n\nfinding_id" + + "\030\002 \001(\t\0228\n\007finding\030\003 \001(\0132\'.google.cloud.s" + + "ecuritycenter.v1.Finding\"]\n\023CreateSource" + + "Request\022\016\n\006parent\030\001 \001(\t\0226\n\006source\030\002 \001(\0132" + + "&.google.cloud.securitycenter.v1.Source\"" + + ".\n\036GetOrganizationSettingsRequest\022\014\n\004nam" + + "e\030\001 \001(\t\" \n\020GetSourceRequest\022\014\n\004name\030\001 \001(" + + "\t\"\341\001\n\022GroupAssetsRequest\022\016\n\006parent\030\001 \001(\t" + + "\022\016\n\006filter\030\002 \001(\t\022\020\n\010group_by\030\003 \001(\t\0223\n\020co" + + "mpare_duration\030\004 \001(\0132\031.google.protobuf.D" + + "uration\022-\n\tread_time\030\005 \001(\0132\032.google.prot" + + "obuf.Timestamp\022\016\n\006having\030\006 \001(\t\022\022\n\npage_t" + + "oken\030\007 \001(\t\022\021\n\tpage_size\030\010 \001(\005\"\270\001\n\023GroupA" + + "ssetsResponse\022E\n\020group_by_results\030\001 \003(\0132" + + "+.google.cloud.securitycenter.v1.GroupRe" + + "sult\022-\n\tread_time\030\002 \001(\0132\032.google.protobu" + + "f.Timestamp\022\027\n\017next_page_token\030\003 \001(\t\022\022\n\n" + + "total_size\030\004 \001(\005\"\343\001\n\024GroupFindingsReques" + + "t\022\016\n\006parent\030\001 \001(\t\022\016\n\006filter\030\002 \001(\t\022\020\n\010gro" + + "up_by\030\003 \001(\t\022-\n\tread_time\030\004 \001(\0132\032.google." + + "protobuf.Timestamp\0223\n\020compare_duration\030\005" + + " \001(\0132\031.google.protobuf.Duration\022\016\n\006havin" + + "g\030\006 \001(\t\022\022\n\npage_token\030\007 \001(\t\022\021\n\tpage_size" + + "\030\010 \001(\005\"\272\001\n\025GroupFindingsResponse\022E\n\020grou" + + "p_by_results\030\001 \003(\0132+.google.cloud.securi" + + "tycenter.v1.GroupResult\022-\n\tread_time\030\002 \001" + + "(\0132\032.google.protobuf.Timestamp\022\027\n\017next_p" + + "age_token\030\003 \001(\t\022\022\n\ntotal_size\030\004 \001(\005\"\270\001\n\013" + + "GroupResult\022O\n\nproperties\030\001 \003(\0132;.google" + + ".cloud.securitycenter.v1.GroupResult.Pro" + + "pertiesEntry\022\r\n\005count\030\002 \001(\003\032I\n\017Propertie" + + "sEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goo" + + "gle.protobuf.Value:\0028\001\"K\n\022ListSourcesReq" + + "uest\022\016\n\006parent\030\001 \001(\t\022\022\n\npage_token\030\002 \001(\t" + + "\022\021\n\tpage_size\030\007 \001(\005\"g\n\023ListSourcesRespon" + + "se\0227\n\007sources\030\001 \003(\0132&.google.cloud.secur" + + "itycenter.v1.Source\022\027\n\017next_page_token\030\002" + + " \001(\t\"\220\002\n\021ListAssetsRequest\022\016\n\006parent\030\001 \001" + + "(\t\022\016\n\006filter\030\002 \001(\t\022\020\n\010order_by\030\003 \001(\t\022-\n\t" + + "read_time\030\004 \001(\0132\032.google.protobuf.Timest" + + "amp\0223\n\020compare_duration\030\005 \001(\0132\031.google.p" + + "rotobuf.Duration\022\016\n\006having\030\006 \001(\t\022.\n\nfiel" + + "d_mask\030\007 \001(\0132\032.google.protobuf.FieldMask" + + "\022\022\n\npage_token\030\010 \001(\t\022\021\n\tpage_size\030\t \001(\005\"" + + "\303\003\n\022ListAssetsResponse\022`\n\023list_assets_re" + + "sults\030\001 \003(\0132C.google.cloud.securitycente" + + "r.v1.ListAssetsResponse.ListAssetsResult" + + "\022-\n\tread_time\030\002 \001(\0132\032.google.protobuf.Ti" + + "mestamp\022\027\n\017next_page_token\030\003 \001(\t\022\022\n\ntota" + + "l_size\030\004 \001(\005\032\356\001\n\020ListAssetsResult\0224\n\005ass" + + "et\030\001 \001(\0132%.google.cloud.securitycenter.v" + + "1.Asset\022e\n\014state_change\030\002 \001(\0162O.google.c" + + "loud.securitycenter.v1.ListAssetsRespons" + + "e.ListAssetsResult.StateChange\"=\n\013StateC" + + "hange\022\n\n\006UNUSED\020\000\022\t\n\005ADDED\020\001\022\013\n\007REMOVED\020" + + "\002\022\n\n\006ACTIVE\020\003\"\222\002\n\023ListFindingsRequest\022\016\n" + + "\006parent\030\001 \001(\t\022\016\n\006filter\030\002 \001(\t\022\020\n\010order_b" + + "y\030\003 \001(\t\022-\n\tread_time\030\004 \001(\0132\032.google.prot" + + "obuf.Timestamp\0223\n\020compare_duration\030\005 \001(\013" + + "2\031.google.protobuf.Duration\022\016\n\006having\030\006 " + + "\001(\t\022.\n\nfield_mask\030\007 \001(\0132\032.google.protobu" + + "f.FieldMask\022\022\n\npage_token\030\010 \001(\t\022\021\n\tpage_" + + "size\030\t \001(\005\"\345\003\n\024ListFindingsResponse\022f\n\025l" + + "ist_findings_results\030\001 \003(\0132G.google.clou" + + "d.securitycenter.v1.ListFindingsResponse" + + ".ListFindingsResult\022-\n\tread_time\030\002 \001(\0132\032" + + ".google.protobuf.Timestamp\022\027\n\017next_page_" + + "token\030\003 \001(\t\022\022\n\ntotal_size\030\004 \001(\005\032\210\002\n\022List" + + "FindingsResult\0228\n\007finding\030\001 \001(\0132\'.google" + + ".cloud.securitycenter.v1.Finding\022i\n\014stat" + + "e_change\030\002 \001(\0162S.google.cloud.securityce" + + "nter.v1.ListFindingsResponse.ListFinding" + + "sResult.StateChange\"M\n\013StateChange\022\n\n\006UN" + + "USED\020\000\022\013\n\007CHANGED\020\001\022\r\n\tUNCHANGED\020\002\022\t\n\005AD" + + "DED\020\003\022\013\n\007REMOVED\020\004\"\224\001\n\026SetFindingStateRe" + + "quest\022\014\n\004name\030\001 \001(\t\022<\n\005state\030\002 \001(\0162-.goo" + + "gle.cloud.securitycenter.v1.Finding.Stat" + + "e\022.\n\nstart_time\030\003 \001(\0132\032.google.protobuf." + + "Timestamp\"*\n\030RunAssetDiscoveryRequest\022\016\n" + + "\006parent\030\001 \001(\t\"\201\001\n\024UpdateFindingRequest\0228" + + "\n\007finding\030\001 \001(\0132\'.google.cloud.securityc" + + "enter.v1.Finding\022/\n\013update_mask\030\002 \001(\0132\032." + + "google.protobuf.FieldMask\"\251\001\n!UpdateOrga" + + "nizationSettingsRequest\022S\n\025organization_" + + "settings\030\001 \001(\01324.google.cloud.securityce" + + "nter.v1.OrganizationSettings\022/\n\013update_m" + + "ask\030\002 \001(\0132\032.google.protobuf.FieldMask\"~\n" + + "\023UpdateSourceRequest\0226\n\006source\030\001 \001(\0132&.g" + + "oogle.cloud.securitycenter.v1.Source\022/\n\013" + + "update_mask\030\002 \001(\0132\032.google.protobuf.Fiel" + + "dMask\"\304\001\n\032UpdateSecurityMarksRequest\022E\n\016" + + "security_marks\030\001 \001(\0132-.google.cloud.secu" + + "ritycenter.v1.SecurityMarks\022/\n\013update_ma" + + "sk\030\002 \001(\0132\032.google.protobuf.FieldMask\022.\n\n" + + "start_time\030\003 \001(\0132\032.google.protobuf.Times" + + "tamp2\220\032\n\016SecurityCenter\022\241\001\n\014CreateSource" + + "\0223.google.cloud.securitycenter.v1.Create" + + "SourceRequest\032&.google.cloud.securitycen" + + "ter.v1.Source\"4\202\323\344\223\002.\"$/v1/{parent=organ" + + "izations/*}/sources:\006source\022\260\001\n\rCreateFi" + + "nding\0224.google.cloud.securitycenter.v1.C" + + "reateFindingRequest\032\'.google.cloud.secur" + + "itycenter.v1.Finding\"@\202\323\344\223\002:\"//v1/{paren" + + "t=organizations/*/sources/*}/findings:\007f" + + "inding\022\213\001\n\014GetIamPolicy\022\".google.iam.v1." + + "GetIamPolicyRequest\032\025.google.iam.v1.Poli" + + "cy\"@\202\323\344\223\002:\"5/v1/{resource=organizations/" + + "*/sources/*}:getIamPolicy:\001*\022\310\001\n\027GetOrga" + + "nizationSettings\022>.google.cloud.security" + + "center.v1.GetOrganizationSettingsRequest" + + "\0324.google.cloud.securitycenter.v1.Organi" + + "zationSettings\"7\202\323\344\223\0021\022//v1/{name=organi" + + "zations/*/organizationSettings}\022\223\001\n\tGetS" + + "ource\0220.google.cloud.securitycenter.v1.G" + + "etSourceRequest\032&.google.cloud.securityc" + + "enter.v1.Source\",\202\323\344\223\002&\022$/v1/{name=organ" + + "izations/*/sources/*}\022\254\001\n\013GroupAssets\0222." + + "google.cloud.securitycenter.v1.GroupAsse" + + "tsRequest\0323.google.cloud.securitycenter." + + "v1.GroupAssetsResponse\"4\202\323\344\223\002.\")/v1/{par" + + "ent=organizations/*}/assets:group:\001*\022\276\001\n" + + "\rGroupFindings\0224.google.cloud.securityce" + + "nter.v1.GroupFindingsRequest\0325.google.cl" + + "oud.securitycenter.v1.GroupFindingsRespo" + + "nse\"@\202\323\344\223\002:\"5/v1/{parent=organizations/*" + + "/sources/*}/findings:group:\001*\022\240\001\n\nListAs" + + "sets\0221.google.cloud.securitycenter.v1.Li" + + "stAssetsRequest\0322.google.cloud.securityc" + + "enter.v1.ListAssetsResponse\"+\202\323\344\223\002%\022#/v1" + + "/{parent=organizations/*}/assets\022\262\001\n\014Lis" + + "tFindings\0223.google.cloud.securitycenter." + + "v1.ListFindingsRequest\0324.google.cloud.se" + + "curitycenter.v1.ListFindingsResponse\"7\202\323" + + "\344\223\0021\022//v1/{parent=organizations/*/source" + + "s/*}/findings\022\244\001\n\013ListSources\0222.google.c" + + "loud.securitycenter.v1.ListSourcesReques" + + "t\0323.google.cloud.securitycenter.v1.ListS" + + "ourcesResponse\",\202\323\344\223\002&\022$/v1/{parent=orga" + + "nizations/*}/sources\022\251\001\n\021RunAssetDiscove" + + "ry\0228.google.cloud.securitycenter.v1.RunA" + + "ssetDiscoveryRequest\032\035.google.longrunnin" + + "g.Operation\";\202\323\344\223\0025\"0/v1/{parent=organiz" + + "ations/*}/assets:runDiscovery:\001*\022\267\001\n\017Set" + + "FindingState\0226.google.cloud.securitycent" + + "er.v1.SetFindingStateRequest\032\'.google.cl" + + "oud.securitycenter.v1.Finding\"C\202\323\344\223\002=\"8/" + + "v1/{name=organizations/*/sources/*/findi" + + "ngs/*}:setState:\001*\022\213\001\n\014SetIamPolicy\022\".go" + + "ogle.iam.v1.SetIamPolicyRequest\032\025.google" + + ".iam.v1.Policy\"@\202\323\344\223\002:\"5/v1/{resource=or" + + "ganizations/*/sources/*}:setIamPolicy:\001*" + + "\022\261\001\n\022TestIamPermissions\022(.google.iam.v1." + + "TestIamPermissionsRequest\032).google.iam.v" + + "1.TestIamPermissionsResponse\"F\202\323\344\223\002@\";/v" + + "1/{resource=organizations/*/sources/*}:t" + + "estIamPermissions:\001*\022\270\001\n\rUpdateFinding\0224" + + ".google.cloud.securitycenter.v1.UpdateFi" + + "ndingRequest\032\'.google.cloud.securitycent" + + "er.v1.Finding\"H\202\323\344\223\002B27/v1/{finding.name" + + "=organizations/*/sources/*/findings/*}:\007" + + "finding\022\373\001\n\032UpdateOrganizationSettings\022A" + + ".google.cloud.securitycenter.v1.UpdateOr" + + "ganizationSettingsRequest\0324.google.cloud" + + ".securitycenter.v1.OrganizationSettings\"" + + "d\202\323\344\223\002^2E/v1/{organization_settings.name" + + "=organizations/*/organizationSettings}:\025" + + "organization_settings\022\250\001\n\014UpdateSource\0223" + + ".google.cloud.securitycenter.v1.UpdateSo" + + "urceRequest\032&.google.cloud.securitycente" + + "r.v1.Source\";\202\323\344\223\00252+/v1/{source.name=or" + + "ganizations/*/sources/*}:\006source\022\274\002\n\023Upd" + + "ateSecurityMarks\022:.google.cloud.security" + + "center.v1.UpdateSecurityMarksRequest\032-.g" + + "oogle.cloud.securitycenter.v1.SecurityMa" + + "rks\"\271\001\202\323\344\223\002\262\0012@/v1/{security_marks.name=" + + "organizations/*/assets/*/securityMarks}:" + + "\016security_marksZ^2L/v1/{security_marks.n" + + "ame=organizations/*/sources/*/findings/*" + + "/securityMarks}:\016security_marksBt\n\"com.g" + + "oogle.cloud.securitycenter.v1P\001ZLgoogle." + + "golang.org/genproto/googleapis/cloud/sec" + + "uritycenter/v1;securitycenterb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.cloud.securitycenter.v1.AssetOuterClass.getDescriptor(), + com.google.cloud.securitycenter.v1.FindingOuterClass.getDescriptor(), + com.google.cloud.securitycenter.v1.OrganizationSettingsOuterClass.getDescriptor(), + com.google.cloud.securitycenter.v1.SecurityMarksOuterClass.getDescriptor(), + com.google.cloud.securitycenter.v1.SourceOuterClass.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_securitycenter_v1_CreateFindingRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1_CreateFindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_CreateFindingRequest_descriptor, + new java.lang.String[] { + "Parent", "FindingId", "Finding", + }); + internal_static_google_cloud_securitycenter_v1_CreateSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_securitycenter_v1_CreateSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_CreateSourceRequest_descriptor, + new java.lang.String[] { + "Parent", "Source", + }); + internal_static_google_cloud_securitycenter_v1_GetOrganizationSettingsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_securitycenter_v1_GetOrganizationSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_GetOrganizationSettingsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_securitycenter_v1_GetSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_securitycenter_v1_GetSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_GetSourceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_securitycenter_v1_GroupAssetsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_securitycenter_v1_GroupAssetsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_GroupAssetsRequest_descriptor, + new java.lang.String[] { + "Parent", + "Filter", + "GroupBy", + "CompareDuration", + "ReadTime", + "Having", + "PageToken", + "PageSize", + }); + internal_static_google_cloud_securitycenter_v1_GroupAssetsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_securitycenter_v1_GroupAssetsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_GroupAssetsResponse_descriptor, + new java.lang.String[] { + "GroupByResults", "ReadTime", "NextPageToken", "TotalSize", + }); + internal_static_google_cloud_securitycenter_v1_GroupFindingsRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_securitycenter_v1_GroupFindingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_GroupFindingsRequest_descriptor, + new java.lang.String[] { + "Parent", + "Filter", + "GroupBy", + "ReadTime", + "CompareDuration", + "Having", + "PageToken", + "PageSize", + }); + internal_static_google_cloud_securitycenter_v1_GroupFindingsResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_securitycenter_v1_GroupFindingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_GroupFindingsResponse_descriptor, + new java.lang.String[] { + "GroupByResults", "ReadTime", "NextPageToken", "TotalSize", + }); + internal_static_google_cloud_securitycenter_v1_GroupResult_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_securitycenter_v1_GroupResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_GroupResult_descriptor, + new java.lang.String[] { + "Properties", "Count", + }); + internal_static_google_cloud_securitycenter_v1_GroupResult_PropertiesEntry_descriptor = + internal_static_google_cloud_securitycenter_v1_GroupResult_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1_GroupResult_PropertiesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_GroupResult_PropertiesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_securitycenter_v1_ListSourcesRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_securitycenter_v1_ListSourcesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_ListSourcesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", "PageSize", + }); + internal_static_google_cloud_securitycenter_v1_ListSourcesResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_securitycenter_v1_ListSourcesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_ListSourcesResponse_descriptor, + new java.lang.String[] { + "Sources", "NextPageToken", + }); + internal_static_google_cloud_securitycenter_v1_ListAssetsRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_securitycenter_v1_ListAssetsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_ListAssetsRequest_descriptor, + new java.lang.String[] { + "Parent", + "Filter", + "OrderBy", + "ReadTime", + "CompareDuration", + "Having", + "FieldMask", + "PageToken", + "PageSize", + }); + internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_descriptor, + new java.lang.String[] { + "ListAssetsResults", "ReadTime", "NextPageToken", "TotalSize", + }); + internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_ListAssetsResult_descriptor = + internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_ListAssetsResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_ListAssetsResponse_ListAssetsResult_descriptor, + new java.lang.String[] { + "Asset", "StateChange", + }); + internal_static_google_cloud_securitycenter_v1_ListFindingsRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_securitycenter_v1_ListFindingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_ListFindingsRequest_descriptor, + new java.lang.String[] { + "Parent", + "Filter", + "OrderBy", + "ReadTime", + "CompareDuration", + "Having", + "FieldMask", + "PageToken", + "PageSize", + }); + internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_descriptor, + new java.lang.String[] { + "ListFindingsResults", "ReadTime", "NextPageToken", "TotalSize", + }); + internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_ListFindingsResult_descriptor = + internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_ListFindingsResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_ListFindingsResponse_ListFindingsResult_descriptor, + new java.lang.String[] { + "Finding", "StateChange", + }); + internal_static_google_cloud_securitycenter_v1_SetFindingStateRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_securitycenter_v1_SetFindingStateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_SetFindingStateRequest_descriptor, + new java.lang.String[] { + "Name", "State", "StartTime", + }); + internal_static_google_cloud_securitycenter_v1_RunAssetDiscoveryRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_securitycenter_v1_RunAssetDiscoveryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_RunAssetDiscoveryRequest_descriptor, + new java.lang.String[] { + "Parent", + }); + internal_static_google_cloud_securitycenter_v1_UpdateFindingRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_securitycenter_v1_UpdateFindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_UpdateFindingRequest_descriptor, + new java.lang.String[] { + "Finding", "UpdateMask", + }); + internal_static_google_cloud_securitycenter_v1_UpdateOrganizationSettingsRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_securitycenter_v1_UpdateOrganizationSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_UpdateOrganizationSettingsRequest_descriptor, + new java.lang.String[] { + "OrganizationSettings", "UpdateMask", + }); + internal_static_google_cloud_securitycenter_v1_UpdateSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_securitycenter_v1_UpdateSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_UpdateSourceRequest_descriptor, + new java.lang.String[] { + "Source", "UpdateMask", + }); + internal_static_google_cloud_securitycenter_v1_UpdateSecurityMarksRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_securitycenter_v1_UpdateSecurityMarksRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_UpdateSecurityMarksRequest_descriptor, + new java.lang.String[] { + "SecurityMarks", "UpdateMask", "StartTime", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.securitycenter.v1.AssetOuterClass.getDescriptor(); + com.google.cloud.securitycenter.v1.FindingOuterClass.getDescriptor(); + com.google.cloud.securitycenter.v1.OrganizationSettingsOuterClass.getDescriptor(); + com.google.cloud.securitycenter.v1.SecurityMarksOuterClass.getDescriptor(); + com.google.cloud.securitycenter.v1.SourceOuterClass.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecuritymarksName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecuritymarksName.java new file mode 100644 index 000000000000..85bd38c1acf4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecuritymarksName.java @@ -0,0 +1,23 @@ +/* + * Copyright 2018 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. + */ + +package com.google.cloud.securitycenter.v1; + +import com.google.api.resourcenames.ResourceName; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public abstract class SecuritymarksName implements ResourceName { + protected SecuritymarksName() {} +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecuritymarksNames.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecuritymarksNames.java new file mode 100644 index 000000000000..a412ddeff96a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SecuritymarksNames.java @@ -0,0 +1,31 @@ +/* + * Copyright 2018 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. + */ + +package com.google.cloud.securitycenter.v1; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class SecuritymarksNames { + private SecuritymarksNames() {} + + public static SecuritymarksName parse(String resourceNameString) { + if (AssetSecurityMarksName.isParsableFrom(resourceNameString)) { + return AssetSecurityMarksName.parse(resourceNameString); + } + if (FindingSecurityMarksName.isParsableFrom(resourceNameString)) { + return FindingSecurityMarksName.parse(resourceNameString); + } + return UntypedSecuritymarksName.parse(resourceNameString); + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SetFindingStateRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SetFindingStateRequest.java new file mode 100644 index 000000000000..eafdc874786b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SetFindingStateRequest.java @@ -0,0 +1,1009 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for updating a finding's state.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.SetFindingStateRequest} + */ +public final class SetFindingStateRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.SetFindingStateRequest) + SetFindingStateRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetFindingStateRequest.newBuilder() to construct. + private SetFindingStateRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetFindingStateRequest() { + name_ = ""; + state_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SetFindingStateRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_SetFindingStateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_SetFindingStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.SetFindingStateRequest.class, + com.google.cloud.securitycenter.v1.SetFindingStateRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The relative resource name of the finding. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/sources/456/finding/789".
+   * 
+ * + * string name = 1; + */ + 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 relative resource name of the finding. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/sources/456/finding/789".
+   * 
+ * + * string name = 1; + */ + 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 STATE_FIELD_NUMBER = 2; + private int state_; + /** + * + * + *
+   * The desired State of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 2; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * The desired State of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 2; + */ + public com.google.cloud.securitycenter.v1.Finding.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1.Finding.State result = + com.google.cloud.securitycenter.v1.Finding.State.valueOf(state_); + return result == null ? com.google.cloud.securitycenter.v1.Finding.State.UNRECOGNIZED : result; + } + + public static final int START_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The time at which the updated state takes effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * The time at which the updated state takes effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The time at which the updated state takes effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (state_ != com.google.cloud.securitycenter.v1.Finding.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, state_); + } + if (startTime_ != null) { + output.writeMessage(3, getStartTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (state_ != com.google.cloud.securitycenter.v1.Finding.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStartTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.SetFindingStateRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.SetFindingStateRequest other = + (com.google.cloud.securitycenter.v1.SetFindingStateRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && state_ == other.state_; + result = result && (hasStartTime() == other.hasStartTime()); + if (hasStartTime()) { + result = result && getStartTime().equals(other.getStartTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.SetFindingStateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.SetFindingStateRequest 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.v1.SetFindingStateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.SetFindingStateRequest 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.v1.SetFindingStateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.SetFindingStateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.SetFindingStateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.SetFindingStateRequest 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.v1.SetFindingStateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.SetFindingStateRequest 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.v1.SetFindingStateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.SetFindingStateRequest 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.v1.SetFindingStateRequest 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; + } + /** + * + * + *
+   * Request message for updating a finding's state.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.SetFindingStateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.SetFindingStateRequest) + com.google.cloud.securitycenter.v1.SetFindingStateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_SetFindingStateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_SetFindingStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.SetFindingStateRequest.class, + com.google.cloud.securitycenter.v1.SetFindingStateRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.SetFindingStateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + state_ = 0; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_SetFindingStateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.SetFindingStateRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.SetFindingStateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.SetFindingStateRequest build() { + com.google.cloud.securitycenter.v1.SetFindingStateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.SetFindingStateRequest buildPartial() { + com.google.cloud.securitycenter.v1.SetFindingStateRequest result = + new com.google.cloud.securitycenter.v1.SetFindingStateRequest(this); + result.name_ = name_; + result.state_ = state_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.SetFindingStateRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.SetFindingStateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.SetFindingStateRequest other) { + if (other == com.google.cloud.securitycenter.v1.SetFindingStateRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.SetFindingStateRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.SetFindingStateRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The relative resource name of the finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456/finding/789".
+     * 
+ * + * string name = 1; + */ + 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 relative resource name of the finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456/finding/789".
+     * 
+ * + * string name = 1; + */ + 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 relative resource name of the finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456/finding/789".
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456/finding/789".
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of the finding. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456/finding/789".
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * The desired State of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 2; + */ + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * The desired State of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 2; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The desired State of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 2; + */ + public com.google.cloud.securitycenter.v1.Finding.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1.Finding.State result = + com.google.cloud.securitycenter.v1.Finding.State.valueOf(state_); + return result == null + ? com.google.cloud.securitycenter.v1.Finding.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The desired State of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 2; + */ + public Builder setState(com.google.cloud.securitycenter.v1.Finding.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The desired State of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 2; + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The time at which the updated state takes effect.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.SetFindingStateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.SetFindingStateRequest) + private static final com.google.cloud.securitycenter.v1.SetFindingStateRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.SetFindingStateRequest(); + } + + public static com.google.cloud.securitycenter.v1.SetFindingStateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetFindingStateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SetFindingStateRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.SetFindingStateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SetFindingStateRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SetFindingStateRequestOrBuilder.java new file mode 100644 index 000000000000..ce327a031c83 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SetFindingStateRequestOrBuilder.java @@ -0,0 +1,89 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface SetFindingStateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.SetFindingStateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The relative resource name of the finding. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/sources/456/finding/789".
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The relative resource name of the finding. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/sources/456/finding/789".
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The desired State of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 2; + */ + int getStateValue(); + /** + * + * + *
+   * The desired State of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding.State state = 2; + */ + com.google.cloud.securitycenter.v1.Finding.State getState(); + + /** + * + * + *
+   * The time at which the updated state takes effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + boolean hasStartTime(); + /** + * + * + *
+   * The time at which the updated state takes effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The time at which the updated state takes effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Source.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Source.java new file mode 100644 index 000000000000..0e374f38d4a1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/Source.java @@ -0,0 +1,1028 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/source.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Cloud Security Command Center's (Cloud SCC) finding source. A finding source
+ * is an entity or a mechanism that can produce a finding. A source is like a
+ * container of findings that come from the same scanner, logger, monitor, etc.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.Source} + */ +public final class Source extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.Source) + SourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Source.newBuilder() to construct. + private Source(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Source() { + name_ = ""; + displayName_ = ""; + description_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Source( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SourceOuterClass + .internal_static_google_cloud_securitycenter_v1_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SourceOuterClass + .internal_static_google_cloud_securitycenter_v1_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.Source.class, + com.google.cloud.securitycenter.v1.Source.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The relative resource name of this source. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/sources/456"
+   * 
+ * + * string name = 1; + */ + 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 relative resource name of this source. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/sources/456"
+   * 
+ * + * string name = 1; + */ + 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 DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * The source’s display name.
+   * A source’s display name must be unique amongst its siblings, for example,
+   * two sources with the same parent can't share the same display name.
+   * The display name must start and end with a letter or digit, may contain
+   * letters, digits, spaces, hyphens, and underscores, and can be no longer
+   * than 32 characters. This is captured by the regular expression:
+   * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?.
+   * 
+ * + * string display_name = 2; + */ + 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 source’s display name.
+   * A source’s display name must be unique amongst its siblings, for example,
+   * two sources with the same parent can't share the same display name.
+   * The display name must start and end with a letter or digit, may contain
+   * letters, digits, spaces, hyphens, and underscores, and can be no longer
+   * than 32 characters. This is captured by the regular expression:
+   * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?.
+   * 
+ * + * string display_name = 2; + */ + 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; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * The description of the source (max of 1024 characters).
+   * Example:
+   * "Cloud Security Scanner is a web security scanner for common
+   * vulnerabilities in App Engine applications. It can automatically
+   * scan and detect four common vulnerabilities, including cross-site-scripting
+   * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+   * outdated/insecure libraries."
+   * 
+ * + * string description = 3; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * The description of the source (max of 1024 characters).
+   * Example:
+   * "Cloud Security Scanner is a web security scanner for common
+   * vulnerabilities in App Engine applications. It can automatically
+   * scan and detect four common vulnerabilities, including cross-site-scripting
+   * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+   * outdated/insecure libraries."
+   * 
+ * + * string description = 3; + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.Source)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.Source other = + (com.google.cloud.securitycenter.v1.Source) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && getDisplayName().equals(other.getDisplayName()); + result = result && getDescription().equals(other.getDescription()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.Source parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Source 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.v1.Source parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Source 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.v1.Source parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.Source parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.Source parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Source 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.v1.Source parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Source 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.v1.Source parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.Source 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.v1.Source 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; + } + /** + * + * + *
+   * Cloud Security Command Center's (Cloud SCC) finding source. A finding source
+   * is an entity or a mechanism that can produce a finding. A source is like a
+   * container of findings that come from the same scanner, logger, monitor, etc.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.Source} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.Source) + com.google.cloud.securitycenter.v1.SourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SourceOuterClass + .internal_static_google_cloud_securitycenter_v1_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SourceOuterClass + .internal_static_google_cloud_securitycenter_v1_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.Source.class, + com.google.cloud.securitycenter.v1.Source.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.Source.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + description_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SourceOuterClass + .internal_static_google_cloud_securitycenter_v1_Source_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Source getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.Source.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Source build() { + com.google.cloud.securitycenter.v1.Source result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Source buildPartial() { + com.google.cloud.securitycenter.v1.Source result = + new com.google.cloud.securitycenter.v1.Source(this); + result.name_ = name_; + result.displayName_ = displayName_; + result.description_ = description_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.Source) { + return mergeFrom((com.google.cloud.securitycenter.v1.Source) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.Source other) { + if (other == com.google.cloud.securitycenter.v1.Source.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.Source parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1.Source) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The relative resource name of this source. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456"
+     * 
+ * + * string name = 1; + */ + 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 relative resource name of this source. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456"
+     * 
+ * + * string name = 1; + */ + 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 relative resource name of this source. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456"
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this source. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456"
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The relative resource name of this source. See:
+     * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+     * Example:
+     * "organizations/123/sources/456"
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The source’s display name.
+     * A source’s display name must be unique amongst its siblings, for example,
+     * two sources with the same parent can't share the same display name.
+     * The display name must start and end with a letter or digit, may contain
+     * letters, digits, spaces, hyphens, and underscores, and can be no longer
+     * than 32 characters. This is captured by the regular expression:
+     * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?.
+     * 
+ * + * string display_name = 2; + */ + 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 source’s display name.
+     * A source’s display name must be unique amongst its siblings, for example,
+     * two sources with the same parent can't share the same display name.
+     * The display name must start and end with a letter or digit, may contain
+     * letters, digits, spaces, hyphens, and underscores, and can be no longer
+     * than 32 characters. This is captured by the regular expression:
+     * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?.
+     * 
+ * + * string display_name = 2; + */ + 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 source’s display name.
+     * A source’s display name must be unique amongst its siblings, for example,
+     * two sources with the same parent can't share the same display name.
+     * The display name must start and end with a letter or digit, may contain
+     * letters, digits, spaces, hyphens, and underscores, and can be no longer
+     * than 32 characters. This is captured by the regular expression:
+     * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The source’s display name.
+     * A source’s display name must be unique amongst its siblings, for example,
+     * two sources with the same parent can't share the same display name.
+     * The display name must start and end with a letter or digit, may contain
+     * letters, digits, spaces, hyphens, and underscores, and can be no longer
+     * than 32 characters. This is captured by the regular expression:
+     * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?.
+     * 
+ * + * string display_name = 2; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The source’s display name.
+     * A source’s display name must be unique amongst its siblings, for example,
+     * two sources with the same parent can't share the same display name.
+     * The display name must start and end with a letter or digit, may contain
+     * letters, digits, spaces, hyphens, and underscores, and can be no longer
+     * than 32 characters. This is captured by the regular expression:
+     * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * The description of the source (max of 1024 characters).
+     * Example:
+     * "Cloud Security Scanner is a web security scanner for common
+     * vulnerabilities in App Engine applications. It can automatically
+     * scan and detect four common vulnerabilities, including cross-site-scripting
+     * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+     * outdated/insecure libraries."
+     * 
+ * + * string description = 3; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The description of the source (max of 1024 characters).
+     * Example:
+     * "Cloud Security Scanner is a web security scanner for common
+     * vulnerabilities in App Engine applications. It can automatically
+     * scan and detect four common vulnerabilities, including cross-site-scripting
+     * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+     * outdated/insecure libraries."
+     * 
+ * + * string description = 3; + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The description of the source (max of 1024 characters).
+     * Example:
+     * "Cloud Security Scanner is a web security scanner for common
+     * vulnerabilities in App Engine applications. It can automatically
+     * scan and detect four common vulnerabilities, including cross-site-scripting
+     * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+     * outdated/insecure libraries."
+     * 
+ * + * string description = 3; + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the source (max of 1024 characters).
+     * Example:
+     * "Cloud Security Scanner is a web security scanner for common
+     * vulnerabilities in App Engine applications. It can automatically
+     * scan and detect four common vulnerabilities, including cross-site-scripting
+     * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+     * outdated/insecure libraries."
+     * 
+ * + * string description = 3; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * The description of the source (max of 1024 characters).
+     * Example:
+     * "Cloud Security Scanner is a web security scanner for common
+     * vulnerabilities in App Engine applications. It can automatically
+     * scan and detect four common vulnerabilities, including cross-site-scripting
+     * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+     * outdated/insecure libraries."
+     * 
+ * + * string description = 3; + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.Source) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.Source) + private static final com.google.cloud.securitycenter.v1.Source DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.Source(); + } + + public static com.google.cloud.securitycenter.v1.Source getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Source parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Source(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.Source getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SourceName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SourceName.java new file mode 100644 index 000000000000..ca573eb6955c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SourceName.java @@ -0,0 +1,180 @@ +/* + * Copyright 2018 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. + */ + +package com.google.cloud.securitycenter.v1; + +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; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class SourceName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/sources/{source}"); + + private volatile Map fieldValuesMap; + + private final String organization; + private final String source; + + public String getOrganization() { + return organization; + } + + public String getSource() { + return source; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private SourceName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + source = Preconditions.checkNotNull(builder.getSource()); + } + + public static SourceName of(String organization, String source) { + return newBuilder().setOrganization(organization).setSource(source).build(); + } + + public static String format(String organization, String source) { + return newBuilder().setOrganization(organization).setSource(source).build().toString(); + } + + public static SourceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "SourceName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("source")); + } + + 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 (SourceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("organization", organization); + fieldMapBuilder.put("source", source); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("organization", organization, "source", source); + } + + /** Builder for SourceName. */ + public static class Builder { + + private String organization; + private String source; + + public String getOrganization() { + return organization; + } + + public String getSource() { + return source; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setSource(String source) { + this.source = source; + return this; + } + + private Builder() {} + + private Builder(SourceName sourceName) { + organization = sourceName.organization; + source = sourceName.source; + } + + public SourceName build() { + return new SourceName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof SourceName) { + SourceName that = (SourceName) o; + return (this.organization.equals(that.organization)) && (this.source.equals(that.source)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= organization.hashCode(); + h *= 1000003; + h ^= source.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SourceOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SourceOrBuilder.java new file mode 100644 index 000000000000..7b80d966b89d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SourceOrBuilder.java @@ -0,0 +1,103 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/source.proto + +package com.google.cloud.securitycenter.v1; + +public interface SourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.Source) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The relative resource name of this source. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/sources/456"
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The relative resource name of this source. See:
+   * https://cloud.google.com/apis/design/resource_names#relative_resource_name
+   * Example:
+   * "organizations/123/sources/456"
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The source’s display name.
+   * A source’s display name must be unique amongst its siblings, for example,
+   * two sources with the same parent can't share the same display name.
+   * The display name must start and end with a letter or digit, may contain
+   * letters, digits, spaces, hyphens, and underscores, and can be no longer
+   * than 32 characters. This is captured by the regular expression:
+   * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?.
+   * 
+ * + * string display_name = 2; + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The source’s display name.
+   * A source’s display name must be unique amongst its siblings, for example,
+   * two sources with the same parent can't share the same display name.
+   * The display name must start and end with a letter or digit, may contain
+   * letters, digits, spaces, hyphens, and underscores, and can be no longer
+   * than 32 characters. This is captured by the regular expression:
+   * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?.
+   * 
+ * + * string display_name = 2; + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The description of the source (max of 1024 characters).
+   * Example:
+   * "Cloud Security Scanner is a web security scanner for common
+   * vulnerabilities in App Engine applications. It can automatically
+   * scan and detect four common vulnerabilities, including cross-site-scripting
+   * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+   * outdated/insecure libraries."
+   * 
+ * + * string description = 3; + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The description of the source (max of 1024 characters).
+   * Example:
+   * "Cloud Security Scanner is a web security scanner for common
+   * vulnerabilities in App Engine applications. It can automatically
+   * scan and detect four common vulnerabilities, including cross-site-scripting
+   * (XSS), Flash injection, mixed content (HTTP in HTTPS), and
+   * outdated/insecure libraries."
+   * 
+ * + * string description = 3; + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SourceOuterClass.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SourceOuterClass.java new file mode 100644 index 000000000000..0402ab4bf884 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/SourceOuterClass.java @@ -0,0 +1,63 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/source.proto + +package com.google.cloud.securitycenter.v1; + +public final class SourceOuterClass { + private SourceOuterClass() {} + + 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_v1_Source_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1_Source_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/v1/source." + + "proto\022\036google.cloud.securitycenter.v1\032\034g" + + "oogle/api/annotations.proto\"G\n\006Source\022\014\n" + + "\004name\030\001 \001(\t\022\024\n\014display_name\030\002 \001(\t\022\023\n\013des" + + "cription\030\003 \001(\tJ\004\010\004\020\005Bt\n\"com.google.cloud" + + ".securitycenter.v1P\001ZLgoogle.golang.org/" + + "genproto/googleapis/cloud/securitycenter" + + "/v1;securitycenterb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_securitycenter_v1_Source_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1_Source_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1_Source_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Description", + }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UntypedSecuritymarksName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UntypedSecuritymarksName.java new file mode 100644 index 000000000000..dcf017e6bb39 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UntypedSecuritymarksName.java @@ -0,0 +1,99 @@ +/* + * Copyright 2018 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. + */ + +package com.google.cloud.securitycenter.v1; + +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; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class UntypedSecuritymarksName extends SecuritymarksName { + + private final String rawValue; + private Map valueMap; + + private UntypedSecuritymarksName(String rawValue) { + this.rawValue = Preconditions.checkNotNull(rawValue); + this.valueMap = ImmutableMap.of("", rawValue); + } + + public static UntypedSecuritymarksName from(ResourceName resourceName) { + return new UntypedSecuritymarksName(resourceName.toString()); + } + + public static UntypedSecuritymarksName parse(String formattedString) { + return new UntypedSecuritymarksName(formattedString); + } + + 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 (UntypedSecuritymarksName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return true; + } + + /** Return a map with a single value rawValue keyed on an empty String "". */ + public Map getFieldValuesMap() { + return valueMap; + } + + /** Return the initial rawValue if @param fieldName is an empty String, else return null. */ + public String getFieldValue(String fieldName) { + return valueMap.get(fieldName); + } + + @Override + public String toString() { + return rawValue; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UntypedSecuritymarksName) { + UntypedSecuritymarksName that = (UntypedSecuritymarksName) o; + return this.rawValue.equals(that.rawValue); + } + return false; + } + + @Override + public int hashCode() { + return rawValue.hashCode(); + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateFindingRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateFindingRequest.java new file mode 100644 index 000000000000..d6bd5900dbe9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateFindingRequest.java @@ -0,0 +1,1073 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for updating or creating a finding.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.UpdateFindingRequest} + */ +public final class UpdateFindingRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.UpdateFindingRequest) + UpdateFindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateFindingRequest.newBuilder() to construct. + private UpdateFindingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateFindingRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateFindingRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1.Finding.Builder subBuilder = null; + if (finding_ != null) { + subBuilder = finding_.toBuilder(); + } + finding_ = + input.readMessage( + com.google.cloud.securitycenter.v1.Finding.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(finding_); + finding_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.UpdateFindingRequest.class, + com.google.cloud.securitycenter.v1.UpdateFindingRequest.Builder.class); + } + + public static final int FINDING_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1.Finding finding_; + /** + * + * + *
+   * The finding resource to update or create if it does not already exist.
+   * parent, security_marks, and update_time will be ignored.
+   * In the case of creation, the finding id portion of the name must be
+   * alphanumeric and less than or equal to 32 characters and greater than 0
+   * characters in length.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public boolean hasFinding() { + return finding_ != null; + } + /** + * + * + *
+   * The finding resource to update or create if it does not already exist.
+   * parent, security_marks, and update_time will be ignored.
+   * In the case of creation, the finding id portion of the name must be
+   * alphanumeric and less than or equal to 32 characters and greater than 0
+   * characters in length.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1.Finding getFinding() { + return finding_ == null + ? com.google.cloud.securitycenter.v1.Finding.getDefaultInstance() + : finding_; + } + /** + * + * + *
+   * The finding resource to update or create if it does not already exist.
+   * parent, security_marks, and update_time will be ignored.
+   * In the case of creation, the finding id portion of the name must be
+   * alphanumeric and less than or equal to 32 characters and greater than 0
+   * characters in length.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1.FindingOrBuilder getFindingOrBuilder() { + return getFinding(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The FieldMask to use when updating the finding resource. This field should
+   * not be specified when creating a finding.
+   * When updating a finding, an empty mask is treated as updating all mutable
+   * fields and replacing source_properties.  Individual source_properties can
+   * be added/updated by using "source_properties.<property key>" in the field
+   * mask.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The FieldMask to use when updating the finding resource. This field should
+   * not be specified when creating a finding.
+   * When updating a finding, an empty mask is treated as updating all mutable
+   * fields and replacing source_properties.  Individual source_properties can
+   * be added/updated by using "source_properties.<property key>" in the field
+   * mask.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The FieldMask to use when updating the finding resource. This field should
+   * not be specified when creating a finding.
+   * When updating a finding, an empty mask is treated as updating all mutable
+   * fields and replacing source_properties.  Individual source_properties can
+   * be added/updated by using "source_properties.<property key>" in the field
+   * mask.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (finding_ != null) { + output.writeMessage(1, getFinding()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (finding_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFinding()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.UpdateFindingRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.UpdateFindingRequest other = + (com.google.cloud.securitycenter.v1.UpdateFindingRequest) obj; + + boolean result = true; + result = result && (hasFinding() == other.hasFinding()); + if (hasFinding()) { + result = result && getFinding().equals(other.getFinding()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask().equals(other.getUpdateMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFinding()) { + hash = (37 * hash) + FINDING_FIELD_NUMBER; + hash = (53 * hash) + getFinding().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.UpdateFindingRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.UpdateFindingRequest 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.v1.UpdateFindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.UpdateFindingRequest 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.v1.UpdateFindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.UpdateFindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.UpdateFindingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.UpdateFindingRequest 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.v1.UpdateFindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.UpdateFindingRequest 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.v1.UpdateFindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.UpdateFindingRequest 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.v1.UpdateFindingRequest 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; + } + /** + * + * + *
+   * Request message for updating or creating a finding.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.UpdateFindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.UpdateFindingRequest) + com.google.cloud.securitycenter.v1.UpdateFindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.UpdateFindingRequest.class, + com.google.cloud.securitycenter.v1.UpdateFindingRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.UpdateFindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (findingBuilder_ == null) { + finding_ = null; + } else { + finding_ = null; + findingBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateFindingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateFindingRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.UpdateFindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateFindingRequest build() { + com.google.cloud.securitycenter.v1.UpdateFindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateFindingRequest buildPartial() { + com.google.cloud.securitycenter.v1.UpdateFindingRequest result = + new com.google.cloud.securitycenter.v1.UpdateFindingRequest(this); + if (findingBuilder_ == null) { + result.finding_ = finding_; + } else { + result.finding_ = findingBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.UpdateFindingRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.UpdateFindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.UpdateFindingRequest other) { + if (other == com.google.cloud.securitycenter.v1.UpdateFindingRequest.getDefaultInstance()) + return this; + if (other.hasFinding()) { + mergeFinding(other.getFinding()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.UpdateFindingRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.UpdateFindingRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1.Finding finding_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Finding, + com.google.cloud.securitycenter.v1.Finding.Builder, + com.google.cloud.securitycenter.v1.FindingOrBuilder> + findingBuilder_; + /** + * + * + *
+     * The finding resource to update or create if it does not already exist.
+     * parent, security_marks, and update_time will be ignored.
+     * In the case of creation, the finding id portion of the name must be
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public boolean hasFinding() { + return findingBuilder_ != null || finding_ != null; + } + /** + * + * + *
+     * The finding resource to update or create if it does not already exist.
+     * parent, security_marks, and update_time will be ignored.
+     * In the case of creation, the finding id portion of the name must be
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1.Finding getFinding() { + if (findingBuilder_ == null) { + return finding_ == null + ? com.google.cloud.securitycenter.v1.Finding.getDefaultInstance() + : finding_; + } else { + return findingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The finding resource to update or create if it does not already exist.
+     * parent, security_marks, and update_time will be ignored.
+     * In the case of creation, the finding id portion of the name must be
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public Builder setFinding(com.google.cloud.securitycenter.v1.Finding value) { + if (findingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + finding_ = value; + onChanged(); + } else { + findingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The finding resource to update or create if it does not already exist.
+     * parent, security_marks, and update_time will be ignored.
+     * In the case of creation, the finding id portion of the name must be
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public Builder setFinding(com.google.cloud.securitycenter.v1.Finding.Builder builderForValue) { + if (findingBuilder_ == null) { + finding_ = builderForValue.build(); + onChanged(); + } else { + findingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The finding resource to update or create if it does not already exist.
+     * parent, security_marks, and update_time will be ignored.
+     * In the case of creation, the finding id portion of the name must be
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public Builder mergeFinding(com.google.cloud.securitycenter.v1.Finding value) { + if (findingBuilder_ == null) { + if (finding_ != null) { + finding_ = + com.google.cloud.securitycenter.v1.Finding.newBuilder(finding_) + .mergeFrom(value) + .buildPartial(); + } else { + finding_ = value; + } + onChanged(); + } else { + findingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The finding resource to update or create if it does not already exist.
+     * parent, security_marks, and update_time will be ignored.
+     * In the case of creation, the finding id portion of the name must be
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public Builder clearFinding() { + if (findingBuilder_ == null) { + finding_ = null; + onChanged(); + } else { + finding_ = null; + findingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The finding resource to update or create if it does not already exist.
+     * parent, security_marks, and update_time will be ignored.
+     * In the case of creation, the finding id portion of the name must be
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1.Finding.Builder getFindingBuilder() { + + onChanged(); + return getFindingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The finding resource to update or create if it does not already exist.
+     * parent, security_marks, and update_time will be ignored.
+     * In the case of creation, the finding id portion of the name must be
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1.FindingOrBuilder getFindingOrBuilder() { + if (findingBuilder_ != null) { + return findingBuilder_.getMessageOrBuilder(); + } else { + return finding_ == null + ? com.google.cloud.securitycenter.v1.Finding.getDefaultInstance() + : finding_; + } + } + /** + * + * + *
+     * The finding resource to update or create if it does not already exist.
+     * parent, security_marks, and update_time will be ignored.
+     * In the case of creation, the finding id portion of the name must be
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Finding, + com.google.cloud.securitycenter.v1.Finding.Builder, + com.google.cloud.securitycenter.v1.FindingOrBuilder> + getFindingFieldBuilder() { + if (findingBuilder_ == null) { + findingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Finding, + com.google.cloud.securitycenter.v1.Finding.Builder, + com.google.cloud.securitycenter.v1.FindingOrBuilder>( + getFinding(), getParentForChildren(), isClean()); + finding_ = null; + } + return findingBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The FieldMask to use when updating the finding resource. This field should
+     * not be specified when creating a finding.
+     * When updating a finding, an empty mask is treated as updating all mutable
+     * fields and replacing source_properties.  Individual source_properties can
+     * be added/updated by using "source_properties.<property key>" in the field
+     * mask.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The FieldMask to use when updating the finding resource. This field should
+     * not be specified when creating a finding.
+     * When updating a finding, an empty mask is treated as updating all mutable
+     * fields and replacing source_properties.  Individual source_properties can
+     * be added/updated by using "source_properties.<property key>" in the field
+     * mask.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The FieldMask to use when updating the finding resource. This field should
+     * not be specified when creating a finding.
+     * When updating a finding, an empty mask is treated as updating all mutable
+     * fields and replacing source_properties.  Individual source_properties can
+     * be added/updated by using "source_properties.<property key>" in the field
+     * mask.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the finding resource. This field should
+     * not be specified when creating a finding.
+     * When updating a finding, an empty mask is treated as updating all mutable
+     * fields and replacing source_properties.  Individual source_properties can
+     * be added/updated by using "source_properties.<property key>" in the field
+     * mask.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the finding resource. This field should
+     * not be specified when creating a finding.
+     * When updating a finding, an empty mask is treated as updating all mutable
+     * fields and replacing source_properties.  Individual source_properties can
+     * be added/updated by using "source_properties.<property key>" in the field
+     * mask.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the finding resource. This field should
+     * not be specified when creating a finding.
+     * When updating a finding, an empty mask is treated as updating all mutable
+     * fields and replacing source_properties.  Individual source_properties can
+     * be added/updated by using "source_properties.<property key>" in the field
+     * mask.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the finding resource. This field should
+     * not be specified when creating a finding.
+     * When updating a finding, an empty mask is treated as updating all mutable
+     * fields and replacing source_properties.  Individual source_properties can
+     * be added/updated by using "source_properties.<property key>" in the field
+     * mask.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The FieldMask to use when updating the finding resource. This field should
+     * not be specified when creating a finding.
+     * When updating a finding, an empty mask is treated as updating all mutable
+     * fields and replacing source_properties.  Individual source_properties can
+     * be added/updated by using "source_properties.<property key>" in the field
+     * mask.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The FieldMask to use when updating the finding resource. This field should
+     * not be specified when creating a finding.
+     * When updating a finding, an empty mask is treated as updating all mutable
+     * fields and replacing source_properties.  Individual source_properties can
+     * be added/updated by using "source_properties.<property key>" in the field
+     * mask.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.UpdateFindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.UpdateFindingRequest) + private static final com.google.cloud.securitycenter.v1.UpdateFindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.UpdateFindingRequest(); + } + + public static com.google.cloud.securitycenter.v1.UpdateFindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateFindingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateFindingRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateFindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateFindingRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateFindingRequestOrBuilder.java new file mode 100644 index 000000000000..b63d251256af --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateFindingRequestOrBuilder.java @@ -0,0 +1,99 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface UpdateFindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.UpdateFindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The finding resource to update or create if it does not already exist.
+   * parent, security_marks, and update_time will be ignored.
+   * In the case of creation, the finding id portion of the name must be
+   * alphanumeric and less than or equal to 32 characters and greater than 0
+   * characters in length.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + boolean hasFinding(); + /** + * + * + *
+   * The finding resource to update or create if it does not already exist.
+   * parent, security_marks, and update_time will be ignored.
+   * In the case of creation, the finding id portion of the name must be
+   * alphanumeric and less than or equal to 32 characters and greater than 0
+   * characters in length.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + com.google.cloud.securitycenter.v1.Finding getFinding(); + /** + * + * + *
+   * The finding resource to update or create if it does not already exist.
+   * parent, security_marks, and update_time will be ignored.
+   * In the case of creation, the finding id portion of the name must be
+   * alphanumeric and less than or equal to 32 characters and greater than 0
+   * characters in length.
+   * 
+ * + * .google.cloud.securitycenter.v1.Finding finding = 1; + */ + com.google.cloud.securitycenter.v1.FindingOrBuilder getFindingOrBuilder(); + + /** + * + * + *
+   * The FieldMask to use when updating the finding resource. This field should
+   * not be specified when creating a finding.
+   * When updating a finding, an empty mask is treated as updating all mutable
+   * fields and replacing source_properties.  Individual source_properties can
+   * be added/updated by using "source_properties.<property key>" in the field
+   * mask.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the finding resource. This field should
+   * not be specified when creating a finding.
+   * When updating a finding, an empty mask is treated as updating all mutable
+   * fields and replacing source_properties.  Individual source_properties can
+   * be added/updated by using "source_properties.<property key>" in the field
+   * mask.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the finding resource. This field should
+   * not be specified when creating a finding.
+   * When updating a finding, an empty mask is treated as updating all mutable
+   * fields and replacing source_properties.  Individual source_properties can
+   * be added/updated by using "source_properties.<property key>" in the field
+   * mask.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateOrganizationSettingsRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateOrganizationSettingsRequest.java new file mode 100644 index 000000000000..ae17df86fa4b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateOrganizationSettingsRequest.java @@ -0,0 +1,998 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for updating an organization's settings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} + */ +public final class UpdateOrganizationSettingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) + UpdateOrganizationSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateOrganizationSettingsRequest.newBuilder() to construct. + private UpdateOrganizationSettingsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateOrganizationSettingsRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateOrganizationSettingsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1.OrganizationSettings.Builder subBuilder = null; + if (organizationSettings_ != null) { + subBuilder = organizationSettings_.toBuilder(); + } + organizationSettings_ = + input.readMessage( + com.google.cloud.securitycenter.v1.OrganizationSettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(organizationSettings_); + organizationSettings_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateOrganizationSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.class, + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.Builder.class); + } + + public static final int ORGANIZATION_SETTINGS_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1.OrganizationSettings organizationSettings_; + /** + * + * + *
+   * The organization settings resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + public boolean hasOrganizationSettings() { + return organizationSettings_ != null; + } + /** + * + * + *
+   * The organization settings resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + public com.google.cloud.securitycenter.v1.OrganizationSettings getOrganizationSettings() { + return organizationSettings_ == null + ? com.google.cloud.securitycenter.v1.OrganizationSettings.getDefaultInstance() + : organizationSettings_; + } + /** + * + * + *
+   * The organization settings resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + public com.google.cloud.securitycenter.v1.OrganizationSettingsOrBuilder + getOrganizationSettingsOrBuilder() { + return getOrganizationSettings(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The FieldMask to use when updating the settings resource.
+   *  If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The FieldMask to use when updating the settings resource.
+   *  If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The FieldMask to use when updating the settings resource.
+   *  If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (organizationSettings_ != null) { + output.writeMessage(1, getOrganizationSettings()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (organizationSettings_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOrganizationSettings()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest other = + (com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) obj; + + boolean result = true; + result = result && (hasOrganizationSettings() == other.hasOrganizationSettings()); + if (hasOrganizationSettings()) { + result = result && getOrganizationSettings().equals(other.getOrganizationSettings()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask().equals(other.getUpdateMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOrganizationSettings()) { + hash = (37 * hash) + ORGANIZATION_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getOrganizationSettings().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest 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.v1.UpdateOrganizationSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest 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.v1.UpdateOrganizationSettingsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest 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.v1.UpdateOrganizationSettingsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + 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.v1.UpdateOrganizationSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest 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.v1.UpdateOrganizationSettingsRequest 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; + } + /** + * + * + *
+   * Request message for updating an organization's settings.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateOrganizationSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.class, + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (organizationSettingsBuilder_ == null) { + organizationSettings_ = null; + } else { + organizationSettings_ = null; + organizationSettingsBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest build() { + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest buildPartial() { + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest result = + new com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(this); + if (organizationSettingsBuilder_ == null) { + result.organizationSettings_ = organizationSettings_; + } else { + result.organizationSettings_ = organizationSettingsBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) { + return mergeFrom( + (com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest other) { + if (other + == com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + .getDefaultInstance()) return this; + if (other.hasOrganizationSettings()) { + mergeOrganizationSettings(other.getOrganizationSettings()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1.OrganizationSettings organizationSettings_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.OrganizationSettings, + com.google.cloud.securitycenter.v1.OrganizationSettings.Builder, + com.google.cloud.securitycenter.v1.OrganizationSettingsOrBuilder> + organizationSettingsBuilder_; + /** + * + * + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + public boolean hasOrganizationSettings() { + return organizationSettingsBuilder_ != null || organizationSettings_ != null; + } + /** + * + * + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + public com.google.cloud.securitycenter.v1.OrganizationSettings getOrganizationSettings() { + if (organizationSettingsBuilder_ == null) { + return organizationSettings_ == null + ? com.google.cloud.securitycenter.v1.OrganizationSettings.getDefaultInstance() + : organizationSettings_; + } else { + return organizationSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + public Builder setOrganizationSettings( + com.google.cloud.securitycenter.v1.OrganizationSettings value) { + if (organizationSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + organizationSettings_ = value; + onChanged(); + } else { + organizationSettingsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + public Builder setOrganizationSettings( + com.google.cloud.securitycenter.v1.OrganizationSettings.Builder builderForValue) { + if (organizationSettingsBuilder_ == null) { + organizationSettings_ = builderForValue.build(); + onChanged(); + } else { + organizationSettingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + public Builder mergeOrganizationSettings( + com.google.cloud.securitycenter.v1.OrganizationSettings value) { + if (organizationSettingsBuilder_ == null) { + if (organizationSettings_ != null) { + organizationSettings_ = + com.google.cloud.securitycenter.v1.OrganizationSettings.newBuilder( + organizationSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + organizationSettings_ = value; + } + onChanged(); + } else { + organizationSettingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + public Builder clearOrganizationSettings() { + if (organizationSettingsBuilder_ == null) { + organizationSettings_ = null; + onChanged(); + } else { + organizationSettings_ = null; + organizationSettingsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + public com.google.cloud.securitycenter.v1.OrganizationSettings.Builder + getOrganizationSettingsBuilder() { + + onChanged(); + return getOrganizationSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + public com.google.cloud.securitycenter.v1.OrganizationSettingsOrBuilder + getOrganizationSettingsOrBuilder() { + if (organizationSettingsBuilder_ != null) { + return organizationSettingsBuilder_.getMessageOrBuilder(); + } else { + return organizationSettings_ == null + ? com.google.cloud.securitycenter.v1.OrganizationSettings.getDefaultInstance() + : organizationSettings_; + } + } + /** + * + * + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.OrganizationSettings, + com.google.cloud.securitycenter.v1.OrganizationSettings.Builder, + com.google.cloud.securitycenter.v1.OrganizationSettingsOrBuilder> + getOrganizationSettingsFieldBuilder() { + if (organizationSettingsBuilder_ == null) { + organizationSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.OrganizationSettings, + com.google.cloud.securitycenter.v1.OrganizationSettings.Builder, + com.google.cloud.securitycenter.v1.OrganizationSettingsOrBuilder>( + getOrganizationSettings(), getParentForChildren(), isClean()); + organizationSettings_ = null; + } + return organizationSettingsBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The FieldMask to use when updating the settings resource.
+     *  If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.UpdateOrganizationSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) + private static final com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest(); + } + + public static com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateOrganizationSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateOrganizationSettingsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateOrganizationSettingsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateOrganizationSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..e48c9b564746 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateOrganizationSettingsRequestOrBuilder.java @@ -0,0 +1,76 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface UpdateOrganizationSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The organization settings resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + boolean hasOrganizationSettings(); + /** + * + * + *
+   * The organization settings resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + com.google.cloud.securitycenter.v1.OrganizationSettings getOrganizationSettings(); + /** + * + * + *
+   * The organization settings resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.OrganizationSettings organization_settings = 1; + */ + com.google.cloud.securitycenter.v1.OrganizationSettingsOrBuilder + getOrganizationSettingsOrBuilder(); + + /** + * + * + *
+   * The FieldMask to use when updating the settings resource.
+   *  If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the settings resource.
+   *  If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the settings resource.
+   *  If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSecurityMarksRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSecurityMarksRequest.java new file mode 100644 index 000000000000..d26e93c8aa28 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSecurityMarksRequest.java @@ -0,0 +1,1287 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for updating a SecurityMarks resource.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} + */ +public final class UpdateSecurityMarksRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) + UpdateSecurityMarksRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSecurityMarksRequest.newBuilder() to construct. + private UpdateSecurityMarksRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSecurityMarksRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateSecurityMarksRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1.SecurityMarks.Builder subBuilder = null; + if (securityMarks_ != null) { + subBuilder = securityMarks_.toBuilder(); + } + securityMarks_ = + input.readMessage( + com.google.cloud.securitycenter.v1.SecurityMarks.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(securityMarks_); + securityMarks_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateSecurityMarksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateSecurityMarksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.class, + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.Builder.class); + } + + public static final int SECURITY_MARKS_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1.SecurityMarks securityMarks_; + /** + * + * + *
+   * The security marks resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + public boolean hasSecurityMarks() { + return securityMarks_ != null; + } + /** + * + * + *
+   * The security marks resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + public com.google.cloud.securitycenter.v1.SecurityMarks getSecurityMarks() { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } + /** + * + * + *
+   * The security marks resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + public com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder getSecurityMarksOrBuilder() { + return getSecurityMarks(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The FieldMask to use when updating the security marks resource.
+   * The field mask must not contain duplicate fields.
+   * If empty or set to "marks", all marks will be replaced.  Individual
+   * marks can be updated using "marks.<mark_key>".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The FieldMask to use when updating the security marks resource.
+   * The field mask must not contain duplicate fields.
+   * If empty or set to "marks", all marks will be replaced.  Individual
+   * marks can be updated using "marks.<mark_key>".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The FieldMask to use when updating the security marks resource.
+   * The field mask must not contain duplicate fields.
+   * If empty or set to "marks", all marks will be replaced.  Individual
+   * marks can be updated using "marks.<mark_key>".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int START_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The time at which the updated SecurityMarks take effect.
+   * If not set uses current server time.  Updates will be applied to the
+   * SecurityMarks that are active immediately preceding this time.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * The time at which the updated SecurityMarks take effect.
+   * If not set uses current server time.  Updates will be applied to the
+   * SecurityMarks that are active immediately preceding this time.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The time at which the updated SecurityMarks take effect.
+   * If not set uses current server time.  Updates will be applied to the
+   * SecurityMarks that are active immediately preceding this time.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + 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 (securityMarks_ != null) { + output.writeMessage(1, getSecurityMarks()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (startTime_ != null) { + output.writeMessage(3, getStartTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (securityMarks_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSecurityMarks()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStartTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest other = + (com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) obj; + + boolean result = true; + result = result && (hasSecurityMarks() == other.hasSecurityMarks()); + if (hasSecurityMarks()) { + result = result && getSecurityMarks().equals(other.getSecurityMarks()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask().equals(other.getUpdateMask()); + } + result = result && (hasStartTime() == other.hasStartTime()); + if (hasStartTime()) { + result = result && getStartTime().equals(other.getStartTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSecurityMarks()) { + hash = (37 * hash) + SECURITY_MARKS_FIELD_NUMBER; + hash = (53 * hash) + getSecurityMarks().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest 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.v1.UpdateSecurityMarksRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest 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.v1.UpdateSecurityMarksRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest 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.v1.UpdateSecurityMarksRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest 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.v1.UpdateSecurityMarksRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest 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.v1.UpdateSecurityMarksRequest 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; + } + /** + * + * + *
+   * Request message for updating a SecurityMarks resource.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.UpdateSecurityMarksRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateSecurityMarksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateSecurityMarksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.class, + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (securityMarksBuilder_ == null) { + securityMarks_ = null; + } else { + securityMarks_ = null; + securityMarksBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateSecurityMarksRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest build() { + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest buildPartial() { + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest result = + new com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest(this); + if (securityMarksBuilder_ == null) { + result.securityMarks_ = securityMarks_; + } else { + result.securityMarks_ = securityMarksBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest other) { + if (other + == com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest.getDefaultInstance()) + return this; + if (other.hasSecurityMarks()) { + mergeSecurityMarks(other.getSecurityMarks()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1.SecurityMarks securityMarks_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.SecurityMarks, + com.google.cloud.securitycenter.v1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder> + securityMarksBuilder_; + /** + * + * + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + public boolean hasSecurityMarks() { + return securityMarksBuilder_ != null || securityMarks_ != null; + } + /** + * + * + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + public com.google.cloud.securitycenter.v1.SecurityMarks getSecurityMarks() { + if (securityMarksBuilder_ == null) { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } else { + return securityMarksBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + public Builder setSecurityMarks(com.google.cloud.securitycenter.v1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + securityMarks_ = value; + onChanged(); + } else { + securityMarksBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + public Builder setSecurityMarks( + com.google.cloud.securitycenter.v1.SecurityMarks.Builder builderForValue) { + if (securityMarksBuilder_ == null) { + securityMarks_ = builderForValue.build(); + onChanged(); + } else { + securityMarksBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + public Builder mergeSecurityMarks(com.google.cloud.securitycenter.v1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (securityMarks_ != null) { + securityMarks_ = + com.google.cloud.securitycenter.v1.SecurityMarks.newBuilder(securityMarks_) + .mergeFrom(value) + .buildPartial(); + } else { + securityMarks_ = value; + } + onChanged(); + } else { + securityMarksBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + public Builder clearSecurityMarks() { + if (securityMarksBuilder_ == null) { + securityMarks_ = null; + onChanged(); + } else { + securityMarks_ = null; + securityMarksBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + public com.google.cloud.securitycenter.v1.SecurityMarks.Builder getSecurityMarksBuilder() { + + onChanged(); + return getSecurityMarksFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + public com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder getSecurityMarksOrBuilder() { + if (securityMarksBuilder_ != null) { + return securityMarksBuilder_.getMessageOrBuilder(); + } else { + return securityMarks_ == null + ? com.google.cloud.securitycenter.v1.SecurityMarks.getDefaultInstance() + : securityMarks_; + } + } + /** + * + * + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.SecurityMarks, + com.google.cloud.securitycenter.v1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder> + getSecurityMarksFieldBuilder() { + if (securityMarksBuilder_ == null) { + securityMarksBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.SecurityMarks, + com.google.cloud.securitycenter.v1.SecurityMarks.Builder, + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder>( + getSecurityMarks(), getParentForChildren(), isClean()); + securityMarks_ = null; + } + return securityMarksBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The FieldMask to use when updating the security marks resource.
+     * The field mask must not contain duplicate fields.
+     * If empty or set to "marks", all marks will be replaced.  Individual
+     * marks can be updated using "marks.<mark_key>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The FieldMask to use when updating the security marks resource.
+     * The field mask must not contain duplicate fields.
+     * If empty or set to "marks", all marks will be replaced.  Individual
+     * marks can be updated using "marks.<mark_key>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The FieldMask to use when updating the security marks resource.
+     * The field mask must not contain duplicate fields.
+     * If empty or set to "marks", all marks will be replaced.  Individual
+     * marks can be updated using "marks.<mark_key>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the security marks resource.
+     * The field mask must not contain duplicate fields.
+     * If empty or set to "marks", all marks will be replaced.  Individual
+     * marks can be updated using "marks.<mark_key>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the security marks resource.
+     * The field mask must not contain duplicate fields.
+     * If empty or set to "marks", all marks will be replaced.  Individual
+     * marks can be updated using "marks.<mark_key>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the security marks resource.
+     * The field mask must not contain duplicate fields.
+     * If empty or set to "marks", all marks will be replaced.  Individual
+     * marks can be updated using "marks.<mark_key>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the security marks resource.
+     * The field mask must not contain duplicate fields.
+     * If empty or set to "marks", all marks will be replaced.  Individual
+     * marks can be updated using "marks.<mark_key>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The FieldMask to use when updating the security marks resource.
+     * The field mask must not contain duplicate fields.
+     * If empty or set to "marks", all marks will be replaced.  Individual
+     * marks can be updated using "marks.<mark_key>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The FieldMask to use when updating the security marks resource.
+     * The field mask must not contain duplicate fields.
+     * If empty or set to "marks", all marks will be replaced.  Individual
+     * marks can be updated using "marks.<mark_key>".
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.protobuf.Timestamp startTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The time at which the updated SecurityMarks take effect.
+     * If not set uses current server time.  Updates will be applied to the
+     * SecurityMarks that are active immediately preceding this time.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.UpdateSecurityMarksRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) + private static final com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest(); + } + + public static com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSecurityMarksRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateSecurityMarksRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSecurityMarksRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSecurityMarksRequestOrBuilder.java new file mode 100644 index 000000000000..90bf7a6b3314 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSecurityMarksRequestOrBuilder.java @@ -0,0 +1,118 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface UpdateSecurityMarksRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.UpdateSecurityMarksRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The security marks resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + boolean hasSecurityMarks(); + /** + * + * + *
+   * The security marks resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + com.google.cloud.securitycenter.v1.SecurityMarks getSecurityMarks(); + /** + * + * + *
+   * The security marks resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.SecurityMarks security_marks = 1; + */ + com.google.cloud.securitycenter.v1.SecurityMarksOrBuilder getSecurityMarksOrBuilder(); + + /** + * + * + *
+   * The FieldMask to use when updating the security marks resource.
+   * The field mask must not contain duplicate fields.
+   * If empty or set to "marks", all marks will be replaced.  Individual
+   * marks can be updated using "marks.<mark_key>".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the security marks resource.
+   * The field mask must not contain duplicate fields.
+   * If empty or set to "marks", all marks will be replaced.  Individual
+   * marks can be updated using "marks.<mark_key>".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the security marks resource.
+   * The field mask must not contain duplicate fields.
+   * If empty or set to "marks", all marks will be replaced.  Individual
+   * marks can be updated using "marks.<mark_key>".
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * The time at which the updated SecurityMarks take effect.
+   * If not set uses current server time.  Updates will be applied to the
+   * SecurityMarks that are active immediately preceding this time.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + boolean hasStartTime(); + /** + * + * + *
+   * The time at which the updated SecurityMarks take effect.
+   * If not set uses current server time.  Updates will be applied to the
+   * SecurityMarks that are active immediately preceding this time.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The time at which the updated SecurityMarks take effect.
+   * If not set uses current server time.  Updates will be applied to the
+   * SecurityMarks that are active immediately preceding this time.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSourceRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSourceRequest.java new file mode 100644 index 000000000000..400e07512106 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSourceRequest.java @@ -0,0 +1,977 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +/** + * + * + *
+ * Request message for updating a source.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.UpdateSourceRequest} + */ +public final class UpdateSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1.UpdateSourceRequest) + UpdateSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateSourceRequest.newBuilder() to construct. + private UpdateSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSourceRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateSourceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securitycenter.v1.Source.Builder subBuilder = null; + if (source_ != null) { + subBuilder = source_.toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.securitycenter.v1.Source.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(source_); + source_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.UpdateSourceRequest.class, + com.google.cloud.securitycenter.v1.UpdateSourceRequest.Builder.class); + } + + public static final int SOURCE_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1.Source source_; + /** + * + * + *
+   * The source resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + public boolean hasSource() { + return source_ != null; + } + /** + * + * + *
+   * The source resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + public com.google.cloud.securitycenter.v1.Source getSource() { + return source_ == null + ? com.google.cloud.securitycenter.v1.Source.getDefaultInstance() + : source_; + } + /** + * + * + *
+   * The source resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + public com.google.cloud.securitycenter.v1.SourceOrBuilder getSourceOrBuilder() { + return getSource(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The FieldMask to use when updating the source resource.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The FieldMask to use when updating the source resource.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The FieldMask to use when updating the source resource.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (source_ != null) { + output.writeMessage(1, getSource()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (source_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSource()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securitycenter.v1.UpdateSourceRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1.UpdateSourceRequest other = + (com.google.cloud.securitycenter.v1.UpdateSourceRequest) obj; + + boolean result = true; + result = result && (hasSource() == other.hasSource()); + if (hasSource()) { + result = result && getSource().equals(other.getSource()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask().equals(other.getUpdateMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSource()) { + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1.UpdateSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.UpdateSourceRequest 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.v1.UpdateSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.UpdateSourceRequest 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.v1.UpdateSourceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securitycenter.v1.UpdateSourceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securitycenter.v1.UpdateSourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.UpdateSourceRequest 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.v1.UpdateSourceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.UpdateSourceRequest 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.v1.UpdateSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securitycenter.v1.UpdateSourceRequest 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.v1.UpdateSourceRequest 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; + } + /** + * + * + *
+   * Request message for updating a source.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1.UpdateSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1.UpdateSourceRequest) + com.google.cloud.securitycenter.v1.UpdateSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1.UpdateSourceRequest.class, + com.google.cloud.securitycenter.v1.UpdateSourceRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1.UpdateSourceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (sourceBuilder_ == null) { + source_ = null; + } else { + source_ = null; + sourceBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securitycenter.v1.SecuritycenterService + .internal_static_google_cloud_securitycenter_v1_UpdateSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateSourceRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1.UpdateSourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateSourceRequest build() { + com.google.cloud.securitycenter.v1.UpdateSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateSourceRequest buildPartial() { + com.google.cloud.securitycenter.v1.UpdateSourceRequest result = + new com.google.cloud.securitycenter.v1.UpdateSourceRequest(this); + if (sourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = sourceBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securitycenter.v1.UpdateSourceRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1.UpdateSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1.UpdateSourceRequest other) { + if (other == com.google.cloud.securitycenter.v1.UpdateSourceRequest.getDefaultInstance()) + return this; + if (other.hasSource()) { + mergeSource(other.getSource()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.securitycenter.v1.UpdateSourceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.securitycenter.v1.UpdateSourceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1.Source source_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Source, + com.google.cloud.securitycenter.v1.Source.Builder, + com.google.cloud.securitycenter.v1.SourceOrBuilder> + sourceBuilder_; + /** + * + * + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + public boolean hasSource() { + return sourceBuilder_ != null || source_ != null; + } + /** + * + * + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + public com.google.cloud.securitycenter.v1.Source getSource() { + if (sourceBuilder_ == null) { + return source_ == null + ? com.google.cloud.securitycenter.v1.Source.getDefaultInstance() + : source_; + } else { + return sourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + public Builder setSource(com.google.cloud.securitycenter.v1.Source value) { + if (sourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + sourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + public Builder setSource(com.google.cloud.securitycenter.v1.Source.Builder builderForValue) { + if (sourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + sourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + public Builder mergeSource(com.google.cloud.securitycenter.v1.Source value) { + if (sourceBuilder_ == null) { + if (source_ != null) { + source_ = + com.google.cloud.securitycenter.v1.Source.newBuilder(source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + sourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + public Builder clearSource() { + if (sourceBuilder_ == null) { + source_ = null; + onChanged(); + } else { + source_ = null; + sourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + public com.google.cloud.securitycenter.v1.Source.Builder getSourceBuilder() { + + onChanged(); + return getSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + public com.google.cloud.securitycenter.v1.SourceOrBuilder getSourceOrBuilder() { + if (sourceBuilder_ != null) { + return sourceBuilder_.getMessageOrBuilder(); + } else { + return source_ == null + ? com.google.cloud.securitycenter.v1.Source.getDefaultInstance() + : source_; + } + } + /** + * + * + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Source, + com.google.cloud.securitycenter.v1.Source.Builder, + com.google.cloud.securitycenter.v1.SourceOrBuilder> + getSourceFieldBuilder() { + if (sourceBuilder_ == null) { + sourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1.Source, + com.google.cloud.securitycenter.v1.Source.Builder, + com.google.cloud.securitycenter.v1.SourceOrBuilder>( + getSource(), getParentForChildren(), isClean()); + source_ = null; + } + return sourceBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The FieldMask to use when updating the source resource.
+     * If empty all mutable fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.v1.UpdateSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.UpdateSourceRequest) + private static final com.google.cloud.securitycenter.v1.UpdateSourceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1.UpdateSourceRequest(); + } + + public static com.google.cloud.securitycenter.v1.UpdateSourceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSourceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateSourceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1.UpdateSourceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSourceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSourceRequestOrBuilder.java new file mode 100644 index 000000000000..db5f008060e8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/UpdateSourceRequestOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1; + +public interface UpdateSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1.UpdateSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The source resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + boolean hasSource(); + /** + * + * + *
+   * The source resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + com.google.cloud.securitycenter.v1.Source getSource(); + /** + * + * + *
+   * The source resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1.Source source = 1; + */ + com.google.cloud.securitycenter.v1.SourceOrBuilder getSourceOrBuilder(); + + /** + * + * + *
+   * The FieldMask to use when updating the source resource.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the source resource.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The FieldMask to use when updating the source resource.
+   * If empty all mutable fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/asset.proto b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/asset.proto new file mode 100644 index 000000000000..7508fc62afb7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/asset.proto @@ -0,0 +1,101 @@ +// Copyright 2019 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.v1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; + +// Cloud Security Command Center's (Cloud SCC) representation of a Google Cloud +// Platform (GCP) resource. +// +// The Asset is a Cloud SCC resource that captures information about a single +// GCP resource. All modifications to an Asset are only within the context of +// Cloud SCC and don't affect the referenced GCP resource. +message Asset { + // Cloud SCC managed properties. These properties are managed by Cloud SCC and + // cannot be modified by the user. + message SecurityCenterProperties { + // The full resource name of the GCP resource this asset + // represents. This field is immutable after create time. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_name = 1; + + // The type of the GCP resource. Examples include: APPLICATION, + // PROJECT, and ORGANIZATION. This is a case insensitive field defined by + // Cloud SCC and/or the producer of the resource and is immutable + // after create time. + string resource_type = 2; + + // The full resource name of the immediate parent of the resource. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_parent = 3; + + // The full resource name of the project the resource belongs to. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + string resource_project = 4; + + // Owners of the Google Cloud resource. + repeated string resource_owners = 5; + } + + // IAM Policy information associated with the GCP resource described by the + // Cloud SCC asset. This information is managed and defined by the GCP + // resource and cannot be modified by the user. + message IamPolicy { + // The JSON representation of the Policy associated with the asset. + // See https://cloud.google.com/iam/reference/rest/v1/Policy for format + // details. + string policy_blob = 1; + } + + // The relative resource name of this asset. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/assets/456". + string name = 1; + + // Cloud SCC managed properties. These properties are managed by + // Cloud SCC and cannot be modified by the user. + SecurityCenterProperties security_center_properties = 2; + + // Resource managed properties. These properties are managed and defined by + // the GCP resource and cannot be modified by the user. + map resource_properties = 7; + + // User specified security marks. These marks are entirely managed by the user + // and come from the SecurityMarks resource that belongs to the asset. + SecurityMarks security_marks = 8; + + // The time at which the asset was created in Cloud SCC. + google.protobuf.Timestamp create_time = 9; + + // The time at which the asset was last updated, added, or deleted in Cloud + // SCC. + google.protobuf.Timestamp update_time = 10; + + // IAM Policy information associated with the GCP resource described by the + // Cloud SCC asset. This information is managed and defined by the GCP + // resource and cannot be modified by the user. + IamPolicy iam_policy = 11; +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/finding.proto b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/finding.proto new file mode 100644 index 000000000000..992598cffb18 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/finding.proto @@ -0,0 +1,99 @@ +// Copyright 2019 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.v1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; + +// Cloud Security Command Center (Cloud SCC) finding. +// +// A finding is a record of assessment data (security, risk, health or privacy) +// ingested into Cloud SCC for presentation, notification, analysis, +// policy testing, and enforcement. For example, an XSS vulnerability in an +// App Engine application is a finding. +message Finding { + // The state of the finding. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // The finding requires attention and has not been addressed yet. + ACTIVE = 1; + + // The finding has been fixed, triaged as a non-issue or otherwise addressed + // and is no longer active. + INACTIVE = 2; + } + + // The relative resource name of this finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/sources/456/findings/789" + string name = 1; + + // The relative resource name of the source the finding belongs to. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // This field is immutable after creation time. + // For example: + // "organizations/123/sources/456" + string parent = 2; + + // The full resource name of the Google Cloud Platform (GCP) resource this + // finding is for. See: + // https://cloud.google.com/apis/design/resource_names#full_resource_name + // This field is immutable after creation time. + string resource_name = 3; + + // The state of the finding. + State state = 4; + + // The additional taxonomy group within findings from a given source. + // This field is immutable after creation time. + // Example: "XSS_FLASH_INJECTION" + string category = 5; + + // The URI that, if available, points to a web page outside of Cloud SCC + // where additional information about the finding can be found. This field is + // guaranteed to be either empty or a well formed URL. + string external_uri = 6; + + // Source specific properties. These properties are managed by the source + // that writes the finding. The key names in the source_properties map must be + // between 1 and 255 characters, and must start with a letter and contain + // alphanumeric characters or underscores only. + map source_properties = 7; + + // Output only. User specified security marks. These marks are entirely + // managed by the user and come from the SecurityMarks resource that belongs + // to the finding. + SecurityMarks security_marks = 8; + + // The time at which the event took place. For example, if the finding + // represents an open firewall it would capture the time the open firewall was + // detected. + google.protobuf.Timestamp event_time = 9; + + // The time at which the finding was created in Cloud SCC. + google.protobuf.Timestamp create_time = 10; +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/organization_settings.proto b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/organization_settings.proto new file mode 100644 index 000000000000..c3c12a28172f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/organization_settings.proto @@ -0,0 +1,76 @@ +// Copyright 2019 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.v1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; + +// User specified settings that are attached to the Cloud Security Command +// Center (Cloud SCC) organization. +message OrganizationSettings { + // The configuration used for Asset Discovery runs. + message AssetDiscoveryConfig { + // The mode of inclusion when running Asset Discovery. + // Asset discovery can be limited by explicitly identifying projects to be + // included or excluded. If INCLUDE_ONLY is set, then only those projects + // within the organization and their children are discovered during asset + // discovery. If EXCLUDE is set, then projects that don't match those + // projects are discovered during asset discovery. If neither are set, then + // all projects within the organization are discovered during asset + // discovery. + enum InclusionMode { + // Unspecified. Setting the mode with this value will disable + // inclusion/exclusion filtering for Asset Discovery. + INCLUSION_MODE_UNSPECIFIED = 0; + + // Asset Discovery will capture only the resources within the projects + // specified. All other resources will be ignored. + INCLUDE_ONLY = 1; + + // Asset Discovery will ignore all resources under the projects specified. + // All other resources will be retrieved. + EXCLUDE = 2; + } + + // The project ids to use for filtering asset discovery. + repeated string project_ids = 1; + + // The mode to use for filtering asset discovery. + InclusionMode inclusion_mode = 2; + } + + // The relative resource name of the settings. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/organizationSettings". + string name = 1; + + // A flag that indicates if Asset Discovery should be enabled. If the flag is + // set to `true`, then discovery of assets will occur. If it is set to `false, + // all historical assets will remain, but discovery of future assets will not + // occur. + bool enable_asset_discovery = 2; + + // The configuration used for Asset Discovery runs. + AssetDiscoveryConfig asset_discovery_config = 3; + + reserved 4, 5; +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/security_marks.proto b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/security_marks.proto new file mode 100644 index 000000000000..b4197e74e4ba --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/security_marks.proto @@ -0,0 +1,46 @@ +// Copyright 2019 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.v1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; + +// User specified security marks that are attached to the parent Cloud Security +// Command Center (Cloud SCC) resource. Security marks are scoped within a Cloud +// SCC organization -- they can be modified and viewed by all users who have +// proper permissions on the organization. +message SecurityMarks { + // The relative resource name of the SecurityMarks. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Examples: + // "organizations/123/assets/456/securityMarks" + // "organizations/123/sources/456/findings/789/securityMarks". + string name = 1; + + // Mutable user specified security marks belonging to the parent resource. + // Constraints are as follows: + // - Keys and values are treated as case insensitive + // - Keys must be between 1 - 256 characters (inclusive) + // - Keys must be letters, numbers, underscores, or dashes + // - Values have leading and trailing whitespace trimmed, remaining + // characters must be between 1 - 4096 characters (inclusive) + map marks = 2; +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/securitycenter_service.proto b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/securitycenter_service.proto new file mode 100644 index 000000000000..a8a05993a48e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/securitycenter_service.proto @@ -0,0 +1,891 @@ +// Copyright 2019 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.v1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1/asset.proto"; +import "google/cloud/securitycenter/v1/finding.proto"; +import "google/cloud/securitycenter/v1/organization_settings.proto"; +import "google/cloud/securitycenter/v1/security_marks.proto"; +import "google/cloud/securitycenter/v1/source.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; + +// V1 APIs for Security Center service. +service SecurityCenter { + // Creates a source. + rpc CreateSource(CreateSourceRequest) returns (Source) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/sources" + body: "source" + }; + } + + // Creates a finding. The corresponding source must exist for finding creation + // to succeed. + rpc CreateFinding(CreateFindingRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/sources/*}/findings" + body: "finding" + }; + } + + // Gets the access control policy on the specified Source. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" + body: "*" + }; + } + + // Gets the settings for an organization. + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/organizationSettings}" + }; + } + + // Gets a source. + rpc GetSource(GetSourceRequest) returns (Source) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/sources/*}" + }; + } + + // Filters an organization's assets and groups them by their specified + // properties. + rpc GroupAssets(GroupAssetsRequest) returns (GroupAssetsResponse) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/assets:group" + body: "*" + }; + } + + // Filters an organization or source's findings and groups them by their + // specified properties. + // + // To group across all sources provide a `-` as the source id. + // Example: /v1/organizations/123/sources/-/findings + rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/sources/*}/findings:group" + body: "*" + }; + } + + // Lists an organization's assets. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/assets" + }; + } + + // Lists an organization or source's findings. + // + // To list across all sources provide a `-` as the source id. + // Example: /v1/organizations/123/sources/-/findings + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/sources/*}/findings" + }; + } + + // Lists all sources belonging to an organization. + rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/sources" + }; + } + + // Runs asset discovery. The discovery is tracked with a long-running + // operation. + // + // This API can only be called with limited frequency for an organization. If + // it is called too frequently the caller will receive a TOO_MANY_REQUESTS + // error. + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/assets:runDiscovery" + body: "*" + }; + } + + // Updates the state of a finding. + rpc SetFindingState(SetFindingStateRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1/{name=organizations/*/sources/*/findings/*}:setState" + body: "*" + }; + } + + // Sets the access control policy on the specified Source. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" + body: "*" + }; + } + + // Returns the permissions that a caller has on the specified source. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" + body: "*" + }; + } + + // Creates or updates a finding. The corresponding source must exist for a + // finding creation to succeed. + rpc UpdateFinding(UpdateFindingRequest) returns (Finding) { + option (google.api.http) = { + patch: "/v1/{finding.name=organizations/*/sources/*/findings/*}" + body: "finding" + }; + } + + // Updates an organization's settings. + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { + option (google.api.http) = { + patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" + body: "organization_settings" + }; + } + + // Updates a source. + rpc UpdateSource(UpdateSourceRequest) returns (Source) { + option (google.api.http) = { + patch: "/v1/{source.name=organizations/*/sources/*}" + body: "source" + }; + } + + // Updates security marks. + rpc UpdateSecurityMarks(UpdateSecurityMarksRequest) returns (SecurityMarks) { + option (google.api.http) = { + patch: "/v1/{security_marks.name=organizations/*/assets/*/securityMarks}" + body: "security_marks" + additional_bindings { + patch: "/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}" + body: "security_marks" + } + }; + } +} + +// Request message for creating a finding. +message CreateFindingRequest { + // Resource name of the new finding's parent. Its format should be + // "organizations/[organization_id]/sources/[source_id]". + string parent = 1; + + // Unique identifier provided by the client within the parent scope. + // It must be alphanumeric and less than or equal to 32 characters and + // greater than 0 characters in length. + string finding_id = 2; + + // The Finding being created. The name and security_marks will be ignored as + // they are both output only fields on this resource. + Finding finding = 3; +} + +// Request message for creating a source. +message CreateSourceRequest { + // Resource name of the new source's parent. Its format should be + // "organizations/[organization_id]". + string parent = 1; + + // The Source being created, only the display_name and description will be + // used. All other fields will be ignored. + Source source = 2; +} + +// Request message for getting organization settings. +message GetOrganizationSettingsRequest { + // Name of the organization to get organization settings for. Its format is + // "organizations/[organization_id]/organizationSettings". + string name = 1; +} + +// Request message for getting a source. +message GetSourceRequest { + // Relative resource name of the source. Its format is + // "organizations/[organization_id]/source/[source_id]". + string name = 1; +} + +// Request message for grouping by assets. +message GroupAssetsRequest { + // Name of the organization to groupBy. Its format is + // "organizations/[organization_id]". + string parent = 1; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `resource_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what assets fields to use for grouping. The string + // value should follow SQL syntax: comma separated list of fields. For + // example: + // "security_center_properties.resource_project,security_center_properties.project". + // + // The following fields are supported when compare_duration is not set: + // + // * security_center_properties.resource_project + // * security_center_properties.resource_type + // * security_center_properties.resource_parent + // + // The following fields are supported when compare_duration is set: + // + // * security_center_properties.resource_type + string group_by = 3; + + // When compare_duration is set, the GroupResult's "state_change" property is + // updated to indicate whether the asset was added, removed, or remained + // present during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state change value is derived based on the presence of the asset at the + // two points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present at the start of + // compare_duration, but present at reference_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at reference_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and reference_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all assets present at + // read_time. + // + // If this field is set then `state_change` must be a specified field in + // `group_by`. + google.protobuf.Duration compare_duration = 4; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only 'state_change' is supported and + // requires compare_duration to be specified. + string having = 6; + + // The value returned by the last `GroupAssetsResponse`; indicates + // that this is a continuation of a prior `GroupAssets` call, and that the + // system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for grouping by assets. +message GroupAssetsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of results matching the query. + int32 total_size = 4; +} + +// Request message for grouping by findings. +message GroupFindingsRequest { + // Name of the source to groupBy. Its format is + // "organizations/[organization_id]/sources/[source_id]". To groupBy across + // all sources provide a source_id of `-`. For example: + // organizations/123/sources/- + string parent = 1; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `source_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what assets fields to use for grouping (including + // `state_change`). 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 + // * state_change + // * parent + string group_by = 3; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the GroupResult's "state_change" attribute is + // updated to indicate whether the finding had its state changed, the + // finding's state remained unchanged, or if the finding was added during the + // compare_duration period of time that precedes the read_time. This is the + // time between (read_time - compare_duration) and read_time. + // + // The state_change value is derived based on the presence and state of the + // finding at the two points in time. Intermediate state changes between the + // two times don't affect the result. For example, the results aren't affected + // if the finding is made inactive and then active again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "CHANGED": indicates that the finding was present at the start of + // compare_duration, but changed its state at read_time. + // * "UNCHANGED": indicates that the finding was present at the start of + // compare_duration and did not change state at read_time. + // * "ADDED": indicates that the finding was not present at the start + // of compare_duration, but was present at read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all findings present + // at read_time. + // + // If this field is set then `state_change` must be a specified field in + // `group_by`. + google.protobuf.Duration compare_duration = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only 'finding.state' and 'state_change' + // are supported and requires compare_duration to be specified. + string having = 6; + + // The value returned by the last `GroupFindingsResponse`; indicates + // that this is a continuation of a prior `GroupFindings` call, and + // that the system should return the next page of data. + string page_token = 7; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 8; +} + +// Response message for group by findings. +message GroupFindingsResponse { + // Group results. There exists an element for each existing unique + // combination of property/values. The element contains a count for the number + // of times those specific property/values appear. + repeated GroupResult group_by_results = 1; + + // Time used for executing the groupBy request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of results matching the query. + int32 total_size = 4; +} + +// Result containing the properties and count of a groupBy request. +message GroupResult { + // Properties matching the groupBy fields in the request. + map properties = 1; + + // Total count of resources for the given properties. + int64 count = 2; +} + +// Request message for listing sources. +message ListSourcesRequest { + // Resource name of the parent of sources to list. Its format should be + // "organizations/[organization_id]". + string parent = 1; + + // The value returned by the last `ListSourcesResponse`; indicates + // that this is a continuation of a prior `ListSources` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 7; +} + +// Response message for listing sources. +message ListSourcesResponse { + // Sources belonging to the requested parent. + repeated Source sources = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + +// Request message for listing assets. +message ListAssetsRequest { + // Name of the organization assets should belong to. Its format is + // "organizations/[organization_id]". + string parent = 1; + + // Expression that defines the filter to apply across assets. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. The fields map to those + // defined in the Asset resource. Examples include: + // + // * name + // * security_center_properties.resource_name + // * resource_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `resource_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,resource_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,resource_properties.a_property" and " + // name desc , resource_properties.a_property " are equivalent. + string order_by = 3; + + // Time used as a reference point when filtering assets. The filter is limited + // to assets existing at the supplied time and their values are those at that + // specific time. Absence of this field will default to the API's version of + // NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListAssetsResult's "state_change" + // attribute is updated to indicate whether the asset was added, removed, or + // remained present during the compare_duration period of time that precedes + // the read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state_change value is derived based on the presence of the asset at the + // two points in time. Intermediate state changes between the two times don't + // affect the result. For example, the results aren't affected if the asset is + // removed and re-created again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present at the start of + // compare_duration, but present at read_time. + // * "REMOVED": indicates that the asset was present at the start of + // compare_duration, but not present at read_time. + // * "ACTIVE": indicates that the asset was present at both the + // start and the end of the time period defined by + // compare_duration and read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all assets present at + // read_time. + google.protobuf.Duration compare_duration = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only 'state_change' is supported and + // requires compare_duration to be specified. + string having = 6; + + // Optional. + // + // A field mask to specify the ListAssetsResult fields to be listed in the + // response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7; + + // The value returned by the last `ListAssetsResponse`; indicates + // that this is a continuation of a prior `ListAssets` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing assets. +message ListAssetsResponse { + // Result containing the Asset and its State. + message ListAssetsResult { + // The change in state of the asset. + // + // When querying across two points in time this describes + // the change between the two points: ADDED, REMOVED, or ACTIVE. + // If there was no compare_duration supplied in the request the state change + // will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // Asset was added between the points in time. + ADDED = 1; + + // Asset was removed between the points in time. + REMOVED = 2; + + // Asset was present at both point(s) in time. + ACTIVE = 3; + } + + // Asset matching the search request. + Asset asset = 1; + + // State change of the asset between the points in time. + StateChange state_change = 2; + } + + // Assets matching the list request. + repeated ListAssetsResult list_assets_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of assets matching the query. + int32 total_size = 4; +} + +// Request message for listing findings. +message ListFindingsRequest { + // Name of the source the findings belong to. Its format is + // "organizations/[organization_id]/sources/[source_id]". To list across all + // sources provide a source_id of `-`. For example: + // organizations/123/sources/- + string parent = 1; + + // Expression that defines the filter to apply across findings. + // The expression is a list of one or more restrictions combined via logical + // operators `AND` and `OR`. + // Parentheses are supported, and `OR` has higher precedence than `AND`. + // + // Restrictions have the form ` ` and may have a `-` + // character in front of them to indicate negation. Examples include: + // + // * name + // * source_properties.a_property + // * security_marks.marks.marka + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + // + // For example, `source_properties.size = 100` is a valid filter string. + string filter = 2; + + // Expression that defines what fields and order to use for sorting. The + // string value should follow SQL syntax: comma separated list of fields. For + // example: "name,resource_properties.a_property". The default sorting order + // is ascending. To specify descending order for a field, a suffix " desc" + // should be appended to the field name. For example: "name + // desc,source_properties.a_property". Redundant space characters in the + // syntax are insignificant. "name desc,source_properties.a_property" and " + // name desc , source_properties.a_property " are equivalent. + string order_by = 3; + + // Time used as a reference point when filtering findings. The filter is + // limited to findings existing at the supplied time and their values are + // those at that specific time. Absence of this field will default to the + // API's version of NOW. + google.protobuf.Timestamp read_time = 4; + + // When compare_duration is set, the ListFindingsResult's "state_change" + // attribute is updated to indicate whether the finding had its state changed, + // the finding's state remained unchanged, or if the finding was added in any + // state during the compare_duration period of time that precedes the + // read_time. This is the time between (read_time - compare_duration) and + // read_time. + // + // The state_change value is derived based on the presence and state of the + // finding at the two points in time. Intermediate state changes between the + // two times don't affect the result. For example, the results aren't affected + // if the finding is made inactive and then active again. + // + // Possible "state_change" values when compare_duration is specified: + // + // * "CHANGED": indicates that the finding was present at the start of + // compare_duration, but changed its state at read_time. + // * "UNCHANGED": indicates that the finding was present at the start of + // compare_duration and did not change state at read_time. + // * "ADDED": indicates that the finding was not present at the start + // of compare_duration, but was present at read_time. + // + // If compare_duration is not specified, then the only possible state_change + // is "UNUSED", which will be the state_change set for all findings present at + // read_time. + google.protobuf.Duration compare_duration = 5; + + // Filter that specifies what fields to further filter on *after* the query + // filter has been executed. Currently only 'finding.state' and 'state_change' + // are supported and requires compare_duration to be specified. + string having = 6; + + // Optional. + // + // A field mask to specify the Finding fields to be listed in the response. + // An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7; + + // The value returned by the last `ListFindingsResponse`; indicates + // that this is a continuation of a prior `ListFindings` call, and + // that the system should return the next page of data. + string page_token = 8; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 9; +} + +// Response message for listing findings. +message ListFindingsResponse { + // Result containing the Finding and its StateChange. + message ListFindingsResult { + // The change in state of the finding. + // + // When querying across two points in time this describes + // the change in the finding between the two points: CHANGED, UNCHANGED, + // ADDED, or REMOVED. Findings can not be deleted, so REMOVED implies that + // the finding at timestamp does not match the filter specified, but it did + // at timestamp - compare_duration. If there was no compare_duration + // supplied in the request the state change will be: UNUSED + enum StateChange { + // State change is unused, this is the canonical default for this enum. + UNUSED = 0; + + // The finding has changed state in some way between the points in time + // and existed at both points. + CHANGED = 1; + + // The finding has not changed state between the points in time and + // existed at both points. + UNCHANGED = 2; + + // The finding was created between the points in time. + ADDED = 3; + + // The finding at timestamp does not match the filter specified, but it + // did at timestamp - compare_duration. + REMOVED = 4; + } + + // Finding matching the search request. + Finding finding = 1; + + // State change of the finding between the points in time. + StateChange state_change = 2; + } + + // Findings matching the list request. + repeated ListFindingsResult list_findings_results = 1; + + // Time used for executing the list request. + google.protobuf.Timestamp read_time = 2; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 3; + + // The total number of findings matching the query. + int32 total_size = 4; +} + +// Request message for updating a finding's state. +message SetFindingStateRequest { + // The relative resource name of the finding. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/sources/456/finding/789". + string name = 1; + + // The desired State of the finding. + Finding.State state = 2; + + // The time at which the updated state takes effect. + google.protobuf.Timestamp start_time = 3; +} + +// Request message for running asset discovery for an organization. +message RunAssetDiscoveryRequest { + // Name of the organization to run asset discovery for. Its format is + // "organizations/[organization_id]". + string parent = 1; +} + +// Request message for updating or creating a finding. +message UpdateFindingRequest { + // The finding resource to update or create if it does not already exist. + // parent, security_marks, and update_time will be ignored. + // + // In the case of creation, the finding id portion of the name must be + // alphanumeric and less than or equal to 32 characters and greater than 0 + // characters in length. + Finding finding = 1; + + // The FieldMask to use when updating the finding resource. This field should + // not be specified when creating a finding. + // + // When updating a finding, an empty mask is treated as updating all mutable + // fields and replacing source_properties. Individual source_properties can + // be added/updated by using "source_properties." in the field + // mask. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating an organization's settings. +message UpdateOrganizationSettingsRequest { + // The organization settings resource to update. + OrganizationSettings organization_settings = 1; + + // The FieldMask to use when updating the settings resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a source. +message UpdateSourceRequest { + // The source resource to update. + Source source = 1; + + // The FieldMask to use when updating the source resource. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for updating a SecurityMarks resource. +message UpdateSecurityMarksRequest { + // The security marks resource to update. + SecurityMarks security_marks = 1; + + // The FieldMask to use when updating the security marks resource. + // + // The field mask must not contain duplicate fields. + // If empty or set to "marks", all marks will be replaced. Individual + // marks can be updated using "marks.". + google.protobuf.FieldMask update_mask = 2; + + // The time at which the updated SecurityMarks take effect. + // If not set uses current server time. Updates will be applied to the + // SecurityMarks that are active immediately preceding this time. + google.protobuf.Timestamp start_time = 3; +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/source.proto b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/source.proto new file mode 100644 index 000000000000..e58a0596d613 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/proto/google/cloud/securitycenter/v1/source.proto @@ -0,0 +1,55 @@ +// Copyright 2019 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.v1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1"; + +// Cloud Security Command Center's (Cloud SCC) finding source. A finding source +// is an entity or a mechanism that can produce a finding. A source is like a +// container of findings that come from the same scanner, logger, monitor, etc. +message Source { + // The relative resource name of this source. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/123/sources/456" + string name = 1; + + // The source’s display name. + // A source’s display name must be unique amongst its siblings, for example, + // two sources with the same parent can't share the same display name. + // The display name must start and end with a letter or digit, may contain + // letters, digits, spaces, hyphens, and underscores, and can be no longer + // than 32 characters. This is captured by the regular expression: + // [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,30}[\p{L}\p{N}])?. + string display_name = 2; + + // The description of the source (max of 1024 characters). + // Example: + // "Cloud Security Scanner is a web security scanner for common + // vulnerabilities in App Engine applications. It can automatically + // scan and detect four common vulnerabilities, including cross-site-scripting + // (XSS), Flash injection, mixed content (HTTP in HTTPS), and + // outdated/insecure libraries." + string description = 3; + + reserved 4; +} diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index f8c29606e131..e7992f0a50a0 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -620,6 +620,16 @@ grpc-google-cloud-securitycenter-v1beta1 0.47.1-SNAPSHOT
+ + com.google.api.grpc + proto-google-cloud-securitycenter-v1 + 0.47.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-securitycenter-v1 + 0.47.1-SNAPSHOT + com.google.cloud google-cloud-spanner diff --git a/google-cloud-clients/google-cloud-securitycenter/pom.xml b/google-cloud-clients/google-cloud-securitycenter/pom.xml index 18f892f868ee..0bb0fd8016af 100644 --- a/google-cloud-clients/google-cloud-securitycenter/pom.xml +++ b/google-cloud-clients/google-cloud-securitycenter/pom.xml @@ -34,6 +34,14 @@ com.google.api.grpc grpc-google-cloud-securitycenter-v1beta1 + + com.google.api.grpc + proto-google-cloud-securitycenter-v1 + + + com.google.api.grpc + grpc-google-cloud-securitycenter-v1 + io.grpc grpc-netty-shaded diff --git a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java new file mode 100644 index 000000000000..9e1733f8f631 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java @@ -0,0 +1,2471 @@ +/* + * Copyright 2019 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.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.securitycenter.v1.stub.SecurityCenterStub; +import com.google.cloud.securitycenter.v1.stub.SecurityCenterStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: V1 APIs for Security Center service. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ *   Source source = Source.newBuilder().build();
+ *   Source response = securityCenterClient.createSource(parent, source);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the securityCenterClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of SecurityCenterSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * SecurityCenterSettings securityCenterSettings =
+ *     SecurityCenterSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SecurityCenterClient securityCenterClient =
+ *     SecurityCenterClient.create(securityCenterSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * SecurityCenterSettings securityCenterSettings =
+ *     SecurityCenterSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SecurityCenterClient securityCenterClient =
+ *     SecurityCenterClient.create(securityCenterSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class SecurityCenterClient implements BackgroundResource { + private final SecurityCenterSettings settings; + private final SecurityCenterStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of SecurityCenterClient with default settings. */ + public static final SecurityCenterClient create() throws IOException { + return create(SecurityCenterSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SecurityCenterClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final SecurityCenterClient create(SecurityCenterSettings settings) + throws IOException { + return new SecurityCenterClient(settings); + } + + /** + * Constructs an instance of SecurityCenterClient, using the given stub for making calls. This is + * for advanced usage - prefer to use SecurityCenterSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final SecurityCenterClient create(SecurityCenterStub stub) { + return new SecurityCenterClient(stub); + } + + /** + * Constructs an instance of SecurityCenterClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected SecurityCenterClient(SecurityCenterSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SecurityCenterStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected SecurityCenterClient(SecurityCenterStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final SecurityCenterSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SecurityCenterStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   Source source = Source.newBuilder().build();
+   *   Source response = securityCenterClient.createSource(parent, source);
+   * }
+   * 
+ * + * @param parent Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * @param source The Source being created, only the display_name and description will be used. All + * other fields will be ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Source createSource(OrganizationName parent, Source source) { + + CreateSourceRequest request = + CreateSourceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSource(source) + .build(); + return createSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   Source source = Source.newBuilder().build();
+   *   Source response = securityCenterClient.createSource(parent.toString(), source);
+   * }
+   * 
+ * + * @param parent Resource name of the new source's parent. Its format should be + * "organizations/[organization_id]". + * @param source The Source being created, only the display_name and description will be used. All + * other fields will be ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Source createSource(String parent, Source source) { + + CreateSourceRequest request = + CreateSourceRequest.newBuilder().setParent(parent).setSource(source).build(); + return createSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   Source source = Source.newBuilder().build();
+   *   CreateSourceRequest request = CreateSourceRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setSource(source)
+   *     .build();
+   *   Source response = securityCenterClient.createSource(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Source createSource(CreateSourceRequest request) { + return createSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   Source source = Source.newBuilder().build();
+   *   CreateSourceRequest request = CreateSourceRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setSource(source)
+   *     .build();
+   *   ApiFuture<Source> future = securityCenterClient.createSourceCallable().futureCall(request);
+   *   // Do something
+   *   Source response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createSourceCallable() { + return stub.createSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a finding. The corresponding source must exist for finding creation to succeed. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   String findingId = "";
+   *   Finding finding = Finding.newBuilder().build();
+   *   Finding response = securityCenterClient.createFinding(parent, findingId, finding);
+   * }
+   * 
+ * + * @param parent Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * @param findingId Unique identifier provided by the client within the parent scope. It must be + * alphanumeric and less than or equal to 32 characters and greater than 0 characters in + * length. + * @param finding The Finding being created. The name and security_marks will be ignored as they + * are both output only fields on this resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Finding createFinding(SourceName parent, String findingId, Finding finding) { + + CreateFindingRequest request = + CreateFindingRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setFindingId(findingId) + .setFinding(finding) + .build(); + return createFinding(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a finding. The corresponding source must exist for finding creation to succeed. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   String findingId = "";
+   *   Finding finding = Finding.newBuilder().build();
+   *   Finding response = securityCenterClient.createFinding(parent.toString(), findingId, finding);
+   * }
+   * 
+ * + * @param parent Resource name of the new finding's parent. Its format should be + * "organizations/[organization_id]/sources/[source_id]". + * @param findingId Unique identifier provided by the client within the parent scope. It must be + * alphanumeric and less than or equal to 32 characters and greater than 0 characters in + * length. + * @param finding The Finding being created. The name and security_marks will be ignored as they + * are both output only fields on this resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Finding createFinding(String parent, String findingId, Finding finding) { + + CreateFindingRequest request = + CreateFindingRequest.newBuilder() + .setParent(parent) + .setFindingId(findingId) + .setFinding(finding) + .build(); + return createFinding(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a finding. The corresponding source must exist for finding creation to succeed. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   String findingId = "";
+   *   Finding finding = Finding.newBuilder().build();
+   *   CreateFindingRequest request = CreateFindingRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setFindingId(findingId)
+   *     .setFinding(finding)
+   *     .build();
+   *   Finding response = securityCenterClient.createFinding(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Finding createFinding(CreateFindingRequest request) { + return createFindingCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a finding. The corresponding source must exist for finding creation to succeed. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   String findingId = "";
+   *   Finding finding = Finding.newBuilder().build();
+   *   CreateFindingRequest request = CreateFindingRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setFindingId(findingId)
+   *     .setFinding(finding)
+   *     .build();
+   *   ApiFuture<Finding> future = securityCenterClient.createFindingCallable().futureCall(request);
+   *   // Do something
+   *   Finding response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createFindingCallable() { + return stub.createFindingCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy on the specified Source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   Policy response = securityCenterClient.getIamPolicy(resource);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. `resource` is + * usually specified as a path. For example, a Project resource is specified as + * `projects/{project}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(SourceName resource) { + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy on the specified Source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   Policy response = securityCenterClient.getIamPolicy(resource.toString());
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. `resource` is + * usually specified as a path. For example, a Project resource is specified as + * `projects/{project}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource) { + + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy on the specified Source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   ResourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = securityCenterClient.getIamPolicy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy on the specified Source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   ResourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = securityCenterClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the settings for an organization. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]");
+   *   OrganizationSettings response = securityCenterClient.getOrganizationSettings(name);
+   * }
+   * 
+ * + * @param name Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OrganizationSettings getOrganizationSettings(OrganizationSettingsName name) { + + GetOrganizationSettingsRequest request = + GetOrganizationSettingsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getOrganizationSettings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the settings for an organization. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]");
+   *   OrganizationSettings response = securityCenterClient.getOrganizationSettings(name.toString());
+   * }
+   * 
+ * + * @param name Name of the organization to get organization settings for. Its format is + * "organizations/[organization_id]/organizationSettings". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OrganizationSettings getOrganizationSettings(String name) { + + GetOrganizationSettingsRequest request = + GetOrganizationSettingsRequest.newBuilder().setName(name).build(); + return getOrganizationSettings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the settings for an organization. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]");
+   *   GetOrganizationSettingsRequest request = GetOrganizationSettingsRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OrganizationSettings response = securityCenterClient.getOrganizationSettings(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OrganizationSettings getOrganizationSettings( + GetOrganizationSettingsRequest request) { + return getOrganizationSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the settings for an organization. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]");
+   *   GetOrganizationSettingsRequest request = GetOrganizationSettingsRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<OrganizationSettings> future = securityCenterClient.getOrganizationSettingsCallable().futureCall(request);
+   *   // Do something
+   *   OrganizationSettings response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + getOrganizationSettingsCallable() { + return stub.getOrganizationSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   Source response = securityCenterClient.getSource(name);
+   * }
+   * 
+ * + * @param name Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Source getSource(SourceName name) { + + GetSourceRequest request = + GetSourceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   Source response = securityCenterClient.getSource(name.toString());
+   * }
+   * 
+ * + * @param name Relative resource name of the source. Its format is + * "organizations/[organization_id]/source/[source_id]". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Source getSource(String name) { + + GetSourceRequest request = GetSourceRequest.newBuilder().setName(name).build(); + return getSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   GetSourceRequest request = GetSourceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Source response = securityCenterClient.getSource(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Source getSource(GetSourceRequest request) { + return getSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   GetSourceRequest request = GetSourceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Source> future = securityCenterClient.getSourceCallable().futureCall(request);
+   *   // Do something
+   *   Source response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getSourceCallable() { + return stub.getSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Filters an organization's assets and groups them by their specified properties. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   String groupBy = "";
+   *   GroupAssetsRequest request = GroupAssetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setGroupBy(groupBy)
+   *     .build();
+   *   for (GroupResult element : securityCenterClient.groupAssets(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GroupAssetsPagedResponse groupAssets(GroupAssetsRequest request) { + return groupAssetsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Filters an organization's assets and groups them by their specified properties. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   String groupBy = "";
+   *   GroupAssetsRequest request = GroupAssetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setGroupBy(groupBy)
+   *     .build();
+   *   ApiFuture<GroupAssetsPagedResponse> future = securityCenterClient.groupAssetsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (GroupResult element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + groupAssetsPagedCallable() { + return stub.groupAssetsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Filters an organization's assets and groups them by their specified properties. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   String groupBy = "";
+   *   GroupAssetsRequest request = GroupAssetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setGroupBy(groupBy)
+   *     .build();
+   *   while (true) {
+   *     GroupAssetsResponse response = securityCenterClient.groupAssetsCallable().call(request);
+   *     for (GroupResult element : response.getGroupByResultsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable groupAssetsCallable() { + return stub.groupAssetsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Filters an organization or source's findings and groups them by their specified properties. + * + *

To group across all sources provide a `-` as the source id. Example: + * /v1/organizations/123/sources/-/findings + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   String groupBy = "";
+   *   for (GroupResult element : securityCenterClient.groupFindings(parent, groupBy).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across all sources + * provide a source_id of `-`. For example: organizations/123/sources/- + * @param groupBy Expression that defines what assets fields to use for grouping (including + * `state_change`). 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 * state_change * parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GroupFindingsPagedResponse groupFindings(SourceName parent, String groupBy) { + GroupFindingsRequest request = + GroupFindingsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setGroupBy(groupBy) + .build(); + return groupFindings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Filters an organization or source's findings and groups them by their specified properties. + * + *

To group across all sources provide a `-` as the source id. Example: + * /v1/organizations/123/sources/-/findings + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   String groupBy = "";
+   *   for (GroupResult element : securityCenterClient.groupFindings(parent.toString(), groupBy).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Name of the source to groupBy. Its format is + * "organizations/[organization_id]/sources/[source_id]". To groupBy across all sources + * provide a source_id of `-`. For example: organizations/123/sources/- + * @param groupBy Expression that defines what assets fields to use for grouping (including + * `state_change`). 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 * state_change * parent + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GroupFindingsPagedResponse groupFindings(String parent, String groupBy) { + GroupFindingsRequest request = + GroupFindingsRequest.newBuilder().setParent(parent).setGroupBy(groupBy).build(); + return groupFindings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Filters an organization or source's findings and groups them by their specified properties. + * + *

To group across all sources provide a `-` as the source id. Example: + * /v1/organizations/123/sources/-/findings + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   String groupBy = "";
+   *   GroupFindingsRequest request = GroupFindingsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setGroupBy(groupBy)
+   *     .build();
+   *   for (GroupResult element : securityCenterClient.groupFindings(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GroupFindingsPagedResponse groupFindings(GroupFindingsRequest request) { + return groupFindingsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Filters an organization or source's findings and groups them by their specified properties. + * + *

To group across all sources provide a `-` as the source id. Example: + * /v1/organizations/123/sources/-/findings + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   String groupBy = "";
+   *   GroupFindingsRequest request = GroupFindingsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setGroupBy(groupBy)
+   *     .build();
+   *   ApiFuture<GroupFindingsPagedResponse> future = securityCenterClient.groupFindingsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (GroupResult element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + groupFindingsPagedCallable() { + return stub.groupFindingsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Filters an organization or source's findings and groups them by their specified properties. + * + *

To group across all sources provide a `-` as the source id. Example: + * /v1/organizations/123/sources/-/findings + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   String groupBy = "";
+   *   GroupFindingsRequest request = GroupFindingsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setGroupBy(groupBy)
+   *     .build();
+   *   while (true) {
+   *     GroupFindingsResponse response = securityCenterClient.groupFindingsCallable().call(request);
+   *     for (GroupResult element : response.getGroupByResultsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable groupFindingsCallable() { + return stub.groupFindingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists an organization's assets. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (ListAssetsResponse.ListAssetsResult element : securityCenterClient.listAssets(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAssetsPagedResponse listAssets(ListAssetsRequest request) { + return listAssetsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists an organization's assets. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListAssetsPagedResponse> future = securityCenterClient.listAssetsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ListAssetsResponse.ListAssetsResult element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listAssetsPagedCallable() { + return stub.listAssetsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists an organization's assets. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListAssetsResponse response = securityCenterClient.listAssetsCallable().call(request);
+   *     for (ListAssetsResponse.ListAssetsResult element : response.getListAssetsResultsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listAssetsCallable() { + return stub.listAssetsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists an organization or source's findings. + * + *

To list across all sources provide a `-` as the source id. Example: + * /v1/organizations/123/sources/-/findings + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   ListFindingsRequest request = ListFindingsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (ListFindingsResponse.ListFindingsResult element : securityCenterClient.listFindings(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFindingsPagedResponse listFindings(ListFindingsRequest request) { + return listFindingsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists an organization or source's findings. + * + *

To list across all sources provide a `-` as the source id. Example: + * /v1/organizations/123/sources/-/findings + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   ListFindingsRequest request = ListFindingsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListFindingsPagedResponse> future = securityCenterClient.listFindingsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ListFindingsResponse.ListFindingsResult element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listFindingsPagedCallable() { + return stub.listFindingsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists an organization or source's findings. + * + *

To list across all sources provide a `-` as the source id. Example: + * /v1/organizations/123/sources/-/findings + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   ListFindingsRequest request = ListFindingsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListFindingsResponse response = securityCenterClient.listFindingsCallable().call(request);
+   *     for (ListFindingsResponse.ListFindingsResult element : response.getListFindingsResultsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listFindingsCallable() { + return stub.listFindingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all sources belonging to an organization. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   for (Source element : securityCenterClient.listSources(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSourcesPagedResponse listSources(OrganizationName parent) { + ListSourcesRequest request = + ListSourcesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSources(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all sources belonging to an organization. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   for (Source element : securityCenterClient.listSources(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Resource name of the parent of sources to list. Its format should be + * "organizations/[organization_id]". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSourcesPagedResponse listSources(String parent) { + ListSourcesRequest request = ListSourcesRequest.newBuilder().setParent(parent).build(); + return listSources(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all sources belonging to an organization. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   ListSourcesRequest request = ListSourcesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Source element : securityCenterClient.listSources(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSourcesPagedResponse listSources(ListSourcesRequest request) { + return listSourcesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all sources belonging to an organization. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   ListSourcesRequest request = ListSourcesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListSourcesPagedResponse> future = securityCenterClient.listSourcesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Source element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listSourcesPagedCallable() { + return stub.listSourcesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all sources belonging to an organization. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   ListSourcesRequest request = ListSourcesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListSourcesResponse response = securityCenterClient.listSourcesCallable().call(request);
+   *     for (Source element : response.getSourcesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listSourcesCallable() { + return stub.listSourcesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Runs asset discovery. The discovery is tracked with a long-running operation. + * + *

This API can only be called with limited frequency for an organization. If it is called too + * frequently the caller will receive a TOO_MANY_REQUESTS error. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   securityCenterClient.runAssetDiscoveryAsync(parent).get();
+   * }
+   * 
+ * + * @param parent Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture runAssetDiscoveryAsync(OrganizationName parent) { + + RunAssetDiscoveryRequest request = + RunAssetDiscoveryRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return runAssetDiscoveryAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Runs asset discovery. The discovery is tracked with a long-running operation. + * + *

This API can only be called with limited frequency for an organization. If it is called too + * frequently the caller will receive a TOO_MANY_REQUESTS error. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   securityCenterClient.runAssetDiscoveryAsync(parent.toString()).get();
+   * }
+   * 
+ * + * @param parent Name of the organization to run asset discovery for. Its format is + * "organizations/[organization_id]". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture runAssetDiscoveryAsync(String parent) { + + RunAssetDiscoveryRequest request = + RunAssetDiscoveryRequest.newBuilder().setParent(parent).build(); + return runAssetDiscoveryAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Runs asset discovery. The discovery is tracked with a long-running operation. + * + *

This API can only be called with limited frequency for an organization. If it is called too + * frequently the caller will receive a TOO_MANY_REQUESTS error. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   RunAssetDiscoveryRequest request = RunAssetDiscoveryRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   securityCenterClient.runAssetDiscoveryAsync(request).get();
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture runAssetDiscoveryAsync( + RunAssetDiscoveryRequest request) { + return runAssetDiscoveryOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Runs asset discovery. The discovery is tracked with a long-running operation. + * + *

This API can only be called with limited frequency for an organization. If it is called too + * frequently the caller will receive a TOO_MANY_REQUESTS error. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   RunAssetDiscoveryRequest request = RunAssetDiscoveryRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   OperationFuture<Empty, Empty> future = securityCenterClient.runAssetDiscoveryOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + runAssetDiscoveryOperationCallable() { + return stub.runAssetDiscoveryOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Runs asset discovery. The discovery is tracked with a long-running operation. + * + *

This API can only be called with limited frequency for an organization. If it is called too + * frequently the caller will receive a TOO_MANY_REQUESTS error. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   RunAssetDiscoveryRequest request = RunAssetDiscoveryRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = securityCenterClient.runAssetDiscoveryCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable runAssetDiscoveryCallable() { + return stub.runAssetDiscoveryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the state of a finding. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]");
+   *   Finding.State state = Finding.State.STATE_UNSPECIFIED;
+   *   Timestamp startTime = Timestamp.newBuilder().build();
+   *   Finding response = securityCenterClient.setFindingState(name, state, startTime);
+   * }
+   * 
+ * + * @param name The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: + * "organizations/123/sources/456/finding/789". + * @param state The desired State of the finding. + * @param startTime The time at which the updated state takes effect. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Finding setFindingState(FindingName name, Finding.State state, Timestamp startTime) { + + SetFindingStateRequest request = + SetFindingStateRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setState(state) + .setStartTime(startTime) + .build(); + return setFindingState(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the state of a finding. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]");
+   *   Finding.State state = Finding.State.STATE_UNSPECIFIED;
+   *   Timestamp startTime = Timestamp.newBuilder().build();
+   *   Finding response = securityCenterClient.setFindingState(name.toString(), state, startTime);
+   * }
+   * 
+ * + * @param name The relative resource name of the finding. See: + * https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: + * "organizations/123/sources/456/finding/789". + * @param state The desired State of the finding. + * @param startTime The time at which the updated state takes effect. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Finding setFindingState(String name, Finding.State state, Timestamp startTime) { + + SetFindingStateRequest request = + SetFindingStateRequest.newBuilder() + .setName(name) + .setState(state) + .setStartTime(startTime) + .build(); + return setFindingState(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the state of a finding. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]");
+   *   Finding.State state = Finding.State.STATE_UNSPECIFIED;
+   *   Timestamp startTime = Timestamp.newBuilder().build();
+   *   SetFindingStateRequest request = SetFindingStateRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setState(state)
+   *     .setStartTime(startTime)
+   *     .build();
+   *   Finding response = securityCenterClient.setFindingState(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Finding setFindingState(SetFindingStateRequest request) { + return setFindingStateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the state of a finding. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]");
+   *   Finding.State state = Finding.State.STATE_UNSPECIFIED;
+   *   Timestamp startTime = Timestamp.newBuilder().build();
+   *   SetFindingStateRequest request = SetFindingStateRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setState(state)
+   *     .setStartTime(startTime)
+   *     .build();
+   *   ApiFuture<Finding> future = securityCenterClient.setFindingStateCallable().futureCall(request);
+   *   // Do something
+   *   Finding response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable setFindingStateCallable() { + return stub.setFindingStateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified Source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = securityCenterClient.setIamPolicy(resource, policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. `resource` is + * usually specified as a path. For example, a Project resource is specified as + * `projects/{project}`. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SourceName resource, Policy policy) { + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setPolicy(policy) + .build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified Source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = securityCenterClient.setIamPolicy(resource.toString(), policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. `resource` is + * usually specified as a path. For example, a Project resource is specified as + * `projects/{project}`. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource, Policy policy) { + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified Source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   ResourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   Policy response = securityCenterClient.setIamPolicy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified Source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   ResourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   ApiFuture<Policy> future = securityCenterClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the permissions that a caller has on the specified source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = securityCenterClient.testIamPermissions(resource, permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. + * `resource` is usually specified as a path. For example, a Project resource is specified as + * `projects/{project}`. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + SourceName resource, List permissions) { + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the permissions that a caller has on the specified source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = securityCenterClient.testIamPermissions(resource.toString(), permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. + * `resource` is usually specified as a path. For example, a Project resource is specified as + * `projects/{project}`. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the permissions that a caller has on the specified source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   ResourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   TestIamPermissionsResponse response = securityCenterClient.testIamPermissions(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the permissions that a caller has on the specified source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   ResourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   ApiFuture<TestIamPermissionsResponse> future = securityCenterClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates or updates a finding. The corresponding source must exist for a finding creation to + * succeed. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   Finding finding = Finding.newBuilder().build();
+   *   Finding response = securityCenterClient.updateFinding(finding);
+   * }
+   * 
+ * + * @param finding The finding resource to update or create if it does not already exist. parent, + * security_marks, and update_time will be ignored. + *

In the case of creation, the finding id portion of the name must be alphanumeric and + * less than or equal to 32 characters and greater than 0 characters in length. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Finding updateFinding(Finding finding) { + + UpdateFindingRequest request = UpdateFindingRequest.newBuilder().setFinding(finding).build(); + return updateFinding(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates or updates a finding. The corresponding source must exist for a finding creation to + * succeed. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   Finding finding = Finding.newBuilder().build();
+   *   UpdateFindingRequest request = UpdateFindingRequest.newBuilder()
+   *     .setFinding(finding)
+   *     .build();
+   *   Finding response = securityCenterClient.updateFinding(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Finding updateFinding(UpdateFindingRequest request) { + return updateFindingCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates or updates a finding. The corresponding source must exist for a finding creation to + * succeed. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   Finding finding = Finding.newBuilder().build();
+   *   UpdateFindingRequest request = UpdateFindingRequest.newBuilder()
+   *     .setFinding(finding)
+   *     .build();
+   *   ApiFuture<Finding> future = securityCenterClient.updateFindingCallable().futureCall(request);
+   *   // Do something
+   *   Finding response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateFindingCallable() { + return stub.updateFindingCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an organization's settings. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build();
+   *   OrganizationSettings response = securityCenterClient.updateOrganizationSettings(organizationSettings);
+   * }
+   * 
+ * + * @param organizationSettings The organization settings resource to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OrganizationSettings updateOrganizationSettings( + OrganizationSettings organizationSettings) { + + UpdateOrganizationSettingsRequest request = + UpdateOrganizationSettingsRequest.newBuilder() + .setOrganizationSettings(organizationSettings) + .build(); + return updateOrganizationSettings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an organization's settings. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build();
+   *   UpdateOrganizationSettingsRequest request = UpdateOrganizationSettingsRequest.newBuilder()
+   *     .setOrganizationSettings(organizationSettings)
+   *     .build();
+   *   OrganizationSettings response = securityCenterClient.updateOrganizationSettings(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OrganizationSettings updateOrganizationSettings( + UpdateOrganizationSettingsRequest request) { + return updateOrganizationSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an organization's settings. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build();
+   *   UpdateOrganizationSettingsRequest request = UpdateOrganizationSettingsRequest.newBuilder()
+   *     .setOrganizationSettings(organizationSettings)
+   *     .build();
+   *   ApiFuture<OrganizationSettings> future = securityCenterClient.updateOrganizationSettingsCallable().futureCall(request);
+   *   // Do something
+   *   OrganizationSettings response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateOrganizationSettingsCallable() { + return stub.updateOrganizationSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   Source source = Source.newBuilder().build();
+   *   Source response = securityCenterClient.updateSource(source);
+   * }
+   * 
+ * + * @param source The source resource to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Source updateSource(Source source) { + + UpdateSourceRequest request = UpdateSourceRequest.newBuilder().setSource(source).build(); + return updateSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   Source source = Source.newBuilder().build();
+   *   UpdateSourceRequest request = UpdateSourceRequest.newBuilder()
+   *     .setSource(source)
+   *     .build();
+   *   Source response = securityCenterClient.updateSource(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Source updateSource(UpdateSourceRequest request) { + return updateSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a source. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   Source source = Source.newBuilder().build();
+   *   UpdateSourceRequest request = UpdateSourceRequest.newBuilder()
+   *     .setSource(source)
+   *     .build();
+   *   ApiFuture<Source> future = securityCenterClient.updateSourceCallable().futureCall(request);
+   *   // Do something
+   *   Source response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateSourceCallable() { + return stub.updateSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates security marks. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SecurityMarks securityMarks = SecurityMarks.newBuilder().build();
+   *   SecurityMarks response = securityCenterClient.updateSecurityMarks(securityMarks);
+   * }
+   * 
+ * + * @param securityMarks The security marks resource to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SecurityMarks updateSecurityMarks(SecurityMarks securityMarks) { + + UpdateSecurityMarksRequest request = + UpdateSecurityMarksRequest.newBuilder().setSecurityMarks(securityMarks).build(); + return updateSecurityMarks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates security marks. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SecurityMarks securityMarks = SecurityMarks.newBuilder().build();
+   *   UpdateSecurityMarksRequest request = UpdateSecurityMarksRequest.newBuilder()
+   *     .setSecurityMarks(securityMarks)
+   *     .build();
+   *   SecurityMarks response = securityCenterClient.updateSecurityMarks(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SecurityMarks updateSecurityMarks(UpdateSecurityMarksRequest request) { + return updateSecurityMarksCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates security marks. + * + *

Sample code: + * + *


+   * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+   *   SecurityMarks securityMarks = SecurityMarks.newBuilder().build();
+   *   UpdateSecurityMarksRequest request = UpdateSecurityMarksRequest.newBuilder()
+   *     .setSecurityMarks(securityMarks)
+   *     .build();
+   *   ApiFuture<SecurityMarks> future = securityCenterClient.updateSecurityMarksCallable().futureCall(request);
+   *   // Do something
+   *   SecurityMarks response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + updateSecurityMarksCallable() { + return stub.updateSecurityMarksCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class GroupAssetsPagedResponse + extends AbstractPagedListResponse< + GroupAssetsRequest, + GroupAssetsResponse, + GroupResult, + GroupAssetsPage, + GroupAssetsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + GroupAssetsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public GroupAssetsPagedResponse apply(GroupAssetsPage input) { + return new GroupAssetsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private GroupAssetsPagedResponse(GroupAssetsPage page) { + super(page, GroupAssetsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class GroupAssetsPage + extends AbstractPage { + + private GroupAssetsPage( + PageContext context, + GroupAssetsResponse response) { + super(context, response); + } + + private static GroupAssetsPage createEmptyPage() { + return new GroupAssetsPage(null, null); + } + + @Override + protected GroupAssetsPage createPage( + PageContext context, + GroupAssetsResponse response) { + return new GroupAssetsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class GroupAssetsFixedSizeCollection + extends AbstractFixedSizeCollection< + GroupAssetsRequest, + GroupAssetsResponse, + GroupResult, + GroupAssetsPage, + GroupAssetsFixedSizeCollection> { + + private GroupAssetsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static GroupAssetsFixedSizeCollection createEmptyCollection() { + return new GroupAssetsFixedSizeCollection(null, 0); + } + + @Override + protected GroupAssetsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new GroupAssetsFixedSizeCollection(pages, collectionSize); + } + } + + public static class GroupFindingsPagedResponse + extends AbstractPagedListResponse< + GroupFindingsRequest, + GroupFindingsResponse, + GroupResult, + GroupFindingsPage, + GroupFindingsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + GroupFindingsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public GroupFindingsPagedResponse apply(GroupFindingsPage input) { + return new GroupFindingsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private GroupFindingsPagedResponse(GroupFindingsPage page) { + super(page, GroupFindingsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class GroupFindingsPage + extends AbstractPage< + GroupFindingsRequest, GroupFindingsResponse, GroupResult, GroupFindingsPage> { + + private GroupFindingsPage( + PageContext context, + GroupFindingsResponse response) { + super(context, response); + } + + private static GroupFindingsPage createEmptyPage() { + return new GroupFindingsPage(null, null); + } + + @Override + protected GroupFindingsPage createPage( + PageContext context, + GroupFindingsResponse response) { + return new GroupFindingsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class GroupFindingsFixedSizeCollection + extends AbstractFixedSizeCollection< + GroupFindingsRequest, + GroupFindingsResponse, + GroupResult, + GroupFindingsPage, + GroupFindingsFixedSizeCollection> { + + private GroupFindingsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static GroupFindingsFixedSizeCollection createEmptyCollection() { + return new GroupFindingsFixedSizeCollection(null, 0); + } + + @Override + protected GroupFindingsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new GroupFindingsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListAssetsPagedResponse + extends AbstractPagedListResponse< + ListAssetsRequest, + ListAssetsResponse, + ListAssetsResponse.ListAssetsResult, + ListAssetsPage, + ListAssetsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAssetsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListAssetsPagedResponse apply(ListAssetsPage input) { + return new ListAssetsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListAssetsPagedResponse(ListAssetsPage page) { + super(page, ListAssetsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAssetsPage + extends AbstractPage< + ListAssetsRequest, + ListAssetsResponse, + ListAssetsResponse.ListAssetsResult, + ListAssetsPage> { + + private ListAssetsPage( + PageContext + context, + ListAssetsResponse response) { + super(context, response); + } + + private static ListAssetsPage createEmptyPage() { + return new ListAssetsPage(null, null); + } + + @Override + protected ListAssetsPage createPage( + PageContext + context, + ListAssetsResponse response) { + return new ListAssetsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAssetsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAssetsRequest, + ListAssetsResponse, + ListAssetsResponse.ListAssetsResult, + ListAssetsPage, + ListAssetsFixedSizeCollection> { + + private ListAssetsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAssetsFixedSizeCollection createEmptyCollection() { + return new ListAssetsFixedSizeCollection(null, 0); + } + + @Override + protected ListAssetsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAssetsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListFindingsPagedResponse + extends AbstractPagedListResponse< + ListFindingsRequest, + ListFindingsResponse, + ListFindingsResponse.ListFindingsResult, + ListFindingsPage, + ListFindingsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListFindingsRequest, ListFindingsResponse, ListFindingsResponse.ListFindingsResult> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListFindingsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListFindingsPagedResponse apply(ListFindingsPage input) { + return new ListFindingsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListFindingsPagedResponse(ListFindingsPage page) { + super(page, ListFindingsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListFindingsPage + extends AbstractPage< + ListFindingsRequest, + ListFindingsResponse, + ListFindingsResponse.ListFindingsResult, + ListFindingsPage> { + + private ListFindingsPage( + PageContext< + ListFindingsRequest, ListFindingsResponse, ListFindingsResponse.ListFindingsResult> + context, + ListFindingsResponse response) { + super(context, response); + } + + private static ListFindingsPage createEmptyPage() { + return new ListFindingsPage(null, null); + } + + @Override + protected ListFindingsPage createPage( + PageContext< + ListFindingsRequest, ListFindingsResponse, ListFindingsResponse.ListFindingsResult> + context, + ListFindingsResponse response) { + return new ListFindingsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListFindingsRequest, ListFindingsResponse, ListFindingsResponse.ListFindingsResult> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListFindingsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListFindingsRequest, + ListFindingsResponse, + ListFindingsResponse.ListFindingsResult, + ListFindingsPage, + ListFindingsFixedSizeCollection> { + + private ListFindingsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListFindingsFixedSizeCollection createEmptyCollection() { + return new ListFindingsFixedSizeCollection(null, 0); + } + + @Override + protected ListFindingsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListFindingsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSourcesPagedResponse + extends AbstractPagedListResponse< + ListSourcesRequest, + ListSourcesResponse, + Source, + ListSourcesPage, + ListSourcesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSourcesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListSourcesPagedResponse apply(ListSourcesPage input) { + return new ListSourcesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListSourcesPagedResponse(ListSourcesPage page) { + super(page, ListSourcesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSourcesPage + extends AbstractPage { + + private ListSourcesPage( + PageContext context, + ListSourcesResponse response) { + super(context, response); + } + + private static ListSourcesPage createEmptyPage() { + return new ListSourcesPage(null, null); + } + + @Override + protected ListSourcesPage createPage( + PageContext context, + ListSourcesResponse response) { + return new ListSourcesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSourcesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSourcesRequest, + ListSourcesResponse, + Source, + ListSourcesPage, + ListSourcesFixedSizeCollection> { + + private ListSourcesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSourcesFixedSizeCollection createEmptyCollection() { + return new ListSourcesFixedSizeCollection(null, 0); + } + + @Override + protected ListSourcesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSourcesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterSettings.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterSettings.java new file mode 100644 index 000000000000..6505e59bb948 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterSettings.java @@ -0,0 +1,399 @@ +/* + * Copyright 2019 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.v1; + +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListSourcesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.securitycenter.v1.stub.SecurityCenterStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link SecurityCenterClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (securitycenter.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of createSource to 30 seconds: + * + *

+ * 
+ * SecurityCenterSettings.Builder securityCenterSettingsBuilder =
+ *     SecurityCenterSettings.newBuilder();
+ * securityCenterSettingsBuilder.createSourceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * SecurityCenterSettings securityCenterSettings = securityCenterSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class SecurityCenterSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createSource. */ + public UnaryCallSettings createSourceSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).createSourceSettings(); + } + + /** Returns the object with the settings used for calls to createFinding. */ + public UnaryCallSettings createFindingSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).createFindingSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((SecurityCenterStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getOrganizationSettings. */ + public UnaryCallSettings + getOrganizationSettingsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).getOrganizationSettingsSettings(); + } + + /** Returns the object with the settings used for calls to getSource. */ + public UnaryCallSettings getSourceSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).getSourceSettings(); + } + + /** Returns the object with the settings used for calls to groupAssets. */ + public PagedCallSettings + groupAssetsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).groupAssetsSettings(); + } + + /** Returns the object with the settings used for calls to groupFindings. */ + public PagedCallSettings + groupFindingsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).groupFindingsSettings(); + } + + /** Returns the object with the settings used for calls to listAssets. */ + public PagedCallSettings + listAssetsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).listAssetsSettings(); + } + + /** Returns the object with the settings used for calls to listFindings. */ + public PagedCallSettings + listFindingsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).listFindingsSettings(); + } + + /** Returns the object with the settings used for calls to listSources. */ + public PagedCallSettings + listSourcesSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).listSourcesSettings(); + } + + /** Returns the object with the settings used for calls to runAssetDiscovery. */ + public UnaryCallSettings runAssetDiscoverySettings() { + return ((SecurityCenterStubSettings) getStubSettings()).runAssetDiscoverySettings(); + } + + /** Returns the object with the settings used for calls to runAssetDiscovery. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + runAssetDiscoveryOperationSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).runAssetDiscoveryOperationSettings(); + } + + /** Returns the object with the settings used for calls to setFindingState. */ + public UnaryCallSettings setFindingStateSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).setFindingStateSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((SecurityCenterStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + /** Returns the object with the settings used for calls to updateFinding. */ + public UnaryCallSettings updateFindingSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).updateFindingSettings(); + } + + /** Returns the object with the settings used for calls to updateOrganizationSettings. */ + public UnaryCallSettings + updateOrganizationSettingsSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).updateOrganizationSettingsSettings(); + } + + /** Returns the object with the settings used for calls to updateSource. */ + public UnaryCallSettings updateSourceSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).updateSourceSettings(); + } + + /** Returns the object with the settings used for calls to updateSecurityMarks. */ + public UnaryCallSettings + updateSecurityMarksSettings() { + return ((SecurityCenterStubSettings) getStubSettings()).updateSecurityMarksSettings(); + } + + public static final SecurityCenterSettings create(SecurityCenterStubSettings stub) + throws IOException { + return new SecurityCenterSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SecurityCenterStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SecurityCenterStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SecurityCenterStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SecurityCenterStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SecurityCenterStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SecurityCenterStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SecurityCenterStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SecurityCenterSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SecurityCenterSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(SecurityCenterStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(SecurityCenterStubSettings.newBuilder()); + } + + protected Builder(SecurityCenterSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SecurityCenterStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public SecurityCenterStubSettings.Builder getStubSettingsBuilder() { + return ((SecurityCenterStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createSource. */ + public UnaryCallSettings.Builder createSourceSettings() { + return getStubSettingsBuilder().createSourceSettings(); + } + + /** Returns the builder for the settings used for calls to createFinding. */ + public UnaryCallSettings.Builder createFindingSettings() { + return getStubSettingsBuilder().createFindingSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getOrganizationSettings. */ + public UnaryCallSettings.Builder + getOrganizationSettingsSettings() { + return getStubSettingsBuilder().getOrganizationSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to getSource. */ + public UnaryCallSettings.Builder getSourceSettings() { + return getStubSettingsBuilder().getSourceSettings(); + } + + /** Returns the builder for the settings used for calls to groupAssets. */ + public PagedCallSettings.Builder< + GroupAssetsRequest, GroupAssetsResponse, GroupAssetsPagedResponse> + groupAssetsSettings() { + return getStubSettingsBuilder().groupAssetsSettings(); + } + + /** Returns the builder for the settings used for calls to groupFindings. */ + public PagedCallSettings.Builder< + GroupFindingsRequest, GroupFindingsResponse, GroupFindingsPagedResponse> + groupFindingsSettings() { + return getStubSettingsBuilder().groupFindingsSettings(); + } + + /** Returns the builder for the settings used for calls to listAssets. */ + public PagedCallSettings.Builder + listAssetsSettings() { + return getStubSettingsBuilder().listAssetsSettings(); + } + + /** Returns the builder for the settings used for calls to listFindings. */ + public PagedCallSettings.Builder< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + listFindingsSettings() { + return getStubSettingsBuilder().listFindingsSettings(); + } + + /** Returns the builder for the settings used for calls to listSources. */ + public PagedCallSettings.Builder< + ListSourcesRequest, ListSourcesResponse, ListSourcesPagedResponse> + listSourcesSettings() { + return getStubSettingsBuilder().listSourcesSettings(); + } + + /** Returns the builder for the settings used for calls to runAssetDiscovery. */ + public UnaryCallSettings.Builder + runAssetDiscoverySettings() { + return getStubSettingsBuilder().runAssetDiscoverySettings(); + } + + /** Returns the builder for the settings used for calls to runAssetDiscovery. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + runAssetDiscoveryOperationSettings() { + return getStubSettingsBuilder().runAssetDiscoveryOperationSettings(); + } + + /** Returns the builder for the settings used for calls to setFindingState. */ + public UnaryCallSettings.Builder setFindingStateSettings() { + return getStubSettingsBuilder().setFindingStateSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + /** Returns the builder for the settings used for calls to updateFinding. */ + public UnaryCallSettings.Builder updateFindingSettings() { + return getStubSettingsBuilder().updateFindingSettings(); + } + + /** Returns the builder for the settings used for calls to updateOrganizationSettings. */ + public UnaryCallSettings.Builder + updateOrganizationSettingsSettings() { + return getStubSettingsBuilder().updateOrganizationSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to updateSource. */ + public UnaryCallSettings.Builder updateSourceSettings() { + return getStubSettingsBuilder().updateSourceSettings(); + } + + /** Returns the builder for the settings used for calls to updateSecurityMarks. */ + public UnaryCallSettings.Builder + updateSecurityMarksSettings() { + return getStubSettingsBuilder().updateSecurityMarksSettings(); + } + + @Override + public SecurityCenterSettings build() throws IOException { + return new SecurityCenterSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/package-info.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/package-info.java new file mode 100644 index 000000000000..61ff121ef5b9 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/package-info.java @@ -0,0 +1,38 @@ +/* + * Copyright 2019 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. + */ + +/** + * A client to Cloud Security Command Center API. + * + *

The interfaces provided are listed below, along with usage samples. + * + *

==================== SecurityCenterClient ==================== + * + *

Service Description: V1 APIs for Security Center service. + * + *

Sample for SecurityCenterClient: + * + *

+ * 
+ * try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
+ *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ *   Source source = Source.newBuilder().build();
+ *   Source response = securityCenterClient.createSource(parent, source);
+ * }
+ * 
+ * 
+ */ +package com.google.cloud.securitycenter.v1; diff --git a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/GrpcSecurityCenterCallableFactory.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/GrpcSecurityCenterCallableFactory.java new file mode 100644 index 000000000000..f60f41dea5fa --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/GrpcSecurityCenterCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 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.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Cloud Security Command Center API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcSecurityCenterCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/GrpcSecurityCenterStub.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/GrpcSecurityCenterStub.java new file mode 100644 index 000000000000..6a0226581b62 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/GrpcSecurityCenterStub.java @@ -0,0 +1,620 @@ +/* + * Copyright 2019 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.v1.stub; + +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListSourcesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.securitycenter.v1.CreateFindingRequest; +import com.google.cloud.securitycenter.v1.CreateSourceRequest; +import com.google.cloud.securitycenter.v1.Finding; +import com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1.GetSourceRequest; +import com.google.cloud.securitycenter.v1.GroupAssetsRequest; +import com.google.cloud.securitycenter.v1.GroupAssetsResponse; +import com.google.cloud.securitycenter.v1.GroupFindingsRequest; +import com.google.cloud.securitycenter.v1.GroupFindingsResponse; +import com.google.cloud.securitycenter.v1.ListAssetsRequest; +import com.google.cloud.securitycenter.v1.ListAssetsResponse; +import com.google.cloud.securitycenter.v1.ListFindingsRequest; +import com.google.cloud.securitycenter.v1.ListFindingsResponse; +import com.google.cloud.securitycenter.v1.ListSourcesRequest; +import com.google.cloud.securitycenter.v1.ListSourcesResponse; +import com.google.cloud.securitycenter.v1.OrganizationSettings; +import com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; +import com.google.cloud.securitycenter.v1.SecurityMarks; +import com.google.cloud.securitycenter.v1.SetFindingStateRequest; +import com.google.cloud.securitycenter.v1.Source; +import com.google.cloud.securitycenter.v1.UpdateFindingRequest; +import com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; +import com.google.cloud.securitycenter.v1.UpdateSourceRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Cloud Security Command Center API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcSecurityCenterStub extends SecurityCenterStub { + + private static final MethodDescriptor createSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/CreateSource") + .setRequestMarshaller(ProtoUtils.marshaller(CreateSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Source.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createFindingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/CreateFinding") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateFindingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Finding.getDefaultInstance())) + .build(); + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getOrganizationSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter/GetOrganizationSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(GetOrganizationSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(OrganizationSettings.getDefaultInstance())) + .build(); + private static final MethodDescriptor getSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/GetSource") + .setRequestMarshaller(ProtoUtils.marshaller(GetSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Source.getDefaultInstance())) + .build(); + private static final MethodDescriptor + groupAssetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/GroupAssets") + .setRequestMarshaller(ProtoUtils.marshaller(GroupAssetsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GroupAssetsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + groupFindingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/GroupFindings") + .setRequestMarshaller( + ProtoUtils.marshaller(GroupFindingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GroupFindingsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listAssetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/ListAssets") + .setRequestMarshaller(ProtoUtils.marshaller(ListAssetsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListAssetsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listFindingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/ListFindings") + .setRequestMarshaller(ProtoUtils.marshaller(ListFindingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListFindingsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listSourcesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/ListSources") + .setRequestMarshaller(ProtoUtils.marshaller(ListSourcesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSourcesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + runAssetDiscoveryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/RunAssetDiscovery") + .setRequestMarshaller( + ProtoUtils.marshaller(RunAssetDiscoveryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + setFindingStateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/SetFindingState") + .setRequestMarshaller( + ProtoUtils.marshaller(SetFindingStateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Finding.getDefaultInstance())) + .build(); + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateFindingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/UpdateFinding") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateFindingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Finding.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateOrganizationSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter/UpdateOrganizationSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateOrganizationSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(OrganizationSettings.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securitycenter.v1.SecurityCenter/UpdateSource") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Source.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateSecurityMarksMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securitycenter.v1.SecurityCenter/UpdateSecurityMarks") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateSecurityMarksRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SecurityMarks.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable createSourceCallable; + private final UnaryCallable createFindingCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + getOrganizationSettingsCallable; + private final UnaryCallable getSourceCallable; + private final UnaryCallable groupAssetsCallable; + private final UnaryCallable + groupAssetsPagedCallable; + private final UnaryCallable groupFindingsCallable; + private final UnaryCallable + groupFindingsPagedCallable; + private final UnaryCallable listAssetsCallable; + private final UnaryCallable listAssetsPagedCallable; + private final UnaryCallable listFindingsCallable; + private final UnaryCallable + listFindingsPagedCallable; + private final UnaryCallable listSourcesCallable; + private final UnaryCallable + listSourcesPagedCallable; + private final UnaryCallable runAssetDiscoveryCallable; + private final OperationCallable + runAssetDiscoveryOperationCallable; + private final UnaryCallable setFindingStateCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + private final UnaryCallable updateFindingCallable; + private final UnaryCallable + updateOrganizationSettingsCallable; + private final UnaryCallable updateSourceCallable; + private final UnaryCallable + updateSecurityMarksCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSecurityCenterStub create(SecurityCenterStubSettings settings) + throws IOException { + return new GrpcSecurityCenterStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSecurityCenterStub create(ClientContext clientContext) + throws IOException { + return new GrpcSecurityCenterStub( + SecurityCenterStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSecurityCenterStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSecurityCenterStub( + SecurityCenterStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSecurityCenterStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcSecurityCenterStub(SecurityCenterStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSecurityCenterCallableFactory()); + } + + /** + * Constructs an instance of GrpcSecurityCenterStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcSecurityCenterStub( + SecurityCenterStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSourceMethodDescriptor) + .build(); + GrpcCallSettings createFindingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createFindingMethodDescriptor) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .build(); + GrpcCallSettings + getOrganizationSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getOrganizationSettingsMethodDescriptor) + .build(); + GrpcCallSettings getSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSourceMethodDescriptor) + .build(); + GrpcCallSettings groupAssetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(groupAssetsMethodDescriptor) + .build(); + GrpcCallSettings groupFindingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(groupFindingsMethodDescriptor) + .build(); + GrpcCallSettings listAssetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAssetsMethodDescriptor) + .build(); + GrpcCallSettings listFindingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFindingsMethodDescriptor) + .build(); + GrpcCallSettings listSourcesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSourcesMethodDescriptor) + .build(); + GrpcCallSettings runAssetDiscoveryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(runAssetDiscoveryMethodDescriptor) + .build(); + GrpcCallSettings setFindingStateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setFindingStateMethodDescriptor) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .build(); + GrpcCallSettings updateFindingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateFindingMethodDescriptor) + .build(); + GrpcCallSettings + updateOrganizationSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateOrganizationSettingsMethodDescriptor) + .build(); + GrpcCallSettings updateSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSourceMethodDescriptor) + .build(); + GrpcCallSettings + updateSecurityMarksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSecurityMarksMethodDescriptor) + .build(); + + this.createSourceCallable = + callableFactory.createUnaryCallable( + createSourceTransportSettings, settings.createSourceSettings(), clientContext); + this.createFindingCallable = + callableFactory.createUnaryCallable( + createFindingTransportSettings, settings.createFindingSettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.getOrganizationSettingsCallable = + callableFactory.createUnaryCallable( + getOrganizationSettingsTransportSettings, + settings.getOrganizationSettingsSettings(), + clientContext); + this.getSourceCallable = + callableFactory.createUnaryCallable( + getSourceTransportSettings, settings.getSourceSettings(), clientContext); + this.groupAssetsCallable = + callableFactory.createUnaryCallable( + groupAssetsTransportSettings, settings.groupAssetsSettings(), clientContext); + this.groupAssetsPagedCallable = + callableFactory.createPagedCallable( + groupAssetsTransportSettings, settings.groupAssetsSettings(), clientContext); + this.groupFindingsCallable = + callableFactory.createUnaryCallable( + groupFindingsTransportSettings, settings.groupFindingsSettings(), clientContext); + this.groupFindingsPagedCallable = + callableFactory.createPagedCallable( + groupFindingsTransportSettings, settings.groupFindingsSettings(), clientContext); + this.listAssetsCallable = + callableFactory.createUnaryCallable( + listAssetsTransportSettings, settings.listAssetsSettings(), clientContext); + this.listAssetsPagedCallable = + callableFactory.createPagedCallable( + listAssetsTransportSettings, settings.listAssetsSettings(), clientContext); + this.listFindingsCallable = + callableFactory.createUnaryCallable( + listFindingsTransportSettings, settings.listFindingsSettings(), clientContext); + this.listFindingsPagedCallable = + callableFactory.createPagedCallable( + listFindingsTransportSettings, settings.listFindingsSettings(), clientContext); + this.listSourcesCallable = + callableFactory.createUnaryCallable( + listSourcesTransportSettings, settings.listSourcesSettings(), clientContext); + this.listSourcesPagedCallable = + callableFactory.createPagedCallable( + listSourcesTransportSettings, settings.listSourcesSettings(), clientContext); + this.runAssetDiscoveryCallable = + callableFactory.createUnaryCallable( + runAssetDiscoveryTransportSettings, + settings.runAssetDiscoverySettings(), + clientContext); + this.runAssetDiscoveryOperationCallable = + callableFactory.createOperationCallable( + runAssetDiscoveryTransportSettings, + settings.runAssetDiscoveryOperationSettings(), + clientContext, + this.operationsStub); + this.setFindingStateCallable = + callableFactory.createUnaryCallable( + setFindingStateTransportSettings, settings.setFindingStateSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + this.updateFindingCallable = + callableFactory.createUnaryCallable( + updateFindingTransportSettings, settings.updateFindingSettings(), clientContext); + this.updateOrganizationSettingsCallable = + callableFactory.createUnaryCallable( + updateOrganizationSettingsTransportSettings, + settings.updateOrganizationSettingsSettings(), + clientContext); + this.updateSourceCallable = + callableFactory.createUnaryCallable( + updateSourceTransportSettings, settings.updateSourceSettings(), clientContext); + this.updateSecurityMarksCallable = + callableFactory.createUnaryCallable( + updateSecurityMarksTransportSettings, + settings.updateSecurityMarksSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable createSourceCallable() { + return createSourceCallable; + } + + public UnaryCallable createFindingCallable() { + return createFindingCallable; + } + + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + public UnaryCallable + getOrganizationSettingsCallable() { + return getOrganizationSettingsCallable; + } + + public UnaryCallable getSourceCallable() { + return getSourceCallable; + } + + public UnaryCallable groupAssetsPagedCallable() { + return groupAssetsPagedCallable; + } + + public UnaryCallable groupAssetsCallable() { + return groupAssetsCallable; + } + + public UnaryCallable + groupFindingsPagedCallable() { + return groupFindingsPagedCallable; + } + + public UnaryCallable groupFindingsCallable() { + return groupFindingsCallable; + } + + public UnaryCallable listAssetsPagedCallable() { + return listAssetsPagedCallable; + } + + public UnaryCallable listAssetsCallable() { + return listAssetsCallable; + } + + public UnaryCallable listFindingsPagedCallable() { + return listFindingsPagedCallable; + } + + public UnaryCallable listFindingsCallable() { + return listFindingsCallable; + } + + public UnaryCallable listSourcesPagedCallable() { + return listSourcesPagedCallable; + } + + public UnaryCallable listSourcesCallable() { + return listSourcesCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + runAssetDiscoveryOperationCallable() { + return runAssetDiscoveryOperationCallable; + } + + public UnaryCallable runAssetDiscoveryCallable() { + return runAssetDiscoveryCallable; + } + + public UnaryCallable setFindingStateCallable() { + return setFindingStateCallable; + } + + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + public UnaryCallable updateFindingCallable() { + return updateFindingCallable; + } + + public UnaryCallable + updateOrganizationSettingsCallable() { + return updateOrganizationSettingsCallable; + } + + public UnaryCallable updateSourceCallable() { + return updateSourceCallable; + } + + public UnaryCallable updateSecurityMarksCallable() { + return updateSecurityMarksCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/SecurityCenterStub.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/SecurityCenterStub.java new file mode 100644 index 000000000000..111898d24834 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/SecurityCenterStub.java @@ -0,0 +1,183 @@ +/* + * Copyright 2019 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.v1.stub; + +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListSourcesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.securitycenter.v1.CreateFindingRequest; +import com.google.cloud.securitycenter.v1.CreateSourceRequest; +import com.google.cloud.securitycenter.v1.Finding; +import com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1.GetSourceRequest; +import com.google.cloud.securitycenter.v1.GroupAssetsRequest; +import com.google.cloud.securitycenter.v1.GroupAssetsResponse; +import com.google.cloud.securitycenter.v1.GroupFindingsRequest; +import com.google.cloud.securitycenter.v1.GroupFindingsResponse; +import com.google.cloud.securitycenter.v1.ListAssetsRequest; +import com.google.cloud.securitycenter.v1.ListAssetsResponse; +import com.google.cloud.securitycenter.v1.ListFindingsRequest; +import com.google.cloud.securitycenter.v1.ListFindingsResponse; +import com.google.cloud.securitycenter.v1.ListSourcesRequest; +import com.google.cloud.securitycenter.v1.ListSourcesResponse; +import com.google.cloud.securitycenter.v1.OrganizationSettings; +import com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; +import com.google.cloud.securitycenter.v1.SecurityMarks; +import com.google.cloud.securitycenter.v1.SetFindingStateRequest; +import com.google.cloud.securitycenter.v1.Source; +import com.google.cloud.securitycenter.v1.UpdateFindingRequest; +import com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; +import com.google.cloud.securitycenter.v1.UpdateSourceRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Cloud Security Command Center API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class SecurityCenterStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable createSourceCallable() { + throw new UnsupportedOperationException("Not implemented: createSourceCallable()"); + } + + public UnaryCallable createFindingCallable() { + throw new UnsupportedOperationException("Not implemented: createFindingCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + getOrganizationSettingsCallable() { + throw new UnsupportedOperationException("Not implemented: getOrganizationSettingsCallable()"); + } + + public UnaryCallable getSourceCallable() { + throw new UnsupportedOperationException("Not implemented: getSourceCallable()"); + } + + public UnaryCallable groupAssetsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: groupAssetsPagedCallable()"); + } + + public UnaryCallable groupAssetsCallable() { + throw new UnsupportedOperationException("Not implemented: groupAssetsCallable()"); + } + + public UnaryCallable + groupFindingsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: groupFindingsPagedCallable()"); + } + + public UnaryCallable groupFindingsCallable() { + throw new UnsupportedOperationException("Not implemented: groupFindingsCallable()"); + } + + public UnaryCallable listAssetsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAssetsPagedCallable()"); + } + + public UnaryCallable listAssetsCallable() { + throw new UnsupportedOperationException("Not implemented: listAssetsCallable()"); + } + + public UnaryCallable listFindingsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listFindingsPagedCallable()"); + } + + public UnaryCallable listFindingsCallable() { + throw new UnsupportedOperationException("Not implemented: listFindingsCallable()"); + } + + public UnaryCallable listSourcesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSourcesPagedCallable()"); + } + + public UnaryCallable listSourcesCallable() { + throw new UnsupportedOperationException("Not implemented: listSourcesCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + runAssetDiscoveryOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: runAssetDiscoveryOperationCallable()"); + } + + public UnaryCallable runAssetDiscoveryCallable() { + throw new UnsupportedOperationException("Not implemented: runAssetDiscoveryCallable()"); + } + + public UnaryCallable setFindingStateCallable() { + throw new UnsupportedOperationException("Not implemented: setFindingStateCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + public UnaryCallable updateFindingCallable() { + throw new UnsupportedOperationException("Not implemented: updateFindingCallable()"); + } + + public UnaryCallable + updateOrganizationSettingsCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateOrganizationSettingsCallable()"); + } + + public UnaryCallable updateSourceCallable() { + throw new UnsupportedOperationException("Not implemented: updateSourceCallable()"); + } + + public UnaryCallable updateSecurityMarksCallable() { + throw new UnsupportedOperationException("Not implemented: updateSecurityMarksCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/SecurityCenterStubSettings.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/SecurityCenterStubSettings.java new file mode 100644 index 000000000000..e753a999c2d2 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/stub/SecurityCenterStubSettings.java @@ -0,0 +1,1082 @@ +/* + * Copyright 2019 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.v1.stub; + +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListSourcesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.securitycenter.v1.CreateFindingRequest; +import com.google.cloud.securitycenter.v1.CreateSourceRequest; +import com.google.cloud.securitycenter.v1.Finding; +import com.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1.GetSourceRequest; +import com.google.cloud.securitycenter.v1.GroupAssetsRequest; +import com.google.cloud.securitycenter.v1.GroupAssetsResponse; +import com.google.cloud.securitycenter.v1.GroupFindingsRequest; +import com.google.cloud.securitycenter.v1.GroupFindingsResponse; +import com.google.cloud.securitycenter.v1.GroupResult; +import com.google.cloud.securitycenter.v1.ListAssetsRequest; +import com.google.cloud.securitycenter.v1.ListAssetsResponse; +import com.google.cloud.securitycenter.v1.ListFindingsRequest; +import com.google.cloud.securitycenter.v1.ListFindingsResponse; +import com.google.cloud.securitycenter.v1.ListSourcesRequest; +import com.google.cloud.securitycenter.v1.ListSourcesResponse; +import com.google.cloud.securitycenter.v1.OrganizationSettings; +import com.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest; +import com.google.cloud.securitycenter.v1.SecurityMarks; +import com.google.cloud.securitycenter.v1.SetFindingStateRequest; +import com.google.cloud.securitycenter.v1.Source; +import com.google.cloud.securitycenter.v1.UpdateFindingRequest; +import com.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest; +import com.google.cloud.securitycenter.v1.UpdateSourceRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link SecurityCenterStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (securitycenter.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of createSource to 30 seconds: + * + *

+ * 
+ * SecurityCenterStubSettings.Builder securityCenterSettingsBuilder =
+ *     SecurityCenterStubSettings.newBuilder();
+ * securityCenterSettingsBuilder.createSourceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * SecurityCenterStubSettings securityCenterSettings = securityCenterSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class SecurityCenterStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createSourceSettings; + private final UnaryCallSettings createFindingSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + getOrganizationSettingsSettings; + private final UnaryCallSettings getSourceSettings; + private final PagedCallSettings + groupAssetsSettings; + private final PagedCallSettings< + GroupFindingsRequest, GroupFindingsResponse, GroupFindingsPagedResponse> + groupFindingsSettings; + private final PagedCallSettings + listAssetsSettings; + private final PagedCallSettings< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + listFindingsSettings; + private final PagedCallSettings + listSourcesSettings; + private final UnaryCallSettings runAssetDiscoverySettings; + private final OperationCallSettings + runAssetDiscoveryOperationSettings; + private final UnaryCallSettings setFindingStateSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + private final UnaryCallSettings updateFindingSettings; + private final UnaryCallSettings + updateOrganizationSettingsSettings; + private final UnaryCallSettings updateSourceSettings; + private final UnaryCallSettings + updateSecurityMarksSettings; + + /** Returns the object with the settings used for calls to createSource. */ + public UnaryCallSettings createSourceSettings() { + return createSourceSettings; + } + + /** Returns the object with the settings used for calls to createFinding. */ + public UnaryCallSettings createFindingSettings() { + return createFindingSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getOrganizationSettings. */ + public UnaryCallSettings + getOrganizationSettingsSettings() { + return getOrganizationSettingsSettings; + } + + /** Returns the object with the settings used for calls to getSource. */ + public UnaryCallSettings getSourceSettings() { + return getSourceSettings; + } + + /** Returns the object with the settings used for calls to groupAssets. */ + public PagedCallSettings + groupAssetsSettings() { + return groupAssetsSettings; + } + + /** Returns the object with the settings used for calls to groupFindings. */ + public PagedCallSettings + groupFindingsSettings() { + return groupFindingsSettings; + } + + /** Returns the object with the settings used for calls to listAssets. */ + public PagedCallSettings + listAssetsSettings() { + return listAssetsSettings; + } + + /** Returns the object with the settings used for calls to listFindings. */ + public PagedCallSettings + listFindingsSettings() { + return listFindingsSettings; + } + + /** Returns the object with the settings used for calls to listSources. */ + public PagedCallSettings + listSourcesSettings() { + return listSourcesSettings; + } + + /** Returns the object with the settings used for calls to runAssetDiscovery. */ + public UnaryCallSettings runAssetDiscoverySettings() { + return runAssetDiscoverySettings; + } + + /** Returns the object with the settings used for calls to runAssetDiscovery. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + runAssetDiscoveryOperationSettings() { + return runAssetDiscoveryOperationSettings; + } + + /** Returns the object with the settings used for calls to setFindingState. */ + public UnaryCallSettings setFindingStateSettings() { + return setFindingStateSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + /** Returns the object with the settings used for calls to updateFinding. */ + public UnaryCallSettings updateFindingSettings() { + return updateFindingSettings; + } + + /** Returns the object with the settings used for calls to updateOrganizationSettings. */ + public UnaryCallSettings + updateOrganizationSettingsSettings() { + return updateOrganizationSettingsSettings; + } + + /** Returns the object with the settings used for calls to updateSource. */ + public UnaryCallSettings updateSourceSettings() { + return updateSourceSettings; + } + + /** Returns the object with the settings used for calls to updateSecurityMarks. */ + public UnaryCallSettings + updateSecurityMarksSettings() { + return updateSecurityMarksSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SecurityCenterStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSecurityCenterStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "securitycenter.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SecurityCenterStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SecurityCenterStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSourceSettings = settingsBuilder.createSourceSettings().build(); + createFindingSettings = settingsBuilder.createFindingSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + getOrganizationSettingsSettings = settingsBuilder.getOrganizationSettingsSettings().build(); + getSourceSettings = settingsBuilder.getSourceSettings().build(); + groupAssetsSettings = settingsBuilder.groupAssetsSettings().build(); + groupFindingsSettings = settingsBuilder.groupFindingsSettings().build(); + listAssetsSettings = settingsBuilder.listAssetsSettings().build(); + listFindingsSettings = settingsBuilder.listFindingsSettings().build(); + listSourcesSettings = settingsBuilder.listSourcesSettings().build(); + runAssetDiscoverySettings = settingsBuilder.runAssetDiscoverySettings().build(); + runAssetDiscoveryOperationSettings = + settingsBuilder.runAssetDiscoveryOperationSettings().build(); + setFindingStateSettings = settingsBuilder.setFindingStateSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + updateFindingSettings = settingsBuilder.updateFindingSettings().build(); + updateOrganizationSettingsSettings = + settingsBuilder.updateOrganizationSettingsSettings().build(); + updateSourceSettings = settingsBuilder.updateSourceSettings().build(); + updateSecurityMarksSettings = settingsBuilder.updateSecurityMarksSettings().build(); + } + + private static final PagedListDescriptor + GROUP_ASSETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public GroupAssetsRequest injectToken(GroupAssetsRequest payload, String token) { + return GroupAssetsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public GroupAssetsRequest injectPageSize(GroupAssetsRequest payload, int pageSize) { + return GroupAssetsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(GroupAssetsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(GroupAssetsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(GroupAssetsResponse payload) { + return payload.getGroupByResultsList() != null + ? payload.getGroupByResultsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor + GROUP_FINDINGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public GroupFindingsRequest injectToken(GroupFindingsRequest payload, String token) { + return GroupFindingsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public GroupFindingsRequest injectPageSize(GroupFindingsRequest payload, int pageSize) { + return GroupFindingsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(GroupFindingsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(GroupFindingsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(GroupFindingsResponse payload) { + return payload.getGroupByResultsList() != null + ? payload.getGroupByResultsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListAssetsRequest, ListAssetsResponse, ListAssetsResponse.ListAssetsResult> + LIST_ASSETS_PAGE_STR_DESC = + new PagedListDescriptor< + ListAssetsRequest, ListAssetsResponse, ListAssetsResponse.ListAssetsResult>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAssetsRequest injectToken(ListAssetsRequest payload, String token) { + return ListAssetsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAssetsRequest injectPageSize(ListAssetsRequest payload, int pageSize) { + return ListAssetsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAssetsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAssetsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListAssetsResponse payload) { + return payload.getListAssetsResultsList() != null + ? payload.getListAssetsResultsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListFindingsRequest, ListFindingsResponse, ListFindingsResponse.ListFindingsResult> + LIST_FINDINGS_PAGE_STR_DESC = + new PagedListDescriptor< + ListFindingsRequest, + ListFindingsResponse, + ListFindingsResponse.ListFindingsResult>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListFindingsRequest injectToken(ListFindingsRequest payload, String token) { + return ListFindingsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListFindingsRequest injectPageSize(ListFindingsRequest payload, int pageSize) { + return ListFindingsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListFindingsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListFindingsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListFindingsResponse payload) { + return payload.getListFindingsResultsList() != null + ? payload.getListFindingsResultsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor + LIST_SOURCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSourcesRequest injectToken(ListSourcesRequest payload, String token) { + return ListSourcesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSourcesRequest injectPageSize(ListSourcesRequest payload, int pageSize) { + return ListSourcesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSourcesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSourcesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSourcesResponse payload) { + return payload.getSourcesList() != null + ? payload.getSourcesList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + GroupAssetsRequest, GroupAssetsResponse, GroupAssetsPagedResponse> + GROUP_ASSETS_PAGE_STR_FACT = + new PagedListResponseFactory< + GroupAssetsRequest, GroupAssetsResponse, GroupAssetsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + GroupAssetsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, GROUP_ASSETS_PAGE_STR_DESC, request, context); + return GroupAssetsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + GroupFindingsRequest, GroupFindingsResponse, GroupFindingsPagedResponse> + GROUP_FINDINGS_PAGE_STR_FACT = + new PagedListResponseFactory< + GroupFindingsRequest, GroupFindingsResponse, GroupFindingsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + GroupFindingsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, GROUP_FINDINGS_PAGE_STR_DESC, request, context); + return GroupFindingsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse> + LIST_ASSETS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAssetsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListAssetsRequest, ListAssetsResponse, ListAssetsResponse.ListAssetsResult> + pageContext = + PageContext.create(callable, LIST_ASSETS_PAGE_STR_DESC, request, context); + return ListAssetsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + LIST_FINDINGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFindingsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListFindingsRequest, + ListFindingsResponse, + ListFindingsResponse.ListFindingsResult> + pageContext = + PageContext.create(callable, LIST_FINDINGS_PAGE_STR_DESC, request, context); + return ListFindingsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListSourcesRequest, ListSourcesResponse, ListSourcesPagedResponse> + LIST_SOURCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSourcesRequest, ListSourcesResponse, ListSourcesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSourcesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SOURCES_PAGE_STR_DESC, request, context); + return ListSourcesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for SecurityCenterStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder createSourceSettings; + private final UnaryCallSettings.Builder createFindingSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + getOrganizationSettingsSettings; + private final UnaryCallSettings.Builder getSourceSettings; + private final PagedCallSettings.Builder< + GroupAssetsRequest, GroupAssetsResponse, GroupAssetsPagedResponse> + groupAssetsSettings; + private final PagedCallSettings.Builder< + GroupFindingsRequest, GroupFindingsResponse, GroupFindingsPagedResponse> + groupFindingsSettings; + private final PagedCallSettings.Builder< + ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse> + listAssetsSettings; + private final PagedCallSettings.Builder< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + listFindingsSettings; + private final PagedCallSettings.Builder< + ListSourcesRequest, ListSourcesResponse, ListSourcesPagedResponse> + listSourcesSettings; + private final UnaryCallSettings.Builder + runAssetDiscoverySettings; + private final OperationCallSettings.Builder + runAssetDiscoveryOperationSettings; + private final UnaryCallSettings.Builder + setFindingStateSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private final UnaryCallSettings.Builder updateFindingSettings; + private final UnaryCallSettings.Builder + updateOrganizationSettingsSettings; + private final UnaryCallSettings.Builder updateSourceSettings; + private final UnaryCallSettings.Builder + updateSecurityMarksSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createFindingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getOrganizationSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + groupAssetsSettings = PagedCallSettings.newBuilder(GROUP_ASSETS_PAGE_STR_FACT); + + groupFindingsSettings = PagedCallSettings.newBuilder(GROUP_FINDINGS_PAGE_STR_FACT); + + listAssetsSettings = PagedCallSettings.newBuilder(LIST_ASSETS_PAGE_STR_FACT); + + listFindingsSettings = PagedCallSettings.newBuilder(LIST_FINDINGS_PAGE_STR_FACT); + + listSourcesSettings = PagedCallSettings.newBuilder(LIST_SOURCES_PAGE_STR_FACT); + + runAssetDiscoverySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + runAssetDiscoveryOperationSettings = OperationCallSettings.newBuilder(); + + setFindingStateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateFindingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateOrganizationSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateSecurityMarksSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSourceSettings, + createFindingSettings, + getIamPolicySettings, + getOrganizationSettingsSettings, + getSourceSettings, + groupAssetsSettings, + groupFindingsSettings, + listAssetsSettings, + listFindingsSettings, + listSourcesSettings, + runAssetDiscoverySettings, + setFindingStateSettings, + setIamPolicySettings, + testIamPermissionsSettings, + updateFindingSettings, + updateOrganizationSettingsSettings, + updateSourceSettings, + updateSecurityMarksSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createFindingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getOrganizationSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .groupAssetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .groupFindingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listAssetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listFindingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listSourcesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .runAssetDiscoverySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .setFindingStateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateFindingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateOrganizationSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateSecurityMarksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .runAssetDiscoveryOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(Empty.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + protected Builder(SecurityCenterStubSettings settings) { + super(settings); + + createSourceSettings = settings.createSourceSettings.toBuilder(); + createFindingSettings = settings.createFindingSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + getOrganizationSettingsSettings = settings.getOrganizationSettingsSettings.toBuilder(); + getSourceSettings = settings.getSourceSettings.toBuilder(); + groupAssetsSettings = settings.groupAssetsSettings.toBuilder(); + groupFindingsSettings = settings.groupFindingsSettings.toBuilder(); + listAssetsSettings = settings.listAssetsSettings.toBuilder(); + listFindingsSettings = settings.listFindingsSettings.toBuilder(); + listSourcesSettings = settings.listSourcesSettings.toBuilder(); + runAssetDiscoverySettings = settings.runAssetDiscoverySettings.toBuilder(); + runAssetDiscoveryOperationSettings = settings.runAssetDiscoveryOperationSettings.toBuilder(); + setFindingStateSettings = settings.setFindingStateSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + updateFindingSettings = settings.updateFindingSettings.toBuilder(); + updateOrganizationSettingsSettings = settings.updateOrganizationSettingsSettings.toBuilder(); + updateSourceSettings = settings.updateSourceSettings.toBuilder(); + updateSecurityMarksSettings = settings.updateSecurityMarksSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSourceSettings, + createFindingSettings, + getIamPolicySettings, + getOrganizationSettingsSettings, + getSourceSettings, + groupAssetsSettings, + groupFindingsSettings, + listAssetsSettings, + listFindingsSettings, + listSourcesSettings, + runAssetDiscoverySettings, + setFindingStateSettings, + setIamPolicySettings, + testIamPermissionsSettings, + updateFindingSettings, + updateOrganizationSettingsSettings, + updateSourceSettings, + updateSecurityMarksSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createSource. */ + public UnaryCallSettings.Builder createSourceSettings() { + return createSourceSettings; + } + + /** Returns the builder for the settings used for calls to createFinding. */ + public UnaryCallSettings.Builder createFindingSettings() { + return createFindingSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getOrganizationSettings. */ + public UnaryCallSettings.Builder + getOrganizationSettingsSettings() { + return getOrganizationSettingsSettings; + } + + /** Returns the builder for the settings used for calls to getSource. */ + public UnaryCallSettings.Builder getSourceSettings() { + return getSourceSettings; + } + + /** Returns the builder for the settings used for calls to groupAssets. */ + public PagedCallSettings.Builder< + GroupAssetsRequest, GroupAssetsResponse, GroupAssetsPagedResponse> + groupAssetsSettings() { + return groupAssetsSettings; + } + + /** Returns the builder for the settings used for calls to groupFindings. */ + public PagedCallSettings.Builder< + GroupFindingsRequest, GroupFindingsResponse, GroupFindingsPagedResponse> + groupFindingsSettings() { + return groupFindingsSettings; + } + + /** Returns the builder for the settings used for calls to listAssets. */ + public PagedCallSettings.Builder + listAssetsSettings() { + return listAssetsSettings; + } + + /** Returns the builder for the settings used for calls to listFindings. */ + public PagedCallSettings.Builder< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + listFindingsSettings() { + return listFindingsSettings; + } + + /** Returns the builder for the settings used for calls to listSources. */ + public PagedCallSettings.Builder< + ListSourcesRequest, ListSourcesResponse, ListSourcesPagedResponse> + listSourcesSettings() { + return listSourcesSettings; + } + + /** Returns the builder for the settings used for calls to runAssetDiscovery. */ + public UnaryCallSettings.Builder + runAssetDiscoverySettings() { + return runAssetDiscoverySettings; + } + + /** Returns the builder for the settings used for calls to runAssetDiscovery. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + runAssetDiscoveryOperationSettings() { + return runAssetDiscoveryOperationSettings; + } + + /** Returns the builder for the settings used for calls to setFindingState. */ + public UnaryCallSettings.Builder setFindingStateSettings() { + return setFindingStateSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + /** Returns the builder for the settings used for calls to updateFinding. */ + public UnaryCallSettings.Builder updateFindingSettings() { + return updateFindingSettings; + } + + /** Returns the builder for the settings used for calls to updateOrganizationSettings. */ + public UnaryCallSettings.Builder + updateOrganizationSettingsSettings() { + return updateOrganizationSettingsSettings; + } + + /** Returns the builder for the settings used for calls to updateSource. */ + public UnaryCallSettings.Builder updateSourceSettings() { + return updateSourceSettings; + } + + /** Returns the builder for the settings used for calls to updateSecurityMarks. */ + public UnaryCallSettings.Builder + updateSecurityMarksSettings() { + return updateSecurityMarksSettings; + } + + @Override + public SecurityCenterStubSettings build() throws IOException { + return new SecurityCenterStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1/MockSecurityCenter.java b/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1/MockSecurityCenter.java new file mode 100644 index 000000000000..0b288e179bf5 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1/MockSecurityCenter.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 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.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockSecurityCenter implements MockGrpcService { + private final MockSecurityCenterImpl serviceImpl; + + public MockSecurityCenter() { + serviceImpl = new MockSecurityCenterImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(GeneratedMessageV3 response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1/MockSecurityCenterImpl.java b/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1/MockSecurityCenterImpl.java new file mode 100644 index 000000000000..a3390dc944c5 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1/MockSecurityCenterImpl.java @@ -0,0 +1,332 @@ +/* + * Copyright 2019 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.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.securitycenter.v1.SecurityCenterGrpc.SecurityCenterImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockSecurityCenterImpl extends SecurityCenterImplBase { + private ArrayList requests; + private Queue responses; + + public MockSecurityCenterImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(GeneratedMessageV3 response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createSource(CreateSourceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Source) { + requests.add(request); + responseObserver.onNext((Source) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createFinding( + CreateFindingRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Finding) { + requests.add(request); + responseObserver.onNext((Finding) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getOrganizationSettings( + GetOrganizationSettingsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof OrganizationSettings) { + requests.add(request); + responseObserver.onNext((OrganizationSettings) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getSource(GetSourceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Source) { + requests.add(request); + responseObserver.onNext((Source) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void groupAssets( + GroupAssetsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof GroupAssetsResponse) { + requests.add(request); + responseObserver.onNext((GroupAssetsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void groupFindings( + GroupFindingsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof GroupFindingsResponse) { + requests.add(request); + responseObserver.onNext((GroupFindingsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listAssets( + ListAssetsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListAssetsResponse) { + requests.add(request); + responseObserver.onNext((ListAssetsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listFindings( + ListFindingsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListFindingsResponse) { + requests.add(request); + responseObserver.onNext((ListFindingsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listSources( + ListSourcesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListSourcesResponse) { + requests.add(request); + responseObserver.onNext((ListSourcesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void runAssetDiscovery( + RunAssetDiscoveryRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void setFindingState( + SetFindingStateRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Finding) { + requests.add(request); + responseObserver.onNext((Finding) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext((TestIamPermissionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateFinding( + UpdateFindingRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Finding) { + requests.add(request); + responseObserver.onNext((Finding) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateOrganizationSettings( + UpdateOrganizationSettingsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof OrganizationSettings) { + requests.add(request); + responseObserver.onNext((OrganizationSettings) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateSource(UpdateSourceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Source) { + requests.add(request); + responseObserver.onNext((Source) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateSecurityMarks( + UpdateSecurityMarksRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof SecurityMarks) { + requests.add(request); + responseObserver.onNext((SecurityMarks) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1/SecurityCenterClientTest.java b/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1/SecurityCenterClientTest.java new file mode 100644 index 000000000000..cc563616f1c3 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1/SecurityCenterClientTest.java @@ -0,0 +1,795 @@ +/* + * Copyright 2019 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.v1; + +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1.SecurityCenterClient.ListSourcesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.GeneratedMessageV3; +import com.google.protobuf.Timestamp; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class SecurityCenterClientTest { + private static MockSecurityCenter mockSecurityCenter; + private static MockServiceHelper serviceHelper; + private SecurityCenterClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockSecurityCenter = new MockSecurityCenter(); + serviceHelper = + new MockServiceHelper("in-process-1", Arrays.asList(mockSecurityCenter)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + SecurityCenterSettings settings = + SecurityCenterSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SecurityCenterClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createSourceTest() { + String name = "name3373707"; + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Source expectedResponse = + Source.newBuilder() + .setName(name) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + Source source = Source.newBuilder().build(); + + Source actualResponse = client.createSource(parent, source); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSourceRequest actualRequest = (CreateSourceRequest) actualRequests.get(0); + + Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + Source source = Source.newBuilder().build(); + + client.createSource(parent, source); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createFindingTest() { + String name = "name3373707"; + String parent2 = "parent21175163357"; + String resourceName = "resourceName979421212"; + String category = "category50511102"; + String externalUri = "externalUri-1385596168"; + Finding expectedResponse = + Finding.newBuilder() + .setName(name) + .setParent(parent2) + .setResourceName(resourceName) + .setCategory(category) + .setExternalUri(externalUri) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + String findingId = "findingId728776081"; + Finding finding = Finding.newBuilder().build(); + + Finding actualResponse = client.createFinding(parent, findingId, finding); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFindingRequest actualRequest = (CreateFindingRequest) actualRequests.get(0); + + Assert.assertEquals(parent, SourceName.parse(actualRequest.getParent())); + Assert.assertEquals(findingId, actualRequest.getFindingId()); + Assert.assertEquals(finding, actualRequest.getFinding()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createFindingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + String findingId = "findingId728776081"; + Finding finding = Finding.newBuilder().build(); + + client.createFinding(parent, findingId, finding); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockSecurityCenter.addResponse(expectedResponse); + + SourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = (GetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getOrganizationSettingsTest() { + String name2 = "name2-1052831874"; + boolean enableAssetDiscovery = false; + OrganizationSettings expectedResponse = + OrganizationSettings.newBuilder() + .setName(name2) + .setEnableAssetDiscovery(enableAssetDiscovery) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]"); + + OrganizationSettings actualResponse = client.getOrganizationSettings(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetOrganizationSettingsRequest actualRequest = + (GetOrganizationSettingsRequest) actualRequests.get(0); + + Assert.assertEquals(name, OrganizationSettingsName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getOrganizationSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]"); + + client.getOrganizationSettings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getSourceTest() { + String name2 = "name2-1052831874"; + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Source expectedResponse = + Source.newBuilder() + .setName(name2) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + + Source actualResponse = client.getSource(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSourceRequest actualRequest = (GetSourceRequest) actualRequests.get(0); + + Assert.assertEquals(name, SourceName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + + client.getSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void groupFindingsTest() { + String nextPageToken = ""; + int totalSize = 705419236; + GroupResult groupByResultsElement = GroupResult.newBuilder().build(); + List groupByResults = Arrays.asList(groupByResultsElement); + GroupFindingsResponse expectedResponse = + GroupFindingsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .setTotalSize(totalSize) + .addAllGroupByResults(groupByResults) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + String groupBy = "groupBy506361367"; + + GroupFindingsPagedResponse pagedListResponse = client.groupFindings(parent, groupBy); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getGroupByResultsList().get(0), resources.get(0)); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GroupFindingsRequest actualRequest = (GroupFindingsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, SourceName.parse(actualRequest.getParent())); + Assert.assertEquals(groupBy, actualRequest.getGroupBy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void groupFindingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + String groupBy = "groupBy506361367"; + + client.groupFindings(parent, groupBy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listSourcesTest() { + String nextPageToken = ""; + Source sourcesElement = Source.newBuilder().build(); + List sources = Arrays.asList(sourcesElement); + ListSourcesResponse expectedResponse = + ListSourcesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllSources(sources) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + ListSourcesPagedResponse pagedListResponse = client.listSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSourcesList().get(0), resources.get(0)); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSourcesRequest actualRequest = (ListSourcesRequest) actualRequests.get(0); + + Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listSourcesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + client.listSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void runAssetDiscoveryTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("runAssetDiscoveryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityCenter.addResponse(resultOperation); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + Empty actualResponse = client.runAssetDiscoveryAsync(parent).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RunAssetDiscoveryRequest actualRequest = (RunAssetDiscoveryRequest) actualRequests.get(0); + + Assert.assertEquals(parent, OrganizationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void runAssetDiscoveryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + client.runAssetDiscoveryAsync(parent).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void setFindingStateTest() { + String name2 = "name2-1052831874"; + String parent = "parent-995424086"; + String resourceName = "resourceName979421212"; + String category = "category50511102"; + String externalUri = "externalUri-1385596168"; + Finding expectedResponse = + Finding.newBuilder() + .setName(name2) + .setParent(parent) + .setResourceName(resourceName) + .setCategory(category) + .setExternalUri(externalUri) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]"); + Finding.State state = Finding.State.STATE_UNSPECIFIED; + Timestamp startTime = Timestamp.newBuilder().build(); + + Finding actualResponse = client.setFindingState(name, state, startTime); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetFindingStateRequest actualRequest = (SetFindingStateRequest) actualRequests.get(0); + + Assert.assertEquals(name, FindingName.parse(actualRequest.getName())); + Assert.assertEquals(state, actualRequest.getState()); + Assert.assertEquals(startTime, actualRequest.getStartTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void setFindingStateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]"); + Finding.State state = Finding.State.STATE_UNSPECIFIED; + Timestamp startTime = Timestamp.newBuilder().build(); + + client.setFindingState(name, state, startTime); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockSecurityCenter.addResponse(expectedResponse); + + SourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = (SetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + Policy policy = Policy.newBuilder().build(); + + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsTest() { + TestIamPermissionsResponse expectedResponse = TestIamPermissionsResponse.newBuilder().build(); + mockSecurityCenter.addResponse(expectedResponse); + + SourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = (TestIamPermissionsRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SourceName resource = SourceName.of("[ORGANIZATION]", "[SOURCE]"); + List permissions = new ArrayList<>(); + + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateFindingTest() { + String name = "name3373707"; + String parent = "parent-995424086"; + String resourceName = "resourceName979421212"; + String category = "category50511102"; + String externalUri = "externalUri-1385596168"; + Finding expectedResponse = + Finding.newBuilder() + .setName(name) + .setParent(parent) + .setResourceName(resourceName) + .setCategory(category) + .setExternalUri(externalUri) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + Finding finding = Finding.newBuilder().build(); + + Finding actualResponse = client.updateFinding(finding); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateFindingRequest actualRequest = (UpdateFindingRequest) actualRequests.get(0); + + Assert.assertEquals(finding, actualRequest.getFinding()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateFindingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + Finding finding = Finding.newBuilder().build(); + + client.updateFinding(finding); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateOrganizationSettingsTest() { + String name = "name3373707"; + boolean enableAssetDiscovery = false; + OrganizationSettings expectedResponse = + OrganizationSettings.newBuilder() + .setName(name) + .setEnableAssetDiscovery(enableAssetDiscovery) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build(); + + OrganizationSettings actualResponse = client.updateOrganizationSettings(organizationSettings); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateOrganizationSettingsRequest actualRequest = + (UpdateOrganizationSettingsRequest) actualRequests.get(0); + + Assert.assertEquals(organizationSettings, actualRequest.getOrganizationSettings()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateOrganizationSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build(); + + client.updateOrganizationSettings(organizationSettings); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateSourceTest() { + String name = "name3373707"; + String displayName = "displayName1615086568"; + String description = "description-1724546052"; + Source expectedResponse = + Source.newBuilder() + .setName(name) + .setDisplayName(displayName) + .setDescription(description) + .build(); + mockSecurityCenter.addResponse(expectedResponse); + + Source source = Source.newBuilder().build(); + + Source actualResponse = client.updateSource(source); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSourceRequest actualRequest = (UpdateSourceRequest) actualRequests.get(0); + + Assert.assertEquals(source, actualRequest.getSource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + Source source = Source.newBuilder().build(); + + client.updateSource(source); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateSecurityMarksTest() { + String name = "name3373707"; + SecurityMarks expectedResponse = SecurityMarks.newBuilder().setName(name).build(); + mockSecurityCenter.addResponse(expectedResponse); + + SecurityMarks securityMarks = SecurityMarks.newBuilder().build(); + + SecurityMarks actualResponse = client.updateSecurityMarks(securityMarks); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityCenter.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSecurityMarksRequest actualRequest = (UpdateSecurityMarksRequest) actualRequests.get(0); + + Assert.assertEquals(securityMarks, actualRequest.getSecurityMarks()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateSecurityMarksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSecurityCenter.addException(exception); + + try { + SecurityMarks securityMarks = SecurityMarks.newBuilder().build(); + + client.updateSecurityMarks(securityMarks); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-clients/google-cloud-securitycenter/synth.metadata b/google-cloud-clients/google-cloud-securitycenter/synth.metadata index c17ba15545b6..a3237ad51a27 100644 --- a/google-cloud-clients/google-cloud-securitycenter/synth.metadata +++ b/google-cloud-clients/google-cloud-securitycenter/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-03-06T08:50:50.672265Z", + "updateTime": "2019-03-07T21:20:30.007235Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "856117505ff9075b3e9c0b5674113667b6cf9e00", - "internalRef": "236931378" + "sha": "6df9a80f147c4349949f6573b5275deebddd3ba8", + "internalRef": "237262681" } } ], @@ -27,6 +27,16 @@ "generator": "gapic", "config": "google/cloud/securitycenter/artman_securitycenter_v1beta1.yaml" } + }, + { + "client": { + "source": "googleapis", + "apiName": "securitycenter", + "apiVersion": "v1", + "language": "java", + "generator": "gapic", + "config": "google/cloud/securitycenter/artman_securitycenter_v1.yaml" + } } ] } \ No newline at end of file diff --git a/google-cloud-clients/google-cloud-securitycenter/synth.py b/google-cloud-clients/google-cloud-securitycenter/synth.py index 6a8fa74779f2..a4fe60af5a12 100644 --- a/google-cloud-clients/google-cloud-securitycenter/synth.py +++ b/google-cloud-clients/google-cloud-securitycenter/synth.py @@ -21,7 +21,7 @@ gapic = gcp.GAPICGenerator() service = 'securitycenter' -versions = ['v1beta1'] +versions = ['v1beta1', 'v1'] config_pattern = '/google/cloud/securitycenter/artman_securitycenter_{version}.yaml' for version in versions: diff --git a/versions.txt b/versions.txt index b266c1583433..5efdde243746 100644 --- a/versions.txt +++ b/versions.txt @@ -91,6 +91,7 @@ grpc-google-cloud-redis-v1:0.47.0:0.47.1-SNAPSHOT grpc-google-cloud-redis-v1beta1:0.47.0:0.47.1-SNAPSHOT grpc-google-cloud-scheduler-v1beta1:0.47.0:0.47.1-SNAPSHOT grpc-google-cloud-securitycenter-v1beta1:0.47.0:0.47.1-SNAPSHOT +grpc-google-cloud-securitycenter-v1:0.47.0:0.47.1-SNAPSHOT grpc-google-cloud-spanner-admin-database-v1:1.9.0:1.9.1-SNAPSHOT grpc-google-cloud-spanner-admin-instance-v1:1.9.0:1.9.1-SNAPSHOT grpc-google-cloud-spanner-v1:1.9.0:1.9.1-SNAPSHOT @@ -144,6 +145,7 @@ proto-google-cloud-redis-v1:0.47.0:0.47.1-SNAPSHOT proto-google-cloud-redis-v1beta1:0.47.0:0.47.1-SNAPSHOT proto-google-cloud-scheduler-v1beta1:0.47.0:0.47.1-SNAPSHOT proto-google-cloud-securitycenter-v1beta1:0.47.0:0.47.1-SNAPSHOT +proto-google-cloud-securitycenter-v1:0.47.0:0.47.1-SNAPSHOT proto-google-cloud-spanner-admin-database-v1:1.9.0:1.9.1-SNAPSHOT proto-google-cloud-spanner-admin-instance-v1:1.9.0:1.9.1-SNAPSHOT proto-google-cloud-spanner-v1:1.9.0:1.9.1-SNAPSHOT From f984a2b23bd0f8603ac1098a96c81de3b32f3613 Mon Sep 17 00:00:00 2001 From: kolea2 Date: Fri, 8 Mar 2019 10:27:27 -0500 Subject: [PATCH 2/3] Add securitycenter to google-cloud-bom pom.xml --- google-cloud-bom/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index e7992f0a50a0..709d0a150f31 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -610,6 +610,11 @@ grpc-google-cloud-scheduler-v1beta1 0.47.1-SNAPSHOT + + com.google.cloud + google-cloud-securitycenter + 0.82.1-alpha-SNAPSHOT + com.google.api.grpc proto-google-cloud-securitycenter-v1beta1 From 6782a84f8c0ca4361f9186cc7b19ed456cfafb1b Mon Sep 17 00:00:00 2001 From: kolea2 Date: Fri, 8 Mar 2019 10:37:23 -0500 Subject: [PATCH 3/3] Fixing code format --- .../google/cloud/securitycenter/v1/ListAssetsResponse.java | 6 ++++-- .../cloud/securitycenter/v1/ListFindingsResponse.java | 6 ++++-- .../cloud/securitycenter/v1/OrganizationSettings.java | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsResponse.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsResponse.java index 399224aa67ec..0522e4f487f6 100644 --- a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsResponse.java +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListAssetsResponse.java @@ -571,7 +571,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io } if (stateChange_ != com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange - .UNUSED.getNumber()) { + .UNUSED + .getNumber()) { output.writeEnum(2, stateChange_); } unknownFields.writeTo(output); @@ -588,7 +589,8 @@ public int getSerializedSize() { } if (stateChange_ != com.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange - .UNUSED.getNumber()) { + .UNUSED + .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, stateChange_); } size += unknownFields.getSerializedSize(); diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsResponse.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsResponse.java index 34c9ca9b3abc..9d5653cd55b3 100644 --- a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsResponse.java +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/ListFindingsResponse.java @@ -604,7 +604,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io } if (stateChange_ != com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange - .UNUSED.getNumber()) { + .UNUSED + .getNumber()) { output.writeEnum(2, stateChange_); } unknownFields.writeTo(output); @@ -621,7 +622,8 @@ public int getSerializedSize() { } if (stateChange_ != com.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange - .UNUSED.getNumber()) { + .UNUSED + .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, stateChange_); } size += unknownFields.getSerializedSize(); diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettings.java b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettings.java index efc44c91a4d0..78e0966aadd6 100644 --- a/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettings.java +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1/src/main/java/com/google/cloud/securitycenter/v1/OrganizationSettings.java @@ -568,7 +568,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io } if (inclusionMode_ != com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - .InclusionMode.INCLUSION_MODE_UNSPECIFIED.getNumber()) { + .InclusionMode.INCLUSION_MODE_UNSPECIFIED + .getNumber()) { output.writeEnum(2, inclusionMode_); } unknownFields.writeTo(output); @@ -590,7 +591,8 @@ public int getSerializedSize() { } if (inclusionMode_ != com.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig - .InclusionMode.INCLUSION_MODE_UNSPECIFIED.getNumber()) { + .InclusionMode.INCLUSION_MODE_UNSPECIFIED + .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, inclusionMode_); } size += unknownFields.getSerializedSize();