
software.amazon.awssdk.services.guardduty.model.LineageObject Maven / Gradle / Ivy
/*
* 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.guardduty.model;
import java.io.Serializable;
import java.time.Instant;
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.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;
/**
*
* Information about the runtime process details.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class LineageObject implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("StartTime").getter(getter(LineageObject::startTime)).setter(setter(Builder::startTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startTime").build()).build();
private static final SdkField NAMESPACE_PID_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("NamespacePid").getter(getter(LineageObject::namespacePid)).setter(setter(Builder::namespacePid))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("namespacePid").build()).build();
private static final SdkField USER_ID_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("UserId").getter(getter(LineageObject::userId)).setter(setter(Builder::userId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("userId").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(LineageObject::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField PID_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Pid")
.getter(getter(LineageObject::pid)).setter(setter(Builder::pid))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pid").build()).build();
private static final SdkField UUID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Uuid")
.getter(getter(LineageObject::uuid)).setter(setter(Builder::uuid))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("uuid").build()).build();
private static final SdkField EXECUTABLE_PATH_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ExecutablePath").getter(getter(LineageObject::executablePath)).setter(setter(Builder::executablePath))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("executablePath").build()).build();
private static final SdkField EUID_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Euid")
.getter(getter(LineageObject::euid)).setter(setter(Builder::euid))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("euid").build()).build();
private static final SdkField PARENT_UUID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ParentUuid").getter(getter(LineageObject::parentUuid)).setter(setter(Builder::parentUuid))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("parentUuid").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(START_TIME_FIELD,
NAMESPACE_PID_FIELD, USER_ID_FIELD, NAME_FIELD, PID_FIELD, UUID_FIELD, EXECUTABLE_PATH_FIELD, EUID_FIELD,
PARENT_UUID_FIELD));
private static final long serialVersionUID = 1L;
private final Instant startTime;
private final Integer namespacePid;
private final Integer userId;
private final String name;
private final Integer pid;
private final String uuid;
private final String executablePath;
private final Integer euid;
private final String parentUuid;
private LineageObject(BuilderImpl builder) {
this.startTime = builder.startTime;
this.namespacePid = builder.namespacePid;
this.userId = builder.userId;
this.name = builder.name;
this.pid = builder.pid;
this.uuid = builder.uuid;
this.executablePath = builder.executablePath;
this.euid = builder.euid;
this.parentUuid = builder.parentUuid;
}
/**
*
* The time when the process started. This is in UTC format.
*
*
* @return The time when the process started. This is in UTC format.
*/
public final Instant startTime() {
return startTime;
}
/**
*
* The process ID of the child process.
*
*
* @return The process ID of the child process.
*/
public final Integer namespacePid() {
return namespacePid;
}
/**
*
* The user ID of the user that executed the process.
*
*
* @return The user ID of the user that executed the process.
*/
public final Integer userId() {
return userId;
}
/**
*
* The name of the process.
*
*
* @return The name of the process.
*/
public final String name() {
return name;
}
/**
*
* The ID of the process.
*
*
* @return The ID of the process.
*/
public final Integer pid() {
return pid;
}
/**
*
* The unique ID assigned to the process by GuardDuty.
*
*
* @return The unique ID assigned to the process by GuardDuty.
*/
public final String uuid() {
return uuid;
}
/**
*
* The absolute path of the process executable file.
*
*
* @return The absolute path of the process executable file.
*/
public final String executablePath() {
return executablePath;
}
/**
*
* The effective user ID that was used to execute the process.
*
*
* @return The effective user ID that was used to execute the process.
*/
public final Integer euid() {
return euid;
}
/**
*
* The unique ID of the parent process. This ID is assigned to the parent process by GuardDuty.
*
*
* @return The unique ID of the parent process. This ID is assigned to the parent process by GuardDuty.
*/
public final String parentUuid() {
return parentUuid;
}
@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(startTime());
hashCode = 31 * hashCode + Objects.hashCode(namespacePid());
hashCode = 31 * hashCode + Objects.hashCode(userId());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(pid());
hashCode = 31 * hashCode + Objects.hashCode(uuid());
hashCode = 31 * hashCode + Objects.hashCode(executablePath());
hashCode = 31 * hashCode + Objects.hashCode(euid());
hashCode = 31 * hashCode + Objects.hashCode(parentUuid());
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 LineageObject)) {
return false;
}
LineageObject other = (LineageObject) obj;
return Objects.equals(startTime(), other.startTime()) && Objects.equals(namespacePid(), other.namespacePid())
&& Objects.equals(userId(), other.userId()) && Objects.equals(name(), other.name())
&& Objects.equals(pid(), other.pid()) && Objects.equals(uuid(), other.uuid())
&& Objects.equals(executablePath(), other.executablePath()) && Objects.equals(euid(), other.euid())
&& Objects.equals(parentUuid(), other.parentUuid());
}
/**
* 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("LineageObject").add("StartTime", startTime()).add("NamespacePid", namespacePid())
.add("UserId", userId()).add("Name", name()).add("Pid", pid()).add("Uuid", uuid())
.add("ExecutablePath", executablePath()).add("Euid", euid()).add("ParentUuid", parentUuid()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "StartTime":
return Optional.ofNullable(clazz.cast(startTime()));
case "NamespacePid":
return Optional.ofNullable(clazz.cast(namespacePid()));
case "UserId":
return Optional.ofNullable(clazz.cast(userId()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Pid":
return Optional.ofNullable(clazz.cast(pid()));
case "Uuid":
return Optional.ofNullable(clazz.cast(uuid()));
case "ExecutablePath":
return Optional.ofNullable(clazz.cast(executablePath()));
case "Euid":
return Optional.ofNullable(clazz.cast(euid()));
case "ParentUuid":
return Optional.ofNullable(clazz.cast(parentUuid()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy