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

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

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

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

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

/**
 * Contains information about a version of a flow.
 *
 * This data type is used in the following API operations:
 * + [ListFlowVersions response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListFlowVersions.html#API_agent_ListFlowVersions_ResponseSyntax)
 */
public class FlowVersionSummary private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the flow that the version belongs to.
     */
    public val arn: kotlin.String = requireNotNull(builder.arn) { "A non-null value must be provided for arn" }
    /**
     * The time at the version was created.
     */
    public val createdAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createdAt) { "A non-null value must be provided for createdAt" }
    /**
     * The unique identifier of the flow.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
    /**
     * The status of the flow.
     */
    public val status: aws.sdk.kotlin.services.bedrockagent.model.FlowStatus = requireNotNull(builder.status) { "A non-null value must be provided for status" }
    /**
     * The version of the flow.
     */
    public val version: kotlin.String = requireNotNull(builder.version) { "A non-null value must be provided for version" }

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

    override fun toString(): kotlin.String = buildString {
        append("FlowVersionSummary(")
        append("arn=$arn,")
        append("createdAt=$createdAt,")
        append("id=$id,")
        append("status=$status,")
        append("version=$version")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = arn.hashCode()
        result = 31 * result + (createdAt.hashCode())
        result = 31 * result + (id.hashCode())
        result = 31 * result + (status.hashCode())
        result = 31 * result + (version.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 FlowVersionSummary

        if (arn != other.arn) return false
        if (createdAt != other.createdAt) return false
        if (id != other.id) return false
        if (status != other.status) return false
        if (version != other.version) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the flow that the version belongs to.
         */
        public var arn: kotlin.String? = null
        /**
         * The time at the version was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The unique identifier of the flow.
         */
        public var id: kotlin.String? = null
        /**
         * The status of the flow.
         */
        public var status: aws.sdk.kotlin.services.bedrockagent.model.FlowStatus? = null
        /**
         * The version of the flow.
         */
        public var version: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.FlowVersionSummary) : this() {
            this.arn = x.arn
            this.createdAt = x.createdAt
            this.id = x.id
            this.status = x.status
            this.version = x.version
        }

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

        internal fun correctErrors(): Builder {
            if (arn == null) arn = ""
            if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
            if (id == null) id = ""
            if (status == null) status = FlowStatus.SdkUnknown("no value provided")
            if (version == null) version = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy