com.google.cloud.securitycenter.v2.AttackExposure Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-cloud-securitycenter-v2 Show documentation
Show all versions of proto-google-cloud-securitycenter-v2 Show documentation
Proto library for google-cloud-securitycenter
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/securitycenter/v2/attack_exposure.proto
// Protobuf Java Version: 3.25.3
package com.google.cloud.securitycenter.v2;
/**
*
*
*
* An attack exposure contains the results of an attack path simulation run.
*
*
* Protobuf type {@code google.cloud.securitycenter.v2.AttackExposure}
*/
public final class AttackExposure extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.securitycenter.v2.AttackExposure)
AttackExposureOrBuilder {
private static final long serialVersionUID = 0L;
// Use AttackExposure.newBuilder() to construct.
private AttackExposure(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private AttackExposure() {
attackExposureResult_ = "";
state_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new AttackExposure();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.securitycenter.v2.AttackExposureProto
.internal_static_google_cloud_securitycenter_v2_AttackExposure_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.securitycenter.v2.AttackExposureProto
.internal_static_google_cloud_securitycenter_v2_AttackExposure_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.securitycenter.v2.AttackExposure.class,
com.google.cloud.securitycenter.v2.AttackExposure.Builder.class);
}
/**
*
*
*
* This enum defines the various states an AttackExposure can be in.
*
*
* Protobuf enum {@code google.cloud.securitycenter.v2.AttackExposure.State}
*/
public enum State implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
*
* The state is not specified.
*
*
* STATE_UNSPECIFIED = 0;
*/
STATE_UNSPECIFIED(0),
/**
*
*
*
* The attack exposure has been calculated.
*
*
* CALCULATED = 1;
*/
CALCULATED(1),
/**
*
*
*
* The attack exposure has not been calculated.
*
*
* NOT_CALCULATED = 2;
*/
NOT_CALCULATED(2),
UNRECOGNIZED(-1),
;
/**
*
*
*
* The state is not specified.
*
*
* STATE_UNSPECIFIED = 0;
*/
public static final int STATE_UNSPECIFIED_VALUE = 0;
/**
*
*
*
* The attack exposure has been calculated.
*
*
* CALCULATED = 1;
*/
public static final int CALCULATED_VALUE = 1;
/**
*
*
*
* The attack exposure has not been calculated.
*
*
* NOT_CALCULATED = 2;
*/
public static final int NOT_CALCULATED_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;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static State valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static State forNumber(int value) {
switch (value) {
case 0:
return STATE_UNSPECIFIED;
case 1:
return CALCULATED;
case 2:
return NOT_CALCULATED;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public State findValueByNumber(int number) {
return State.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return com.google.cloud.securitycenter.v2.AttackExposure.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.v2.AttackExposure.State)
}
private int bitField0_;
public static final int SCORE_FIELD_NUMBER = 1;
private double score_ = 0D;
/**
*
*
*
* A number between 0 (inclusive) and infinity that represents how important
* this finding is to remediate. The higher the score, the more important it
* is to remediate.
*
*
* double score = 1;
*
* @return The score.
*/
@java.lang.Override
public double getScore() {
return score_;
}
public static final int LATEST_CALCULATION_TIME_FIELD_NUMBER = 2;
private com.google.protobuf.Timestamp latestCalculationTime_;
/**
*
*
*
* The most recent time the attack exposure was updated on this finding.
*
*
* .google.protobuf.Timestamp latest_calculation_time = 2;
*
* @return Whether the latestCalculationTime field is set.
*/
@java.lang.Override
public boolean hasLatestCalculationTime() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* The most recent time the attack exposure was updated on this finding.
*
*
* .google.protobuf.Timestamp latest_calculation_time = 2;
*
* @return The latestCalculationTime.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getLatestCalculationTime() {
return latestCalculationTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: latestCalculationTime_;
}
/**
*
*
*
* The most recent time the attack exposure was updated on this finding.
*
*
* .google.protobuf.Timestamp latest_calculation_time = 2;
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getLatestCalculationTimeOrBuilder() {
return latestCalculationTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: latestCalculationTime_;
}
public static final int ATTACK_EXPOSURE_RESULT_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private volatile java.lang.Object attackExposureResult_ = "";
/**
*
*
*
* The resource name of the attack path simulation result that contains the
* details regarding this attack exposure score.
* Example: organizations/123/simulations/456/attackExposureResults/789
*
*
* string attack_exposure_result = 3;
*
* @return The attackExposureResult.
*/
@java.lang.Override
public java.lang.String getAttackExposureResult() {
java.lang.Object ref = attackExposureResult_;
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();
attackExposureResult_ = s;
return s;
}
}
/**
*
*
*
* The resource name of the attack path simulation result that contains the
* details regarding this attack exposure score.
* Example: organizations/123/simulations/456/attackExposureResults/789
*
*
* string attack_exposure_result = 3;
*
* @return The bytes for attackExposureResult.
*/
@java.lang.Override
public com.google.protobuf.ByteString getAttackExposureResultBytes() {
java.lang.Object ref = attackExposureResult_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
attackExposureResult_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int STATE_FIELD_NUMBER = 4;
private int state_ = 0;
/**
*
*
*
* Output only. What state this AttackExposure is in. This captures whether or
* not an attack exposure has been calculated or not.
*
*
*
* .google.cloud.securitycenter.v2.AttackExposure.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @return The enum numeric value on the wire for state.
*/
@java.lang.Override
public int getStateValue() {
return state_;
}
/**
*
*
*
* Output only. What state this AttackExposure is in. This captures whether or
* not an attack exposure has been calculated or not.
*
*
*
* .google.cloud.securitycenter.v2.AttackExposure.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @return The state.
*/
@java.lang.Override
public com.google.cloud.securitycenter.v2.AttackExposure.State getState() {
com.google.cloud.securitycenter.v2.AttackExposure.State result =
com.google.cloud.securitycenter.v2.AttackExposure.State.forNumber(state_);
return result == null
? com.google.cloud.securitycenter.v2.AttackExposure.State.UNRECOGNIZED
: result;
}
public static final int EXPOSED_HIGH_VALUE_RESOURCES_COUNT_FIELD_NUMBER = 5;
private int exposedHighValueResourcesCount_ = 0;
/**
*
*
*
* The number of high value resources that are exposed as a result of this
* finding.
*
*
* int32 exposed_high_value_resources_count = 5;
*
* @return The exposedHighValueResourcesCount.
*/
@java.lang.Override
public int getExposedHighValueResourcesCount() {
return exposedHighValueResourcesCount_;
}
public static final int EXPOSED_MEDIUM_VALUE_RESOURCES_COUNT_FIELD_NUMBER = 6;
private int exposedMediumValueResourcesCount_ = 0;
/**
*
*
*
* The number of medium value resources that are exposed as a result of this
* finding.
*
*
* int32 exposed_medium_value_resources_count = 6;
*
* @return The exposedMediumValueResourcesCount.
*/
@java.lang.Override
public int getExposedMediumValueResourcesCount() {
return exposedMediumValueResourcesCount_;
}
public static final int EXPOSED_LOW_VALUE_RESOURCES_COUNT_FIELD_NUMBER = 7;
private int exposedLowValueResourcesCount_ = 0;
/**
*
*
*
* The number of high value resources that are exposed as a result of this
* finding.
*
*
* int32 exposed_low_value_resources_count = 7;
*
* @return The exposedLowValueResourcesCount.
*/
@java.lang.Override
public int getExposedLowValueResourcesCount() {
return exposedLowValueResourcesCount_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (java.lang.Double.doubleToRawLongBits(score_) != 0) {
output.writeDouble(1, score_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(2, getLatestCalculationTime());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attackExposureResult_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, attackExposureResult_);
}
if (state_
!= com.google.cloud.securitycenter.v2.AttackExposure.State.STATE_UNSPECIFIED.getNumber()) {
output.writeEnum(4, state_);
}
if (exposedHighValueResourcesCount_ != 0) {
output.writeInt32(5, exposedHighValueResourcesCount_);
}
if (exposedMediumValueResourcesCount_ != 0) {
output.writeInt32(6, exposedMediumValueResourcesCount_);
}
if (exposedLowValueResourcesCount_ != 0) {
output.writeInt32(7, exposedLowValueResourcesCount_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (java.lang.Double.doubleToRawLongBits(score_) != 0) {
size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, score_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(2, getLatestCalculationTime());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attackExposureResult_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, attackExposureResult_);
}
if (state_
!= com.google.cloud.securitycenter.v2.AttackExposure.State.STATE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_);
}
if (exposedHighValueResourcesCount_ != 0) {
size +=
com.google.protobuf.CodedOutputStream.computeInt32Size(
5, exposedHighValueResourcesCount_);
}
if (exposedMediumValueResourcesCount_ != 0) {
size +=
com.google.protobuf.CodedOutputStream.computeInt32Size(
6, exposedMediumValueResourcesCount_);
}
if (exposedLowValueResourcesCount_ != 0) {
size +=
com.google.protobuf.CodedOutputStream.computeInt32Size(7, exposedLowValueResourcesCount_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.securitycenter.v2.AttackExposure)) {
return super.equals(obj);
}
com.google.cloud.securitycenter.v2.AttackExposure other =
(com.google.cloud.securitycenter.v2.AttackExposure) obj;
if (java.lang.Double.doubleToLongBits(getScore())
!= java.lang.Double.doubleToLongBits(other.getScore())) return false;
if (hasLatestCalculationTime() != other.hasLatestCalculationTime()) return false;
if (hasLatestCalculationTime()) {
if (!getLatestCalculationTime().equals(other.getLatestCalculationTime())) return false;
}
if (!getAttackExposureResult().equals(other.getAttackExposureResult())) return false;
if (state_ != other.state_) return false;
if (getExposedHighValueResourcesCount() != other.getExposedHighValueResourcesCount())
return false;
if (getExposedMediumValueResourcesCount() != other.getExposedMediumValueResourcesCount())
return false;
if (getExposedLowValueResourcesCount() != other.getExposedLowValueResourcesCount())
return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + SCORE_FIELD_NUMBER;
hash =
(53 * hash)
+ com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getScore()));
if (hasLatestCalculationTime()) {
hash = (37 * hash) + LATEST_CALCULATION_TIME_FIELD_NUMBER;
hash = (53 * hash) + getLatestCalculationTime().hashCode();
}
hash = (37 * hash) + ATTACK_EXPOSURE_RESULT_FIELD_NUMBER;
hash = (53 * hash) + getAttackExposureResult().hashCode();
hash = (37 * hash) + STATE_FIELD_NUMBER;
hash = (53 * hash) + state_;
hash = (37 * hash) + EXPOSED_HIGH_VALUE_RESOURCES_COUNT_FIELD_NUMBER;
hash = (53 * hash) + getExposedHighValueResourcesCount();
hash = (37 * hash) + EXPOSED_MEDIUM_VALUE_RESOURCES_COUNT_FIELD_NUMBER;
hash = (53 * hash) + getExposedMediumValueResourcesCount();
hash = (37 * hash) + EXPOSED_LOW_VALUE_RESOURCES_COUNT_FIELD_NUMBER;
hash = (53 * hash) + getExposedLowValueResourcesCount();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.securitycenter.v2.AttackExposure parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.securitycenter.v2.AttackExposure parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.securitycenter.v2.AttackExposure parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.securitycenter.v2.AttackExposure parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.securitycenter.v2.AttackExposure parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.securitycenter.v2.AttackExposure parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.securitycenter.v2.AttackExposure parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.securitycenter.v2.AttackExposure parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.securitycenter.v2.AttackExposure parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.securitycenter.v2.AttackExposure parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.securitycenter.v2.AttackExposure parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.securitycenter.v2.AttackExposure parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.cloud.securitycenter.v2.AttackExposure prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* An attack exposure contains the results of an attack path simulation run.
*
*
* Protobuf type {@code google.cloud.securitycenter.v2.AttackExposure}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.securitycenter.v2.AttackExposure)
com.google.cloud.securitycenter.v2.AttackExposureOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.securitycenter.v2.AttackExposureProto
.internal_static_google_cloud_securitycenter_v2_AttackExposure_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.securitycenter.v2.AttackExposureProto
.internal_static_google_cloud_securitycenter_v2_AttackExposure_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.securitycenter.v2.AttackExposure.class,
com.google.cloud.securitycenter.v2.AttackExposure.Builder.class);
}
// Construct using com.google.cloud.securitycenter.v2.AttackExposure.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getLatestCalculationTimeFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
score_ = 0D;
latestCalculationTime_ = null;
if (latestCalculationTimeBuilder_ != null) {
latestCalculationTimeBuilder_.dispose();
latestCalculationTimeBuilder_ = null;
}
attackExposureResult_ = "";
state_ = 0;
exposedHighValueResourcesCount_ = 0;
exposedMediumValueResourcesCount_ = 0;
exposedLowValueResourcesCount_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.securitycenter.v2.AttackExposureProto
.internal_static_google_cloud_securitycenter_v2_AttackExposure_descriptor;
}
@java.lang.Override
public com.google.cloud.securitycenter.v2.AttackExposure getDefaultInstanceForType() {
return com.google.cloud.securitycenter.v2.AttackExposure.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.securitycenter.v2.AttackExposure build() {
com.google.cloud.securitycenter.v2.AttackExposure result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.securitycenter.v2.AttackExposure buildPartial() {
com.google.cloud.securitycenter.v2.AttackExposure result =
new com.google.cloud.securitycenter.v2.AttackExposure(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(com.google.cloud.securitycenter.v2.AttackExposure result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.score_ = score_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.latestCalculationTime_ =
latestCalculationTimeBuilder_ == null
? latestCalculationTime_
: latestCalculationTimeBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.attackExposureResult_ = attackExposureResult_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.state_ = state_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.exposedHighValueResourcesCount_ = exposedHighValueResourcesCount_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.exposedMediumValueResourcesCount_ = exposedMediumValueResourcesCount_;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.exposedLowValueResourcesCount_ = exposedLowValueResourcesCount_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.securitycenter.v2.AttackExposure) {
return mergeFrom((com.google.cloud.securitycenter.v2.AttackExposure) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.securitycenter.v2.AttackExposure other) {
if (other == com.google.cloud.securitycenter.v2.AttackExposure.getDefaultInstance())
return this;
if (other.getScore() != 0D) {
setScore(other.getScore());
}
if (other.hasLatestCalculationTime()) {
mergeLatestCalculationTime(other.getLatestCalculationTime());
}
if (!other.getAttackExposureResult().isEmpty()) {
attackExposureResult_ = other.attackExposureResult_;
bitField0_ |= 0x00000004;
onChanged();
}
if (other.state_ != 0) {
setStateValue(other.getStateValue());
}
if (other.getExposedHighValueResourcesCount() != 0) {
setExposedHighValueResourcesCount(other.getExposedHighValueResourcesCount());
}
if (other.getExposedMediumValueResourcesCount() != 0) {
setExposedMediumValueResourcesCount(other.getExposedMediumValueResourcesCount());
}
if (other.getExposedLowValueResourcesCount() != 0) {
setExposedLowValueResourcesCount(other.getExposedLowValueResourcesCount());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 9:
{
score_ = input.readDouble();
bitField0_ |= 0x00000001;
break;
} // case 9
case 18:
{
input.readMessage(
getLatestCalculationTimeFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
case 26:
{
attackExposureResult_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
break;
} // case 26
case 32:
{
state_ = input.readEnum();
bitField0_ |= 0x00000008;
break;
} // case 32
case 40:
{
exposedHighValueResourcesCount_ = input.readInt32();
bitField0_ |= 0x00000010;
break;
} // case 40
case 48:
{
exposedMediumValueResourcesCount_ = input.readInt32();
bitField0_ |= 0x00000020;
break;
} // case 48
case 56:
{
exposedLowValueResourcesCount_ = input.readInt32();
bitField0_ |= 0x00000040;
break;
} // case 56
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private double score_;
/**
*
*
*
* A number between 0 (inclusive) and infinity that represents how important
* this finding is to remediate. The higher the score, the more important it
* is to remediate.
*
*
* double score = 1;
*
* @return The score.
*/
@java.lang.Override
public double getScore() {
return score_;
}
/**
*
*
*
* A number between 0 (inclusive) and infinity that represents how important
* this finding is to remediate. The higher the score, the more important it
* is to remediate.
*
*
* double score = 1;
*
* @param value The score to set.
* @return This builder for chaining.
*/
public Builder setScore(double value) {
score_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* A number between 0 (inclusive) and infinity that represents how important
* this finding is to remediate. The higher the score, the more important it
* is to remediate.
*
*
* double score = 1;
*
* @return This builder for chaining.
*/
public Builder clearScore() {
bitField0_ = (bitField0_ & ~0x00000001);
score_ = 0D;
onChanged();
return this;
}
private com.google.protobuf.Timestamp latestCalculationTime_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
latestCalculationTimeBuilder_;
/**
*
*
*
* The most recent time the attack exposure was updated on this finding.
*
*
* .google.protobuf.Timestamp latest_calculation_time = 2;
*
* @return Whether the latestCalculationTime field is set.
*/
public boolean hasLatestCalculationTime() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
*
*
* The most recent time the attack exposure was updated on this finding.
*
*
* .google.protobuf.Timestamp latest_calculation_time = 2;
*
* @return The latestCalculationTime.
*/
public com.google.protobuf.Timestamp getLatestCalculationTime() {
if (latestCalculationTimeBuilder_ == null) {
return latestCalculationTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: latestCalculationTime_;
} else {
return latestCalculationTimeBuilder_.getMessage();
}
}
/**
*
*
*
* The most recent time the attack exposure was updated on this finding.
*
*
* .google.protobuf.Timestamp latest_calculation_time = 2;
*/
public Builder setLatestCalculationTime(com.google.protobuf.Timestamp value) {
if (latestCalculationTimeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
latestCalculationTime_ = value;
} else {
latestCalculationTimeBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* The most recent time the attack exposure was updated on this finding.
*
*
* .google.protobuf.Timestamp latest_calculation_time = 2;
*/
public Builder setLatestCalculationTime(com.google.protobuf.Timestamp.Builder builderForValue) {
if (latestCalculationTimeBuilder_ == null) {
latestCalculationTime_ = builderForValue.build();
} else {
latestCalculationTimeBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* The most recent time the attack exposure was updated on this finding.
*
*
* .google.protobuf.Timestamp latest_calculation_time = 2;
*/
public Builder mergeLatestCalculationTime(com.google.protobuf.Timestamp value) {
if (latestCalculationTimeBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)
&& latestCalculationTime_ != null
&& latestCalculationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
getLatestCalculationTimeBuilder().mergeFrom(value);
} else {
latestCalculationTime_ = value;
}
} else {
latestCalculationTimeBuilder_.mergeFrom(value);
}
if (latestCalculationTime_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
*
*
*
* The most recent time the attack exposure was updated on this finding.
*
*
* .google.protobuf.Timestamp latest_calculation_time = 2;
*/
public Builder clearLatestCalculationTime() {
bitField0_ = (bitField0_ & ~0x00000002);
latestCalculationTime_ = null;
if (latestCalculationTimeBuilder_ != null) {
latestCalculationTimeBuilder_.dispose();
latestCalculationTimeBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* The most recent time the attack exposure was updated on this finding.
*
*
* .google.protobuf.Timestamp latest_calculation_time = 2;
*/
public com.google.protobuf.Timestamp.Builder getLatestCalculationTimeBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getLatestCalculationTimeFieldBuilder().getBuilder();
}
/**
*
*
*
* The most recent time the attack exposure was updated on this finding.
*
*
* .google.protobuf.Timestamp latest_calculation_time = 2;
*/
public com.google.protobuf.TimestampOrBuilder getLatestCalculationTimeOrBuilder() {
if (latestCalculationTimeBuilder_ != null) {
return latestCalculationTimeBuilder_.getMessageOrBuilder();
} else {
return latestCalculationTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: latestCalculationTime_;
}
}
/**
*
*
*
* The most recent time the attack exposure was updated on this finding.
*
*
* .google.protobuf.Timestamp latest_calculation_time = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
getLatestCalculationTimeFieldBuilder() {
if (latestCalculationTimeBuilder_ == null) {
latestCalculationTimeBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>(
getLatestCalculationTime(), getParentForChildren(), isClean());
latestCalculationTime_ = null;
}
return latestCalculationTimeBuilder_;
}
private java.lang.Object attackExposureResult_ = "";
/**
*
*
*
* The resource name of the attack path simulation result that contains the
* details regarding this attack exposure score.
* Example: organizations/123/simulations/456/attackExposureResults/789
*
*
* string attack_exposure_result = 3;
*
* @return The attackExposureResult.
*/
public java.lang.String getAttackExposureResult() {
java.lang.Object ref = attackExposureResult_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
attackExposureResult_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The resource name of the attack path simulation result that contains the
* details regarding this attack exposure score.
* Example: organizations/123/simulations/456/attackExposureResults/789
*
*
* string attack_exposure_result = 3;
*
* @return The bytes for attackExposureResult.
*/
public com.google.protobuf.ByteString getAttackExposureResultBytes() {
java.lang.Object ref = attackExposureResult_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
attackExposureResult_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The resource name of the attack path simulation result that contains the
* details regarding this attack exposure score.
* Example: organizations/123/simulations/456/attackExposureResults/789
*
*
* string attack_exposure_result = 3;
*
* @param value The attackExposureResult to set.
* @return This builder for chaining.
*/
public Builder setAttackExposureResult(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
attackExposureResult_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* The resource name of the attack path simulation result that contains the
* details regarding this attack exposure score.
* Example: organizations/123/simulations/456/attackExposureResults/789
*
*
* string attack_exposure_result = 3;
*
* @return This builder for chaining.
*/
public Builder clearAttackExposureResult() {
attackExposureResult_ = getDefaultInstance().getAttackExposureResult();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
/**
*
*
*
* The resource name of the attack path simulation result that contains the
* details regarding this attack exposure score.
* Example: organizations/123/simulations/456/attackExposureResults/789
*
*
* string attack_exposure_result = 3;
*
* @param value The bytes for attackExposureResult to set.
* @return This builder for chaining.
*/
public Builder setAttackExposureResultBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
attackExposureResult_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
private int state_ = 0;
/**
*
*
*
* Output only. What state this AttackExposure is in. This captures whether or
* not an attack exposure has been calculated or not.
*
*
*
* .google.cloud.securitycenter.v2.AttackExposure.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @return The enum numeric value on the wire for state.
*/
@java.lang.Override
public int getStateValue() {
return state_;
}
/**
*
*
*
* Output only. What state this AttackExposure is in. This captures whether or
* not an attack exposure has been calculated or not.
*
*
*
* .google.cloud.securitycenter.v2.AttackExposure.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @param value The enum numeric value on the wire for state to set.
* @return This builder for chaining.
*/
public Builder setStateValue(int value) {
state_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
*
* Output only. What state this AttackExposure is in. This captures whether or
* not an attack exposure has been calculated or not.
*
*
*
* .google.cloud.securitycenter.v2.AttackExposure.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @return The state.
*/
@java.lang.Override
public com.google.cloud.securitycenter.v2.AttackExposure.State getState() {
com.google.cloud.securitycenter.v2.AttackExposure.State result =
com.google.cloud.securitycenter.v2.AttackExposure.State.forNumber(state_);
return result == null
? com.google.cloud.securitycenter.v2.AttackExposure.State.UNRECOGNIZED
: result;
}
/**
*
*
*
* Output only. What state this AttackExposure is in. This captures whether or
* not an attack exposure has been calculated or not.
*
*
*
* .google.cloud.securitycenter.v2.AttackExposure.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @param value The state to set.
* @return This builder for chaining.
*/
public Builder setState(com.google.cloud.securitycenter.v2.AttackExposure.State value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
state_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* Output only. What state this AttackExposure is in. This captures whether or
* not an attack exposure has been calculated or not.
*
*
*
* .google.cloud.securitycenter.v2.AttackExposure.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
*
* @return This builder for chaining.
*/
public Builder clearState() {
bitField0_ = (bitField0_ & ~0x00000008);
state_ = 0;
onChanged();
return this;
}
private int exposedHighValueResourcesCount_;
/**
*
*
*
* The number of high value resources that are exposed as a result of this
* finding.
*
*
* int32 exposed_high_value_resources_count = 5;
*
* @return The exposedHighValueResourcesCount.
*/
@java.lang.Override
public int getExposedHighValueResourcesCount() {
return exposedHighValueResourcesCount_;
}
/**
*
*
*
* The number of high value resources that are exposed as a result of this
* finding.
*
*
* int32 exposed_high_value_resources_count = 5;
*
* @param value The exposedHighValueResourcesCount to set.
* @return This builder for chaining.
*/
public Builder setExposedHighValueResourcesCount(int value) {
exposedHighValueResourcesCount_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* The number of high value resources that are exposed as a result of this
* finding.
*
*
* int32 exposed_high_value_resources_count = 5;
*
* @return This builder for chaining.
*/
public Builder clearExposedHighValueResourcesCount() {
bitField0_ = (bitField0_ & ~0x00000010);
exposedHighValueResourcesCount_ = 0;
onChanged();
return this;
}
private int exposedMediumValueResourcesCount_;
/**
*
*
*
* The number of medium value resources that are exposed as a result of this
* finding.
*
*
* int32 exposed_medium_value_resources_count = 6;
*
* @return The exposedMediumValueResourcesCount.
*/
@java.lang.Override
public int getExposedMediumValueResourcesCount() {
return exposedMediumValueResourcesCount_;
}
/**
*
*
*
* The number of medium value resources that are exposed as a result of this
* finding.
*
*
* int32 exposed_medium_value_resources_count = 6;
*
* @param value The exposedMediumValueResourcesCount to set.
* @return This builder for chaining.
*/
public Builder setExposedMediumValueResourcesCount(int value) {
exposedMediumValueResourcesCount_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
*
* The number of medium value resources that are exposed as a result of this
* finding.
*
*
* int32 exposed_medium_value_resources_count = 6;
*
* @return This builder for chaining.
*/
public Builder clearExposedMediumValueResourcesCount() {
bitField0_ = (bitField0_ & ~0x00000020);
exposedMediumValueResourcesCount_ = 0;
onChanged();
return this;
}
private int exposedLowValueResourcesCount_;
/**
*
*
*
* The number of high value resources that are exposed as a result of this
* finding.
*
*
* int32 exposed_low_value_resources_count = 7;
*
* @return The exposedLowValueResourcesCount.
*/
@java.lang.Override
public int getExposedLowValueResourcesCount() {
return exposedLowValueResourcesCount_;
}
/**
*
*
*
* The number of high value resources that are exposed as a result of this
* finding.
*
*
* int32 exposed_low_value_resources_count = 7;
*
* @param value The exposedLowValueResourcesCount to set.
* @return This builder for chaining.
*/
public Builder setExposedLowValueResourcesCount(int value) {
exposedLowValueResourcesCount_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
*
* The number of high value resources that are exposed as a result of this
* finding.
*
*
* int32 exposed_low_value_resources_count = 7;
*
* @return This builder for chaining.
*/
public Builder clearExposedLowValueResourcesCount() {
bitField0_ = (bitField0_ & ~0x00000040);
exposedLowValueResourcesCount_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.securitycenter.v2.AttackExposure)
}
// @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v2.AttackExposure)
private static final com.google.cloud.securitycenter.v2.AttackExposure DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.securitycenter.v2.AttackExposure();
}
public static com.google.cloud.securitycenter.v2.AttackExposure getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public AttackExposure parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.securitycenter.v2.AttackExposure getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy