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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.AgentSummary.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 details about an agent.
 */
public class AgentSummary private constructor(builder: Builder) {
    /**
     * The unique identifier of the agent.
     */
    public val agentId: kotlin.String = requireNotNull(builder.agentId) { "A non-null value must be provided for agentId" }
    /**
     * The name of the agent.
     */
    public val agentName: kotlin.String = requireNotNull(builder.agentName) { "A non-null value must be provided for agentName" }
    /**
     * The status of the agent.
     */
    public val agentStatus: aws.sdk.kotlin.services.bedrockagent.model.AgentStatus = requireNotNull(builder.agentStatus) { "A non-null value must be provided for agentStatus" }
    /**
     * The description 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 latest version of the agent.
     */
    public val latestAgentVersion: kotlin.String? = builder.latestAgentVersion
    /**
     * The time at which the agent 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.AgentSummary = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("AgentSummary(")
        append("agentId=$agentId,")
        append("agentName=$agentName,")
        append("agentStatus=$agentStatus,")
        append("description=$description,")
        append("guardrailConfiguration=$guardrailConfiguration,")
        append("latestAgentVersion=$latestAgentVersion,")
        append("updatedAt=$updatedAt")
        append(")")
    }

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

        if (agentId != other.agentId) return false
        if (agentName != other.agentName) return false
        if (agentStatus != other.agentStatus) return false
        if (description != other.description) return false
        if (guardrailConfiguration != other.guardrailConfiguration) return false
        if (latestAgentVersion != other.latestAgentVersion) return false
        if (updatedAt != other.updatedAt) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The unique identifier of the agent.
         */
        public var agentId: kotlin.String? = null
        /**
         * The name of the agent.
         */
        public var agentName: kotlin.String? = null
        /**
         * The status of the agent.
         */
        public var agentStatus: aws.sdk.kotlin.services.bedrockagent.model.AgentStatus? = null
        /**
         * The description 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 latest version of the agent.
         */
        public var latestAgentVersion: kotlin.String? = null
        /**
         * The time at which the agent 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.AgentSummary) : this() {
            this.agentId = x.agentId
            this.agentName = x.agentName
            this.agentStatus = x.agentStatus
            this.description = x.description
            this.guardrailConfiguration = x.guardrailConfiguration
            this.latestAgentVersion = x.latestAgentVersion
            this.updatedAt = x.updatedAt
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.AgentSummary = AgentSummary(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 (agentId == null) agentId = ""
            if (agentName == null) agentName = ""
            if (agentStatus == null) agentStatus = AgentStatus.SdkUnknown("no value provided")
            if (updatedAt == null) updatedAt = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy