
software.amazon.awssdk.services.detective.model.TTPsObservedDetail Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of detective Show documentation
Show all versions of detective Show documentation
The AWS Java SDK for Detective module holds the client classes that are used for
communicating with Detective.
/*
* 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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
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 tactics, techniques, and procedures (TTPs) used in a potential security event. Tactics are based on MITRE ATT&CK Matrix for Enterprise.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class TTPsObservedDetail implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField TACTIC_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Tactic")
.getter(getter(TTPsObservedDetail::tactic)).setter(setter(Builder::tactic))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tactic").build()).build();
private static final SdkField TECHNIQUE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Technique").getter(getter(TTPsObservedDetail::technique)).setter(setter(Builder::technique))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Technique").build()).build();
private static final SdkField PROCEDURE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Procedure").getter(getter(TTPsObservedDetail::procedure)).setter(setter(Builder::procedure))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Procedure").build()).build();
private static final SdkField IP_ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IpAddress").getter(getter(TTPsObservedDetail::ipAddress)).setter(setter(Builder::ipAddress))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IpAddress").build()).build();
private static final SdkField API_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("APIName").getter(getter(TTPsObservedDetail::apiName)).setter(setter(Builder::apiName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("APIName").build()).build();
private static final SdkField API_SUCCESS_COUNT_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("APISuccessCount").getter(getter(TTPsObservedDetail::apiSuccessCount))
.setter(setter(Builder::apiSuccessCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("APISuccessCount").build()).build();
private static final SdkField API_FAILURE_COUNT_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("APIFailureCount").getter(getter(TTPsObservedDetail::apiFailureCount))
.setter(setter(Builder::apiFailureCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("APIFailureCount").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TACTIC_FIELD, TECHNIQUE_FIELD,
PROCEDURE_FIELD, IP_ADDRESS_FIELD, API_NAME_FIELD, API_SUCCESS_COUNT_FIELD, API_FAILURE_COUNT_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("Tactic", TACTIC_FIELD);
put("Technique", TECHNIQUE_FIELD);
put("Procedure", PROCEDURE_FIELD);
put("IpAddress", IP_ADDRESS_FIELD);
put("APIName", API_NAME_FIELD);
put("APISuccessCount", API_SUCCESS_COUNT_FIELD);
put("APIFailureCount", API_FAILURE_COUNT_FIELD);
}
});
private static final long serialVersionUID = 1L;
private final String tactic;
private final String technique;
private final String procedure;
private final String ipAddress;
private final String apiName;
private final Long apiSuccessCount;
private final Long apiFailureCount;
private TTPsObservedDetail(BuilderImpl builder) {
this.tactic = builder.tactic;
this.technique = builder.technique;
this.procedure = builder.procedure;
this.ipAddress = builder.ipAddress;
this.apiName = builder.apiName;
this.apiSuccessCount = builder.apiSuccessCount;
this.apiFailureCount = builder.apiFailureCount;
}
/**
*
* The tactic used, identified by the investigation.
*
*
* @return The tactic used, identified by the investigation.
*/
public final String tactic() {
return tactic;
}
/**
*
* The technique used, identified by the investigation.
*
*
* @return The technique used, identified by the investigation.
*/
public final String technique() {
return technique;
}
/**
*
* The procedure used, identified by the investigation.
*
*
* @return The procedure used, identified by the investigation.
*/
public final String procedure() {
return procedure;
}
/**
*
* The IP address where the tactics, techniques, and procedure (TTP) was observed.
*
*
* @return The IP address where the tactics, techniques, and procedure (TTP) was observed.
*/
public final String ipAddress() {
return ipAddress;
}
/**
*
* The name of the API where the tactics, techniques, and procedure (TTP) was observed.
*
*
* @return The name of the API where the tactics, techniques, and procedure (TTP) was observed.
*/
public final String apiName() {
return apiName;
}
/**
*
* The total number of successful API requests.
*
*
* @return The total number of successful API requests.
*/
public final Long apiSuccessCount() {
return apiSuccessCount;
}
/**
*
* The total number of failed API requests.
*
*
* @return The total number of failed API requests.
*/
public final Long apiFailureCount() {
return apiFailureCount;
}
@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(tactic());
hashCode = 31 * hashCode + Objects.hashCode(technique());
hashCode = 31 * hashCode + Objects.hashCode(procedure());
hashCode = 31 * hashCode + Objects.hashCode(ipAddress());
hashCode = 31 * hashCode + Objects.hashCode(apiName());
hashCode = 31 * hashCode + Objects.hashCode(apiSuccessCount());
hashCode = 31 * hashCode + Objects.hashCode(apiFailureCount());
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 TTPsObservedDetail)) {
return false;
}
TTPsObservedDetail other = (TTPsObservedDetail) obj;
return Objects.equals(tactic(), other.tactic()) && Objects.equals(technique(), other.technique())
&& Objects.equals(procedure(), other.procedure()) && Objects.equals(ipAddress(), other.ipAddress())
&& Objects.equals(apiName(), other.apiName()) && Objects.equals(apiSuccessCount(), other.apiSuccessCount())
&& Objects.equals(apiFailureCount(), other.apiFailureCount());
}
/**
* 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("TTPsObservedDetail").add("Tactic", tactic()).add("Technique", technique())
.add("Procedure", procedure()).add("IpAddress", ipAddress()).add("APIName", apiName())
.add("APISuccessCount", apiSuccessCount()).add("APIFailureCount", apiFailureCount()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Tactic":
return Optional.ofNullable(clazz.cast(tactic()));
case "Technique":
return Optional.ofNullable(clazz.cast(technique()));
case "Procedure":
return Optional.ofNullable(clazz.cast(procedure()));
case "IpAddress":
return Optional.ofNullable(clazz.cast(ipAddress()));
case "APIName":
return Optional.ofNullable(clazz.cast(apiName()));
case "APISuccessCount":
return Optional.ofNullable(clazz.cast(apiSuccessCount()));
case "APIFailureCount":
return Optional.ofNullable(clazz.cast(apiFailureCount()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy