software.amazon.awssdk.services.detective.model.IndicatorDetail Maven / Gradle / Ivy
Show all versions of detective Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 software.amazon.awssdk.services.detective.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Details about the indicators of compromise which are used to determine if a resource is involved in a security
* incident. An indicator of compromise (IOC) is an artifact observed in or on a network, system, or environment that
* can (with a high level of confidence) identify malicious activity or a security incident. For the list of indicators
* of compromise that are generated by Detective investigations, see Detective
* investigations.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class IndicatorDetail implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField TT_PS_OBSERVED_DETAIL_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("TTPsObservedDetail")
.getter(getter(IndicatorDetail::ttPsObservedDetail)).setter(setter(Builder::ttPsObservedDetail))
.constructor(TTPsObservedDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TTPsObservedDetail").build())
.build();
private static final SdkField IMPOSSIBLE_TRAVEL_DETAIL_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ImpossibleTravelDetail")
.getter(getter(IndicatorDetail::impossibleTravelDetail)).setter(setter(Builder::impossibleTravelDetail))
.constructor(ImpossibleTravelDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImpossibleTravelDetail").build())
.build();
private static final SdkField FLAGGED_IP_ADDRESS_DETAIL_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("FlaggedIpAddressDetail")
.getter(getter(IndicatorDetail::flaggedIpAddressDetail)).setter(setter(Builder::flaggedIpAddressDetail))
.constructor(FlaggedIpAddressDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FlaggedIpAddressDetail").build())
.build();
private static final SdkField NEW_GEOLOCATION_DETAIL_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("NewGeolocationDetail")
.getter(getter(IndicatorDetail::newGeolocationDetail)).setter(setter(Builder::newGeolocationDetail))
.constructor(NewGeolocationDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NewGeolocationDetail").build())
.build();
private static final SdkField NEW_ASO_DETAIL_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("NewAsoDetail").getter(getter(IndicatorDetail::newAsoDetail)).setter(setter(Builder::newAsoDetail))
.constructor(NewAsoDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NewAsoDetail").build()).build();
private static final SdkField NEW_USER_AGENT_DETAIL_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("NewUserAgentDetail")
.getter(getter(IndicatorDetail::newUserAgentDetail)).setter(setter(Builder::newUserAgentDetail))
.constructor(NewUserAgentDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NewUserAgentDetail").build())
.build();
private static final SdkField RELATED_FINDING_DETAIL_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RelatedFindingDetail")
.getter(getter(IndicatorDetail::relatedFindingDetail)).setter(setter(Builder::relatedFindingDetail))
.constructor(RelatedFindingDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RelatedFindingDetail").build())
.build();
private static final SdkField RELATED_FINDING_GROUP_DETAIL_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RelatedFindingGroupDetail")
.getter(getter(IndicatorDetail::relatedFindingGroupDetail)).setter(setter(Builder::relatedFindingGroupDetail))
.constructor(RelatedFindingGroupDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RelatedFindingGroupDetail").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TT_PS_OBSERVED_DETAIL_FIELD,
IMPOSSIBLE_TRAVEL_DETAIL_FIELD, FLAGGED_IP_ADDRESS_DETAIL_FIELD, NEW_GEOLOCATION_DETAIL_FIELD, NEW_ASO_DETAIL_FIELD,
NEW_USER_AGENT_DETAIL_FIELD, RELATED_FINDING_DETAIL_FIELD, RELATED_FINDING_GROUP_DETAIL_FIELD));
private static final long serialVersionUID = 1L;
private final TTPsObservedDetail ttPsObservedDetail;
private final ImpossibleTravelDetail impossibleTravelDetail;
private final FlaggedIpAddressDetail flaggedIpAddressDetail;
private final NewGeolocationDetail newGeolocationDetail;
private final NewAsoDetail newAsoDetail;
private final NewUserAgentDetail newUserAgentDetail;
private final RelatedFindingDetail relatedFindingDetail;
private final RelatedFindingGroupDetail relatedFindingGroupDetail;
private IndicatorDetail(BuilderImpl builder) {
this.ttPsObservedDetail = builder.ttPsObservedDetail;
this.impossibleTravelDetail = builder.impossibleTravelDetail;
this.flaggedIpAddressDetail = builder.flaggedIpAddressDetail;
this.newGeolocationDetail = builder.newGeolocationDetail;
this.newAsoDetail = builder.newAsoDetail;
this.newUserAgentDetail = builder.newUserAgentDetail;
this.relatedFindingDetail = builder.relatedFindingDetail;
this.relatedFindingGroupDetail = builder.relatedFindingGroupDetail;
}
/**
*
* Details about the indicator of compromise.
*
*
* @return Details about the indicator of compromise.
*/
public final TTPsObservedDetail ttPsObservedDetail() {
return ttPsObservedDetail;
}
/**
*
* Identifies unusual and impossible user activity for an account.
*
*
* @return Identifies unusual and impossible user activity for an account.
*/
public final ImpossibleTravelDetail impossibleTravelDetail() {
return impossibleTravelDetail;
}
/**
*
* Suspicious IP addresses that are flagged, which indicates critical or severe threats based on threat intelligence
* by Detective. This indicator is derived from Amazon Web Services threat intelligence.
*
*
* @return Suspicious IP addresses that are flagged, which indicates critical or severe threats based on threat
* intelligence by Detective. This indicator is derived from Amazon Web Services threat intelligence.
*/
public final FlaggedIpAddressDetail flaggedIpAddressDetail() {
return flaggedIpAddressDetail;
}
/**
*
* Contains details about the new geographic location.
*
*
* @return Contains details about the new geographic location.
*/
public final NewGeolocationDetail newGeolocationDetail() {
return newGeolocationDetail;
}
/**
*
* Contains details about the new Autonomous System Organization (ASO).
*
*
* @return Contains details about the new Autonomous System Organization (ASO).
*/
public final NewAsoDetail newAsoDetail() {
return newAsoDetail;
}
/**
*
* Contains details about the new user agent.
*
*
* @return Contains details about the new user agent.
*/
public final NewUserAgentDetail newUserAgentDetail() {
return newUserAgentDetail;
}
/**
*
* Contains details about related findings.
*
*
* @return Contains details about related findings.
*/
public final RelatedFindingDetail relatedFindingDetail() {
return relatedFindingDetail;
}
/**
*
* Contains details about related finding groups.
*
*
* @return Contains details about related finding groups.
*/
public final RelatedFindingGroupDetail relatedFindingGroupDetail() {
return relatedFindingGroupDetail;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(ttPsObservedDetail());
hashCode = 31 * hashCode + Objects.hashCode(impossibleTravelDetail());
hashCode = 31 * hashCode + Objects.hashCode(flaggedIpAddressDetail());
hashCode = 31 * hashCode + Objects.hashCode(newGeolocationDetail());
hashCode = 31 * hashCode + Objects.hashCode(newAsoDetail());
hashCode = 31 * hashCode + Objects.hashCode(newUserAgentDetail());
hashCode = 31 * hashCode + Objects.hashCode(relatedFindingDetail());
hashCode = 31 * hashCode + Objects.hashCode(relatedFindingGroupDetail());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof IndicatorDetail)) {
return false;
}
IndicatorDetail other = (IndicatorDetail) obj;
return Objects.equals(ttPsObservedDetail(), other.ttPsObservedDetail())
&& Objects.equals(impossibleTravelDetail(), other.impossibleTravelDetail())
&& Objects.equals(flaggedIpAddressDetail(), other.flaggedIpAddressDetail())
&& Objects.equals(newGeolocationDetail(), other.newGeolocationDetail())
&& Objects.equals(newAsoDetail(), other.newAsoDetail())
&& Objects.equals(newUserAgentDetail(), other.newUserAgentDetail())
&& Objects.equals(relatedFindingDetail(), other.relatedFindingDetail())
&& Objects.equals(relatedFindingGroupDetail(), other.relatedFindingGroupDetail());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("IndicatorDetail").add("TTPsObservedDetail", ttPsObservedDetail())
.add("ImpossibleTravelDetail", impossibleTravelDetail()).add("FlaggedIpAddressDetail", flaggedIpAddressDetail())
.add("NewGeolocationDetail", newGeolocationDetail()).add("NewAsoDetail", newAsoDetail())
.add("NewUserAgentDetail", newUserAgentDetail()).add("RelatedFindingDetail", relatedFindingDetail())
.add("RelatedFindingGroupDetail", relatedFindingGroupDetail()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "TTPsObservedDetail":
return Optional.ofNullable(clazz.cast(ttPsObservedDetail()));
case "ImpossibleTravelDetail":
return Optional.ofNullable(clazz.cast(impossibleTravelDetail()));
case "FlaggedIpAddressDetail":
return Optional.ofNullable(clazz.cast(flaggedIpAddressDetail()));
case "NewGeolocationDetail":
return Optional.ofNullable(clazz.cast(newGeolocationDetail()));
case "NewAsoDetail":
return Optional.ofNullable(clazz.cast(newAsoDetail()));
case "NewUserAgentDetail":
return Optional.ofNullable(clazz.cast(newUserAgentDetail()));
case "RelatedFindingDetail":
return Optional.ofNullable(clazz.cast(relatedFindingDetail()));
case "RelatedFindingGroupDetail":
return Optional.ofNullable(clazz.cast(relatedFindingGroupDetail()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function