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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.Agent.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 agent.
 */
public class Agent private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the agent.
     */
    public val agentArn: kotlin.String = requireNotNull(builder.agentArn) { "A non-null value must be provided for agentArn" }
    /**
     * 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 Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.
     */
    public val agentResourceRoleArn: kotlin.String = requireNotNull(builder.agentResourceRoleArn) { "A non-null value must be provided for agentResourceRoleArn" }
    /**
     * The status of the agent and whether it is ready for use. The following statuses are possible:
     * + CREATING – The agent is being created.
     * + PREPARING – The agent is being prepared.
     * + PREPARED – The agent is prepared and ready to be invoked.
     * + NOT_PREPARED – The agent has been created but not yet prepared.
     * + FAILED – The agent API operation failed.
     * + UPDATING – The agent is being updated.
     * + DELETING – The agent is being deleted.
     */
    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" }
    /**
     * 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 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 Amazon Resource Name (ARN) of the KMS key that encrypts the agent.
     */
    public val customerEncryptionKeyArn: kotlin.String? = builder.customerEncryptionKeyArn
    /**
     * The description of the agent.
     */
    public val description: kotlin.String? = builder.description
    /**
     * Contains reasons that the agent-related API that you invoked failed.
     */
    public val failureReasons: List? = builder.failureReasons
    /**
     * The foundation model used for orchestration by the agent.
     */
    public val foundationModel: kotlin.String? = builder.foundationModel
    /**
     * Details about the guardrail associated with the agent.
     */
    public val guardrailConfiguration: aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration? = builder.guardrailConfiguration
    /**
     * The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.
     *
     * A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.
     */
    public val idleSessionTtlInSeconds: kotlin.Int = requireNotNull(builder.idleSessionTtlInSeconds) { "A non-null value must be provided for idleSessionTtlInSeconds" }
    /**
     * Instructions that tell the agent what it should do and how it should interact with users.
     */
    public val instruction: kotlin.String? = builder.instruction
    /**
     * Contains memory configuration for the agent.
     */
    public val memoryConfiguration: aws.sdk.kotlin.services.bedrockagent.model.MemoryConfiguration? = builder.memoryConfiguration
    /**
     * The time at which the agent was last prepared.
     */
    public val preparedAt: aws.smithy.kotlin.runtime.time.Instant? = builder.preparedAt
    /**
     * Contains configurations to override prompt templates in different parts of an agent sequence. For more information, see [Advanced prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html).
     */
    public val promptOverrideConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptOverrideConfiguration? = builder.promptOverrideConfiguration
    /**
     * Contains recommended actions to take for the agent-related API that you invoked to succeed.
     */
    public val recommendedActions: List? = builder.recommendedActions
    /**
     * 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.Agent = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("Agent(")
        append("agentArn=$agentArn,")
        append("agentId=$agentId,")
        append("agentName=$agentName,")
        append("agentResourceRoleArn=$agentResourceRoleArn,")
        append("agentStatus=$agentStatus,")
        append("agentVersion=$agentVersion,")
        append("clientToken=$clientToken,")
        append("createdAt=$createdAt,")
        append("customerEncryptionKeyArn=$customerEncryptionKeyArn,")
        append("description=$description,")
        append("failureReasons=$failureReasons,")
        append("foundationModel=$foundationModel,")
        append("guardrailConfiguration=$guardrailConfiguration,")
        append("idleSessionTtlInSeconds=$idleSessionTtlInSeconds,")
        append("instruction=*** Sensitive Data Redacted ***,")
        append("memoryConfiguration=$memoryConfiguration,")
        append("preparedAt=$preparedAt,")
        append("promptOverrideConfiguration=*** Sensitive Data Redacted ***,")
        append("recommendedActions=$recommendedActions,")
        append("updatedAt=$updatedAt")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = agentArn.hashCode()
        result = 31 * result + (agentId.hashCode())
        result = 31 * result + (agentName.hashCode())
        result = 31 * result + (agentResourceRoleArn.hashCode())
        result = 31 * result + (agentStatus.hashCode())
        result = 31 * result + (agentVersion.hashCode())
        result = 31 * result + (clientToken?.hashCode() ?: 0)
        result = 31 * result + (createdAt.hashCode())
        result = 31 * result + (customerEncryptionKeyArn?.hashCode() ?: 0)
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (failureReasons?.hashCode() ?: 0)
        result = 31 * result + (foundationModel?.hashCode() ?: 0)
        result = 31 * result + (guardrailConfiguration?.hashCode() ?: 0)
        result = 31 * result + (idleSessionTtlInSeconds)
        result = 31 * result + (instruction?.hashCode() ?: 0)
        result = 31 * result + (memoryConfiguration?.hashCode() ?: 0)
        result = 31 * result + (preparedAt?.hashCode() ?: 0)
        result = 31 * result + (promptOverrideConfiguration?.hashCode() ?: 0)
        result = 31 * result + (recommendedActions?.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 Agent

        if (agentArn != other.agentArn) return false
        if (agentId != other.agentId) return false
        if (agentName != other.agentName) return false
        if (agentResourceRoleArn != other.agentResourceRoleArn) return false
        if (agentStatus != other.agentStatus) return false
        if (agentVersion != other.agentVersion) return false
        if (clientToken != other.clientToken) return false
        if (createdAt != other.createdAt) return false
        if (customerEncryptionKeyArn != other.customerEncryptionKeyArn) return false
        if (description != other.description) return false
        if (failureReasons != other.failureReasons) return false
        if (foundationModel != other.foundationModel) return false
        if (guardrailConfiguration != other.guardrailConfiguration) return false
        if (idleSessionTtlInSeconds != other.idleSessionTtlInSeconds) return false
        if (instruction != other.instruction) return false
        if (memoryConfiguration != other.memoryConfiguration) return false
        if (preparedAt != other.preparedAt) return false
        if (promptOverrideConfiguration != other.promptOverrideConfiguration) return false
        if (recommendedActions != other.recommendedActions) return false
        if (updatedAt != other.updatedAt) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the agent.
         */
        public var agentArn: kotlin.String? = null
        /**
         * The unique identifier of the agent.
         */
        public var agentId: kotlin.String? = null
        /**
         * The name of the agent.
         */
        public var agentName: kotlin.String? = null
        /**
         * The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.
         */
        public var agentResourceRoleArn: kotlin.String? = null
        /**
         * The status of the agent and whether it is ready for use. The following statuses are possible:
         * + CREATING – The agent is being created.
         * + PREPARING – The agent is being prepared.
         * + PREPARED – The agent is prepared and ready to be invoked.
         * + NOT_PREPARED – The agent has been created but not yet prepared.
         * + FAILED – The agent API operation failed.
         * + UPDATING – The agent is being updated.
         * + DELETING – The agent is being deleted.
         */
        public var agentStatus: aws.sdk.kotlin.services.bedrockagent.model.AgentStatus? = null
        /**
         * The version of the agent.
         */
        public var agentVersion: 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 agent was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The Amazon Resource Name (ARN) of the KMS key that encrypts the agent.
         */
        public var customerEncryptionKeyArn: kotlin.String? = null
        /**
         * The description of the agent.
         */
        public var description: kotlin.String? = null
        /**
         * Contains reasons that the agent-related API that you invoked failed.
         */
        public var failureReasons: List? = null
        /**
         * The foundation model used for orchestration by the agent.
         */
        public var foundationModel: kotlin.String? = null
        /**
         * Details about the guardrail associated with the agent.
         */
        public var guardrailConfiguration: aws.sdk.kotlin.services.bedrockagent.model.GuardrailConfiguration? = null
        /**
         * The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.
         *
         * A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.
         */
        public var idleSessionTtlInSeconds: kotlin.Int? = null
        /**
         * Instructions that tell the agent what it should do and how it should interact with users.
         */
        public var instruction: kotlin.String? = null
        /**
         * Contains memory configuration for the agent.
         */
        public var memoryConfiguration: aws.sdk.kotlin.services.bedrockagent.model.MemoryConfiguration? = null
        /**
         * The time at which the agent was last prepared.
         */
        public var preparedAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Contains configurations to override prompt templates in different parts of an agent sequence. For more information, see [Advanced prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html).
         */
        public var promptOverrideConfiguration: aws.sdk.kotlin.services.bedrockagent.model.PromptOverrideConfiguration? = null
        /**
         * Contains recommended actions to take for the agent-related API that you invoked to succeed.
         */
        public var recommendedActions: List? = 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.Agent) : this() {
            this.agentArn = x.agentArn
            this.agentId = x.agentId
            this.agentName = x.agentName
            this.agentResourceRoleArn = x.agentResourceRoleArn
            this.agentStatus = x.agentStatus
            this.agentVersion = x.agentVersion
            this.clientToken = x.clientToken
            this.createdAt = x.createdAt
            this.customerEncryptionKeyArn = x.customerEncryptionKeyArn
            this.description = x.description
            this.failureReasons = x.failureReasons
            this.foundationModel = x.foundationModel
            this.guardrailConfiguration = x.guardrailConfiguration
            this.idleSessionTtlInSeconds = x.idleSessionTtlInSeconds
            this.instruction = x.instruction
            this.memoryConfiguration = x.memoryConfiguration
            this.preparedAt = x.preparedAt
            this.promptOverrideConfiguration = x.promptOverrideConfiguration
            this.recommendedActions = x.recommendedActions
            this.updatedAt = x.updatedAt
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.Agent = Agent(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)
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy