diff --git a/google-api-grpc/grpc-google-cloud-securitycenter-v1beta1/pom.xml b/google-api-grpc/grpc-google-cloud-securitycenter-v1beta1/pom.xml new file mode 100644 index 000000000000..64011f63211a --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-securitycenter-v1beta1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + grpc-google-cloud-securitycenter-v1beta1 + 0.35.1-SNAPSHOT + grpc-google-cloud-securitycenter-v1beta1 + GRPC library for grpc-google-cloud-securitycenter-v1beta1 + + com.google.api.grpc + google-api-grpc + 0.35.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-securitycenter-v1beta1 + compile + + + diff --git a/google-api-grpc/grpc-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityCenterGrpc.java b/google-api-grpc/grpc-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityCenterGrpc.java new file mode 100644 index 000000000000..1490b7499083 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityCenterGrpc.java @@ -0,0 +1,1925 @@ +package com.google.cloud.securitycenter.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * V1 Beta APIs for Security Center service.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto") +public final class SecurityCenterGrpc { + + private SecurityCenterGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.securitycenter.v1beta1.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 METHOD_CREATE_SOURCE = getCreateSourceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateSourceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateSourceMethod() { + return getCreateSourceMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateSourceMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "CreateSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.CreateSourceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_CREATE_FINDING = getCreateFindingMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateFindingMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateFindingMethod() { + return getCreateFindingMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateFindingMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "CreateFinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.CreateFindingRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_GET_IAM_POLICY = getGetIamPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetIamPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetIamPolicyMethod() { + return getGetIamPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor 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.v1beta1.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 METHOD_GET_ORGANIZATION_SETTINGS = getGetOrganizationSettingsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetOrganizationSettingsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetOrganizationSettingsMethod() { + return getGetOrganizationSettingsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetOrganizationSettingsMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "GetOrganizationSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_GET_SOURCE = getGetSourceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetSourceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetSourceMethod() { + return getGetSourceMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetSourceMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "GetSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.GetSourceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_GROUP_ASSETS = getGroupAssetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGroupAssetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGroupAssetsMethod() { + return getGroupAssetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGroupAssetsMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "GroupAssets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_GROUP_FINDINGS = getGroupFindingsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGroupFindingsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGroupFindingsMethod() { + return getGroupFindingsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGroupFindingsMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "GroupFindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_LIST_ASSETS = getListAssetsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListAssetsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListAssetsMethod() { + return getListAssetsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListAssetsMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "ListAssets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.ListAssetsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_LIST_FINDINGS = getListFindingsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListFindingsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListFindingsMethod() { + return getListFindingsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListFindingsMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "ListFindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.ListFindingsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_LIST_SOURCES = getListSourcesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListSourcesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListSourcesMethod() { + return getListSourcesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListSourcesMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "ListSources")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.ListSourcesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_RUN_ASSET_DISCOVERY = getRunAssetDiscoveryMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getRunAssetDiscoveryMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getRunAssetDiscoveryMethod() { + return getRunAssetDiscoveryMethodHelper(); + } + + private static io.grpc.MethodDescriptor getRunAssetDiscoveryMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "RunAssetDiscovery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_SET_FINDING_STATE = getSetFindingStateMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getSetFindingStateMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getSetFindingStateMethod() { + return getSetFindingStateMethodHelper(); + } + + private static io.grpc.MethodDescriptor getSetFindingStateMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "SetFindingState")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_SET_IAM_POLICY = getSetIamPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getSetIamPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getSetIamPolicyMethod() { + return getSetIamPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor 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.v1beta1.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 METHOD_TEST_IAM_PERMISSIONS = getTestIamPermissionsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getTestIamPermissionsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getTestIamPermissionsMethod() { + return getTestIamPermissionsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getTestIamPermissionsMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.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 METHOD_UPDATE_FINDING = getUpdateFindingMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateFindingMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateFindingMethod() { + return getUpdateFindingMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateFindingMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "UpdateFinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_UPDATE_ORGANIZATION_SETTINGS = getUpdateOrganizationSettingsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateOrganizationSettingsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateOrganizationSettingsMethod() { + return getUpdateOrganizationSettingsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateOrganizationSettingsMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "UpdateOrganizationSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_UPDATE_SOURCE = getUpdateSourceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateSourceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateSourceMethod() { + return getUpdateSourceMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateSourceMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "UpdateSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 METHOD_UPDATE_SECURITY_MARKS = getUpdateSecurityMarksMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateSecurityMarksMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateSecurityMarksMethod() { + return getUpdateSecurityMarksMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateSecurityMarksMethodHelper() { + io.grpc.MethodDescriptor 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.v1beta1.SecurityCenter", "UpdateSecurityMarks")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securitycenter.v1beta1.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 Beta APIs for Security Center service.
+   * 
+ */ + public static abstract class SecurityCenterImplBase implements io.grpc.BindableService { + + /** + *
+     * Creates a source.
+     * 
+ */ + public void createSource(com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.GetOrganizationSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetOrganizationSettingsMethodHelper(), responseObserver); + } + + /** + *
+     * Gets a source.
+     * 
+ */ + public void getSource(com.google.cloud.securitycenter.v1beta1.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.v1beta1.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: /v1beta1/organizations/123/sources/-/findings
+     * 
+ */ + public void groupFindings(com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGroupFindingsMethodHelper(), responseObserver); + } + + /** + *
+     * Lists an organization's assets.
+     * 
+ */ + public void listAssets(com.google.cloud.securitycenter.v1beta1.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: /v1beta1/organizations/123/sources/-/findings
+     * 
+ */ + public void listFindings(com.google.cloud.securitycenter.v1beta1.ListFindingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListFindingsMethodHelper(), responseObserver); + } + + /** + *
+     * Lists all sources belonging to an organization.
+     * 
+ */ + public void listSources(com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getRunAssetDiscoveryMethodHelper(), responseObserver); + } + + /** + *
+     * Updates the state of a finding.
+     * 
+ */ + public void setFindingState(com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateFindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateFindingMethodHelper(), responseObserver); + } + + /** + *
+     * Updates an organization's settings.
+     * 
+ */ + public void updateOrganizationSettings(com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateOrganizationSettingsMethodHelper(), responseObserver); + } + + /** + *
+     * Updates a source.
+     * 
+ */ + public void updateSource(com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateSourceMethodHelper(), responseObserver); + } + + /** + *
+     * Updates security marks.
+     * 
+ */ + public void updateSecurityMarks(com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateSourceRequest, + com.google.cloud.securitycenter.v1beta1.Source>( + this, METHODID_CREATE_SOURCE))) + .addMethod( + getCreateFindingMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1beta1.CreateFindingRequest, + com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1beta1.OrganizationSettings>( + this, METHODID_GET_ORGANIZATION_SETTINGS))) + .addMethod( + getGetSourceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1beta1.GetSourceRequest, + com.google.cloud.securitycenter.v1beta1.Source>( + this, METHODID_GET_SOURCE))) + .addMethod( + getGroupAssetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest, + com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse>( + this, METHODID_GROUP_ASSETS))) + .addMethod( + getGroupFindingsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest, + com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse>( + this, METHODID_GROUP_FINDINGS))) + .addMethod( + getListAssetsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1beta1.ListAssetsRequest, + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse>( + this, METHODID_LIST_ASSETS))) + .addMethod( + getListFindingsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1beta1.ListFindingsRequest, + com.google.cloud.securitycenter.v1beta1.ListFindingsResponse>( + this, METHODID_LIST_FINDINGS))) + .addMethod( + getListSourcesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1beta1.ListSourcesRequest, + com.google.cloud.securitycenter.v1beta1.ListSourcesResponse>( + this, METHODID_LIST_SOURCES))) + .addMethod( + getRunAssetDiscoveryMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest, + com.google.longrunning.Operation>( + this, METHODID_RUN_ASSET_DISCOVERY))) + .addMethod( + getSetFindingStateMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest, + com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateFindingRequest, + com.google.cloud.securitycenter.v1beta1.Finding>( + this, METHODID_UPDATE_FINDING))) + .addMethod( + getUpdateOrganizationSettingsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest, + com.google.cloud.securitycenter.v1beta1.OrganizationSettings>( + this, METHODID_UPDATE_ORGANIZATION_SETTINGS))) + .addMethod( + getUpdateSourceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest, + com.google.cloud.securitycenter.v1beta1.Source>( + this, METHODID_UPDATE_SOURCE))) + .addMethod( + getUpdateSecurityMarksMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest, + com.google.cloud.securitycenter.v1beta1.SecurityMarks>( + this, METHODID_UPDATE_SECURITY_MARKS))) + .build(); + } + } + + /** + *
+   * V1 Beta 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.v1beta1.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.v1beta1.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.v1beta1.GetOrganizationSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetOrganizationSettingsMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets a source.
+     * 
+ */ + public void getSource(com.google.cloud.securitycenter.v1beta1.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.v1beta1.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: /v1beta1/organizations/123/sources/-/findings
+     * 
+ */ + public void groupFindings(com.google.cloud.securitycenter.v1beta1.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.v1beta1.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: /v1beta1/organizations/123/sources/-/findings
+     * 
+ */ + public void listFindings(com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.UpdateOrganizationSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateOrganizationSettingsMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Updates a source.
+     * 
+ */ + public void updateSource(com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateSourceMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Updates security marks.
+     * 
+ */ + public void updateSecurityMarks(com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateSecurityMarksMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * V1 Beta 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.v1beta1.Source createSource(com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding createFinding(com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings getOrganizationSettings(com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest request) { + return blockingUnaryCall( + getChannel(), getGetOrganizationSettingsMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets a source.
+     * 
+ */ + public com.google.cloud.securitycenter.v1beta1.Source getSource(com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupAssetsResponse groupAssets(com.google.cloud.securitycenter.v1beta1.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: /v1beta1/organizations/123/sources/-/findings
+     * 
+ */ + public com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse groupFindings(com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest request) { + return blockingUnaryCall( + getChannel(), getGroupFindingsMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists an organization's assets.
+     * 
+ */ + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse listAssets(com.google.cloud.securitycenter.v1beta1.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: /v1beta1/organizations/123/sources/-/findings
+     * 
+ */ + public com.google.cloud.securitycenter.v1beta1.ListFindingsResponse listFindings(com.google.cloud.securitycenter.v1beta1.ListFindingsRequest request) { + return blockingUnaryCall( + getChannel(), getListFindingsMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists all sources belonging to an organization.
+     * 
+ */ + public com.google.cloud.securitycenter.v1beta1.ListSourcesResponse listSources(com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest request) { + return blockingUnaryCall( + getChannel(), getRunAssetDiscoveryMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Updates the state of a finding.
+     * 
+ */ + public com.google.cloud.securitycenter.v1beta1.Finding setFindingState(com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding updateFinding(com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateFindingMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Updates an organization's settings.
+     * 
+ */ + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings updateOrganizationSettings(com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateOrganizationSettingsMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Updates a source.
+     * 
+ */ + public com.google.cloud.securitycenter.v1beta1.Source updateSource(com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateSourceMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Updates security marks.
+     * 
+ */ + public com.google.cloud.securitycenter.v1beta1.SecurityMarks updateSecurityMarks(com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateSecurityMarksMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+   * V1 Beta 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 createSource( + com.google.cloud.securitycenter.v1beta1.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 createFinding( + com.google.cloud.securitycenter.v1beta1.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 getOrganizationSettings( + com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetOrganizationSettingsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets a source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getSource( + com.google.cloud.securitycenter.v1beta1.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 groupAssets( + com.google.cloud.securitycenter.v1beta1.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: /v1beta1/organizations/123/sources/-/findings
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture groupFindings( + com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getGroupFindingsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists an organization's assets.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listAssets( + com.google.cloud.securitycenter.v1beta1.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: /v1beta1/organizations/123/sources/-/findings
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listFindings( + com.google.cloud.securitycenter.v1beta1.ListFindingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListFindingsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists all sources belonging to an organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listSources( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest request) { + return futureUnaryCall( + getChannel().newCall(getRunAssetDiscoveryMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Updates the state of a finding.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture setFindingState( + com.google.cloud.securitycenter.v1beta1.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 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 updateFinding( + com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateFindingMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Updates an organization's settings.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateOrganizationSettings( + com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateOrganizationSettingsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Updates a source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateSource( + com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateSourceMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Updates security marks.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateSecurityMarks( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateSourceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_FINDING: + serviceImpl.createFinding((com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetOrganizationSettingsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SOURCE: + serviceImpl.getSource((com.google.cloud.securitycenter.v1beta1.GetSourceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GROUP_ASSETS: + serviceImpl.groupAssets((com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GROUP_FINDINGS: + serviceImpl.groupFindings((com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_ASSETS: + serviceImpl.listAssets((com.google.cloud.securitycenter.v1beta1.ListAssetsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_FINDINGS: + serviceImpl.listFindings((com.google.cloud.securitycenter.v1beta1.ListFindingsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SOURCES: + serviceImpl.listSources((com.google.cloud.securitycenter.v1beta1.ListSourcesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RUN_ASSET_DISCOVERY: + serviceImpl.runAssetDiscovery((com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_FINDING_STATE: + serviceImpl.setFindingState((com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateFindingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_ORGANIZATION_SETTINGS: + serviceImpl.updateOrganizationSettings((com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SOURCE: + serviceImpl.updateSource((com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SECURITY_MARKS: + serviceImpl.updateSecurityMarks((com.google.cloud.securitycenter.v1beta1.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 static abstract 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.v1beta1.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 9b02f97275a1..063a64084329 100644 --- a/google-api-grpc/pom.xml +++ b/google-api-grpc/pom.xml @@ -606,6 +606,16 @@ grpc-google-cloud-iot-v1 0.35.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-securitycenter-v1beta1 + 0.35.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-securitycenter-v1beta1 + 0.35.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-websecurityscanner-v1alpha @@ -646,6 +656,7 @@ grpc-google-cloud-redis-v1beta1 grpc-google-cloud-redis-v1 grpc-google-cloud-scheduler-v1beta1 + grpc-google-cloud-securitycenter-v1beta1 grpc-google-cloud-spanner-admin-database-v1 grpc-google-cloud-spanner-admin-instance-v1 grpc-google-cloud-spanner-v1 @@ -696,6 +707,7 @@ proto-google-cloud-redis-v1beta1 proto-google-cloud-redis-v1 proto-google-cloud-scheduler-v1beta1 + proto-google-cloud-securitycenter-v1beta1 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-v1beta1/pom.xml b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/pom.xml new file mode 100644 index 000000000000..f46ab96069ed --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/pom.xml @@ -0,0 +1,36 @@ + + 4.0.0 + proto-google-cloud-securitycenter-v1beta1 + 0.35.1-SNAPSHOT + proto-google-cloud-securitycenter-v1beta1 + PROTO library for proto-google-cloud-securitycenter-v1beta1 + + com.google.api.grpc + google-api-grpc + 0.35.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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/Asset.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/Asset.java new file mode 100644 index 000000000000..0df3fc376448 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/Asset.java @@ -0,0 +1,3331 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/asset.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * 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.v1beta1.Asset} + */ +public final class Asset extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties.Builder subBuilder = null; + if (securityCenterProperties_ != null) { + subBuilder = securityCenterProperties_.toBuilder(); + } + securityCenterProperties_ = input.readMessage(com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks.Builder subBuilder = null; + if (securityMarks_ != null) { + subBuilder = securityMarks_.toBuilder(); + } + securityMarks_ = input.readMessage(com.google.cloud.securitycenter.v1beta1.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; + } + 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.v1beta1.AssetOuterClass.internal_static_google_cloud_securitycenter_v1beta1_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.v1beta1.AssetOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.Asset.class, com.google.cloud.securitycenter.v1beta1.Asset.Builder.class); + } + + public interface SecurityCenterPropertiesOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties} + */ + public static final class SecurityCenterProperties extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.AssetOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Asset_SecurityCenterProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.AssetOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Asset_SecurityCenterProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.class, com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.Asset.SecurityCenterProperties} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties) + com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterPropertiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.AssetOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Asset_SecurityCenterProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.AssetOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Asset_SecurityCenterProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.class, com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.AssetOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Asset_SecurityCenterProperties_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties build() { + com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties buildPartial() { + com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties) + private static final com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties 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.v1beta1.Asset.SecurityCenterProperties securityCenterProperties_; + /** + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + */ + public com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties getSecurityCenterProperties() { + return securityCenterProperties_ == null ? com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + */ + public com.google.cloud.securitycenter.v1beta1.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< + java.lang.String, com.google.protobuf.Value> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.securitycenter.v1beta1.AssetOuterClass.internal_static_google_cloud_securitycenter_v1beta1_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< + java.lang.String, com.google.protobuf.Value> 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.v1beta1.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.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1beta1.SecurityMarks getSecurityMarks() { + return securityMarks_ == null ? com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1beta1.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(); + } + + 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()); + } + 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()); + } + 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.v1beta1.Asset)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.Asset other = (com.google.cloud.securitycenter.v1beta1.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 && 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(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1beta1.Asset parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.Asset} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.Asset) + com.google.cloud.securitycenter.v1beta1.AssetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.AssetOuterClass.internal_static_google_cloud_securitycenter_v1beta1_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.v1beta1.AssetOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.Asset.class, com.google.cloud.securitycenter.v1beta1.Asset.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.securitycenter.v1beta1.AssetOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Asset_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.Asset getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.Asset.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.Asset build() { + com.google.cloud.securitycenter.v1beta1.Asset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.Asset buildPartial() { + com.google.cloud.securitycenter.v1beta1.Asset result = new com.google.cloud.securitycenter.v1beta1.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(); + } + 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.v1beta1.Asset) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.Asset)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.Asset other) { + if (other == com.google.cloud.securitycenter.v1beta1.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()); + } + 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.v1beta1.Asset parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties securityCenterProperties_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties, com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.Builder, com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterPropertiesOrBuilder> securityCenterPropertiesBuilder_; + /** + *
+     * Cloud SCC managed properties. These properties are managed by
+     * Cloud SCC and cannot be modified by the user.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + */ + public com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties getSecurityCenterProperties() { + if (securityCenterPropertiesBuilder_ == null) { + return securityCenterProperties_ == null ? com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + */ + public Builder setSecurityCenterProperties(com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + */ + public Builder setSecurityCenterProperties( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + */ + public Builder mergeSecurityCenterProperties(com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties value) { + if (securityCenterPropertiesBuilder_ == null) { + if (securityCenterProperties_ != null) { + securityCenterProperties_ = + com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + */ + public com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterPropertiesOrBuilder getSecurityCenterPropertiesOrBuilder() { + if (securityCenterPropertiesBuilder_ != null) { + return securityCenterPropertiesBuilder_.getMessageOrBuilder(); + } else { + return securityCenterProperties_ == null ? + com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties, com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.Builder, com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterPropertiesOrBuilder> + getSecurityCenterPropertiesFieldBuilder() { + if (securityCenterPropertiesBuilder_ == null) { + securityCenterPropertiesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties, com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.Builder, com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterPropertiesOrBuilder>( + getSecurityCenterProperties(), + getParentForChildren(), + isClean()); + securityCenterProperties_ = null; + } + return securityCenterPropertiesBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.protobuf.Value> 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.v1beta1.SecurityMarks securityMarks_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.SecurityMarks, com.google.cloud.securitycenter.v1beta1.SecurityMarks.Builder, com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1beta1.SecurityMarks getSecurityMarks() { + if (securityMarksBuilder_ == null) { + return securityMarks_ == null ? com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public Builder setSecurityMarks(com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public Builder setSecurityMarks( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public Builder mergeSecurityMarks(com.google.cloud.securitycenter.v1beta1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (securityMarks_ != null) { + securityMarks_ = + com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1beta1.SecurityMarksOrBuilder getSecurityMarksOrBuilder() { + if (securityMarksBuilder_ != null) { + return securityMarksBuilder_.getMessageOrBuilder(); + } else { + return securityMarks_ == null ? + com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.SecurityMarks, com.google.cloud.securitycenter.v1beta1.SecurityMarks.Builder, com.google.cloud.securitycenter.v1beta1.SecurityMarksOrBuilder> + getSecurityMarksFieldBuilder() { + if (securityMarksBuilder_ == null) { + securityMarksBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.SecurityMarks, com.google.cloud.securitycenter.v1beta1.SecurityMarks.Builder, com.google.cloud.securitycenter.v1beta1.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_; + } + @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.v1beta1.Asset) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.Asset) + private static final com.google.cloud.securitycenter.v1beta1.Asset DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.Asset(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/AssetOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/AssetOrBuilder.java new file mode 100644 index 000000000000..82c089c2b61d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/AssetOrBuilder.java @@ -0,0 +1,201 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/asset.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface AssetOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + */ + com.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties getSecurityCenterProperties(); + /** + *
+   * Cloud SCC managed properties. These properties are managed by
+   * Cloud SCC and cannot be modified by the user.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties security_center_properties = 2; + */ + com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + com.google.cloud.securitycenter.v1beta1.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(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/AssetOuterClass.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/AssetOuterClass.java new file mode 100644 index 000000000000..10c009b6c287 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/AssetOuterClass.java @@ -0,0 +1,109 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/asset.proto + +package com.google.cloud.securitycenter.v1beta1; + +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_v1beta1_Asset_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_Asset_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_Asset_SecurityCenterProperties_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_Asset_SecurityCenterProperties_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_Asset_ResourcePropertiesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_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/v1beta1/as" + + "set.proto\022#google.cloud.securitycenter.v" + + "1beta1\032\034google/api/annotations.proto\0328go" + + "ogle/cloud/securitycenter/v1beta1/securi" + + "ty_marks.proto\032\034google/protobuf/struct.p" + + "roto\032\037google/protobuf/timestamp.proto\"\367\004" + + "\n\005Asset\022\014\n\004name\030\001 \001(\t\022g\n\032security_center" + + "_properties\030\002 \001(\0132C.google.cloud.securit" + + "ycenter.v1beta1.Asset.SecurityCenterProp" + + "erties\022_\n\023resource_properties\030\007 \003(\0132B.go" + + "ogle.cloud.securitycenter.v1beta1.Asset." + + "ResourcePropertiesEntry\022J\n\016security_mark" + + "s\030\010 \001(\01322.google.cloud.securitycenter.v1" + + "beta1.SecurityMarks\022/\n\013create_time\030\t \001(\013" + + "2\032.google.protobuf.Timestamp\022/\n\013update_t" + + "ime\030\n \001(\0132\032.google.protobuf.Timestamp\032\224\001" + + "\n\030SecurityCenterProperties\022\025\n\rresource_n" + + "ame\030\001 \001(\t\022\025\n\rresource_type\030\002 \001(\t\022\027\n\017reso" + + "urce_parent\030\003 \001(\t\022\030\n\020resource_project\030\004 " + + "\001(\t\022\027\n\017resource_owners\030\005 \003(\t\032Q\n\027Resource" + + "PropertiesEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 " + + "\001(\0132\026.google.protobuf.Value:\0028\001B~\n\'com.g" + + "oogle.cloud.securitycenter.v1beta1P\001ZQgo" + + "ogle.golang.org/genproto/googleapis/clou" + + "d/securitycenter/v1beta1;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.v1beta1.SecurityMarksOuterClass.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_securitycenter_v1beta1_Asset_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1beta1_Asset_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1beta1_Asset_descriptor, + new java.lang.String[] { "Name", "SecurityCenterProperties", "ResourceProperties", "SecurityMarks", "CreateTime", "UpdateTime", }); + internal_static_google_cloud_securitycenter_v1beta1_Asset_SecurityCenterProperties_descriptor = + internal_static_google_cloud_securitycenter_v1beta1_Asset_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_securitycenter_v1beta1_Asset_SecurityCenterProperties_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1beta1_Asset_SecurityCenterProperties_descriptor, + new java.lang.String[] { "ResourceName", "ResourceType", "ResourceParent", "ResourceProject", "ResourceOwners", }); + internal_static_google_cloud_securitycenter_v1beta1_Asset_ResourcePropertiesEntry_descriptor = + internal_static_google_cloud_securitycenter_v1beta1_Asset_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_securitycenter_v1beta1_Asset_ResourcePropertiesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1beta1_Asset_ResourcePropertiesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.securitycenter.v1beta1.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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/AssetSecurityMarksName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/AssetSecurityMarksName.java new file mode 100644 index 000000000000..136ddaadc217 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/AssetSecurityMarksName.java @@ -0,0 +1,189 @@ +/* + * 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.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/CreateFindingRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/CreateFindingRequest.java new file mode 100644 index 000000000000..e4aa37427814 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/CreateFindingRequest.java @@ -0,0 +1,994 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for creating a finding.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.CreateFindingRequest} + */ +public final class CreateFindingRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.Finding.Builder subBuilder = null; + if (finding_ != null) { + subBuilder = finding_.toBuilder(); + } + finding_ = input.readMessage(com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_CreateFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_CreateFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.CreateFindingRequest.class, com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.Finding finding = 3; + */ + public com.google.cloud.securitycenter.v1beta1.Finding getFinding() { + return finding_ == null ? com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding finding = 3; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.CreateFindingRequest other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.CreateFindingRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.CreateFindingRequest) + com.google.cloud.securitycenter.v1beta1.CreateFindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_CreateFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_CreateFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.CreateFindingRequest.class, com.google.cloud.securitycenter.v1beta1.CreateFindingRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_CreateFindingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.CreateFindingRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.CreateFindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.CreateFindingRequest build() { + com.google.cloud.securitycenter.v1beta1.CreateFindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.CreateFindingRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.CreateFindingRequest result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.CreateFindingRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.CreateFindingRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding finding_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Finding, com.google.cloud.securitycenter.v1beta1.Finding.Builder, com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.Finding finding = 3; + */ + public com.google.cloud.securitycenter.v1beta1.Finding getFinding() { + if (findingBuilder_ == null) { + return finding_ == null ? com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding finding = 3; + */ + public Builder setFinding(com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding finding = 3; + */ + public Builder setFinding( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding finding = 3; + */ + public Builder mergeFinding(com.google.cloud.securitycenter.v1beta1.Finding value) { + if (findingBuilder_ == null) { + if (finding_ != null) { + finding_ = + com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.Finding finding = 3; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding finding = 3; + */ + public com.google.cloud.securitycenter.v1beta1.FindingOrBuilder getFindingOrBuilder() { + if (findingBuilder_ != null) { + return findingBuilder_.getMessageOrBuilder(); + } else { + return finding_ == null ? + com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding finding = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Finding, com.google.cloud.securitycenter.v1beta1.Finding.Builder, com.google.cloud.securitycenter.v1beta1.FindingOrBuilder> + getFindingFieldBuilder() { + if (findingBuilder_ == null) { + findingBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Finding, com.google.cloud.securitycenter.v1beta1.Finding.Builder, com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.CreateFindingRequest) + private static final com.google.cloud.securitycenter.v1beta1.CreateFindingRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.CreateFindingRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/CreateFindingRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/CreateFindingRequestOrBuilder.java new file mode 100644 index 000000000000..b2aefbd887e5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/CreateFindingRequestOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface CreateFindingRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.Finding finding = 3; + */ + com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding finding = 3; + */ + com.google.cloud.securitycenter.v1beta1.FindingOrBuilder getFindingOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/CreateSourceRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/CreateSourceRequest.java new file mode 100644 index 000000000000..36618e04ee1d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/CreateSourceRequest.java @@ -0,0 +1,825 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for creating a source.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.CreateSourceRequest} + */ +public final class CreateSourceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.Source.Builder subBuilder = null; + if (source_ != null) { + subBuilder = source_.toBuilder(); + } + source_ = input.readMessage(com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_CreateSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_CreateSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.CreateSourceRequest.class, com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source source_; + /** + *
+   * The Source being created, only the display_name and description will be
+   * used. All other fields will be ignored.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.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.v1beta1.Source source = 2; + */ + public com.google.cloud.securitycenter.v1beta1.Source getSource() { + return source_ == null ? com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source source = 2; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateSourceRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.CreateSourceRequest other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateSourceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateSourceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateSourceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateSourceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.CreateSourceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.CreateSourceRequest) + com.google.cloud.securitycenter.v1beta1.CreateSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_CreateSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_CreateSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.CreateSourceRequest.class, com.google.cloud.securitycenter.v1beta1.CreateSourceRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_CreateSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.CreateSourceRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.CreateSourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.CreateSourceRequest build() { + com.google.cloud.securitycenter.v1beta1.CreateSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.CreateSourceRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.CreateSourceRequest result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateSourceRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.CreateSourceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.CreateSourceRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateSourceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source source_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Source, com.google.cloud.securitycenter.v1beta1.Source.Builder, com.google.cloud.securitycenter.v1beta1.SourceOrBuilder> sourceBuilder_; + /** + *
+     * The Source being created, only the display_name and description will be
+     * used. All other fields will be ignored.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.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.v1beta1.Source source = 2; + */ + public com.google.cloud.securitycenter.v1beta1.Source getSource() { + if (sourceBuilder_ == null) { + return source_ == null ? com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source source = 2; + */ + public Builder setSource(com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source source = 2; + */ + public Builder setSource( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source source = 2; + */ + public Builder mergeSource(com.google.cloud.securitycenter.v1beta1.Source value) { + if (sourceBuilder_ == null) { + if (source_ != null) { + source_ = + com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.Source source = 2; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source source = 2; + */ + public com.google.cloud.securitycenter.v1beta1.SourceOrBuilder getSourceOrBuilder() { + if (sourceBuilder_ != null) { + return sourceBuilder_.getMessageOrBuilder(); + } else { + return source_ == null ? + com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Source, com.google.cloud.securitycenter.v1beta1.Source.Builder, com.google.cloud.securitycenter.v1beta1.SourceOrBuilder> + getSourceFieldBuilder() { + if (sourceBuilder_ == null) { + sourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Source, com.google.cloud.securitycenter.v1beta1.Source.Builder, com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.CreateSourceRequest) + private static final com.google.cloud.securitycenter.v1beta1.CreateSourceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.CreateSourceRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateSourceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/CreateSourceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/CreateSourceRequestOrBuilder.java new file mode 100644 index 000000000000..fe9b1328ccf2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/CreateSourceRequestOrBuilder.java @@ -0,0 +1,57 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface CreateSourceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.Source source = 2; + */ + com.google.cloud.securitycenter.v1beta1.Source getSource(); + /** + *
+   * The Source being created, only the display_name and description will be
+   * used. All other fields will be ignored.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Source source = 2; + */ + com.google.cloud.securitycenter.v1beta1.SourceOrBuilder getSourceOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/Finding.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/Finding.java new file mode 100644 index 000000000000..5a062bb68bb9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/Finding.java @@ -0,0 +1,2621 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/finding.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * 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.v1beta1.Finding} + */ +public final class Finding extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks.Builder subBuilder = null; + if (securityMarks_ != null) { + subBuilder = securityMarks_.toBuilder(); + } + securityMarks_ = input.readMessage(com.google.cloud.securitycenter.v1beta1.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.v1beta1.FindingOuterClass.internal_static_google_cloud_securitycenter_v1beta1_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.v1beta1.FindingOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Finding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.Finding.class, com.google.cloud.securitycenter.v1beta1.Finding.Builder.class); + } + + /** + *
+   * The state of the finding.
+   * 
+ * + * Protobuf enum {@code google.cloud.securitycenter.v1beta1.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< + State> 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.v1beta1.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.v1beta1.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.v1beta1.Finding.State state = 4; + */ + public int getStateValue() { + return state_; + } + /** + *
+   * The state of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding.State state = 4; + */ + public com.google.cloud.securitycenter.v1beta1.Finding.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1beta1.Finding.State result = com.google.cloud.securitycenter.v1beta1.Finding.State.valueOf(state_); + return result == null ? com.google.cloud.securitycenter.v1beta1.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 give 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 give 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< + java.lang.String, com.google.protobuf.Value> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.securitycenter.v1beta1.FindingOuterClass.internal_static_google_cloud_securitycenter_v1beta1_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< + java.lang.String, com.google.protobuf.Value> 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.
+   * 
+ * + * 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.
+   * 
+ * + * 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.
+   * 
+ * + * 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.
+   * 
+ * + * 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.v1beta1.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.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1beta1.SecurityMarks getSecurityMarks() { + return securityMarks_ == null ? com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.Finding)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.Finding other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.Finding} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.Finding) + com.google.cloud.securitycenter.v1beta1.FindingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.FindingOuterClass.internal_static_google_cloud_securitycenter_v1beta1_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.v1beta1.FindingOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Finding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.Finding.class, com.google.cloud.securitycenter.v1beta1.Finding.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.FindingOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Finding_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.Finding getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.Finding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.Finding build() { + com.google.cloud.securitycenter.v1beta1.Finding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.Finding buildPartial() { + com.google.cloud.securitycenter.v1beta1.Finding result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.Finding)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.Finding other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding.State state = 4; + */ + public int getStateValue() { + return state_; + } + /** + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding.State state = 4; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding.State state = 4; + */ + public com.google.cloud.securitycenter.v1beta1.Finding.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1beta1.Finding.State result = com.google.cloud.securitycenter.v1beta1.Finding.State.valueOf(state_); + return result == null ? com.google.cloud.securitycenter.v1beta1.Finding.State.UNRECOGNIZED : result; + } + /** + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding.State state = 4; + */ + public Builder setState(com.google.cloud.securitycenter.v1beta1.Finding.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The state of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.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 give 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 give 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 give 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 give 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 give 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< + java.lang.String, com.google.protobuf.Value> 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.
+     * 
+ * + * 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.v1beta1.SecurityMarks securityMarks_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.SecurityMarks, com.google.cloud.securitycenter.v1beta1.SecurityMarks.Builder, com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1beta1.SecurityMarks getSecurityMarks() { + if (securityMarksBuilder_ == null) { + return securityMarks_ == null ? com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public Builder setSecurityMarks(com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public Builder setSecurityMarks( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public Builder mergeSecurityMarks(com.google.cloud.securitycenter.v1beta1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (securityMarks_ != null) { + securityMarks_ = + com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + public com.google.cloud.securitycenter.v1beta1.SecurityMarksOrBuilder getSecurityMarksOrBuilder() { + if (securityMarksBuilder_ != null) { + return securityMarksBuilder_.getMessageOrBuilder(); + } else { + return securityMarks_ == null ? + com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.SecurityMarks, com.google.cloud.securitycenter.v1beta1.SecurityMarks.Builder, com.google.cloud.securitycenter.v1beta1.SecurityMarksOrBuilder> + getSecurityMarksFieldBuilder() { + if (securityMarksBuilder_ == null) { + securityMarksBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.SecurityMarks, com.google.cloud.securitycenter.v1beta1.SecurityMarks.Builder, com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.Finding) + private static final com.google.cloud.securitycenter.v1beta1.Finding DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.Finding(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/FindingName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/FindingName.java new file mode 100644 index 000000000000..6f3ed26b7025 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/FindingName.java @@ -0,0 +1,212 @@ +/* + * 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.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/FindingOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/FindingOrBuilder.java new file mode 100644 index 000000000000..51289980f9da --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/FindingOrBuilder.java @@ -0,0 +1,290 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/finding.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface FindingOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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.v1beta1.Finding.State state = 4; + */ + int getStateValue(); + /** + *
+   * The state of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding.State state = 4; + */ + com.google.cloud.securitycenter.v1beta1.Finding.State getState(); + + /** + *
+   * The additional taxonomy group within findings from a give 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 give 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.
+   * 
+ * + * map<string, .google.protobuf.Value> source_properties = 7; + */ + int getSourcePropertiesCount(); + /** + *
+   * Source specific properties. These properties are managed by the source
+   * that writes the finding.
+   * 
+ * + * 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.
+   * 
+ * + * 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.
+   * 
+ * + * 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.
+   * 
+ * + * 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.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 8; + */ + com.google.cloud.securitycenter.v1beta1.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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/FindingOuterClass.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/FindingOuterClass.java new file mode 100644 index 000000000000..b5ddf0d22369 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/FindingOuterClass.java @@ -0,0 +1,96 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/finding.proto + +package com.google.cloud.securitycenter.v1beta1; + +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_v1beta1_Finding_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_Finding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_Finding_SourcePropertiesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_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 = { + "\n1google/cloud/securitycenter/v1beta1/fi" + + "nding.proto\022#google.cloud.securitycenter" + + ".v1beta1\032\034google/api/annotations.proto\0328" + + "google/cloud/securitycenter/v1beta1/secu" + + "rity_marks.proto\032\034google/protobuf/struct" + + ".proto\032\037google/protobuf/timestamp.proto\"" + + "\300\004\n\007Finding\022\014\n\004name\030\001 \001(\t\022\016\n\006parent\030\002 \001(" + + "\t\022\025\n\rresource_name\030\003 \001(\t\022A\n\005state\030\004 \001(\0162" + + "2.google.cloud.securitycenter.v1beta1.Fi" + + "nding.State\022\020\n\010category\030\005 \001(\t\022\024\n\014externa" + + "l_uri\030\006 \001(\t\022]\n\021source_properties\030\007 \003(\0132B" + + ".google.cloud.securitycenter.v1beta1.Fin" + + "ding.SourcePropertiesEntry\022J\n\016security_m" + + "arks\030\010 \001(\01322.google.cloud.securitycenter" + + ".v1beta1.SecurityMarks\022.\n\nevent_time\030\t \001" + + "(\0132\032.google.protobuf.Timestamp\022/\n\013create" + + "_time\030\n \001(\0132\032.google.protobuf.Timestamp\032" + + "O\n\025SourcePropertiesEntry\022\013\n\003key\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\006ACTI" + + "VE\020\001\022\014\n\010INACTIVE\020\002B~\n\'com.google.cloud.s" + + "ecuritycenter.v1beta1P\001ZQgoogle.golang.o" + + "rg/genproto/googleapis/cloud/securitycen" + + "ter/v1beta1;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.v1beta1.SecurityMarksOuterClass.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_securitycenter_v1beta1_Finding_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1beta1_Finding_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1beta1_Finding_descriptor, + new java.lang.String[] { "Name", "Parent", "ResourceName", "State", "Category", "ExternalUri", "SourceProperties", "SecurityMarks", "EventTime", "CreateTime", }); + internal_static_google_cloud_securitycenter_v1beta1_Finding_SourcePropertiesEntry_descriptor = + internal_static_google_cloud_securitycenter_v1beta1_Finding_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_securitycenter_v1beta1_Finding_SourcePropertiesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1beta1_Finding_SourcePropertiesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.cloud.securitycenter.v1beta1.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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/FindingSecurityMarksName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/FindingSecurityMarksName.java new file mode 100644 index 000000000000..ddfb21e1d872 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/FindingSecurityMarksName.java @@ -0,0 +1,212 @@ +/* + * 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.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GetOrganizationSettingsRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GetOrganizationSettingsRequest.java new file mode 100644 index 000000000000..f2cae5c39dba --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GetOrganizationSettingsRequest.java @@ -0,0 +1,584 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for getting organization settings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest} + */ +public final class GetOrganizationSettingsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GetOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GetOrganizationSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.class, com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetOrganizationSettingsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetOrganizationSettingsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetOrganizationSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetOrganizationSettingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetOrganizationSettingsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetOrganizationSettingsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GetOrganizationSettingsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest) + com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GetOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GetOrganizationSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.class, com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GetOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest build() { + com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetOrganizationSettingsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetOrganizationSettingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetOrganizationSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest) + private static final com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetOrganizationSettingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GetOrganizationSettingsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GetOrganizationSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..096c10c0863b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GetOrganizationSettingsRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface GetOrganizationSettingsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GetSourceRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GetSourceRequest.java new file mode 100644 index 000000000000..11578a2d85ec --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GetSourceRequest.java @@ -0,0 +1,584 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for getting a source.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.GetSourceRequest} + */ +public final class GetSourceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GetSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GetSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GetSourceRequest.class, com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetSourceRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.GetSourceRequest other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetSourceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetSourceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetSourceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetSourceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GetSourceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.GetSourceRequest) + com.google.cloud.securitycenter.v1beta1.GetSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GetSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GetSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GetSourceRequest.class, com.google.cloud.securitycenter.v1beta1.GetSourceRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GetSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GetSourceRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.GetSourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GetSourceRequest build() { + com.google.cloud.securitycenter.v1beta1.GetSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GetSourceRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.GetSourceRequest result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetSourceRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.GetSourceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.GetSourceRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetSourceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.GetSourceRequest) + private static final com.google.cloud.securitycenter.v1beta1.GetSourceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.GetSourceRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GetSourceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GetSourceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GetSourceRequestOrBuilder.java new file mode 100644 index 000000000000..768b50df24b1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GetSourceRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface GetSourceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupAssetsRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupAssetsRequest.java new file mode 100644 index 000000000000..bbfb3721493b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupAssetsRequest.java @@ -0,0 +1,2023 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for grouping by assets.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.GroupAssetsRequest} + */ +public final class GroupAssetsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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_ = ""; + 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 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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest.class, com.google.cloud.securitycenter.v1beta1.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 not 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 not 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 Asset's "state" 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 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" values when compare_duration is specified:
+   * * "ADDED": indicates that the asset was not present before
+   *              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.
+   * This field is ignored if `state` is not a field in `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public boolean hasCompareDuration() { + return compareDuration_ != null; + } + /** + *
+   * When compare_duration is set, the Asset's "state" 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 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" values when compare_duration is specified:
+   * * "ADDED": indicates that the asset was not present before
+   *              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.
+   * This field is ignored if `state` is not a 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 Asset's "state" 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 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" values when compare_duration is specified:
+   * * "ADDED": indicates that the asset was not present before
+   *              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.
+   * This field is ignored if `state` is not a 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 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 (!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 (!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.v1beta1.GroupAssetsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest other = (com.google.cloud.securitycenter.v1beta1.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 && 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) + 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.v1beta1.GroupAssetsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupAssetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupAssetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupAssetsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupAssetsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupAssetsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.GroupAssetsRequest) + com.google.cloud.securitycenter.v1beta1.GroupAssetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest.class, com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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; + } + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest build() { + com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest result = new com.google.cloud.securitycenter.v1beta1.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.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.v1beta1.GroupAssetsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.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.v1beta1.GroupAssetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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 not 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 not 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 not 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 not 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 not 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 Asset's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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.
+     * This field is ignored if `state` is not a field in `group_by`.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + public boolean hasCompareDuration() { + return compareDurationBuilder_ != null || compareDuration_ != null; + } + /** + *
+     * When compare_duration is set, the Asset's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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.
+     * This field is ignored if `state` is not a 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 Asset's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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.
+     * This field is ignored if `state` is not a 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 Asset's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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.
+     * This field is ignored if `state` is not a 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 Asset's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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.
+     * This field is ignored if `state` is not a 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 Asset's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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.
+     * This field is ignored if `state` is not a 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 Asset's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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.
+     * This field is ignored if `state` is not a 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 Asset's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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.
+     * This field is ignored if `state` is not a 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 Asset's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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.
+     * This field is ignored if `state` is not a 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 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.v1beta1.GroupAssetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.GroupAssetsRequest) + private static final com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupAssetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupAssetsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupAssetsRequestOrBuilder.java new file mode 100644 index 000000000000..c270b3ecd6f5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupAssetsRequestOrBuilder.java @@ -0,0 +1,260 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface GroupAssetsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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 not 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 not 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 Asset's "state" 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 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" values when compare_duration is specified:
+   * * "ADDED": indicates that the asset was not present before
+   *              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.
+   * This field is ignored if `state` is not a field in `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + boolean hasCompareDuration(); + /** + *
+   * When compare_duration is set, the Asset's "state" 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 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" values when compare_duration is specified:
+   * * "ADDED": indicates that the asset was not present before
+   *              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.
+   * This field is ignored if `state` is not a field in `group_by`.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 4; + */ + com.google.protobuf.Duration getCompareDuration(); + /** + *
+   * When compare_duration is set, the Asset's "state" 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 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" values when compare_duration is specified:
+   * * "ADDED": indicates that the asset was not present before
+   *              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.
+   * This field is ignored if `state` is not a 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(); + + /** + *
+   * 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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupAssetsResponse.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupAssetsResponse.java new file mode 100644 index 000000000000..6305f7562fbc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupAssetsResponse.java @@ -0,0 +1,1299 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Response message for grouping by assets.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.GroupAssetsResponse} + */ +public final class GroupAssetsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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_ = ""; + } + + @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.v1beta1.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; + } + 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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse.class, com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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; + } + } + + 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_); + } + 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_); + } + 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.v1beta1.GroupAssetsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse other = (com.google.cloud.securitycenter.v1beta1.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 && 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupAssetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupAssetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupAssetsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupAssetsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupAssetsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.GroupAssetsResponse) + com.google.cloud.securitycenter.v1beta1.GroupAssetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse.class, com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse build() { + com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse buildPartial() { + com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse result = new com.google.cloud.securitycenter.v1beta1.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.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.v1beta1.GroupAssetsResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse other) { + if (other == com.google.cloud.securitycenter.v1beta1.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(); + } + 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.v1beta1.GroupAssetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult, com.google.cloud.securitycenter.v1beta1.GroupResult.Builder, com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public Builder setGroupByResults( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public Builder setGroupByResults( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults(com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.GroupResult.Builder addGroupByResultsBuilder() { + return getGroupByResultsFieldBuilder().addBuilder( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.GroupResult.Builder addGroupByResultsBuilder( + int index) { + return getGroupByResultsFieldBuilder().addBuilder( + index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public java.util.List + getGroupByResultsBuilderList() { + return getGroupByResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.GroupResult, com.google.cloud.securitycenter.v1beta1.GroupResult.Builder, com.google.cloud.securitycenter.v1beta1.GroupResultOrBuilder> + getGroupByResultsFieldBuilder() { + if (groupByResultsBuilder_ == null) { + groupByResultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.GroupResult, com.google.cloud.securitycenter.v1beta1.GroupResult.Builder, com.google.cloud.securitycenter.v1beta1.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; + } + @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.v1beta1.GroupAssetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.GroupAssetsResponse) + private static final com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupAssetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupAssetsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupAssetsResponseOrBuilder.java new file mode 100644 index 000000000000..6239ac4db5b5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupAssetsResponseOrBuilder.java @@ -0,0 +1,108 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface GroupAssetsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + com.google.cloud.securitycenter.v1beta1.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(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupFindingsRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupFindingsRequest.java new file mode 100644 index 000000000000..553c6391ebbb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupFindingsRequest.java @@ -0,0 +1,1595 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for grouping by findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.GroupFindingsRequest} + */ +public final class GroupFindingsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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_ = ""; + 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: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 48: { + + 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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest.class, com.google.cloud.securitycenter.v1beta1.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 not 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 not 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`). The string value should follow SQL syntax: comma separated list
+   * of fields. For example:
+   * "parent,resource_name".
+   * The following fields are supported:
+   * * resource_name
+   * * category
+   * * state
+   * * parent
+   * 
+ * + * 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`). The string value should follow SQL syntax: comma separated list
+   * of fields. For example:
+   * "parent,resource_name".
+   * The following fields are supported:
+   * * resource_name
+   * * category
+   * * state
+   * * parent
+   * 
+ * + * 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 PAGE_TOKEN_FIELD_NUMBER = 5; + 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 = 5; + */ + 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 = 5; + */ + 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 = 6; + 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 = 6; + */ + 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 (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(6, 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 (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, 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.v1beta1.GroupFindingsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest other = (com.google.cloud.securitycenter.v1beta1.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 && 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(); + } + 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.v1beta1.GroupFindingsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupFindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupFindingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupFindingsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupFindingsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupFindingsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.GroupFindingsRequest) + com.google.cloud.securitycenter.v1beta1.GroupFindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest.class, com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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; + } + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest build() { + com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest result = new com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.groupBy_ = groupBy_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.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.v1beta1.GroupFindingsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.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.v1beta1.GroupFindingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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 not 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 not 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 not 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 not 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 not 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`). The string value should follow SQL syntax: comma separated list
+     * of fields. For example:
+     * "parent,resource_name".
+     * The following fields are supported:
+     * * resource_name
+     * * category
+     * * state
+     * * parent
+     * 
+ * + * 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`). The string value should follow SQL syntax: comma separated list
+     * of fields. For example:
+     * "parent,resource_name".
+     * The following fields are supported:
+     * * resource_name
+     * * category
+     * * state
+     * * parent
+     * 
+ * + * 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`). The string value should follow SQL syntax: comma separated list
+     * of fields. For example:
+     * "parent,resource_name".
+     * The following fields are supported:
+     * * resource_name
+     * * category
+     * * state
+     * * parent
+     * 
+ * + * 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`). The string value should follow SQL syntax: comma separated list
+     * of fields. For example:
+     * "parent,resource_name".
+     * The following fields are supported:
+     * * resource_name
+     * * category
+     * * state
+     * * parent
+     * 
+ * + * 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`). The string value should follow SQL syntax: comma separated list
+     * of fields. For example:
+     * "parent,resource_name".
+     * The following fields are supported:
+     * * resource_name
+     * * category
+     * * state
+     * * parent
+     * 
+ * + * 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 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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 6; + */ + 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 = 6; + */ + 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 = 6; + */ + 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.v1beta1.GroupFindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.GroupFindingsRequest) + private static final com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupFindingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupFindingsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupFindingsRequestOrBuilder.java new file mode 100644 index 000000000000..7c5b98c3b984 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupFindingsRequestOrBuilder.java @@ -0,0 +1,185 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface GroupFindingsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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 not 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 not 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`). The string value should follow SQL syntax: comma separated list
+   * of fields. For example:
+   * "parent,resource_name".
+   * The following fields are supported:
+   * * resource_name
+   * * category
+   * * state
+   * * parent
+   * 
+ * + * string group_by = 3; + */ + java.lang.String getGroupBy(); + /** + *
+   * Expression that defines what assets fields to use for grouping (including
+   * `state`). The string value should follow SQL syntax: comma separated list
+   * of fields. For example:
+   * "parent,resource_name".
+   * The following fields are supported:
+   * * resource_name
+   * * category
+   * * state
+   * * parent
+   * 
+ * + * 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(); + + /** + *
+   * 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 = 5; + */ + 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 = 5; + */ + 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 = 6; + */ + int getPageSize(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupFindingsResponse.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupFindingsResponse.java new file mode 100644 index 000000000000..4b74dccd0b98 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupFindingsResponse.java @@ -0,0 +1,1299 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Response message for group by findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.GroupFindingsResponse} + */ +public final class GroupFindingsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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_ = ""; + } + + @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.v1beta1.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; + } + 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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse.class, com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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; + } + } + + 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_); + } + 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_); + } + 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.v1beta1.GroupFindingsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse other = (com.google.cloud.securitycenter.v1beta1.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 && 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupFindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupFindingsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupFindingsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupFindingsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupFindingsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.GroupFindingsResponse) + com.google.cloud.securitycenter.v1beta1.GroupFindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse.class, com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse build() { + com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse buildPartial() { + com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse result = new com.google.cloud.securitycenter.v1beta1.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.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.v1beta1.GroupFindingsResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse other) { + if (other == com.google.cloud.securitycenter.v1beta1.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(); + } + 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.v1beta1.GroupFindingsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult, com.google.cloud.securitycenter.v1beta1.GroupResult.Builder, com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public Builder setGroupByResults( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public Builder setGroupByResults( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults(com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public Builder addGroupByResults( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.GroupResult.Builder addGroupByResultsBuilder() { + return getGroupByResultsFieldBuilder().addBuilder( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.GroupResult.Builder addGroupByResultsBuilder( + int index) { + return getGroupByResultsFieldBuilder().addBuilder( + index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + public java.util.List + getGroupByResultsBuilderList() { + return getGroupByResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.GroupResult, com.google.cloud.securitycenter.v1beta1.GroupResult.Builder, com.google.cloud.securitycenter.v1beta1.GroupResultOrBuilder> + getGroupByResultsFieldBuilder() { + if (groupByResultsBuilder_ == null) { + groupByResultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.GroupResult, com.google.cloud.securitycenter.v1beta1.GroupResult.Builder, com.google.cloud.securitycenter.v1beta1.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; + } + @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.v1beta1.GroupFindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.GroupFindingsResponse) + private static final com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupFindingsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupFindingsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupFindingsResponseOrBuilder.java new file mode 100644 index 000000000000..01c4daff074c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupFindingsResponseOrBuilder.java @@ -0,0 +1,108 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface GroupFindingsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupResult group_by_results = 1; + */ + com.google.cloud.securitycenter.v1beta1.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(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupResult.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupResult.java new file mode 100644 index 000000000000..a18a341b2c20 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupResult.java @@ -0,0 +1,819 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Result containing the properties and count of a groupBy request.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.GroupResult} + */ +public final class GroupResult extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GroupResult.class, com.google.cloud.securitycenter.v1beta1.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< + java.lang.String, com.google.protobuf.Value> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_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< + java.lang.String, com.google.protobuf.Value> 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.v1beta1.GroupResult)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.GroupResult other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.GroupResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.GroupResult) + com.google.cloud.securitycenter.v1beta1.GroupResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.GroupResult.class, com.google.cloud.securitycenter.v1beta1.GroupResult.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_GroupResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupResult getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.GroupResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupResult build() { + com.google.cloud.securitycenter.v1beta1.GroupResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.GroupResult buildPartial() { + com.google.cloud.securitycenter.v1beta1.GroupResult result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.GroupResult)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.GroupResult other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.GroupResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.protobuf.Value> 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.v1beta1.GroupResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.GroupResult) + private static final com.google.cloud.securitycenter.v1beta1.GroupResult DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.GroupResult(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.GroupResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupResultOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupResultOrBuilder.java new file mode 100644 index 000000000000..f2c7272b4d03 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/GroupResultOrBuilder.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface GroupResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListAssetsRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListAssetsRequest.java new file mode 100644 index 000000000000..d17351dc2d5e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListAssetsRequest.java @@ -0,0 +1,2298 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for listing assets.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.ListAssetsRequest} + */ +public final class ListAssetsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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_ = ""; + 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 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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListAssetsRequest.class, com.google.cloud.securitycenter.v1beta1.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 not 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 not 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 ListAssetResult's "state" 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 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" values when compare_duration is specified:
+   * * "ADDED": indicates that the asset was not present before
+   *              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 is
+   * "UNUSED", which indicates that the asset is present at read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public boolean hasCompareDuration() { + return compareDuration_ != null; + } + /** + *
+   * When compare_duration is set, the ListAssetResult's "state" 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 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" values when compare_duration is specified:
+   * * "ADDED": indicates that the asset was not present before
+   *              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 is
+   * "UNUSED", which indicates that the asset is 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 ListAssetResult's "state" 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 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" values when compare_duration is specified:
+   * * "ADDED": indicates that the asset was not present before
+   *              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 is
+   * "UNUSED", which indicates that the asset is present at read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder() { + return getCompareDuration(); + } + + 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 (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 (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.v1beta1.ListAssetsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.ListAssetsRequest other = (com.google.cloud.securitycenter.v1beta1.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 && (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(); + } + 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.v1beta1.ListAssetsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ListAssetsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.ListAssetsRequest) + com.google.cloud.securitycenter.v1beta1.ListAssetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListAssetsRequest.class, com.google.cloud.securitycenter.v1beta1.ListAssetsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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; + } + 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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListAssetsRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.ListAssetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListAssetsRequest build() { + com.google.cloud.securitycenter.v1beta1.ListAssetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListAssetsRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.ListAssetsRequest result = new com.google.cloud.securitycenter.v1beta1.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(); + } + 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.v1beta1.ListAssetsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.ListAssetsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.ListAssetsRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.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.v1beta1.ListAssetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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 not 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 not 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 not 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 not 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 not 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 ListAssetResult's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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 is
+     * "UNUSED", which indicates that the asset is present at read_time.
+     * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + public boolean hasCompareDuration() { + return compareDurationBuilder_ != null || compareDuration_ != null; + } + /** + *
+     * When compare_duration is set, the ListAssetResult's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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 is
+     * "UNUSED", which indicates that the asset is 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 ListAssetResult's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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 is
+     * "UNUSED", which indicates that the asset is 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 ListAssetResult's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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 is
+     * "UNUSED", which indicates that the asset is 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 ListAssetResult's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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 is
+     * "UNUSED", which indicates that the asset is 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 ListAssetResult's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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 is
+     * "UNUSED", which indicates that the asset is 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 ListAssetResult's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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 is
+     * "UNUSED", which indicates that the asset is 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 ListAssetResult's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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 is
+     * "UNUSED", which indicates that the asset is 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 ListAssetResult's "state" 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 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" values when compare_duration is specified:
+     * * "ADDED": indicates that the asset was not present before
+     *              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 is
+     * "UNUSED", which indicates that the asset is 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 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.v1beta1.ListAssetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.ListAssetsRequest) + private static final com.google.cloud.securitycenter.v1beta1.ListAssetsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.ListAssetsRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListAssetsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListAssetsRequestOrBuilder.java new file mode 100644 index 000000000000..0b89736e854e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListAssetsRequestOrBuilder.java @@ -0,0 +1,296 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface ListAssetsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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 not 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 not 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 ListAssetResult's "state" 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 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" values when compare_duration is specified:
+   * * "ADDED": indicates that the asset was not present before
+   *              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 is
+   * "UNUSED", which indicates that the asset is present at read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + boolean hasCompareDuration(); + /** + *
+   * When compare_duration is set, the ListAssetResult's "state" 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 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" values when compare_duration is specified:
+   * * "ADDED": indicates that the asset was not present before
+   *              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 is
+   * "UNUSED", which indicates that the asset is present at read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + com.google.protobuf.Duration getCompareDuration(); + /** + *
+   * When compare_duration is set, the ListAssetResult's "state" 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 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" values when compare_duration is specified:
+   * * "ADDED": indicates that the asset was not present before
+   *              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 is
+   * "UNUSED", which indicates that the asset is present at read_time.
+   * 
+ * + * .google.protobuf.Duration compare_duration = 5; + */ + com.google.protobuf.DurationOrBuilder getCompareDurationOrBuilder(); + + /** + *
+   * 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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListAssetsResponse.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListAssetsResponse.java new file mode 100644 index 000000000000..7e069242b83e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListAssetsResponse.java @@ -0,0 +1,2305 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Response message for listing assets.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.ListAssetsResponse} + */ +public final class ListAssetsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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(); + mutable_bitField0_ |= 0x00000001; + } + listAssetsResults_.add( + input.readMessage(com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.class, com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.Builder.class); + } + + public interface ListAssetsResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Asset asset = 1; + */ + boolean hasAsset(); + /** + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Asset asset = 1; + */ + com.google.cloud.securitycenter.v1beta1.Asset getAsset(); + /** + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Asset asset = 1; + */ + com.google.cloud.securitycenter.v1beta1.AssetOrBuilder getAssetOrBuilder(); + + /** + *
+     * State of the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State state = 2; + */ + int getStateValue(); + /** + *
+     * State of the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State state = 2; + */ + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State getState(); + } + /** + *
+   * Result containing the Asset and its State.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult} + */ + public static final class ListAssetsResult extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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() { + state_ = 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.v1beta1.Asset.Builder subBuilder = null; + if (asset_ != null) { + subBuilder = asset_.toBuilder(); + } + asset_ = input.readMessage(com.google.cloud.securitycenter.v1beta1.Asset.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(asset_); + asset_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + int rawValue = input.readEnum(); + + state_ = 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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_ListAssetsResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_ListAssetsResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.class, com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.Builder.class); + } + + /** + *
+     * 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 should
+     * be: UNUSED
+     * 
+ * + * Protobuf enum {@code google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State} + */ + public enum State + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+       * Unspecified state.
+       * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + *
+       * Request did not specify use of this field in the result.
+       * 
+ * + * UNUSED = 1; + */ + UNUSED(1), + /** + *
+       * Asset was added between the points in time.
+       * 
+ * + * ADDED = 2; + */ + ADDED(2), + /** + *
+       * Asset was removed between the points in time.
+       * 
+ * + * REMOVED = 3; + */ + REMOVED(3), + /** + *
+       * Asset was active at both point(s) in time.
+       * 
+ * + * ACTIVE = 4; + */ + ACTIVE(4), + UNRECOGNIZED(-1), + ; + + /** + *
+       * Unspecified state.
+       * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + *
+       * Request did not specify use of this field in the result.
+       * 
+ * + * UNUSED = 1; + */ + public static final int UNUSED_VALUE = 1; + /** + *
+       * Asset was added between the points in time.
+       * 
+ * + * ADDED = 2; + */ + public static final int ADDED_VALUE = 2; + /** + *
+       * Asset was removed between the points in time.
+       * 
+ * + * REMOVED = 3; + */ + public static final int REMOVED_VALUE = 3; + /** + *
+       * Asset was active at both point(s) in time.
+       * 
+ * + * ACTIVE = 4; + */ + public static final int ACTIVE_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 State valueOf(int value) { + return forNumber(value); + } + + public static State forNumber(int value) { + switch (value) { + case 0: return STATE_UNSPECIFIED; + case 1: return UNUSED; + case 2: return ADDED; + case 3: return REMOVED; + case 4: return ACTIVE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + State> 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.v1beta1.ListAssetsResponse.ListAssetsResult.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.v1beta1.ListAssetsResponse.ListAssetsResult.State) + } + + public static final int ASSET_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1beta1.Asset asset_; + /** + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Asset asset = 1; + */ + public boolean hasAsset() { + return asset_ != null; + } + /** + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Asset getAsset() { + return asset_ == null ? com.google.cloud.securitycenter.v1beta1.Asset.getDefaultInstance() : asset_; + } + /** + *
+     * Asset matching the search request.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1beta1.AssetOrBuilder getAssetOrBuilder() { + return getAsset(); + } + + public static final int STATE_FIELD_NUMBER = 2; + private int state_; + /** + *
+     * State of the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State state = 2; + */ + public int getStateValue() { + return state_; + } + /** + *
+     * State of the asset.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State state = 2; + */ + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State result = com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State.valueOf(state_); + return result == null ? com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State.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 (state_ != com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, state_); + } + 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 (state_ != com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, state_); + } + 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.v1beta1.ListAssetsResponse.ListAssetsResult)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult other = (com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult) obj; + + boolean result = true; + result = result && (hasAsset() == other.hasAsset()); + if (hasAsset()) { + result = result && getAsset() + .equals(other.getAsset()); + } + result = result && state_ == other.state_; + 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_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult) + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_ListAssetsResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_ListAssetsResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.class, com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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; + } + state_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_ListAssetsResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult build() { + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult buildPartial() { + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult result = new com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(this); + if (assetBuilder_ == null) { + result.asset_ = asset_; + } else { + result.asset_ = assetBuilder_.build(); + } + result.state_ = state_; + 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.v1beta1.ListAssetsResponse.ListAssetsResult) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult other) { + if (other == com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.getDefaultInstance()) return this; + if (other.hasAsset()) { + mergeAsset(other.getAsset()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + 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.v1beta1.ListAssetsResponse.ListAssetsResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1beta1.Asset asset_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Asset, com.google.cloud.securitycenter.v1beta1.Asset.Builder, com.google.cloud.securitycenter.v1beta1.AssetOrBuilder> assetBuilder_; + /** + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.Asset asset = 1; + */ + public boolean hasAsset() { + return assetBuilder_ != null || asset_ != null; + } + /** + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Asset getAsset() { + if (assetBuilder_ == null) { + return asset_ == null ? com.google.cloud.securitycenter.v1beta1.Asset.getDefaultInstance() : asset_; + } else { + return assetBuilder_.getMessage(); + } + } + /** + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.Asset asset = 1; + */ + public Builder setAsset(com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset asset = 1; + */ + public Builder setAsset( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.Asset asset = 1; + */ + public Builder mergeAsset(com.google.cloud.securitycenter.v1beta1.Asset value) { + if (assetBuilder_ == null) { + if (asset_ != null) { + asset_ = + com.google.cloud.securitycenter.v1beta1.Asset.newBuilder(asset_).mergeFrom(value).buildPartial(); + } else { + asset_ = value; + } + onChanged(); + } else { + assetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.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.v1beta1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Asset.Builder getAssetBuilder() { + + onChanged(); + return getAssetFieldBuilder().getBuilder(); + } + /** + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.Asset asset = 1; + */ + public com.google.cloud.securitycenter.v1beta1.AssetOrBuilder getAssetOrBuilder() { + if (assetBuilder_ != null) { + return assetBuilder_.getMessageOrBuilder(); + } else { + return asset_ == null ? + com.google.cloud.securitycenter.v1beta1.Asset.getDefaultInstance() : asset_; + } + } + /** + *
+       * Asset matching the search request.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.Asset asset = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Asset, com.google.cloud.securitycenter.v1beta1.Asset.Builder, com.google.cloud.securitycenter.v1beta1.AssetOrBuilder> + getAssetFieldBuilder() { + if (assetBuilder_ == null) { + assetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Asset, com.google.cloud.securitycenter.v1beta1.Asset.Builder, com.google.cloud.securitycenter.v1beta1.AssetOrBuilder>( + getAsset(), + getParentForChildren(), + isClean()); + asset_ = null; + } + return assetBuilder_; + } + + private int state_ = 0; + /** + *
+       * State of the asset.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State state = 2; + */ + public int getStateValue() { + return state_; + } + /** + *
+       * State of the asset.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State state = 2; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + *
+       * State of the asset.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State state = 2; + */ + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State result = com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State.valueOf(state_); + return result == null ? com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State.UNRECOGNIZED : result; + } + /** + *
+       * State of the asset.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State state = 2; + */ + public Builder setState(com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * State of the asset.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.State state = 2; + */ + public Builder clearState() { + + state_ = 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.v1beta1.ListAssetsResponse.ListAssetsResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult) + private static final com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public java.util.List getListAssetsResultsList() { + return listAssetsResults_; + } + /** + *
+   * Assets matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public java.util.List + getListAssetsResultsOrBuilderList() { + return listAssetsResults_; + } + /** + *
+   * Assets matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public int getListAssetsResultsCount() { + return listAssetsResults_.size(); + } + /** + *
+   * Assets matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult getListAssetsResults(int index) { + return listAssetsResults_.get(index); + } + /** + *
+   * Assets matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ListAssetsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.ListAssetsResponse) + com.google.cloud.securitycenter.v1beta1.ListAssetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.class, com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse build() { + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse buildPartial() { + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.ListAssetsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.ListAssetsResponse other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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(listAssetsResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult, com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.Builder, com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResultOrBuilder> listAssetsResultsBuilder_; + + /** + *
+     * Assets matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public Builder setListAssetsResults( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public Builder setListAssetsResults( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public Builder addListAssetsResults(com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public Builder addListAssetsResults( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public Builder addListAssetsResults( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public Builder addListAssetsResults( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public Builder addAllListAssetsResults( + java.lang.Iterable 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.v1beta1.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.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.Builder getListAssetsResultsBuilder( + int index) { + return getListAssetsResultsFieldBuilder().getBuilder(index); + } + /** + *
+     * Assets matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public java.util.List + getListAssetsResultsOrBuilderList() { + if (listAssetsResultsBuilder_ != null) { + return listAssetsResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(listAssetsResults_); + } + } + /** + *
+     * Assets matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.Builder addListAssetsResultsBuilder() { + return getListAssetsResultsFieldBuilder().addBuilder( + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.getDefaultInstance()); + } + /** + *
+     * Assets matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.Builder addListAssetsResultsBuilder( + int index) { + return getListAssetsResultsFieldBuilder().addBuilder( + index, com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.getDefaultInstance()); + } + /** + *
+     * Assets matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + public java.util.List + getListAssetsResultsBuilderList() { + return getListAssetsResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult, com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.Builder, com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResultOrBuilder> + getListAssetsResultsFieldBuilder() { + if (listAssetsResultsBuilder_ == null) { + listAssetsResultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult, com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult.Builder, com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.ListAssetsResponse) + private static final com.google.cloud.securitycenter.v1beta1.ListAssetsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.ListAssetsResponse(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListAssetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListAssetsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListAssetsResponseOrBuilder.java new file mode 100644 index 000000000000..2a499f7309b7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListAssetsResponseOrBuilder.java @@ -0,0 +1,107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface ListAssetsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.ListAssetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Assets matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + java.util.List + getListAssetsResultsList(); + /** + *
+   * Assets matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult getListAssetsResults(int index); + /** + *
+   * Assets matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + int getListAssetsResultsCount(); + /** + *
+   * Assets matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + java.util.List + getListAssetsResultsOrBuilderList(); + /** + *
+   * Assets matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult list_assets_results = 1; + */ + com.google.cloud.securitycenter.v1beta1.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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListFindingsRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListFindingsRequest.java new file mode 100644 index 000000000000..9ad1ba419ba7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListFindingsRequest.java @@ -0,0 +1,1841 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for listing findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.ListFindingsRequest} + */ +public final class ListFindingsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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_ = ""; + 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.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 50: { + 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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListFindingsRequest.class, com.google.cloud.securitycenter.v1beta1.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 not 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 not 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 FIELD_MASK_FIELD_NUMBER = 5; + 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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + public com.google.protobuf.FieldMaskOrBuilder getFieldMaskOrBuilder() { + return getFieldMask(); + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 6; + 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 = 6; + */ + 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 = 6; + */ + 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 (!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 (fieldMask_ != null) { + output.writeMessage(5, getFieldMask()); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, 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 (!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 (fieldMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getFieldMask()); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, 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.v1beta1.ListFindingsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.ListFindingsRequest other = (com.google.cloud.securitycenter.v1beta1.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 && (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 (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.v1beta1.ListFindingsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListFindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListFindingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListFindingsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListFindingsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ListFindingsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.ListFindingsRequest) + com.google.cloud.securitycenter.v1beta1.ListFindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListFindingsRequest.class, com.google.cloud.securitycenter.v1beta1.ListFindingsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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 (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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListFindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListFindingsRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.ListFindingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListFindingsRequest build() { + com.google.cloud.securitycenter.v1beta1.ListFindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListFindingsRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.ListFindingsRequest result = new com.google.cloud.securitycenter.v1beta1.ListFindingsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + 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.v1beta1.ListFindingsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.ListFindingsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.ListFindingsRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.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.v1beta1.ListFindingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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 not 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 not 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 not 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 not 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 not 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.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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 6; + */ + 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 = 6; + */ + 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 = 6; + */ + 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 = 6; + */ + 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 = 6; + */ + 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.v1beta1.ListFindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.ListFindingsRequest) + private static final com.google.cloud.securitycenter.v1beta1.ListFindingsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.ListFindingsRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListFindingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListFindingsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListFindingsRequestOrBuilder.java new file mode 100644 index 000000000000..7b728b3f8f28 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListFindingsRequestOrBuilder.java @@ -0,0 +1,214 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface ListFindingsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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 not 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 not 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(); + + /** + *
+   * 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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 6; + */ + 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 = 6; + */ + 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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListFindingsResponse.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListFindingsResponse.java new file mode 100644 index 000000000000..96150e7e51fd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListFindingsResponse.java @@ -0,0 +1,1327 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Response message for listing findings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.ListFindingsResponse} + */ +public final class ListFindingsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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() { + findings_ = 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)) { + findings_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + findings_.add( + input.readMessage(com.google.cloud.securitycenter.v1beta1.Finding.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)) { + findings_ = java.util.Collections.unmodifiableList(findings_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListFindingsResponse.class, com.google.cloud.securitycenter.v1beta1.ListFindingsResponse.Builder.class); + } + + private int bitField0_; + public static final int FINDINGS_FIELD_NUMBER = 1; + private java.util.List findings_; + /** + *
+   * Findings matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public java.util.List getFindingsList() { + return findings_; + } + /** + *
+   * Findings matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public java.util.List + getFindingsOrBuilderList() { + return findings_; + } + /** + *
+   * Findings matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public int getFindingsCount() { + return findings_.size(); + } + /** + *
+   * Findings matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Finding getFindings(int index) { + return findings_.get(index); + } + /** + *
+   * Findings matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public com.google.cloud.securitycenter.v1beta1.FindingOrBuilder getFindingsOrBuilder( + int index) { + return findings_.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 < findings_.size(); i++) { + output.writeMessage(1, findings_.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 < findings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, findings_.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.v1beta1.ListFindingsResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.ListFindingsResponse other = (com.google.cloud.securitycenter.v1beta1.ListFindingsResponse) obj; + + boolean result = true; + result = result && getFindingsList() + .equals(other.getFindingsList()); + 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 (getFindingsCount() > 0) { + hash = (37 * hash) + FINDINGS_FIELD_NUMBER; + hash = (53 * hash) + getFindingsList().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.v1beta1.ListFindingsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListFindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListFindingsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListFindingsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListFindingsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ListFindingsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.ListFindingsResponse) + com.google.cloud.securitycenter.v1beta1.ListFindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListFindingsResponse.class, com.google.cloud.securitycenter.v1beta1.ListFindingsResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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) { + getFindingsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (findingsBuilder_ == null) { + findings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + findingsBuilder_.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListFindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListFindingsResponse getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.ListFindingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListFindingsResponse build() { + com.google.cloud.securitycenter.v1beta1.ListFindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListFindingsResponse buildPartial() { + com.google.cloud.securitycenter.v1beta1.ListFindingsResponse result = new com.google.cloud.securitycenter.v1beta1.ListFindingsResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (findingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + findings_ = java.util.Collections.unmodifiableList(findings_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.findings_ = findings_; + } else { + result.findings_ = findingsBuilder_.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.v1beta1.ListFindingsResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.ListFindingsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.ListFindingsResponse other) { + if (other == com.google.cloud.securitycenter.v1beta1.ListFindingsResponse.getDefaultInstance()) return this; + if (findingsBuilder_ == null) { + if (!other.findings_.isEmpty()) { + if (findings_.isEmpty()) { + findings_ = other.findings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFindingsIsMutable(); + findings_.addAll(other.findings_); + } + onChanged(); + } + } else { + if (!other.findings_.isEmpty()) { + if (findingsBuilder_.isEmpty()) { + findingsBuilder_.dispose(); + findingsBuilder_ = null; + findings_ = other.findings_; + bitField0_ = (bitField0_ & ~0x00000001); + findingsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFindingsFieldBuilder() : null; + } else { + findingsBuilder_.addAllMessages(other.findings_); + } + } + } + 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.v1beta1.ListFindingsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.ListFindingsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List findings_ = + java.util.Collections.emptyList(); + private void ensureFindingsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + findings_ = new java.util.ArrayList(findings_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Finding, com.google.cloud.securitycenter.v1beta1.Finding.Builder, com.google.cloud.securitycenter.v1beta1.FindingOrBuilder> findingsBuilder_; + + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public java.util.List getFindingsList() { + if (findingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(findings_); + } else { + return findingsBuilder_.getMessageList(); + } + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public int getFindingsCount() { + if (findingsBuilder_ == null) { + return findings_.size(); + } else { + return findingsBuilder_.getCount(); + } + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Finding getFindings(int index) { + if (findingsBuilder_ == null) { + return findings_.get(index); + } else { + return findingsBuilder_.getMessage(index); + } + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public Builder setFindings( + int index, com.google.cloud.securitycenter.v1beta1.Finding value) { + if (findingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFindingsIsMutable(); + findings_.set(index, value); + onChanged(); + } else { + findingsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public Builder setFindings( + int index, com.google.cloud.securitycenter.v1beta1.Finding.Builder builderForValue) { + if (findingsBuilder_ == null) { + ensureFindingsIsMutable(); + findings_.set(index, builderForValue.build()); + onChanged(); + } else { + findingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public Builder addFindings(com.google.cloud.securitycenter.v1beta1.Finding value) { + if (findingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFindingsIsMutable(); + findings_.add(value); + onChanged(); + } else { + findingsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public Builder addFindings( + int index, com.google.cloud.securitycenter.v1beta1.Finding value) { + if (findingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFindingsIsMutable(); + findings_.add(index, value); + onChanged(); + } else { + findingsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public Builder addFindings( + com.google.cloud.securitycenter.v1beta1.Finding.Builder builderForValue) { + if (findingsBuilder_ == null) { + ensureFindingsIsMutable(); + findings_.add(builderForValue.build()); + onChanged(); + } else { + findingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public Builder addFindings( + int index, com.google.cloud.securitycenter.v1beta1.Finding.Builder builderForValue) { + if (findingsBuilder_ == null) { + ensureFindingsIsMutable(); + findings_.add(index, builderForValue.build()); + onChanged(); + } else { + findingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public Builder addAllFindings( + java.lang.Iterable values) { + if (findingsBuilder_ == null) { + ensureFindingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, findings_); + onChanged(); + } else { + findingsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public Builder clearFindings() { + if (findingsBuilder_ == null) { + findings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + findingsBuilder_.clear(); + } + return this; + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public Builder removeFindings(int index) { + if (findingsBuilder_ == null) { + ensureFindingsIsMutable(); + findings_.remove(index); + onChanged(); + } else { + findingsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Finding.Builder getFindingsBuilder( + int index) { + return getFindingsFieldBuilder().getBuilder(index); + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public com.google.cloud.securitycenter.v1beta1.FindingOrBuilder getFindingsOrBuilder( + int index) { + if (findingsBuilder_ == null) { + return findings_.get(index); } else { + return findingsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public java.util.List + getFindingsOrBuilderList() { + if (findingsBuilder_ != null) { + return findingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(findings_); + } + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Finding.Builder addFindingsBuilder() { + return getFindingsFieldBuilder().addBuilder( + com.google.cloud.securitycenter.v1beta1.Finding.getDefaultInstance()); + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Finding.Builder addFindingsBuilder( + int index) { + return getFindingsFieldBuilder().addBuilder( + index, com.google.cloud.securitycenter.v1beta1.Finding.getDefaultInstance()); + } + /** + *
+     * Findings matching the list request.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + public java.util.List + getFindingsBuilderList() { + return getFindingsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Finding, com.google.cloud.securitycenter.v1beta1.Finding.Builder, com.google.cloud.securitycenter.v1beta1.FindingOrBuilder> + getFindingsFieldBuilder() { + if (findingsBuilder_ == null) { + findingsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Finding, com.google.cloud.securitycenter.v1beta1.Finding.Builder, com.google.cloud.securitycenter.v1beta1.FindingOrBuilder>( + findings_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + findings_ = null; + } + return findingsBuilder_; + } + + 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.v1beta1.ListFindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.ListFindingsResponse) + private static final com.google.cloud.securitycenter.v1beta1.ListFindingsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.ListFindingsResponse(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListFindingsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListFindingsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListFindingsResponseOrBuilder.java new file mode 100644 index 000000000000..7606e682aaef --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListFindingsResponseOrBuilder.java @@ -0,0 +1,107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface ListFindingsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.ListFindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Findings matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + java.util.List + getFindingsList(); + /** + *
+   * Findings matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + com.google.cloud.securitycenter.v1beta1.Finding getFindings(int index); + /** + *
+   * Findings matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + int getFindingsCount(); + /** + *
+   * Findings matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + java.util.List + getFindingsOrBuilderList(); + /** + *
+   * Findings matching the list request.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Finding findings = 1; + */ + com.google.cloud.securitycenter.v1beta1.FindingOrBuilder getFindingsOrBuilder( + 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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListSourcesRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListSourcesRequest.java new file mode 100644 index 000000000000..555c870ca7a9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListSourcesRequest.java @@ -0,0 +1,831 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for listing sources.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.ListSourcesRequest} + */ +public final class ListSourcesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListSourcesRequest.class, com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.ListSourcesRequest other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ListSourcesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.ListSourcesRequest) + com.google.cloud.securitycenter.v1beta1.ListSourcesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListSourcesRequest.class, com.google.cloud.securitycenter.v1beta1.ListSourcesRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListSourcesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListSourcesRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.ListSourcesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListSourcesRequest build() { + com.google.cloud.securitycenter.v1beta1.ListSourcesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListSourcesRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.ListSourcesRequest result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.ListSourcesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.ListSourcesRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.ListSourcesRequest) + private static final com.google.cloud.securitycenter.v1beta1.ListSourcesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.ListSourcesRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListSourcesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListSourcesRequestOrBuilder.java new file mode 100644 index 000000000000..adc7aca8d745 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListSourcesRequestOrBuilder.java @@ -0,0 +1,61 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface ListSourcesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListSourcesResponse.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListSourcesResponse.java new file mode 100644 index 000000000000..8b51d3d5e672 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListSourcesResponse.java @@ -0,0 +1,1024 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Response message for listing sources.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.ListSourcesResponse} + */ +public final class ListSourcesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListSourcesResponse.class, com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source sources = 1; + */ + public java.util.List getSourcesList() { + return sources_; + } + /** + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Source sources = 1; + */ + public java.util.List + getSourcesOrBuilderList() { + return sources_; + } + /** + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Source sources = 1; + */ + public int getSourcesCount() { + return sources_.size(); + } + /** + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Source getSources(int index) { + return sources_.get(index); + } + /** + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesResponse)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.ListSourcesResponse other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ListSourcesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.ListSourcesResponse) + com.google.cloud.securitycenter.v1beta1.ListSourcesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.ListSourcesResponse.class, com.google.cloud.securitycenter.v1beta1.ListSourcesResponse.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_ListSourcesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListSourcesResponse getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.ListSourcesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListSourcesResponse build() { + com.google.cloud.securitycenter.v1beta1.ListSourcesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.ListSourcesResponse buildPartial() { + com.google.cloud.securitycenter.v1beta1.ListSourcesResponse result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesResponse) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.ListSourcesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.ListSourcesResponse other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source, com.google.cloud.securitycenter.v1beta1.Source.Builder, com.google.cloud.securitycenter.v1beta1.SourceOrBuilder> sourcesBuilder_; + + /** + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source sources = 1; + */ + public Builder setSources( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source sources = 1; + */ + public Builder setSources( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source sources = 1; + */ + public Builder addSources(com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source sources = 1; + */ + public Builder addSources( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source sources = 1; + */ + public Builder addSources( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source sources = 1; + */ + public Builder addSources( + int index, com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Source.Builder getSourcesBuilder( + int index) { + return getSourcesFieldBuilder().getBuilder(index); + } + /** + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Source.Builder addSourcesBuilder() { + return getSourcesFieldBuilder().addBuilder( + com.google.cloud.securitycenter.v1beta1.Source.getDefaultInstance()); + } + /** + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Source sources = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Source.Builder addSourcesBuilder( + int index) { + return getSourcesFieldBuilder().addBuilder( + index, com.google.cloud.securitycenter.v1beta1.Source.getDefaultInstance()); + } + /** + *
+     * Sources belonging to the requested parent.
+     * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Source sources = 1; + */ + public java.util.List + getSourcesBuilderList() { + return getSourcesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Source, com.google.cloud.securitycenter.v1beta1.Source.Builder, com.google.cloud.securitycenter.v1beta1.SourceOrBuilder> + getSourcesFieldBuilder() { + if (sourcesBuilder_ == null) { + sourcesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Source, com.google.cloud.securitycenter.v1beta1.Source.Builder, com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.ListSourcesResponse) + private static final com.google.cloud.securitycenter.v1beta1.ListSourcesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.ListSourcesResponse(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.ListSourcesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListSourcesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListSourcesResponseOrBuilder.java new file mode 100644 index 000000000000..b1b4e79a7e04 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/ListSourcesResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface ListSourcesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.ListSourcesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Source sources = 1; + */ + java.util.List + getSourcesList(); + /** + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Source sources = 1; + */ + com.google.cloud.securitycenter.v1beta1.Source getSources(int index); + /** + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Source sources = 1; + */ + int getSourcesCount(); + /** + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Source sources = 1; + */ + java.util.List + getSourcesOrBuilderList(); + /** + *
+   * Sources belonging to the requested parent.
+   * 
+ * + * repeated .google.cloud.securitycenter.v1beta1.Source sources = 1; + */ + com.google.cloud.securitycenter.v1beta1.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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationName.java new file mode 100644 index 000000000000..6682eedabb21 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationName.java @@ -0,0 +1,166 @@ +/* + * 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.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationSettings.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationSettings.java new file mode 100644 index 000000000000..a59efbccb758 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationSettings.java @@ -0,0 +1,1877 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/organization_settings.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * User specified settings that are attached to the Cloud Security Command
+ * Center (Cloud SCC) organization.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.OrganizationSettings} + */ +public final class OrganizationSettings extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig.Builder subBuilder = null; + if (assetDiscoveryConfig_ != null) { + subBuilder = assetDiscoveryConfig_.toBuilder(); + } + assetDiscoveryConfig_ = input.readMessage(com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettingsOuterClass.internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.OrganizationSettingsOuterClass.internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.class, com.google.cloud.securitycenter.v1beta1.OrganizationSettings.Builder.class); + } + + public interface AssetDiscoveryConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + */ + int getInclusionModeValue(); + /** + *
+     * The mode to use for filtering asset discovery.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + */ + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode getInclusionMode(); + } + /** + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig} + */ + public static final class AssetDiscoveryConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettingsOuterClass.internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_AssetDiscoveryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.OrganizationSettingsOuterClass.internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_AssetDiscoveryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.class, com.google.cloud.securitycenter.v1beta1.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.v1beta1.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< + InclusionMode> 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.v1beta1.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.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + */ + public int getInclusionModeValue() { + return inclusionMode_; + } + /** + *
+     * The mode to use for filtering asset discovery.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + */ + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode getInclusionMode() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode result = com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode.valueOf(inclusionMode_); + return result == null ? com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig) + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.OrganizationSettingsOuterClass.internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_AssetDiscoveryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.OrganizationSettingsOuterClass.internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_AssetDiscoveryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.class, com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettingsOuterClass.internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_AssetDiscoveryConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig build() { + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig buildPartial() { + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + */ + public int getInclusionModeValue() { + return inclusionMode_; + } + /** + *
+       * The mode to use for filtering asset discovery.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + */ + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode getInclusionMode() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode result = com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode.valueOf(inclusionMode_); + return result == null ? com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode.UNRECOGNIZED : result; + } + /** + *
+       * The mode to use for filtering asset discovery.
+       * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode inclusion_mode = 2; + */ + public Builder setInclusionMode(com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig) + private static final com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig assetDiscoveryConfig_; + /** + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + public boolean hasAssetDiscoveryConfig() { + return assetDiscoveryConfig_ != null; + } + /** + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig getAssetDiscoveryConfig() { + return assetDiscoveryConfig_ == null ? com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.getDefaultInstance() : assetDiscoveryConfig_; + } + /** + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + public com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.OrganizationSettings other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.OrganizationSettings} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.OrganizationSettings) + com.google.cloud.securitycenter.v1beta1.OrganizationSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.OrganizationSettingsOuterClass.internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.OrganizationSettingsOuterClass.internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.class, com.google.cloud.securitycenter.v1beta1.OrganizationSettings.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettingsOuterClass.internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.OrganizationSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings build() { + com.google.cloud.securitycenter.v1beta1.OrganizationSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings buildPartial() { + com.google.cloud.securitycenter.v1beta1.OrganizationSettings result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.OrganizationSettings)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.OrganizationSettings other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig assetDiscoveryConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig, com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.Builder, com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfigOrBuilder> assetDiscoveryConfigBuilder_; + /** + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + public boolean hasAssetDiscoveryConfig() { + return assetDiscoveryConfigBuilder_ != null || assetDiscoveryConfig_ != null; + } + /** + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig getAssetDiscoveryConfig() { + if (assetDiscoveryConfigBuilder_ == null) { + return assetDiscoveryConfig_ == null ? com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.getDefaultInstance() : assetDiscoveryConfig_; + } else { + return assetDiscoveryConfigBuilder_.getMessage(); + } + } + /** + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + public Builder setAssetDiscoveryConfig(com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + public Builder setAssetDiscoveryConfig( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + public Builder mergeAssetDiscoveryConfig(com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig value) { + if (assetDiscoveryConfigBuilder_ == null) { + if (assetDiscoveryConfig_ != null) { + assetDiscoveryConfig_ = + com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.Builder getAssetDiscoveryConfigBuilder() { + + onChanged(); + return getAssetDiscoveryConfigFieldBuilder().getBuilder(); + } + /** + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfigOrBuilder getAssetDiscoveryConfigOrBuilder() { + if (assetDiscoveryConfigBuilder_ != null) { + return assetDiscoveryConfigBuilder_.getMessageOrBuilder(); + } else { + return assetDiscoveryConfig_ == null ? + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.getDefaultInstance() : assetDiscoveryConfig_; + } + } + /** + *
+     * The configuration used for Asset Discovery runs.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig, com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.Builder, com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfigOrBuilder> + getAssetDiscoveryConfigFieldBuilder() { + if (assetDiscoveryConfigBuilder_ == null) { + assetDiscoveryConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig, com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig.Builder, com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.OrganizationSettings) + private static final com.google.cloud.securitycenter.v1beta1.OrganizationSettings DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.OrganizationSettings(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationSettingsName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationSettingsName.java new file mode 100644 index 000000000000..69de31be678a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationSettingsName.java @@ -0,0 +1,166 @@ +/* + * 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.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationSettingsOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationSettingsOrBuilder.java new file mode 100644 index 000000000000..d347866bed7d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationSettingsOrBuilder.java @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/organization_settings.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface OrganizationSettingsOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + boolean hasAssetDiscoveryConfig(); + /** + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig getAssetDiscoveryConfig(); + /** + *
+   * The configuration used for Asset Discovery runs.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfig asset_discovery_config = 3; + */ + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.AssetDiscoveryConfigOrBuilder getAssetDiscoveryConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationSettingsOuterClass.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationSettingsOuterClass.java new file mode 100644 index 000000000000..dae8ef295fdf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/OrganizationSettingsOuterClass.java @@ -0,0 +1,84 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/organization_settings.proto + +package com.google.cloud.securitycenter.v1beta1; + +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_v1beta1_OrganizationSettings_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_AssetDiscoveryConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_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/v1beta1/or" + + "ganization_settings.proto\022#google.cloud." + + "securitycenter.v1beta1\032\034google/api/annot" + + "ations.proto\"\250\003\n\024OrganizationSettings\022\014\n" + + "\004name\030\001 \001(\t\022\036\n\026enable_asset_discovery\030\002 " + + "\001(\010\022n\n\026asset_discovery_config\030\003 \001(\0132N.go" + + "ogle.cloud.securitycenter.v1beta1.Organi" + + "zationSettings.AssetDiscoveryConfig\032\361\001\n\024" + + "AssetDiscoveryConfig\022\023\n\013project_ids\030\001 \003(" + + "\t\022t\n\016inclusion_mode\030\002 \001(\0162\\.google.cloud" + + ".securitycenter.v1beta1.OrganizationSett" + + "ings.AssetDiscoveryConfig.InclusionMode\"" + + "N\n\rInclusionMode\022\036\n\032INCLUSION_MODE_UNSPE" + + "CIFIED\020\000\022\020\n\014INCLUDE_ONLY\020\001\022\013\n\007EXCLUDE\020\002B" + + "~\n\'com.google.cloud.securitycenter.v1bet" + + "a1P\001ZQgoogle.golang.org/genproto/googlea" + + "pis/cloud/securitycenter/v1beta1;securit" + + "ycenterb\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_v1beta1_OrganizationSettings_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_descriptor, + new java.lang.String[] { "Name", "EnableAssetDiscovery", "AssetDiscoveryConfig", }); + internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_AssetDiscoveryConfig_descriptor = + internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_securitycenter_v1beta1_OrganizationSettings_AssetDiscoveryConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1beta1_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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/RunAssetDiscoveryRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/RunAssetDiscoveryRequest.java new file mode 100644 index 000000000000..e7aef2fcba49 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/RunAssetDiscoveryRequest.java @@ -0,0 +1,584 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for running asset discovery for an organization.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest} + */ +public final class RunAssetDiscoveryRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_RunAssetDiscoveryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_RunAssetDiscoveryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.class, com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.RunAssetDiscoveryRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest) + com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_RunAssetDiscoveryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_RunAssetDiscoveryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.class, com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_RunAssetDiscoveryRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest build() { + com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest) + private static final com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.RunAssetDiscoveryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/RunAssetDiscoveryRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/RunAssetDiscoveryRequestOrBuilder.java new file mode 100644 index 000000000000..59dc6ff18103 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/RunAssetDiscoveryRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface RunAssetDiscoveryRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityMarks.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityMarks.java new file mode 100644 index 000000000000..5947674e3c53 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityMarks.java @@ -0,0 +1,988 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/security_marks.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * 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.v1beta1.SecurityMarks} + */ +public final class SecurityMarks extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarksOuterClass.internal_static_google_cloud_securitycenter_v1beta1_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.v1beta1.SecurityMarksOuterClass.internal_static_google_cloud_securitycenter_v1beta1_SecurityMarks_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.SecurityMarks.class, com.google.cloud.securitycenter.v1beta1.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< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.securitycenter.v1beta1.SecurityMarksOuterClass.internal_static_google_cloud_securitycenter_v1beta1_SecurityMarks_MarksEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> 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 alphanumeric and between 1 - 256 characters (inclusive)
+   *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+   *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+   *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+   *   - 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.v1beta1.SecurityMarks)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.SecurityMarks other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.SecurityMarks} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.SecurityMarks) + com.google.cloud.securitycenter.v1beta1.SecurityMarksOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecurityMarksOuterClass.internal_static_google_cloud_securitycenter_v1beta1_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.v1beta1.SecurityMarksOuterClass.internal_static_google_cloud_securitycenter_v1beta1_SecurityMarks_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.SecurityMarks.class, com.google.cloud.securitycenter.v1beta1.SecurityMarks.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarksOuterClass.internal_static_google_cloud_securitycenter_v1beta1_SecurityMarks_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.SecurityMarks getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.SecurityMarks.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.SecurityMarks build() { + com.google.cloud.securitycenter.v1beta1.SecurityMarks result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.SecurityMarks buildPartial() { + com.google.cloud.securitycenter.v1beta1.SecurityMarks result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.SecurityMarks)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.SecurityMarks other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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< + java.lang.String, java.lang.String> 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 alphanumeric and between 1 - 256 characters (inclusive)
+     *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+     *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+     *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+     *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+     *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+     *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+     *   - 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.v1beta1.SecurityMarks) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.SecurityMarks) + private static final com.google.cloud.securitycenter.v1beta1.SecurityMarks DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.SecurityMarks(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityMarksOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityMarksOrBuilder.java new file mode 100644 index 000000000000..1fe8dc05952e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityMarksOrBuilder.java @@ -0,0 +1,114 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/security_marks.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface SecurityMarksOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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 alphanumeric and between 1 - 256 characters (inclusive)
+   *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+   *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+   *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+   *   - 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 alphanumeric and between 1 - 256 characters (inclusive)
+   *   - 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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityMarksOuterClass.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityMarksOuterClass.java new file mode 100644 index 000000000000..5d502f2cf1e2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityMarksOuterClass.java @@ -0,0 +1,77 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/security_marks.proto + +package com.google.cloud.securitycenter.v1beta1; + +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_v1beta1_SecurityMarks_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_SecurityMarks_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_SecurityMarks_MarksEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_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 = { + "\n8google/cloud/securitycenter/v1beta1/se" + + "curity_marks.proto\022#google.cloud.securit" + + "ycenter.v1beta1\032\034google/api/annotations." + + "proto\"\231\001\n\rSecurityMarks\022\014\n\004name\030\001 \001(\t\022L\n" + + "\005marks\030\002 \003(\0132=.google.cloud.securitycent" + + "er.v1beta1.SecurityMarks.MarksEntry\032,\n\nM" + + "arksEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" + + "\001B~\n\'com.google.cloud.securitycenter.v1b" + + "eta1P\001ZQgoogle.golang.org/genproto/googl" + + "eapis/cloud/securitycenter/v1beta1;secur" + + "itycenterb\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_v1beta1_SecurityMarks_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1beta1_SecurityMarks_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1beta1_SecurityMarks_descriptor, + new java.lang.String[] { "Name", "Marks", }); + internal_static_google_cloud_securitycenter_v1beta1_SecurityMarks_MarksEntry_descriptor = + internal_static_google_cloud_securitycenter_v1beta1_SecurityMarks_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_securitycenter_v1beta1_SecurityMarks_MarksEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1beta1_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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecuritycenterService.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecuritycenterService.java new file mode 100644 index 000000000000..25d27c594ca4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SecuritycenterService.java @@ -0,0 +1,522 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +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_v1beta1_CreateFindingRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_CreateFindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_CreateSourceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_CreateSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_GetOrganizationSettingsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_GetOrganizationSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_GetSourceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_GetSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_GroupAssetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_GroupFindingsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_GroupResult_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_GroupResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_GroupResult_PropertiesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_GroupResult_PropertiesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_ListSourcesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_ListSourcesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_ListSourcesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_ListSourcesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_ListAssetsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_ListAssetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_ListAssetsResult_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_ListAssetsResponse_ListAssetsResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_ListFindingsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_ListFindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_ListFindingsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_ListFindingsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_SetFindingStateRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_SetFindingStateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_RunAssetDiscoveryRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_RunAssetDiscoveryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_UpdateFindingRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_UpdateFindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_UpdateOrganizationSettingsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_UpdateOrganizationSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_UpdateSourceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_UpdateSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securitycenter_v1beta1_UpdateSecurityMarksRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_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/v1beta1/se" + + "curitycenter_service.proto\022#google.cloud" + + ".securitycenter.v1beta1\032\034google/api/anno" + + "tations.proto\032/google/cloud/securitycent" + + "er/v1beta1/asset.proto\0321google/cloud/sec" + + "uritycenter/v1beta1/finding.proto\032?googl" + + "e/cloud/securitycenter/v1beta1/organizat" + + "ion_settings.proto\0328google/cloud/securit" + + "ycenter/v1beta1/security_marks.proto\0320go" + + "ogle/cloud/securitycenter/v1beta1/source" + + ".proto\032\036google/iam/v1/iam_policy.proto\032\032" + + "google/iam/v1/policy.proto\032#google/longr" + + "unning/operations.proto\032\036google/protobuf" + + "/duration.proto\032\033google/protobuf/empty.p" + + "roto\032 google/protobuf/field_mask.proto\032\034" + + "google/protobuf/struct.proto\032\037google/pro" + + "tobuf/timestamp.proto\"y\n\024CreateFindingRe" + + "quest\022\016\n\006parent\030\001 \001(\t\022\022\n\nfinding_id\030\002 \001(" + + "\t\022=\n\007finding\030\003 \001(\0132,.google.cloud.securi" + + "tycenter.v1beta1.Finding\"b\n\023CreateSource" + + "Request\022\016\n\006parent\030\001 \001(\t\022;\n\006source\030\002 \001(\0132" + + "+.google.cloud.securitycenter.v1beta1.So" + + "urce\".\n\036GetOrganizationSettingsRequest\022\014" + + "\n\004name\030\001 \001(\t\" \n\020GetSourceRequest\022\014\n\004name" + + "\030\001 \001(\t\"\321\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\022" + + "3\n\020compare_duration\030\004 \001(\0132\031.google.proto" + + "buf.Duration\022-\n\tread_time\030\005 \001(\0132\032.google" + + ".protobuf.Timestamp\022\022\n\npage_token\030\007 \001(\t\022" + + "\021\n\tpage_size\030\010 \001(\005\"\251\001\n\023GroupAssetsRespon" + + "se\022J\n\020group_by_results\030\001 \003(\01320.google.cl" + + "oud.securitycenter.v1beta1.GroupResult\022-" + + "\n\tread_time\030\002 \001(\0132\032.google.protobuf.Time" + + "stamp\022\027\n\017next_page_token\030\003 \001(\t\"\236\001\n\024Group" + + "FindingsRequest\022\016\n\006parent\030\001 \001(\t\022\016\n\006filte" + + "r\030\002 \001(\t\022\020\n\010group_by\030\003 \001(\t\022-\n\tread_time\030\004" + + " \001(\0132\032.google.protobuf.Timestamp\022\022\n\npage" + + "_token\030\005 \001(\t\022\021\n\tpage_size\030\006 \001(\005\"\253\001\n\025Grou" + + "pFindingsResponse\022J\n\020group_by_results\030\001 " + + "\003(\01320.google.cloud.securitycenter.v1beta" + + "1.GroupResult\022-\n\tread_time\030\002 \001(\0132\032.googl" + + "e.protobuf.Timestamp\022\027\n\017next_page_token\030" + + "\003 \001(\t\"\275\001\n\013GroupResult\022T\n\nproperties\030\001 \003(" + + "\0132@.google.cloud.securitycenter.v1beta1." + + "GroupResult.PropertiesEntry\022\r\n\005count\030\002 \001" + + "(\003\032I\n\017PropertiesEntry\022\013\n\003key\030\001 \001(\t\022%\n\005va" + + "lue\030\002 \001(\0132\026.google.protobuf.Value:\0028\001\"K\n" + + "\022ListSourcesRequest\022\016\n\006parent\030\001 \001(\t\022\022\n\np" + + "age_token\030\002 \001(\t\022\021\n\tpage_size\030\007 \001(\005\"l\n\023Li" + + "stSourcesResponse\022<\n\007sources\030\001 \003(\0132+.goo" + + "gle.cloud.securitycenter.v1beta1.Source\022" + + "\027\n\017next_page_token\030\002 \001(\t\"\200\002\n\021ListAssetsR" + + "equest\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\tread_time\030\004 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\0223\n\020compare_durat" + + "ion\030\005 \001(\0132\031.google.protobuf.Duration\022.\n\n" + + "field_mask\030\007 \001(\0132\032.google.protobuf.Field" + + "Mask\022\022\n\npage_token\030\010 \001(\t\022\021\n\tpage_size\030\t " + + "\001(\005\"\326\003\n\022ListAssetsResponse\022e\n\023list_asset" + + "s_results\030\001 \003(\0132H.google.cloud.securityc" + + "enter.v1beta1.ListAssetsResponse.ListAss" + + "etsResult\022-\n\tread_time\030\002 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022\027\n\017next_page_token\030\003 \001(" + + "\t\022\022\n\ntotal_size\030\004 \001(\005\032\374\001\n\020ListAssetsResu" + + "lt\0229\n\005asset\030\001 \001(\0132*.google.cloud.securit" + + "ycenter.v1beta1.Asset\022]\n\005state\030\002 \001(\0162N.g" + + "oogle.cloud.securitycenter.v1beta1.ListA" + + "ssetsResponse.ListAssetsResult.State\"N\n\005" + + "State\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n\006UNUSED\020\001" + + "\022\t\n\005ADDED\020\002\022\013\n\007REMOVED\020\003\022\n\n\006ACTIVE\020\004\"\315\001\n" + + "\023ListFindingsRequest\022\016\n\006parent\030\001 \001(\t\022\016\n\006" + + "filter\030\002 \001(\t\022\020\n\010order_by\030\003 \001(\t\022-\n\tread_t" + + "ime\030\004 \001(\0132\032.google.protobuf.Timestamp\022.\n" + + "\nfield_mask\030\005 \001(\0132\032.google.protobuf.Fiel" + + "dMask\022\022\n\npage_token\030\006 \001(\t\022\021\n\tpage_size\030\007" + + " \001(\005\"\262\001\n\024ListFindingsResponse\022>\n\010finding" + + "s\030\001 \003(\0132,.google.cloud.securitycenter.v1" + + "beta1.Finding\022-\n\tread_time\030\002 \001(\0132\032.googl" + + "e.protobuf.Timestamp\022\027\n\017next_page_token\030" + + "\003 \001(\t\022\022\n\ntotal_size\030\004 \001(\005\"\231\001\n\026SetFinding" + + "StateRequest\022\014\n\004name\030\001 \001(\t\022A\n\005state\030\002 \001(" + + "\01622.google.cloud.securitycenter.v1beta1." + + "Finding.State\022.\n\nstart_time\030\003 \001(\0132\032.goog" + + "le.protobuf.Timestamp\"*\n\030RunAssetDiscove" + + "ryRequest\022\016\n\006parent\030\001 \001(\t\"\206\001\n\024UpdateFind" + + "ingRequest\022=\n\007finding\030\001 \001(\0132,.google.clo" + + "ud.securitycenter.v1beta1.Finding\022/\n\013upd" + + "ate_mask\030\002 \001(\0132\032.google.protobuf.FieldMa" + + "sk\"\256\001\n!UpdateOrganizationSettingsRequest" + + "\022X\n\025organization_settings\030\001 \001(\01329.google" + + ".cloud.securitycenter.v1beta1.Organizati" + + "onSettings\022/\n\013update_mask\030\002 \001(\0132\032.google" + + ".protobuf.FieldMask\"\203\001\n\023UpdateSourceRequ" + + "est\022;\n\006source\030\001 \001(\0132+.google.cloud.secur" + + "itycenter.v1beta1.Source\022/\n\013update_mask\030" + + "\002 \001(\0132\032.google.protobuf.FieldMask\"\311\001\n\032Up" + + "dateSecurityMarksRequest\022J\n\016security_mar" + + "ks\030\001 \001(\01322.google.cloud.securitycenter.v" + + "1beta1.SecurityMarks\022/\n\013update_mask\030\002 \001(" + + "\0132\032.google.protobuf.FieldMask\022.\n\nstart_t" + + "ime\030\003 \001(\0132\032.google.protobuf.Timestamp2\200\034" + + "\n\016SecurityCenter\022\260\001\n\014CreateSource\0228.goog" + + "le.cloud.securitycenter.v1beta1.CreateSo" + + "urceRequest\032+.google.cloud.securitycente" + + "r.v1beta1.Source\"9\202\323\344\223\0023\")/v1beta1/{pare" + + "nt=organizations/*}/sources:\006source\022\277\001\n\r" + + "CreateFinding\0229.google.cloud.securitycen" + + "ter.v1beta1.CreateFindingRequest\032,.googl" + + "e.cloud.securitycenter.v1beta1.Finding\"E" + + "\202\323\344\223\002?\"4/v1beta1/{parent=organizations/*" + + "/sources/*}/findings:\007finding\022\220\001\n\014GetIam" + + "Policy\022\".google.iam.v1.GetIamPolicyReque" + + "st\032\025.google.iam.v1.Policy\"E\202\323\344\223\002?\":/v1be" + + "ta1/{resource=organizations/*/sources/*}" + + ":getIamPolicy:\001*\022\327\001\n\027GetOrganizationSett" + + "ings\022C.google.cloud.securitycenter.v1bet" + + "a1.GetOrganizationSettingsRequest\0329.goog" + + "le.cloud.securitycenter.v1beta1.Organiza" + + "tionSettings\"<\202\323\344\223\0026\0224/v1beta1/{name=org" + + "anizations/*/organizationSettings}\022\242\001\n\tG" + + "etSource\0225.google.cloud.securitycenter.v" + + "1beta1.GetSourceRequest\032+.google.cloud.s" + + "ecuritycenter.v1beta1.Source\"1\202\323\344\223\002+\022)/v" + + "1beta1/{name=organizations/*/sources/*}\022" + + "\273\001\n\013GroupAssets\0227.google.cloud.securityc" + + "enter.v1beta1.GroupAssetsRequest\0328.googl" + + "e.cloud.securitycenter.v1beta1.GroupAsse" + + "tsResponse\"9\202\323\344\223\0023\"./v1beta1/{parent=org" + + "anizations/*}/assets:group:\001*\022\315\001\n\rGroupF" + + "indings\0229.google.cloud.securitycenter.v1" + + "beta1.GroupFindingsRequest\032:.google.clou" + + "d.securitycenter.v1beta1.GroupFindingsRe" + + "sponse\"E\202\323\344\223\002?\":/v1beta1/{parent=organiz" + + "ations/*/sources/*}/findings:group:\001*\022\257\001" + + "\n\nListAssets\0226.google.cloud.securitycent" + + "er.v1beta1.ListAssetsRequest\0327.google.cl" + + "oud.securitycenter.v1beta1.ListAssetsRes" + + "ponse\"0\202\323\344\223\002*\022(/v1beta1/{parent=organiza" + + "tions/*}/assets\022\301\001\n\014ListFindings\0228.googl" + + "e.cloud.securitycenter.v1beta1.ListFindi" + + "ngsRequest\0329.google.cloud.securitycenter" + + ".v1beta1.ListFindingsResponse\"<\202\323\344\223\0026\0224/" + + "v1beta1/{parent=organizations/*/sources/" + + "*}/findings\022\263\001\n\013ListSources\0227.google.clo" + + "ud.securitycenter.v1beta1.ListSourcesReq" + + "uest\0328.google.cloud.securitycenter.v1bet" + + "a1.ListSourcesResponse\"1\202\323\344\223\002+\022)/v1beta1" + + "/{parent=organizations/*}/sources\022\263\001\n\021Ru" + + "nAssetDiscovery\022=.google.cloud.securityc" + + "enter.v1beta1.RunAssetDiscoveryRequest\032\035" + + ".google.longrunning.Operation\"@\202\323\344\223\002:\"5/" + + "v1beta1/{parent=organizations/*}/assets:" + + "runDiscovery:\001*\022\306\001\n\017SetFindingState\022;.go" + + "ogle.cloud.securitycenter.v1beta1.SetFin" + + "dingStateRequest\032,.google.cloud.security" + + "center.v1beta1.Finding\"H\202\323\344\223\002B\"=/v1beta1" + + "/{name=organizations/*/sources/*/finding" + + "s/*}:setState:\001*\022\220\001\n\014SetIamPolicy\022\".goog" + + "le.iam.v1.SetIamPolicyRequest\032\025.google.i" + + "am.v1.Policy\"E\202\323\344\223\002?\":/v1beta1/{resource" + + "=organizations/*/sources/*}:setIamPolicy" + + ":\001*\022\266\001\n\022TestIamPermissions\022(.google.iam." + + "v1.TestIamPermissionsRequest\032).google.ia" + + "m.v1.TestIamPermissionsResponse\"K\202\323\344\223\002E\"" + + "@/v1beta1/{resource=organizations/*/sour" + + "ces/*}:testIamPermissions:\001*\022\307\001\n\rUpdateF" + + "inding\0229.google.cloud.securitycenter.v1b" + + "eta1.UpdateFindingRequest\032,.google.cloud" + + ".securitycenter.v1beta1.Finding\"M\202\323\344\223\002G2" + + " + * Request message for updating a finding's state. + * + * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.SetFindingStateRequest} + */ +public final class SetFindingStateRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_SetFindingStateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_SetFindingStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest.class, com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding.State state = 2; + */ + public int getStateValue() { + return state_; + } + /** + *
+   * The desired State of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding.State state = 2; + */ + public com.google.cloud.securitycenter.v1beta1.Finding.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1beta1.Finding.State result = com.google.cloud.securitycenter.v1beta1.Finding.State.valueOf(state_); + return result == null ? com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.SetFindingStateRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.SetFindingStateRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.SetFindingStateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.SetFindingStateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.SetFindingStateRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.SetFindingStateRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.SetFindingStateRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.SetFindingStateRequest) + com.google.cloud.securitycenter.v1beta1.SetFindingStateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_SetFindingStateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_SetFindingStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest.class, com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_SetFindingStateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest build() { + com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.SetFindingStateRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.SetFindingStateRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.Finding.State state = 2; + */ + public int getStateValue() { + return state_; + } + /** + *
+     * The desired State of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding.State state = 2; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + *
+     * The desired State of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding.State state = 2; + */ + public com.google.cloud.securitycenter.v1beta1.Finding.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.securitycenter.v1beta1.Finding.State result = com.google.cloud.securitycenter.v1beta1.Finding.State.valueOf(state_); + return result == null ? com.google.cloud.securitycenter.v1beta1.Finding.State.UNRECOGNIZED : result; + } + /** + *
+     * The desired State of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding.State state = 2; + */ + public Builder setState(com.google.cloud.securitycenter.v1beta1.Finding.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The desired State of the finding.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.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.v1beta1.SetFindingStateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.SetFindingStateRequest) + private static final com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.SetFindingStateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SetFindingStateRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SetFindingStateRequestOrBuilder.java new file mode 100644 index 000000000000..add9e550c2cf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SetFindingStateRequestOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface SetFindingStateRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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.v1beta1.Finding.State state = 2; + */ + int getStateValue(); + /** + *
+   * The desired State of the finding.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding.State state = 2; + */ + com.google.cloud.securitycenter.v1beta1.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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/Source.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/Source.java new file mode 100644 index 000000000000..71f1bc0c450d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/Source.java @@ -0,0 +1,996 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/source.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * 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.v1beta1.Source} + */ +public final class Source extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.SourceOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SourceOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.Source.class, com.google.cloud.securitycenter.v1beta1.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 30 characters. This is captured by the regular expression:
+   * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\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 30 characters. This is captured by the regular expression:
+   * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\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.v1beta1.Source)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.Source other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.Source} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.Source) + com.google.cloud.securitycenter.v1beta1.SourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SourceOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SourceOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.Source.class, com.google.cloud.securitycenter.v1beta1.Source.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SourceOuterClass.internal_static_google_cloud_securitycenter_v1beta1_Source_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.Source getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.Source.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.Source build() { + com.google.cloud.securitycenter.v1beta1.Source result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.Source buildPartial() { + com.google.cloud.securitycenter.v1beta1.Source result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.Source)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.Source other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.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 30 characters. This is captured by the regular expression:
+     * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\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 30 characters. This is captured by the regular expression:
+     * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\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 30 characters. This is captured by the regular expression:
+     * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\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 30 characters. This is captured by the regular expression:
+     * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\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 30 characters. This is captured by the regular expression:
+     * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\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.v1beta1.Source) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.Source) + private static final com.google.cloud.securitycenter.v1beta1.Source DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.Source(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SourceName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SourceName.java new file mode 100644 index 000000000000..b1d167afdc7d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SourceName.java @@ -0,0 +1,189 @@ +/* + * 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.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SourceOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SourceOrBuilder.java new file mode 100644 index 000000000000..d87d4178899c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SourceOrBuilder.java @@ -0,0 +1,93 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/source.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface SourceOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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 30 characters. This is captured by the regular expression:
+   * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\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 30 characters. This is captured by the regular expression:
+   * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SourceOuterClass.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SourceOuterClass.java new file mode 100644 index 000000000000..86088fb9894e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/SourceOuterClass.java @@ -0,0 +1,63 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/source.proto + +package com.google.cloud.securitycenter.v1beta1; + +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_v1beta1_Source_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securitycenter_v1beta1_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 = { + "\n0google/cloud/securitycenter/v1beta1/so" + + "urce.proto\022#google.cloud.securitycenter." + + "v1beta1\032\034google/api/annotations.proto\"A\n" + + "\006Source\022\014\n\004name\030\001 \001(\t\022\024\n\014display_name\030\002 " + + "\001(\t\022\023\n\013description\030\003 \001(\tB~\n\'com.google.c" + + "loud.securitycenter.v1beta1P\001ZQgoogle.go" + + "lang.org/genproto/googleapis/cloud/secur" + + "itycenter/v1beta1;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_v1beta1_Source_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securitycenter_v1beta1_Source_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securitycenter_v1beta1_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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UntypedSecuritymarksName.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UntypedSecuritymarksName.java new file mode 100644 index 000000000000..395a09277e61 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UntypedSecuritymarksName.java @@ -0,0 +1,103 @@ +/* + * 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.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.api.resourcenames.ResourceName; +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-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateFindingRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateFindingRequest.java new file mode 100644 index 000000000000..5446ea004d77 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateFindingRequest.java @@ -0,0 +1,940 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for updating or creating a finding.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.UpdateFindingRequest} + */ +public final class UpdateFindingRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.Finding.Builder subBuilder = null; + if (finding_ != null) { + subBuilder = finding_.toBuilder(); + } + finding_ = input.readMessage(com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest.class, com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest.Builder.class); + } + + public static final int FINDING_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1beta1.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
+   * alphanumeric and less than or equal to 32 characters and greater than 0
+   * characters in length.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.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
+   * alphanumeric and less than or equal to 32 characters and greater than 0
+   * characters in length.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Finding getFinding() { + return finding_ == null ? com.google.cloud.securitycenter.v1beta1.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
+   * alphanumeric and less than or equal to 32 characters and greater than 0
+   * characters in length.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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 is
+   * ignored if the finding does not already exist and the finding is created.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The FieldMask to use when updating the finding resource. This field is
+   * ignored if the finding does not already exist and the finding is created.
+   * 
+ * + * .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 is
+   * ignored if the finding does not already exist and the finding is created.
+   * 
+ * + * .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.v1beta1.UpdateFindingRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateFindingRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateFindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateFindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateFindingRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateFindingRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.UpdateFindingRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.UpdateFindingRequest) + com.google.cloud.securitycenter.v1beta1.UpdateFindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest.class, com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateFindingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest build() { + com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateFindingRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateFindingRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1beta1.Finding finding_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Finding, com.google.cloud.securitycenter.v1beta1.Finding.Builder, com.google.cloud.securitycenter.v1beta1.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
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.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
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Finding getFinding() { + if (findingBuilder_ == null) { + return finding_ == null ? com.google.cloud.securitycenter.v1beta1.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
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding finding = 1; + */ + public Builder setFinding(com.google.cloud.securitycenter.v1beta1.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
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding finding = 1; + */ + public Builder setFinding( + com.google.cloud.securitycenter.v1beta1.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
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding finding = 1; + */ + public Builder mergeFinding(com.google.cloud.securitycenter.v1beta1.Finding value) { + if (findingBuilder_ == null) { + if (finding_ != null) { + finding_ = + com.google.cloud.securitycenter.v1beta1.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
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.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
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding finding = 1; + */ + public com.google.cloud.securitycenter.v1beta1.FindingOrBuilder getFindingOrBuilder() { + if (findingBuilder_ != null) { + return findingBuilder_.getMessageOrBuilder(); + } else { + return finding_ == null ? + com.google.cloud.securitycenter.v1beta1.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
+     * alphanumeric and less than or equal to 32 characters and greater than 0
+     * characters in length.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding finding = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Finding, com.google.cloud.securitycenter.v1beta1.Finding.Builder, com.google.cloud.securitycenter.v1beta1.FindingOrBuilder> + getFindingFieldBuilder() { + if (findingBuilder_ == null) { + findingBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Finding, com.google.cloud.securitycenter.v1beta1.Finding.Builder, com.google.cloud.securitycenter.v1beta1.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 is
+     * ignored if the finding does not already exist and the finding is created.
+     * 
+ * + * .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 is
+     * ignored if the finding does not already exist and the finding is created.
+     * 
+ * + * .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 is
+     * ignored if the finding does not already exist and the finding is created.
+     * 
+ * + * .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 is
+     * ignored if the finding does not already exist and the finding is created.
+     * 
+ * + * .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 is
+     * ignored if the finding does not already exist and the finding is created.
+     * 
+ * + * .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 is
+     * ignored if the finding does not already exist and the finding is created.
+     * 
+ * + * .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 is
+     * ignored if the finding does not already exist and the finding is created.
+     * 
+ * + * .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 is
+     * ignored if the finding does not already exist and the finding is created.
+     * 
+ * + * .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 is
+     * ignored if the finding does not already exist and the finding is created.
+     * 
+ * + * .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.v1beta1.UpdateFindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.UpdateFindingRequest) + private static final com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateFindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateFindingRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateFindingRequestOrBuilder.java new file mode 100644 index 000000000000..f3f819603f7a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateFindingRequestOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface UpdateFindingRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.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
+   * alphanumeric and less than or equal to 32 characters and greater than 0
+   * characters in length.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.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
+   * alphanumeric and less than or equal to 32 characters and greater than 0
+   * characters in length.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding finding = 1; + */ + com.google.cloud.securitycenter.v1beta1.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
+   * alphanumeric and less than or equal to 32 characters and greater than 0
+   * characters in length.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Finding finding = 1; + */ + com.google.cloud.securitycenter.v1beta1.FindingOrBuilder getFindingOrBuilder(); + + /** + *
+   * The FieldMask to use when updating the finding resource. This field is
+   * ignored if the finding does not already exist and the finding is created.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + *
+   * The FieldMask to use when updating the finding resource. This field is
+   * ignored if the finding does not already exist and the finding is created.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The FieldMask to use when updating the finding resource. This field is
+   * ignored if the finding does not already exist and the finding is created.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateOrganizationSettingsRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateOrganizationSettingsRequest.java new file mode 100644 index 000000000000..281762b23830 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateOrganizationSettingsRequest.java @@ -0,0 +1,880 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for updating an organization's settings.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest} + */ +public final class UpdateOrganizationSettingsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings.Builder subBuilder = null; + if (organizationSettings_ != null) { + subBuilder = organizationSettings_.toBuilder(); + } + organizationSettings_ = input.readMessage(com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateOrganizationSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.class, com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.Builder.class); + } + + public static final int ORGANIZATION_SETTINGS_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1beta1.OrganizationSettings organizationSettings_; + /** + *
+   * The organization settings resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings organization_settings = 1; + */ + public boolean hasOrganizationSettings() { + return organizationSettings_ != null; + } + /** + *
+   * The organization settings resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings organization_settings = 1; + */ + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings getOrganizationSettings() { + return organizationSettings_ == null ? com.google.cloud.securitycenter.v1beta1.OrganizationSettings.getDefaultInstance() : organizationSettings_; + } + /** + *
+   * The organization settings resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings organization_settings = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The FieldMask to use when updating the settings resource.
+   * 
+ * + * .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.
+   * 
+ * + * .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.v1beta1.UpdateOrganizationSettingsRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateOrganizationSettingsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateOrganizationSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateOrganizationSettingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateOrganizationSettingsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateOrganizationSettingsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.UpdateOrganizationSettingsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest) + com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateOrganizationSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.class, com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateOrganizationSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest build() { + com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateOrganizationSettingsRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateOrganizationSettingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1beta1.OrganizationSettings organizationSettings_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.OrganizationSettings, com.google.cloud.securitycenter.v1beta1.OrganizationSettings.Builder, com.google.cloud.securitycenter.v1beta1.OrganizationSettingsOrBuilder> organizationSettingsBuilder_; + /** + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings organization_settings = 1; + */ + public boolean hasOrganizationSettings() { + return organizationSettingsBuilder_ != null || organizationSettings_ != null; + } + /** + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings organization_settings = 1; + */ + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings getOrganizationSettings() { + if (organizationSettingsBuilder_ == null) { + return organizationSettings_ == null ? com.google.cloud.securitycenter.v1beta1.OrganizationSettings.getDefaultInstance() : organizationSettings_; + } else { + return organizationSettingsBuilder_.getMessage(); + } + } + /** + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings organization_settings = 1; + */ + public Builder setOrganizationSettings(com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings organization_settings = 1; + */ + public Builder setOrganizationSettings( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.OrganizationSettings organization_settings = 1; + */ + public Builder mergeOrganizationSettings(com.google.cloud.securitycenter.v1beta1.OrganizationSettings value) { + if (organizationSettingsBuilder_ == null) { + if (organizationSettings_ != null) { + organizationSettings_ = + com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.OrganizationSettings organization_settings = 1; + */ + public com.google.cloud.securitycenter.v1beta1.OrganizationSettings.Builder getOrganizationSettingsBuilder() { + + onChanged(); + return getOrganizationSettingsFieldBuilder().getBuilder(); + } + /** + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings organization_settings = 1; + */ + public com.google.cloud.securitycenter.v1beta1.OrganizationSettingsOrBuilder getOrganizationSettingsOrBuilder() { + if (organizationSettingsBuilder_ != null) { + return organizationSettingsBuilder_.getMessageOrBuilder(); + } else { + return organizationSettings_ == null ? + com.google.cloud.securitycenter.v1beta1.OrganizationSettings.getDefaultInstance() : organizationSettings_; + } + } + /** + *
+     * The organization settings resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings organization_settings = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.OrganizationSettings, com.google.cloud.securitycenter.v1beta1.OrganizationSettings.Builder, com.google.cloud.securitycenter.v1beta1.OrganizationSettingsOrBuilder> + getOrganizationSettingsFieldBuilder() { + if (organizationSettingsBuilder_ == null) { + organizationSettingsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.OrganizationSettings, com.google.cloud.securitycenter.v1beta1.OrganizationSettings.Builder, com.google.cloud.securitycenter.v1beta1.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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The FieldMask to use when updating the settings resource.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.v1beta1.UpdateOrganizationSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest) + private static final com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateOrganizationSettingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateOrganizationSettingsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateOrganizationSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..257d231aec23 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateOrganizationSettingsRequestOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface UpdateOrganizationSettingsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The organization settings resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings organization_settings = 1; + */ + boolean hasOrganizationSettings(); + /** + *
+   * The organization settings resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings organization_settings = 1; + */ + com.google.cloud.securitycenter.v1beta1.OrganizationSettings getOrganizationSettings(); + /** + *
+   * The organization settings resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.OrganizationSettings organization_settings = 1; + */ + com.google.cloud.securitycenter.v1beta1.OrganizationSettingsOrBuilder getOrganizationSettingsOrBuilder(); + + /** + *
+   * The FieldMask to use when updating the settings resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + *
+   * The FieldMask to use when updating the settings resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The FieldMask to use when updating the settings resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateSecurityMarksRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateSecurityMarksRequest.java new file mode 100644 index 000000000000..7b28ecc113bf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateSecurityMarksRequest.java @@ -0,0 +1,1109 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for updating a SecurityMarks resource.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest} + */ +public final class UpdateSecurityMarksRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks.Builder subBuilder = null; + if (securityMarks_ != null) { + subBuilder = securityMarks_.toBuilder(); + } + securityMarks_ = input.readMessage(com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateSecurityMarksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateSecurityMarksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.class, com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.Builder.class); + } + + public static final int SECURITY_MARKS_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1beta1.SecurityMarks securityMarks_; + /** + *
+   * The security marks resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.SecurityMarks security_marks = 1; + */ + public boolean hasSecurityMarks() { + return securityMarks_ != null; + } + /** + *
+   * The security marks resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.SecurityMarks security_marks = 1; + */ + public com.google.cloud.securitycenter.v1beta1.SecurityMarks getSecurityMarks() { + return securityMarks_ == null ? com.google.cloud.securitycenter.v1beta1.SecurityMarks.getDefaultInstance() : securityMarks_; + } + /** + *
+   * The security marks resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.SecurityMarks security_marks = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The FieldMask to use when updating the security marks resource.
+   * 
+ * + * .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.
+   * 
+ * + * .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.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + *
+   * The time at which the updated SecurityMarks take 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 SecurityMarks take 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 (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.v1beta1.UpdateSecurityMarksRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSecurityMarksRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSecurityMarksRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSecurityMarksRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSecurityMarksRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSecurityMarksRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.UpdateSecurityMarksRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest) + com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateSecurityMarksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateSecurityMarksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.class, com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateSecurityMarksRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest build() { + com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSecurityMarksRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSecurityMarksRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1beta1.SecurityMarks securityMarks_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.SecurityMarks, com.google.cloud.securitycenter.v1beta1.SecurityMarks.Builder, com.google.cloud.securitycenter.v1beta1.SecurityMarksOrBuilder> securityMarksBuilder_; + /** + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.SecurityMarks security_marks = 1; + */ + public boolean hasSecurityMarks() { + return securityMarksBuilder_ != null || securityMarks_ != null; + } + /** + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.SecurityMarks security_marks = 1; + */ + public com.google.cloud.securitycenter.v1beta1.SecurityMarks getSecurityMarks() { + if (securityMarksBuilder_ == null) { + return securityMarks_ == null ? com.google.cloud.securitycenter.v1beta1.SecurityMarks.getDefaultInstance() : securityMarks_; + } else { + return securityMarksBuilder_.getMessage(); + } + } + /** + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.SecurityMarks security_marks = 1; + */ + public Builder setSecurityMarks(com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 1; + */ + public Builder setSecurityMarks( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecurityMarks security_marks = 1; + */ + public Builder mergeSecurityMarks(com.google.cloud.securitycenter.v1beta1.SecurityMarks value) { + if (securityMarksBuilder_ == null) { + if (securityMarks_ != null) { + securityMarks_ = + com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.SecurityMarks security_marks = 1; + */ + public com.google.cloud.securitycenter.v1beta1.SecurityMarks.Builder getSecurityMarksBuilder() { + + onChanged(); + return getSecurityMarksFieldBuilder().getBuilder(); + } + /** + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.SecurityMarks security_marks = 1; + */ + public com.google.cloud.securitycenter.v1beta1.SecurityMarksOrBuilder getSecurityMarksOrBuilder() { + if (securityMarksBuilder_ != null) { + return securityMarksBuilder_.getMessageOrBuilder(); + } else { + return securityMarks_ == null ? + com.google.cloud.securitycenter.v1beta1.SecurityMarks.getDefaultInstance() : securityMarks_; + } + } + /** + *
+     * The security marks resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.SecurityMarks security_marks = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.SecurityMarks, com.google.cloud.securitycenter.v1beta1.SecurityMarks.Builder, com.google.cloud.securitycenter.v1beta1.SecurityMarksOrBuilder> + getSecurityMarksFieldBuilder() { + if (securityMarksBuilder_ == null) { + securityMarksBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.SecurityMarks, com.google.cloud.securitycenter.v1beta1.SecurityMarks.Builder, com.google.cloud.securitycenter.v1beta1.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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The FieldMask to use when updating the security marks resource.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + *
+     * The time at which the updated SecurityMarks take 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 SecurityMarks take 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 SecurityMarks take 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 SecurityMarks take 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 SecurityMarks take 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 SecurityMarks take effect.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.v1beta1.UpdateSecurityMarksRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest) + private static final com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSecurityMarksRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateSecurityMarksRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateSecurityMarksRequestOrBuilder.java new file mode 100644 index 000000000000..08a4eff09c6b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateSecurityMarksRequestOrBuilder.java @@ -0,0 +1,84 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface UpdateSecurityMarksRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The security marks resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.SecurityMarks security_marks = 1; + */ + boolean hasSecurityMarks(); + /** + *
+   * The security marks resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.SecurityMarks security_marks = 1; + */ + com.google.cloud.securitycenter.v1beta1.SecurityMarks getSecurityMarks(); + /** + *
+   * The security marks resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.SecurityMarks security_marks = 1; + */ + com.google.cloud.securitycenter.v1beta1.SecurityMarksOrBuilder getSecurityMarksOrBuilder(); + + /** + *
+   * The FieldMask to use when updating the security marks resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + *
+   * The FieldMask to use when updating the security marks resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The FieldMask to use when updating the security marks resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + *
+   * The time at which the updated SecurityMarks take effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + boolean hasStartTime(); + /** + *
+   * The time at which the updated SecurityMarks take effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + com.google.protobuf.Timestamp getStartTime(); + /** + *
+   * The time at which the updated SecurityMarks take effect.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateSourceRequest.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateSourceRequest.java new file mode 100644 index 000000000000..59dccfe85848 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateSourceRequest.java @@ -0,0 +1,880 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +/** + *
+ * Request message for updating a source.
+ * 
+ * + * Protobuf type {@code google.cloud.securitycenter.v1beta1.UpdateSourceRequest} + */ +public final class UpdateSourceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v1beta1.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.v1beta1.Source.Builder subBuilder = null; + if (source_ != null) { + subBuilder = source_.toBuilder(); + } + source_ = input.readMessage(com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest.class, com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest.Builder.class); + } + + public static final int SOURCE_FIELD_NUMBER = 1; + private com.google.cloud.securitycenter.v1beta1.Source source_; + /** + *
+   * The source resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Source source = 1; + */ + public boolean hasSource() { + return source_ != null; + } + /** + *
+   * The source resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Source source = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Source getSource() { + return source_ == null ? com.google.cloud.securitycenter.v1beta1.Source.getDefaultInstance() : source_; + } + /** + *
+   * The source resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Source source = 1; + */ + public com.google.cloud.securitycenter.v1beta1.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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The FieldMask to use when updating the source resource.
+   * 
+ * + * .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.
+   * 
+ * + * .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.v1beta1.UpdateSourceRequest)) { + return super.equals(obj); + } + com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest other = (com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSourceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSourceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSourceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSourceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.UpdateSourceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v1beta1.UpdateSourceRequest) + com.google.cloud.securitycenter.v1beta1.UpdateSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securitycenter.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest.class, com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest.Builder.class); + } + + // Construct using com.google.cloud.securitycenter.v1beta1.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.v1beta1.SecuritycenterService.internal_static_google_cloud_securitycenter_v1beta1_UpdateSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest getDefaultInstanceForType() { + return com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest build() { + com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest buildPartial() { + com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest result = new com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSourceRequest) { + return mergeFrom((com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest other) { + if (other == com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSourceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.securitycenter.v1beta1.Source source_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Source, com.google.cloud.securitycenter.v1beta1.Source.Builder, com.google.cloud.securitycenter.v1beta1.SourceOrBuilder> sourceBuilder_; + /** + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Source source = 1; + */ + public boolean hasSource() { + return sourceBuilder_ != null || source_ != null; + } + /** + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Source source = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Source getSource() { + if (sourceBuilder_ == null) { + return source_ == null ? com.google.cloud.securitycenter.v1beta1.Source.getDefaultInstance() : source_; + } else { + return sourceBuilder_.getMessage(); + } + } + /** + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Source source = 1; + */ + public Builder setSource(com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source source = 1; + */ + public Builder setSource( + com.google.cloud.securitycenter.v1beta1.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.v1beta1.Source source = 1; + */ + public Builder mergeSource(com.google.cloud.securitycenter.v1beta1.Source value) { + if (sourceBuilder_ == null) { + if (source_ != null) { + source_ = + com.google.cloud.securitycenter.v1beta1.Source.newBuilder(source_).mergeFrom(value).buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + sourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.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.v1beta1.Source source = 1; + */ + public com.google.cloud.securitycenter.v1beta1.Source.Builder getSourceBuilder() { + + onChanged(); + return getSourceFieldBuilder().getBuilder(); + } + /** + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Source source = 1; + */ + public com.google.cloud.securitycenter.v1beta1.SourceOrBuilder getSourceOrBuilder() { + if (sourceBuilder_ != null) { + return sourceBuilder_.getMessageOrBuilder(); + } else { + return source_ == null ? + com.google.cloud.securitycenter.v1beta1.Source.getDefaultInstance() : source_; + } + } + /** + *
+     * The source resource to update.
+     * 
+ * + * .google.cloud.securitycenter.v1beta1.Source source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Source, com.google.cloud.securitycenter.v1beta1.Source.Builder, com.google.cloud.securitycenter.v1beta1.SourceOrBuilder> + getSourceFieldBuilder() { + if (sourceBuilder_ == null) { + sourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securitycenter.v1beta1.Source, com.google.cloud.securitycenter.v1beta1.Source.Builder, com.google.cloud.securitycenter.v1beta1.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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The FieldMask to use when updating the source resource.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.
+     * 
+ * + * .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.v1beta1.UpdateSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.UpdateSourceRequest) + private static final com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v1beta1.UpdateSourceRequest(); + } + + public static com.google.cloud.securitycenter.v1beta1.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.v1beta1.UpdateSourceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateSourceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateSourceRequestOrBuilder.java new file mode 100644 index 000000000000..a6c45c61aac2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/java/com/google/cloud/securitycenter/v1beta1/UpdateSourceRequestOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securitycenter/v1beta1/securitycenter_service.proto + +package com.google.cloud.securitycenter.v1beta1; + +public interface UpdateSourceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1beta1.UpdateSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The source resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Source source = 1; + */ + boolean hasSource(); + /** + *
+   * The source resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Source source = 1; + */ + com.google.cloud.securitycenter.v1beta1.Source getSource(); + /** + *
+   * The source resource to update.
+   * 
+ * + * .google.cloud.securitycenter.v1beta1.Source source = 1; + */ + com.google.cloud.securitycenter.v1beta1.SourceOrBuilder getSourceOrBuilder(); + + /** + *
+   * The FieldMask to use when updating the source resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + boolean hasUpdateMask(); + /** + *
+   * The FieldMask to use when updating the source resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The FieldMask to use when updating the source resource.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/asset.proto b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/asset.proto new file mode 100644 index 000000000000..d8f93409a8cf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/asset.proto @@ -0,0 +1,87 @@ +// 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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1beta1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + + +// 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; + } + + // 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; +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/finding.proto b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/finding.proto new file mode 100644 index 000000000000..0c99247b6059 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/finding.proto @@ -0,0 +1,98 @@ +// 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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1beta1/security_marks.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + + +// 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 give 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. + 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-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/organization_settings.proto b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/organization_settings.proto new file mode 100644 index 000000000000..cc9f1c3ce3e4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/organization_settings.proto @@ -0,0 +1,75 @@ +// 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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + + +// 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; +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/security_marks.proto b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/security_marks.proto new file mode 100644 index 000000000000..02eb9ed23f7a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/security_marks.proto @@ -0,0 +1,46 @@ +// 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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + + +// 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 alphanumeric and between 1 - 256 characters (inclusive) + // - 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-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/securitycenter_service.proto b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/securitycenter_service.proto new file mode 100644 index 000000000000..fecca4f0dffd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/securitycenter_service.proto @@ -0,0 +1,750 @@ +// 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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1beta1/asset.proto"; +import "google/cloud/securitycenter/v1beta1/finding.proto"; +import "google/cloud/securitycenter/v1beta1/organization_settings.proto"; +import "google/cloud/securitycenter/v1beta1/security_marks.proto"; +import "google/cloud/securitycenter/v1beta1/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/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + + +// V1 Beta APIs for Security Center service. +service SecurityCenter { + // Creates a source. + rpc CreateSource(CreateSourceRequest) returns (Source) { + option (google.api.http) = { + post: "/v1beta1/{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: "/v1beta1/{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: "/v1beta1/{resource=organizations/*/sources/*}:getIamPolicy" + body: "*" + }; + } + + // Gets the settings for an organization. + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { + option (google.api.http) = { + get: "/v1beta1/{name=organizations/*/organizationSettings}" + }; + } + + // Gets a source. + rpc GetSource(GetSourceRequest) returns (Source) { + option (google.api.http) = { + get: "/v1beta1/{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: "/v1beta1/{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: /v1beta1/organizations/123/sources/-/findings + rpc GroupFindings(GroupFindingsRequest) returns (GroupFindingsResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*/sources/*}/findings:group" + body: "*" + }; + } + + // Lists an organization's assets. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=organizations/*}/assets" + }; + } + + // Lists an organization or source's findings. + // + // To list across all sources provide a `-` as the source id. + // Example: /v1beta1/organizations/123/sources/-/findings + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=organizations/*/sources/*}/findings" + }; + } + + // Lists all sources belonging to an organization. + rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { + option (google.api.http) = { + get: "/v1beta1/{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: "/v1beta1/{parent=organizations/*}/assets:runDiscovery" + body: "*" + }; + } + + // Updates the state of a finding. + rpc SetFindingState(SetFindingStateRequest) returns (Finding) { + option (google.api.http) = { + post: "/v1beta1/{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: "/v1beta1/{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: "/v1beta1/{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: "/v1beta1/{finding.name=organizations/*/sources/*/findings/*}" + body: "finding" + }; + } + + // Updates an organization's settings. + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { + option (google.api.http) = { + patch: "/v1beta1/{organization_settings.name=organizations/*/organizationSettings}" + body: "organization_settings" + }; + } + + // Updates a source. + rpc UpdateSource(UpdateSourceRequest) returns (Source) { + option (google.api.http) = { + patch: "/v1beta1/{source.name=organizations/*/sources/*}" + body: "source" + }; + } + + // Updates security marks. + rpc UpdateSecurityMarks(UpdateSecurityMarksRequest) returns (SecurityMarks) { + option (google.api.http) = { + patch: "/v1beta1/{security_marks.name=organizations/*/assets/*/securityMarks}" + body: "security_marks" + additional_bindings { + patch: "/v1beta1/{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 not 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 Asset's "state" 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 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" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present before + // 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. + // + // This field is ignored if `state` is not a 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; + + // 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; +} + +// 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 not 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`). The string value should follow SQL syntax: comma separated list + // of fields. For example: + // "parent,resource_name". + // + // The following fields are supported: + // + // * resource_name + // * category + // * state + // * parent + 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; + + // 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 = 5; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 6; +} + +// 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; +} + +// 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 not 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 ListAssetResult's "state" 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 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" values when compare_duration is specified: + // + // * "ADDED": indicates that the asset was not present before + // 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 is + // "UNUSED", which indicates that the asset is present at read_time. + google.protobuf.Duration compare_duration = 5; + + // 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 { + // 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 should + // be: UNUSED + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Request did not specify use of this field in the result. + UNUSED = 1; + + // Asset was added between the points in time. + ADDED = 2; + + // Asset was removed between the points in time. + REMOVED = 3; + + // Asset was active at both point(s) in time. + ACTIVE = 4; + } + + // Asset matching the search request. + Asset asset = 1; + + // State of the asset. + State state = 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 not 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; + + // 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 = 5; + + // 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 = 6; + + // 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 findings. +message ListFindingsResponse { + // Findings matching the list request. + repeated Finding findings = 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 + // 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 is + // ignored if the finding does not already exist and the finding is created. + 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. + 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. + 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. + google.protobuf.FieldMask update_mask = 2; + + // The time at which the updated SecurityMarks take effect. + google.protobuf.Timestamp start_time = 3; +} diff --git a/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/source.proto b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/source.proto new file mode 100644 index 000000000000..9dfc9490e9ab --- /dev/null +++ b/google-api-grpc/proto-google-cloud-securitycenter-v1beta1/src/main/proto/google/cloud/securitycenter/v1beta1/source.proto @@ -0,0 +1,54 @@ +// 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. +// + +syntax = "proto3"; + +package google.cloud.securitycenter.v1beta1; + +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter"; +option java_multiple_files = true; +option java_package = "com.google.cloud.securitycenter.v1beta1"; + + +// 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 30 characters. This is captured by the regular expression: + // [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\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; +} diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index 98cbd4a4f96e..373036da059a 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -611,6 +611,16 @@ grpc-google-cloud-scheduler-v1beta1 0.35.1-SNAPSHOT
+ + com.google.api.grpc + proto-google-cloud-securitycenter-v1beta1 + 0.35.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-securitycenter-v1beta1 + 0.35.1-SNAPSHOT + com.google.cloud google-cloud-spanner diff --git a/google-cloud-clients/google-cloud-securitycenter/README.md b/google-cloud-clients/google-cloud-securitycenter/README.md new file mode 100644 index 000000000000..b97222f4371e --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/README.md @@ -0,0 +1,100 @@ +Google Cloud Java Client for Cloud Security Command Center +========================================================== + +Java idiomatic client for [Cloud Security Command Center][cloud-securitycenter]. + +[![Kokoro CI](http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/master.svg)](http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/master.html) +[![Maven](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-securitycenter.svg)](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-securitycenter.svg) +[![Codacy Badge](https://api.codacy.com/project/badge/grade/9da006ad7c3a4fe1abd142e77c003917)](https://www.codacy.com/app/mziccard/google-cloud-java) + +- [Product Documentation][securitycenter-product-docs] +- [Client Library Documentation][securitycenter-lib-docs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + +Quickstart +---------- + +[//]: # ({x-version-update-start:google-cloud-securitycenter:released}) +If you are using Maven, add this to your pom.xml file +```xml + + com.google.cloud + google-cloud-securitycenter + 0.68.0-alpha + +``` +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-securitycenter:0.68.0-alpha' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-securitycenter" % "0.68.0-alpha" +``` +[//]: # ({x-version-update-end}) + +Authentication +-------------- + +See the [Authentication](https://github.com/GoogleCloudPlatform/google-cloud-java#authentication) section in the base directory's README. + +About Cloud Security Command Center +---------------------------- + +[Cloud Security Command Center][cloud-securitycenter] is a suite of Machine Learning products. + +See the [Cloud Security Command Center client library docs][securitycenter-lib-docs] to learn how to use this Cloud Security Command Center Client Library. + +Getting Started +--------------- +#### Prerequisites +You will need a [Google Developers Console](https://console.developers.google.com/) project with the Cloud Security Command Center API enabled. [Follow these instructions](https://cloud.google.com/resource-manager/docs/creating-managing-projects) to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud SDK](https://cloud.google.com/sdk/) and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +#### Installation and setup +You'll need to obtain the `google-cloud-securitycenter` library. See the [Quickstart](#quickstart) section to add `google-cloud-securitycenter` as a dependency in your code. + +Troubleshooting +--------------- + +To get help, follow the instructions in the [shared Troubleshooting document](https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting). + +Transport +--------- +Cloud Security Command Center uses gRPC for the transport layer. + +Java Versions +------------- + +Java 7 or above is required for using this client. + +Versioning +---------- + +This library follows [Semantic Versioning](http://semver.org/). + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time and the public API should not be considered stable. + +Contributing +------------ + +Contributions to this library are always welcome and highly encouraged. + +See `google-cloud`'s [CONTRIBUTING] documentation and the [shared documentation](https://github.com/googleapis/google-cloud-common/blob/master/contributing/readme.md#how-to-contribute-to-gcloud) for more information on how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. + +License +------- + +Apache 2.0 - See [LICENSE] for more information. + + +[CONTRIBUTING]:https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/CONTRIBUTING.md +[code-of-conduct]:https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[LICENSE]: https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/LICENSE +[cloud-platform]: https://cloud.google.com/ +[cloud-securitycenter]: https://cloud.google.com/ +[securitycenter-product-docs]: https://cloud.google.com/ +[securitycenter-lib-docs]: https://googleapis.github.io/google-cloud-java/google-cloud-clients/apidocs/index.html?com/google/cloud/securitycenter/v1beta1/package-summary.html diff --git a/google-cloud-clients/google-cloud-securitycenter/pom.xml b/google-cloud-clients/google-cloud-securitycenter/pom.xml new file mode 100644 index 000000000000..557ba240ec50 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/pom.xml @@ -0,0 +1,87 @@ + + + 4.0.0 + google-cloud-securitycenter + 0.70.1-alpha-SNAPSHOT + jar + Google Cloud Security Command Center + https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-securitycenter + + Java idiomatic client for Google Cloud Security Command Center. + + + com.google.cloud + google-cloud-clients + 0.70.1-alpha-SNAPSHOT + + + google-cloud-securitycenter + + + + ${project.groupId} + google-cloud-core + + + ${project.groupId} + google-cloud-core-grpc + + + com.google.api.grpc + proto-google-cloud-securitycenter-v1beta1 + + + com.google.api.grpc + grpc-google-cloud-securitycenter-v1beta1 + + + io.grpc + grpc-netty-shaded + + + io.grpc + grpc-stub + + + io.grpc + grpc-auth + + + ${project.groupId} + google-cloud-core + test-jar + test + + + junit + junit + test + + + org.easymock + easymock + test + + + org.objenesis + objenesis + test + + + com.google.truth + truth + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + + + com.google.api + gax-grpc + testlib + test + + + diff --git a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityCenterClient.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityCenterClient.java new file mode 100644 index 000000000000..330c93f91bd4 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityCenterClient.java @@ -0,0 +1,2423 @@ +/* + * 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 + * + * 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.v1beta1; + +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.v1beta1.Finding.State; +import com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; +import com.google.cloud.securitycenter.v1beta1.stub.SecurityCenterStub; +import com.google.cloud.securitycenter.v1beta1.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.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 Beta 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()) {
+   *   SourceName 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()) {
+   *   SourceName 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: + * /v1beta1/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`). The string value should follow SQL syntax: comma separated list of fields. For + * example: "parent,resource_name". + *

The following fields are supported: + *

* resource_name * category * state * parent + * @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: + * /v1beta1/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`). The string value should follow SQL syntax: comma separated list of fields. For + * example: "parent,resource_name". + *

The following fields are supported: + *

* resource_name * category * state * parent + * @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: + * /v1beta1/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: + * /v1beta1/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: + * /v1beta1/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: + * /v1beta1/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 (Finding 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: + * /v1beta1/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 (Finding 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: + * /v1beta1/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 (Finding element : response.getFindingsList()) {
+   *       // 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]");
+   *   Empty response = 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]");
+   *   Empty response = 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();
+   *   Empty response = 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<Operation> future = securityCenterClient.runAssetDiscoveryOperationCallable().futureCall(request);
+   *   // Do something
+   *   Empty response = 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()) {
+   *   SourceName 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()) {
+   *   SourceName 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()) {
+   *   SourceName 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()) {
+   *   SourceName 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 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); + } + }); + } + + 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); + } + }); + } + + 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); + } + }); + } + + 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, Finding, ListFindingsPage, + ListFindingsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext 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); + } + }); + } + + private ListFindingsPagedResponse(ListFindingsPage page) { + super(page, ListFindingsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListFindingsPage + extends AbstractPage { + + private ListFindingsPage( + PageContext context, + ListFindingsResponse response) { + super(context, response); + } + + private static ListFindingsPage createEmptyPage() { + return new ListFindingsPage(null, null); + } + + @Override + protected ListFindingsPage createPage( + PageContext context, + ListFindingsResponse response) { + return new ListFindingsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListFindingsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListFindingsRequest, ListFindingsResponse, Finding, 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); + } + }); + } + + 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/v1beta1/SecurityCenterSettings.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityCenterSettings.java new file mode 100644 index 000000000000..afb5ec905919 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/SecurityCenterSettings.java @@ -0,0 +1,399 @@ +/* + * 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 + * + * 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.v1beta1; + +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.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.v1beta1.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/v1beta1/package-info.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/package-info.java new file mode 100644 index 000000000000..29875c63f3d7 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/package-info.java @@ -0,0 +1,38 @@ +/* + * 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 + * + * 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 Beta 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.v1beta1; diff --git a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/stub/GrpcSecurityCenterCallableFactory.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/stub/GrpcSecurityCenterCallableFactory.java new file mode 100644 index 000000000000..1893a6c1d6bc --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/stub/GrpcSecurityCenterCallableFactory.java @@ -0,0 +1,116 @@ +/* + * 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 + * + * 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.v1beta1.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.Operation; +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/v1beta1/stub/GrpcSecurityCenterStub.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/stub/GrpcSecurityCenterStub.java new file mode 100644 index 000000000000..b87e69db2b04 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/stub/GrpcSecurityCenterStub.java @@ -0,0 +1,623 @@ +/* + * 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 + * + * 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.v1beta1.stub; + +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest; +import com.google.cloud.securitycenter.v1beta1.CreateSourceRequest; +import com.google.cloud.securitycenter.v1beta1.Finding; +import com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1beta1.GetSourceRequest; +import com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest; +import com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse; +import com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest; +import com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse; +import com.google.cloud.securitycenter.v1beta1.ListAssetsRequest; +import com.google.cloud.securitycenter.v1beta1.ListAssetsResponse; +import com.google.cloud.securitycenter.v1beta1.ListFindingsRequest; +import com.google.cloud.securitycenter.v1beta1.ListFindingsResponse; +import com.google.cloud.securitycenter.v1beta1.ListSourcesRequest; +import com.google.cloud.securitycenter.v1beta1.ListSourcesResponse; +import com.google.cloud.securitycenter.v1beta1.OrganizationSettings; +import com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; +import com.google.cloud.securitycenter.v1beta1.SecurityMarks; +import com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest; +import com.google.cloud.securitycenter.v1beta1.Source; +import com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest; +import com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; +import com.google.cloud.securitycenter.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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/v1beta1/stub/SecurityCenterStub.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/stub/SecurityCenterStub.java new file mode 100644 index 000000000000..bb147c826cf0 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/stub/SecurityCenterStub.java @@ -0,0 +1,183 @@ +/* + * 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 + * + * 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.v1beta1.stub; + +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest; +import com.google.cloud.securitycenter.v1beta1.CreateSourceRequest; +import com.google.cloud.securitycenter.v1beta1.Finding; +import com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1beta1.GetSourceRequest; +import com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest; +import com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse; +import com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest; +import com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse; +import com.google.cloud.securitycenter.v1beta1.ListAssetsRequest; +import com.google.cloud.securitycenter.v1beta1.ListAssetsResponse; +import com.google.cloud.securitycenter.v1beta1.ListFindingsRequest; +import com.google.cloud.securitycenter.v1beta1.ListFindingsResponse; +import com.google.cloud.securitycenter.v1beta1.ListSourcesRequest; +import com.google.cloud.securitycenter.v1beta1.ListSourcesResponse; +import com.google.cloud.securitycenter.v1beta1.OrganizationSettings; +import com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; +import com.google.cloud.securitycenter.v1beta1.SecurityMarks; +import com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest; +import com.google.cloud.securitycenter.v1beta1.Source; +import com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest; +import com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; +import com.google.cloud.securitycenter.v1beta1.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/v1beta1/stub/SecurityCenterStubSettings.java b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/stub/SecurityCenterStubSettings.java new file mode 100644 index 000000000000..40b734310c72 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1beta1/stub/SecurityCenterStubSettings.java @@ -0,0 +1,1064 @@ +/* + * 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 + * + * 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.v1beta1.stub; + +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.GroupAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.ListAssetsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.ListFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.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.v1beta1.CreateFindingRequest; +import com.google.cloud.securitycenter.v1beta1.CreateSourceRequest; +import com.google.cloud.securitycenter.v1beta1.Finding; +import com.google.cloud.securitycenter.v1beta1.GetOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1beta1.GetSourceRequest; +import com.google.cloud.securitycenter.v1beta1.GroupAssetsRequest; +import com.google.cloud.securitycenter.v1beta1.GroupAssetsResponse; +import com.google.cloud.securitycenter.v1beta1.GroupFindingsRequest; +import com.google.cloud.securitycenter.v1beta1.GroupFindingsResponse; +import com.google.cloud.securitycenter.v1beta1.GroupResult; +import com.google.cloud.securitycenter.v1beta1.ListAssetsRequest; +import com.google.cloud.securitycenter.v1beta1.ListAssetsResponse; +import com.google.cloud.securitycenter.v1beta1.ListAssetsResponse.ListAssetsResult; +import com.google.cloud.securitycenter.v1beta1.ListFindingsRequest; +import com.google.cloud.securitycenter.v1beta1.ListFindingsResponse; +import com.google.cloud.securitycenter.v1beta1.ListSourcesRequest; +import com.google.cloud.securitycenter.v1beta1.ListSourcesResponse; +import com.google.cloud.securitycenter.v1beta1.OrganizationSettings; +import com.google.cloud.securitycenter.v1beta1.RunAssetDiscoveryRequest; +import com.google.cloud.securitycenter.v1beta1.SecurityMarks; +import com.google.cloud.securitycenter.v1beta1.SetFindingStateRequest; +import com.google.cloud.securitycenter.v1beta1.Source; +import com.google.cloud.securitycenter.v1beta1.UpdateFindingRequest; +import com.google.cloud.securitycenter.v1beta1.UpdateOrganizationSettingsRequest; +import com.google.cloud.securitycenter.v1beta1.UpdateSecurityMarksRequest; +import com.google.cloud.securitycenter.v1beta1.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(); + } + }; + + 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(); + } + }; + + 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(); + } + }; + + private static final PagedListDescriptor + LIST_FINDINGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @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.getFindingsList(); + } + }; + + 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(); + } + }; + + 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 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/v1beta1/MockSecurityCenter.java b/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1beta1/MockSecurityCenter.java new file mode 100644 index 000000000000..3cda1cb801f6 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1beta1/MockSecurityCenter.java @@ -0,0 +1,57 @@ +/* + * 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 + * + * 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.v1beta1; + +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/v1beta1/MockSecurityCenterImpl.java b/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1beta1/MockSecurityCenterImpl.java new file mode 100644 index 000000000000..05e2a3d27cdb --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1beta1/MockSecurityCenterImpl.java @@ -0,0 +1,332 @@ +/* + * 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 + * + * 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.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.securitycenter.v1beta1.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/v1beta1/SecurityCenterClientTest.java b/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1beta1/SecurityCenterClientTest.java new file mode 100644 index 000000000000..cd1c1c9856b1 --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/src/test/java/com/google/cloud/securitycenter/v1beta1/SecurityCenterClientTest.java @@ -0,0 +1,793 @@ +/* + * 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 + * + * 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.v1beta1; + +import static com.google.cloud.securitycenter.v1beta1.SecurityCenterClient.GroupFindingsPagedResponse; +import static com.google.cloud.securitycenter.v1beta1.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.cloud.securitycenter.v1beta1.Finding.State; +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.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(resource, SourceName.parse(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 = ""; + GroupResult groupByResultsElement = GroupResult.newBuilder().build(); + List groupByResults = Arrays.asList(groupByResultsElement); + GroupFindingsResponse expectedResponse = + GroupFindingsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .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(resource, SourceName.parse(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(resource, SourceName.parse(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.py b/google-cloud-clients/google-cloud-securitycenter/synth.py new file mode 100644 index 000000000000..4e596b31952e --- /dev/null +++ b/google-cloud-clients/google-cloud-securitycenter/synth.py @@ -0,0 +1,32 @@ +# 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. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp + +gapic = gcp.GAPICGenerator() +common_templates = gcp.CommonTemplates() + +for version in ["v1beta1"]: + library = gapic.java_library( + service='securitycenter', + version=version, + config_path=f'/google/cloud/securitycenter/artman_securitycenter_{version}.yaml', + artman_output_name='') + + s.copy(library / f'gapic-google-cloud-securitycenter-{version}/src', 'src') + s.copy(library / f'grpc-google-cloud-securitycenter-{version}/src', f'../../google-api-grpc/grpc-google-cloud-securitycenter-{version}/src') + s.copy(library / f'proto-google-cloud-securitycenter-{version}/src', f'../../google-api-grpc/proto-google-cloud-securitycenter-{version}/src') diff --git a/google-cloud-clients/pom.xml b/google-cloud-clients/pom.xml index 8e90c1d1b5e0..8b58523e52cb 100644 --- a/google-cloud-clients/pom.xml +++ b/google-cloud-clients/pom.xml @@ -439,6 +439,7 @@ google-cloud-redis google-cloud-resourcemanager google-cloud-scheduler + google-cloud-securitycenter google-cloud-spanner google-cloud-speech google-cloud-storage @@ -749,7 +750,7 @@ Stub packages - com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigquery.storage.v1beta1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.devtools.containeranalysis.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.redis.v1.stub:com.google.cloud.scheduler.v1beta1.stub:com.google.cloud.spanner.admin.database.v1.stub:com.google.cloud.spanner.admin.instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.videointelligence.v1p2beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub + com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigquery.storage.v1beta1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.devtools.containeranalysis.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.redis.v1.stub:com.google.cloud.scheduler.v1beta1.stub:com.google.cloud.securitycenter.v1beta1.stub:com.google.cloud.spanner.admin.database.v1.stub:com.google.cloud.spanner.admin.instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.videointelligence.v1p2beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub Deprecated packages @@ -856,7 +857,7 @@ Stub packages - com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigquery.storage.v1beta1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.scheduler.v1beta1.stub:com.google.cloud.spanner.admin.database.v1.stub:com.google.cloud.spanner.admin.instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub + com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigquery.storage.v1beta1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.scheduler.v1beta1.stub:com.google.cloud.securitycenter.v1beta1.stub:com.google.cloud.spanner.admin.database.v1.stub:com.google.cloud.spanner.admin.instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub Deprecated packages diff --git a/versions.txt b/versions.txt index 4e77eaeb30d0..10292fb9a5ce 100644 --- a/versions.txt +++ b/versions.txt @@ -27,6 +27,7 @@ grpc-google-cloud-pubsub-v1:1.34.0:1.34.1-SNAPSHOT grpc-google-cloud-redis-v1:0.35.0:0.35.1-SNAPSHOT grpc-google-cloud-redis-v1beta1:0.35.0:0.35.1-SNAPSHOT grpc-google-cloud-scheduler-v1beta1:0.35.0:0.35.1-SNAPSHOT +grpc-google-cloud-securitycenter-v1beta1:0.35.0:0.35.1-SNAPSHOT grpc-google-cloud-spanner-admin-database-v1:0.35.0:0.35.1-SNAPSHOT grpc-google-cloud-spanner-admin-instance-v1:0.35.0:0.35.1-SNAPSHOT grpc-google-cloud-spanner-v1:0.35.0:0.35.1-SNAPSHOT @@ -75,6 +76,7 @@ proto-google-cloud-pubsub-v1:1.34.0:1.34.1-SNAPSHOT proto-google-cloud-redis-v1:0.35.0:0.35.1-SNAPSHOT proto-google-cloud-redis-v1beta1:0.35.0:0.35.1-SNAPSHOT proto-google-cloud-scheduler-v1beta1:0.35.0:0.35.1-SNAPSHOT +proto-google-cloud-securitycenter-v1beta1:0.35.0:0.35.1-SNAPSHOT proto-google-cloud-spanner-admin-database-v1:0.35.0:0.35.1-SNAPSHOT proto-google-cloud-spanner-admin-instance-v1:0.35.0:0.35.1-SNAPSHOT proto-google-cloud-spanner-v1:0.35.0:0.35.1-SNAPSHOT @@ -141,6 +143,7 @@ google-cloud-pubsub:1.52.0:1.52.1-SNAPSHOT google-cloud-redis:0.70.0-alpha:0.70.1-alpha-SNAPSHOT google-cloud-resourcemanager:0.70.0-alpha:0.70.1-alpha-SNAPSHOT google-cloud-scheduler:0.70.0-alpha:0.70.1-alpha-SNAPSHOT +google-cloud-securitycenter:0.70.0-alpha:0.70.1-alpha-SNAPSHOT google-cloud-spanner:0.70.0-beta:0.70.1-beta-SNAPSHOT google-cloud-speech:0.70.0-beta:0.70.1-beta-SNAPSHOT google-cloud-storage:1.52.0:1.52.1-SNAPSHOT