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

commonMain.aws.sdk.kotlin.services.qbusiness.model.DataSourceSyncJob.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.qbusiness.model

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

/**
 * Provides information about an Amazon Q Business data source connector synchronization job.
 */
public class DataSourceSyncJob private constructor(builder: Builder) {
    /**
     * If the reason that the synchronization failed is due to an error with the underlying data source, this field contains a code that identifies the error.
     */
    public val dataSourceErrorCode: kotlin.String? = builder.dataSourceErrorCode
    /**
     * The Unix timestamp when the synchronization job completed.
     */
    public val endTime: aws.smithy.kotlin.runtime.time.Instant? = builder.endTime
    /**
     * If the `Status` field is set to `FAILED`, the `ErrorCode` field indicates the reason the synchronization failed.
     */
    public val error: aws.sdk.kotlin.services.qbusiness.model.ErrorDetail? = builder.error
    /**
     * The identifier of a data source synchronization job.
     */
    public val executionId: kotlin.String? = builder.executionId
    /**
     * Maps a batch delete document request to a specific data source sync job. This is optional and should only be supplied when documents are deleted by a data source connector.
     */
    public val metrics: aws.sdk.kotlin.services.qbusiness.model.DataSourceSyncJobMetrics? = builder.metrics
    /**
     * The Unix time stamp when the data source synchronization job started.
     */
    public val startTime: aws.smithy.kotlin.runtime.time.Instant? = builder.startTime
    /**
     * The status of the synchronization job. When the `Status` field is set to `SUCCEEDED`, the synchronization job is done. If the status code is `FAILED`, the `ErrorCode` and `ErrorMessage` fields give you the reason for the failure.
     */
    public val status: aws.sdk.kotlin.services.qbusiness.model.DataSourceSyncJobStatus? = builder.status

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

    override fun toString(): kotlin.String = buildString {
        append("DataSourceSyncJob(")
        append("dataSourceErrorCode=$dataSourceErrorCode,")
        append("endTime=$endTime,")
        append("error=$error,")
        append("executionId=$executionId,")
        append("metrics=$metrics,")
        append("startTime=$startTime,")
        append("status=$status")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dataSourceErrorCode?.hashCode() ?: 0
        result = 31 * result + (endTime?.hashCode() ?: 0)
        result = 31 * result + (error?.hashCode() ?: 0)
        result = 31 * result + (executionId?.hashCode() ?: 0)
        result = 31 * result + (metrics?.hashCode() ?: 0)
        result = 31 * result + (startTime?.hashCode() ?: 0)
        result = 31 * result + (status?.hashCode() ?: 0)
        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 DataSourceSyncJob

        if (dataSourceErrorCode != other.dataSourceErrorCode) return false
        if (endTime != other.endTime) return false
        if (error != other.error) return false
        if (executionId != other.executionId) return false
        if (metrics != other.metrics) return false
        if (startTime != other.startTime) return false
        if (status != other.status) return false

        return true
    }

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

    public class Builder {
        /**
         * If the reason that the synchronization failed is due to an error with the underlying data source, this field contains a code that identifies the error.
         */
        public var dataSourceErrorCode: kotlin.String? = null
        /**
         * The Unix timestamp when the synchronization job completed.
         */
        public var endTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * If the `Status` field is set to `FAILED`, the `ErrorCode` field indicates the reason the synchronization failed.
         */
        public var error: aws.sdk.kotlin.services.qbusiness.model.ErrorDetail? = null
        /**
         * The identifier of a data source synchronization job.
         */
        public var executionId: kotlin.String? = null
        /**
         * Maps a batch delete document request to a specific data source sync job. This is optional and should only be supplied when documents are deleted by a data source connector.
         */
        public var metrics: aws.sdk.kotlin.services.qbusiness.model.DataSourceSyncJobMetrics? = null
        /**
         * The Unix time stamp when the data source synchronization job started.
         */
        public var startTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The status of the synchronization job. When the `Status` field is set to `SUCCEEDED`, the synchronization job is done. If the status code is `FAILED`, the `ErrorCode` and `ErrorMessage` fields give you the reason for the failure.
         */
        public var status: aws.sdk.kotlin.services.qbusiness.model.DataSourceSyncJobStatus? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.qbusiness.model.DataSourceSyncJob) : this() {
            this.dataSourceErrorCode = x.dataSourceErrorCode
            this.endTime = x.endTime
            this.error = x.error
            this.executionId = x.executionId
            this.metrics = x.metrics
            this.startTime = x.startTime
            this.status = x.status
        }

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

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

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy