
software.amazon.awssdk.services.bedrockagent.model.IngestionJobSummary Maven / Gradle / Ivy
Show all versions of bedrockagent 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.bedrockagent.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.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.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Contains details about a data ingestion job.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class IngestionJobSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField DATA_SOURCE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("dataSourceId").getter(getter(IngestionJobSummary::dataSourceId)).setter(setter(Builder::dataSourceId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dataSourceId").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(IngestionJobSummary::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField INGESTION_JOB_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ingestionJobId").getter(getter(IngestionJobSummary::ingestionJobId))
.setter(setter(Builder::ingestionJobId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ingestionJobId").build()).build();
private static final SdkField KNOWLEDGE_BASE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("knowledgeBaseId").getter(getter(IngestionJobSummary::knowledgeBaseId))
.setter(setter(Builder::knowledgeBaseId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("knowledgeBaseId").build()).build();
private static final SdkField STARTED_AT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("startedAt")
.getter(getter(IngestionJobSummary::startedAt))
.setter(setter(Builder::startedAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startedAt").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final SdkField STATISTICS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("statistics")
.getter(getter(IngestionJobSummary::statistics)).setter(setter(Builder::statistics))
.constructor(IngestionJobStatistics::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statistics").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(IngestionJobSummary::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField UPDATED_AT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("updatedAt")
.getter(getter(IngestionJobSummary::updatedAt))
.setter(setter(Builder::updatedAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("updatedAt").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DATA_SOURCE_ID_FIELD,
DESCRIPTION_FIELD, INGESTION_JOB_ID_FIELD, KNOWLEDGE_BASE_ID_FIELD, STARTED_AT_FIELD, STATISTICS_FIELD, STATUS_FIELD,
UPDATED_AT_FIELD));
private static final long serialVersionUID = 1L;
private final String dataSourceId;
private final String description;
private final String ingestionJobId;
private final String knowledgeBaseId;
private final Instant startedAt;
private final IngestionJobStatistics statistics;
private final String status;
private final Instant updatedAt;
private IngestionJobSummary(BuilderImpl builder) {
this.dataSourceId = builder.dataSourceId;
this.description = builder.description;
this.ingestionJobId = builder.ingestionJobId;
this.knowledgeBaseId = builder.knowledgeBaseId;
this.startedAt = builder.startedAt;
this.statistics = builder.statistics;
this.status = builder.status;
this.updatedAt = builder.updatedAt;
}
/**
*
* The unique identifier of the data source for the data ingestion job.
*
*
* @return The unique identifier of the data source for the data ingestion job.
*/
public final String dataSourceId() {
return dataSourceId;
}
/**
*
* The description of the data ingestion job.
*
*
* @return The description of the data ingestion job.
*/
public final String description() {
return description;
}
/**
*
* The unique identifier of the data ingestion job.
*
*
* @return The unique identifier of the data ingestion job.
*/
public final String ingestionJobId() {
return ingestionJobId;
}
/**
*
* The unique identifier of the knowledge base for the data ingestion job.
*
*
* @return The unique identifier of the knowledge base for the data ingestion job.
*/
public final String knowledgeBaseId() {
return knowledgeBaseId;
}
/**
*
* The time the data ingestion job started.
*
*
* @return The time the data ingestion job started.
*/
public final Instant startedAt() {
return startedAt;
}
/**
*
* Contains statistics for the data ingestion job.
*
*
* @return Contains statistics for the data ingestion job.
*/
public final IngestionJobStatistics statistics() {
return statistics;
}
/**
*
* The status of the data ingestion job.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link IngestionJobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the data ingestion job.
* @see IngestionJobStatus
*/
public final IngestionJobStatus status() {
return IngestionJobStatus.fromValue(status);
}
/**
*
* The status of the data ingestion job.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link IngestionJobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the data ingestion job.
* @see IngestionJobStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* The time the data ingestion job was last updated.
*
*
* @return The time the data ingestion job was last updated.
*/
public final Instant updatedAt() {
return updatedAt;
}
@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(dataSourceId());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(ingestionJobId());
hashCode = 31 * hashCode + Objects.hashCode(knowledgeBaseId());
hashCode = 31 * hashCode + Objects.hashCode(startedAt());
hashCode = 31 * hashCode + Objects.hashCode(statistics());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(updatedAt());
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 IngestionJobSummary)) {
return false;
}
IngestionJobSummary other = (IngestionJobSummary) obj;
return Objects.equals(dataSourceId(), other.dataSourceId()) && Objects.equals(description(), other.description())
&& Objects.equals(ingestionJobId(), other.ingestionJobId())
&& Objects.equals(knowledgeBaseId(), other.knowledgeBaseId()) && Objects.equals(startedAt(), other.startedAt())
&& Objects.equals(statistics(), other.statistics()) && Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(updatedAt(), other.updatedAt());
}
/**
* 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("IngestionJobSummary").add("DataSourceId", dataSourceId()).add("Description", description())
.add("IngestionJobId", ingestionJobId()).add("KnowledgeBaseId", knowledgeBaseId()).add("StartedAt", startedAt())
.add("Statistics", statistics()).add("Status", statusAsString()).add("UpdatedAt", updatedAt()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "dataSourceId":
return Optional.ofNullable(clazz.cast(dataSourceId()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "ingestionJobId":
return Optional.ofNullable(clazz.cast(ingestionJobId()));
case "knowledgeBaseId":
return Optional.ofNullable(clazz.cast(knowledgeBaseId()));
case "startedAt":
return Optional.ofNullable(clazz.cast(startedAt()));
case "statistics":
return Optional.ofNullable(clazz.cast(statistics()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "updatedAt":
return Optional.ofNullable(clazz.cast(updatedAt()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function