All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.bedrockagent.model.IngestionJobSummary Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Bedrock Agent module holds the client classes that are used for communicating with Bedrock Agent.

There is a newer version: 2.30.1
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((IngestionJobSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The unique identifier of the data source for the data ingestion job. *

* * @param dataSourceId * The unique identifier of the data source for the data ingestion job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataSourceId(String dataSourceId); /** *

* The description of the data ingestion job. *

* * @param description * The description of the data ingestion job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The unique identifier of the data ingestion job. *

* * @param ingestionJobId * The unique identifier of the data ingestion job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ingestionJobId(String ingestionJobId); /** *

* The unique identifier of the knowledge base for the data ingestion job. *

* * @param knowledgeBaseId * The unique identifier of the knowledge base for the data ingestion job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder knowledgeBaseId(String knowledgeBaseId); /** *

* The time the data ingestion job started. *

* * @param startedAt * The time the data ingestion job started. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startedAt(Instant startedAt); /** *

* Contains statistics for the data ingestion job. *

* * @param statistics * Contains statistics for the data ingestion job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statistics(IngestionJobStatistics statistics); /** *

* Contains statistics for the data ingestion job. *

* This is a convenience method that creates an instance of the {@link IngestionJobStatistics.Builder} avoiding * the need to create one manually via {@link IngestionJobStatistics#builder()}. * *

* When the {@link Consumer} completes, {@link IngestionJobStatistics.Builder#build()} is called immediately and * its result is passed to {@link #statistics(IngestionJobStatistics)}. * * @param statistics * a consumer that will call methods on {@link IngestionJobStatistics.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #statistics(IngestionJobStatistics) */ default Builder statistics(Consumer statistics) { return statistics(IngestionJobStatistics.builder().applyMutation(statistics).build()); } /** *

* The status of the data ingestion job. *

* * @param status * The status of the data ingestion job. * @see IngestionJobStatus * @return Returns a reference to this object so that method calls can be chained together. * @see IngestionJobStatus */ Builder status(String status); /** *

* The status of the data ingestion job. *

* * @param status * The status of the data ingestion job. * @see IngestionJobStatus * @return Returns a reference to this object so that method calls can be chained together. * @see IngestionJobStatus */ Builder status(IngestionJobStatus status); /** *

* The time the data ingestion job was last updated. *

* * @param updatedAt * The time the data ingestion job was last updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder updatedAt(Instant updatedAt); } static final class BuilderImpl implements Builder { private String dataSourceId; private String description; private String ingestionJobId; private String knowledgeBaseId; private Instant startedAt; private IngestionJobStatistics statistics; private String status; private Instant updatedAt; private BuilderImpl() { } private BuilderImpl(IngestionJobSummary model) { dataSourceId(model.dataSourceId); description(model.description); ingestionJobId(model.ingestionJobId); knowledgeBaseId(model.knowledgeBaseId); startedAt(model.startedAt); statistics(model.statistics); status(model.status); updatedAt(model.updatedAt); } public final String getDataSourceId() { return dataSourceId; } public final void setDataSourceId(String dataSourceId) { this.dataSourceId = dataSourceId; } @Override public final Builder dataSourceId(String dataSourceId) { this.dataSourceId = dataSourceId; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getIngestionJobId() { return ingestionJobId; } public final void setIngestionJobId(String ingestionJobId) { this.ingestionJobId = ingestionJobId; } @Override public final Builder ingestionJobId(String ingestionJobId) { this.ingestionJobId = ingestionJobId; return this; } public final String getKnowledgeBaseId() { return knowledgeBaseId; } public final void setKnowledgeBaseId(String knowledgeBaseId) { this.knowledgeBaseId = knowledgeBaseId; } @Override public final Builder knowledgeBaseId(String knowledgeBaseId) { this.knowledgeBaseId = knowledgeBaseId; return this; } public final Instant getStartedAt() { return startedAt; } public final void setStartedAt(Instant startedAt) { this.startedAt = startedAt; } @Override public final Builder startedAt(Instant startedAt) { this.startedAt = startedAt; return this; } public final IngestionJobStatistics.Builder getStatistics() { return statistics != null ? statistics.toBuilder() : null; } public final void setStatistics(IngestionJobStatistics.BuilderImpl statistics) { this.statistics = statistics != null ? statistics.build() : null; } @Override public final Builder statistics(IngestionJobStatistics statistics) { this.statistics = statistics; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(IngestionJobStatus status) { this.status(status == null ? null : status.toString()); return this; } public final Instant getUpdatedAt() { return updatedAt; } public final void setUpdatedAt(Instant updatedAt) { this.updatedAt = updatedAt; } @Override public final Builder updatedAt(Instant updatedAt) { this.updatedAt = updatedAt; return this; } @Override public IngestionJobSummary build() { return new IngestionJobSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy