commonMain.aws.sdk.kotlin.services.bedrockagent.model.AgentVersion.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrockagent-jvm Show documentation
Show all versions of bedrockagent-jvm Show documentation
The AWS SDK for Kotlin client for Bedrock Agent
// 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 AgentVersion private constructor(builder: Builder) {
/**
* The Amazon Resource Name (ARN) of the agent that the version belongs to.
*/
public val agentArn: kotlin.String = requireNotNull(builder.agentArn) { "A non-null value must be provided for agentArn" }
/**
* The unique identifier of the agent that the version belongs to.
*/
public val agentId: kotlin.String = requireNotNull(builder.agentId) { "A non-null value must be provided for agentId" }
/**
* The name of the agent that the version belongs to.
*/
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 that the version belongs to.
*/
public val agentStatus: aws.sdk.kotlin.services.bedrockagent.model.AgentStatus = requireNotNull(builder.agentStatus) { "A non-null value must be provided for agentStatus" }
/**
* 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 Amazon Resource Name (ARN) of the KMS key that encrypts the agent.
*/
public val customerEncryptionKeyArn: kotlin.String? = builder.customerEncryptionKeyArn
/**
* The description of the version.
*/
public val description: kotlin.String? = builder.description
/**
* A list of reasons that the API operation on the version failed.
*/
public val failureReasons: List? = builder.failureReasons
/**
* The foundation model that the version invokes.
*/
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" }
/**
* The instructions provided to the agent.
*/
public val instruction: kotlin.String? = builder.instruction
/**
* Contains details of the memory configuration on the version of the agent.
*/
public val memoryConfiguration: aws.sdk.kotlin.services.bedrockagent.model.MemoryConfiguration? = builder.memoryConfiguration
/**
* 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
/**
* A list of recommended actions to take for the failed API operation on the version to succeed.
*/
public val recommendedActions: List? = builder.recommendedActions
/**
* 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" }
/**
* The version number.
*/
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.AgentVersion = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("AgentVersion(")
append("agentArn=$agentArn,")
append("agentId=$agentId,")
append("agentName=$agentName,")
append("agentResourceRoleArn=$agentResourceRoleArn,")
append("agentStatus=$agentStatus,")
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("promptOverrideConfiguration=*** Sensitive Data Redacted ***,")
append("recommendedActions=$recommendedActions,")
append("updatedAt=$updatedAt,")
append("version=$version")
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 + (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 + (promptOverrideConfiguration?.hashCode() ?: 0)
result = 31 * result + (recommendedActions?.hashCode() ?: 0)
result = 31 * result + (updatedAt.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 AgentVersion
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 (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 (promptOverrideConfiguration != other.promptOverrideConfiguration) return false
if (recommendedActions != other.recommendedActions) return false
if (updatedAt != other.updatedAt) return false
if (version != other.version) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.AgentVersion = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The Amazon Resource Name (ARN) of the agent that the version belongs to.
*/
public var agentArn: kotlin.String? = null
/**
* The unique identifier of the agent that the version belongs to.
*/
public var agentId: kotlin.String? = null
/**
* The name of the agent that the version belongs to.
*/
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 that the version belongs to.
*/
public var agentStatus: aws.sdk.kotlin.services.bedrockagent.model.AgentStatus? = null
/**
* The time at which the version 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 version.
*/
public var description: kotlin.String? = null
/**
* A list of reasons that the API operation on the version failed.
*/
public var failureReasons: List? = null
/**
* The foundation model that the version invokes.
*/
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
/**
* The instructions provided to the agent.
*/
public var instruction: kotlin.String? = null
/**
* Contains details of the memory configuration on the version of the agent.
*/
public var memoryConfiguration: aws.sdk.kotlin.services.bedrockagent.model.MemoryConfiguration? = 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
/**
* A list of recommended actions to take for the failed API operation on the version to succeed.
*/
public var recommendedActions: List? = null
/**
* The time at which the version was last updated.
*/
public var updatedAt: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The version number.
*/
public var version: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.AgentVersion) : this() {
this.agentArn = x.agentArn
this.agentId = x.agentId
this.agentName = x.agentName
this.agentResourceRoleArn = x.agentResourceRoleArn
this.agentStatus = x.agentStatus
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.promptOverrideConfiguration = x.promptOverrideConfiguration
this.recommendedActions = x.recommendedActions
this.updatedAt = x.updatedAt
this.version = x.version
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.AgentVersion = AgentVersion(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 (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
if (idleSessionTtlInSeconds == null) idleSessionTtlInSeconds = 0
if (updatedAt == null) updatedAt = Instant.fromEpochSeconds(0)
if (version == null) version = ""
return this
}
}
}