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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.AgentAlias.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 an alias of an agent.
 */
public class AgentAlias private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the alias of the agent.
     */
    public val agentAliasArn: kotlin.String = requireNotNull(builder.agentAliasArn) { "A non-null value must be provided for agentAliasArn" }
    /**
     * Contains details about the history of the alias.
     */
    public val agentAliasHistoryEvents: List? = builder.agentAliasHistoryEvents
    /**
     * The unique identifier of the alias of the agent.
     */
    public val agentAliasId: kotlin.String = requireNotNull(builder.agentAliasId) { "A non-null value must be provided for agentAliasId" }
    /**
     * The name of the alias of the agent.
     */
    public val agentAliasName: kotlin.String = requireNotNull(builder.agentAliasName) { "A non-null value must be provided for agentAliasName" }
    /**
     * The status of the alias of the agent and whether it is ready for use. The following statuses are possible:
     * + CREATING – The agent alias is being created.
     * + PREPARED – The agent alias is finished being created or updated and is ready to be invoked.
     * + FAILED – The agent alias API operation failed.
     * + UPDATING – The agent alias is being updated.
     * + DELETING – The agent alias is being deleted.
     */
    public val agentAliasStatus: aws.sdk.kotlin.services.bedrockagent.model.AgentAliasStatus = requireNotNull(builder.agentAliasStatus) { "A non-null value must be provided for agentAliasStatus" }
    /**
     * The unique identifier of the agent.
     */
    public val agentId: kotlin.String = requireNotNull(builder.agentId) { "A non-null value must be provided for agentId" }
    /**
     * A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see [Ensuring idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
     */
    public val clientToken: kotlin.String? = builder.clientToken
    /**
     * The time at which the alias of the agent 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 alias of the agent.
     */
    public val description: kotlin.String? = builder.description
    /**
     * Information on the failure of Provisioned Throughput assigned to an agent alias.
     */
    public val failureReasons: List? = builder.failureReasons
    /**
     * Contains details about the routing configuration of the alias.
     */
    public val routingConfiguration: List = requireNotNull(builder.routingConfiguration) { "A non-null value must be provided for routingConfiguration" }
    /**
     * The time at which the alias 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.AgentAlias = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("AgentAlias(")
        append("agentAliasArn=$agentAliasArn,")
        append("agentAliasHistoryEvents=$agentAliasHistoryEvents,")
        append("agentAliasId=$agentAliasId,")
        append("agentAliasName=$agentAliasName,")
        append("agentAliasStatus=$agentAliasStatus,")
        append("agentId=$agentId,")
        append("clientToken=$clientToken,")
        append("createdAt=$createdAt,")
        append("description=$description,")
        append("failureReasons=$failureReasons,")
        append("routingConfiguration=$routingConfiguration,")
        append("updatedAt=$updatedAt")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = agentAliasArn.hashCode()
        result = 31 * result + (agentAliasHistoryEvents?.hashCode() ?: 0)
        result = 31 * result + (agentAliasId.hashCode())
        result = 31 * result + (agentAliasName.hashCode())
        result = 31 * result + (agentAliasStatus.hashCode())
        result = 31 * result + (agentId.hashCode())
        result = 31 * result + (clientToken?.hashCode() ?: 0)
        result = 31 * result + (createdAt.hashCode())
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (failureReasons?.hashCode() ?: 0)
        result = 31 * result + (routingConfiguration.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 AgentAlias

        if (agentAliasArn != other.agentAliasArn) return false
        if (agentAliasHistoryEvents != other.agentAliasHistoryEvents) return false
        if (agentAliasId != other.agentAliasId) return false
        if (agentAliasName != other.agentAliasName) return false
        if (agentAliasStatus != other.agentAliasStatus) return false
        if (agentId != other.agentId) return false
        if (clientToken != other.clientToken) return false
        if (createdAt != other.createdAt) return false
        if (description != other.description) return false
        if (failureReasons != other.failureReasons) return false
        if (routingConfiguration != other.routingConfiguration) return false
        if (updatedAt != other.updatedAt) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the alias of the agent.
         */
        public var agentAliasArn: kotlin.String? = null
        /**
         * Contains details about the history of the alias.
         */
        public var agentAliasHistoryEvents: List? = null
        /**
         * The unique identifier of the alias of the agent.
         */
        public var agentAliasId: kotlin.String? = null
        /**
         * The name of the alias of the agent.
         */
        public var agentAliasName: kotlin.String? = null
        /**
         * The status of the alias of the agent and whether it is ready for use. The following statuses are possible:
         * + CREATING – The agent alias is being created.
         * + PREPARED – The agent alias is finished being created or updated and is ready to be invoked.
         * + FAILED – The agent alias API operation failed.
         * + UPDATING – The agent alias is being updated.
         * + DELETING – The agent alias is being deleted.
         */
        public var agentAliasStatus: aws.sdk.kotlin.services.bedrockagent.model.AgentAliasStatus? = null
        /**
         * The unique identifier of the agent.
         */
        public var agentId: kotlin.String? = null
        /**
         * A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see [Ensuring idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
         */
        public var clientToken: kotlin.String? = null
        /**
         * The time at which the alias of the agent was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The description of the alias of the agent.
         */
        public var description: kotlin.String? = null
        /**
         * Information on the failure of Provisioned Throughput assigned to an agent alias.
         */
        public var failureReasons: List? = null
        /**
         * Contains details about the routing configuration of the alias.
         */
        public var routingConfiguration: List? = null
        /**
         * The time at which the alias 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.AgentAlias) : this() {
            this.agentAliasArn = x.agentAliasArn
            this.agentAliasHistoryEvents = x.agentAliasHistoryEvents
            this.agentAliasId = x.agentAliasId
            this.agentAliasName = x.agentAliasName
            this.agentAliasStatus = x.agentAliasStatus
            this.agentId = x.agentId
            this.clientToken = x.clientToken
            this.createdAt = x.createdAt
            this.description = x.description
            this.failureReasons = x.failureReasons
            this.routingConfiguration = x.routingConfiguration
            this.updatedAt = x.updatedAt
        }

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

        internal fun correctErrors(): Builder {
            if (agentAliasArn == null) agentAliasArn = ""
            if (agentAliasId == null) agentAliasId = ""
            if (agentAliasName == null) agentAliasName = ""
            if (agentAliasStatus == null) agentAliasStatus = AgentAliasStatus.SdkUnknown("no value provided")
            if (agentId == null) agentId = ""
            if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
            if (routingConfiguration == null) routingConfiguration = emptyList()
            if (updatedAt == null) updatedAt = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy