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

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

There is a newer version: 1.3.77
Show newest version
// 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 details about a version of an agent.
 */
public class AgentVersionSummary private constructor(builder: Builder) {
    /**
     * The name of the agent to which the version belongs.
     */
    public val agentName: kotlin.String = requireNotNull(builder.agentName) { "A non-null value must be provided for agentName" }
    /**
     * The status of the agent to which the version belongs.
     */
    public val agentStatus: aws.sdk.kotlin.services.bedrockagent.model.AgentStatus = requireNotNull(builder.agentStatus) { "A non-null value must be provided for agentStatus" }
    /**
     * The version of the agent.
     */
    public val agentVersion: kotlin.String = requireNotNull(builder.agentVersion) { "A non-null value must be provided for agentVersion" }
    /**
     * The time at which 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 description of the version of the agent.
     */
    public val description: kotlin.String? = builder.description
    /**
     * Details about the guardrail associated with the agent.
     */
    public val guardrailConfiguration: aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration? = builder.guardrailConfiguration
    /**
     * The time at which the version 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.AgentVersionSummary = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("AgentVersionSummary(")
        append("agentName=$agentName,")
        append("agentStatus=$agentStatus,")
        append("agentVersion=$agentVersion,")
        append("createdAt=$createdAt,")
        append("description=$description,")
        append("guardrailConfiguration=$guardrailConfiguration,")
        append("updatedAt=$updatedAt")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = agentName.hashCode()
        result = 31 * result + (agentStatus.hashCode())
        result = 31 * result + (agentVersion.hashCode())
        result = 31 * result + (createdAt.hashCode())
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (guardrailConfiguration?.hashCode() ?: 0)
        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 AgentVersionSummary

        if (agentName != other.agentName) return false
        if (agentStatus != other.agentStatus) return false
        if (agentVersion != other.agentVersion) return false
        if (createdAt != other.createdAt) return false
        if (description != other.description) return false
        if (guardrailConfiguration != other.guardrailConfiguration) return false
        if (updatedAt != other.updatedAt) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The name of the agent to which the version belongs.
         */
        public var agentName: kotlin.String? = null
        /**
         * The status of the agent to which the version belongs.
         */
        public var agentStatus: aws.sdk.kotlin.services.bedrockagent.model.AgentStatus? = null
        /**
         * The version of the agent.
         */
        public var agentVersion: kotlin.String? = null
        /**
         * The time at which the version was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The description of the version of the agent.
         */
        public var description: kotlin.String? = null
        /**
         * Details about the guardrail associated with the agent.
         */
        public var guardrailConfiguration: aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration? = null
        /**
         * The time at which the version 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.AgentVersionSummary) : this() {
            this.agentName = x.agentName
            this.agentStatus = x.agentStatus
            this.agentVersion = x.agentVersion
            this.createdAt = x.createdAt
            this.description = x.description
            this.guardrailConfiguration = x.guardrailConfiguration
            this.updatedAt = x.updatedAt
        }

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

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

        internal fun correctErrors(): Builder {
            if (agentName == null) agentName = ""
            if (agentStatus == null) agentStatus = AgentStatus.SdkUnknown("no value provided")
            if (agentVersion == null) agentVersion = ""
            if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
            if (updatedAt == null) updatedAt = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy