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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.IngestionJob.kt Maven / Gradle / Ivy

There is a newer version: 1.3.35
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.bedrockagent.model

import aws.smithy.kotlin.runtime.time.Instant

/**
 * Contains details about an ingestion job, which converts a data source to embeddings for a vector store in knowledge base.
 *
 * This data type is used in the following API operations:
 * + [StartIngestionJob response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_StartIngestionJob.html#API_agent_StartIngestionJob_ResponseSyntax)
 * + [GetIngestionJob response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetIngestionJob.html#API_agent_GetIngestionJob_ResponseSyntax)
 * + [ListIngestionJob response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListIngestionJob.html#API_agent_ListIngestionJob_ResponseSyntax)
 */
public class IngestionJob private constructor(builder: Builder) {
    /**
     * The unique identifier of the ingested data source.
     */
    public val dataSourceId: kotlin.String = requireNotNull(builder.dataSourceId) { "A non-null value must be provided for dataSourceId" }
    /**
     * The description of the ingestion job.
     */
    public val description: kotlin.String? = builder.description
    /**
     * A list of reasons that the ingestion job failed.
     */
    public val failureReasons: List? = builder.failureReasons
    /**
     * The unique identifier of the ingestion job.
     */
    public val ingestionJobId: kotlin.String = requireNotNull(builder.ingestionJobId) { "A non-null value must be provided for ingestionJobId" }
    /**
     * The unique identifier of the knowledge base to which the data source is being added.
     */
    public val knowledgeBaseId: kotlin.String = requireNotNull(builder.knowledgeBaseId) { "A non-null value must be provided for knowledgeBaseId" }
    /**
     * The time at which the ingestion job started.
     */
    public val startedAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.startedAt) { "A non-null value must be provided for startedAt" }
    /**
     * Contains statistics about the ingestion job.
     */
    public val statistics: aws.sdk.kotlin.services.bedrockagent.model.IngestionJobStatistics? = builder.statistics
    /**
     * The status of the ingestion job.
     */
    public val status: aws.sdk.kotlin.services.bedrockagent.model.IngestionJobStatus = requireNotNull(builder.status) { "A non-null value must be provided for status" }
    /**
     * The time at which the ingestion job was last updated.
     */
    public val updatedAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.updatedAt) { "A non-null value must be provided for updatedAt" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.IngestionJob = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("IngestionJob(")
        append("dataSourceId=$dataSourceId,")
        append("description=$description,")
        append("failureReasons=$failureReasons,")
        append("ingestionJobId=$ingestionJobId,")
        append("knowledgeBaseId=$knowledgeBaseId,")
        append("startedAt=$startedAt,")
        append("statistics=$statistics,")
        append("status=$status,")
        append("updatedAt=$updatedAt")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dataSourceId.hashCode()
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (failureReasons?.hashCode() ?: 0)
        result = 31 * result + (ingestionJobId.hashCode())
        result = 31 * result + (knowledgeBaseId.hashCode())
        result = 31 * result + (startedAt.hashCode())
        result = 31 * result + (statistics?.hashCode() ?: 0)
        result = 31 * result + (status.hashCode())
        result = 31 * result + (updatedAt.hashCode())
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as IngestionJob

        if (dataSourceId != other.dataSourceId) return false
        if (description != other.description) return false
        if (failureReasons != other.failureReasons) return false
        if (ingestionJobId != other.ingestionJobId) return false
        if (knowledgeBaseId != other.knowledgeBaseId) return false
        if (startedAt != other.startedAt) return false
        if (statistics != other.statistics) return false
        if (status != other.status) return false
        if (updatedAt != other.updatedAt) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.IngestionJob = Builder(this).apply(block).build()

    public class Builder {
        /**
         * The unique identifier of the ingested data source.
         */
        public var dataSourceId: kotlin.String? = null
        /**
         * The description of the ingestion job.
         */
        public var description: kotlin.String? = null
        /**
         * A list of reasons that the ingestion job failed.
         */
        public var failureReasons: List? = null
        /**
         * The unique identifier of the ingestion job.
         */
        public var ingestionJobId: kotlin.String? = null
        /**
         * The unique identifier of the knowledge base to which the data source is being added.
         */
        public var knowledgeBaseId: kotlin.String? = null
        /**
         * The time at which the ingestion job started.
         */
        public var startedAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Contains statistics about the ingestion job.
         */
        public var statistics: aws.sdk.kotlin.services.bedrockagent.model.IngestionJobStatistics? = null
        /**
         * The status of the ingestion job.
         */
        public var status: aws.sdk.kotlin.services.bedrockagent.model.IngestionJobStatus? = null
        /**
         * The time at which the ingestion job was last updated.
         */
        public var updatedAt: aws.smithy.kotlin.runtime.time.Instant? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.IngestionJob) : this() {
            this.dataSourceId = x.dataSourceId
            this.description = x.description
            this.failureReasons = x.failureReasons
            this.ingestionJobId = x.ingestionJobId
            this.knowledgeBaseId = x.knowledgeBaseId
            this.startedAt = x.startedAt
            this.statistics = x.statistics
            this.status = x.status
            this.updatedAt = x.updatedAt
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.IngestionJob = IngestionJob(this)

        /**
         * construct an [aws.sdk.kotlin.services.bedrockagent.model.IngestionJobStatistics] inside the given [block]
         */
        public fun statistics(block: aws.sdk.kotlin.services.bedrockagent.model.IngestionJobStatistics.Builder.() -> kotlin.Unit) {
            this.statistics = aws.sdk.kotlin.services.bedrockagent.model.IngestionJobStatistics.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (dataSourceId == null) dataSourceId = ""
            if (ingestionJobId == null) ingestionJobId = ""
            if (knowledgeBaseId == null) knowledgeBaseId = ""
            if (startedAt == null) startedAt = Instant.fromEpochSeconds(0)
            if (status == null) status = IngestionJobStatus.SdkUnknown("no value provided")
            if (updatedAt == null) updatedAt = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy