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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.AgentActionGroup.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 action group.
 */
public class AgentActionGroup private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action or the custom control method for handling the information elicited from the user.
     */
    public val actionGroupExecutor: aws.sdk.kotlin.services.bedrockagent.model.ActionGroupExecutor? = builder.actionGroupExecutor
    /**
     * The unique identifier of the action group.
     */
    public val actionGroupId: kotlin.String = requireNotNull(builder.actionGroupId) { "A non-null value must be provided for actionGroupId" }
    /**
     * The name of the action group.
     */
    public val actionGroupName: kotlin.String = requireNotNull(builder.actionGroupName) { "A non-null value must be provided for actionGroupName" }
    /**
     * Specifies whether the action group is available for the agent to invoke or not when sending an [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) request.
     */
    public val actionGroupState: aws.sdk.kotlin.services.bedrockagent.model.ActionGroupState = requireNotNull(builder.actionGroupState) { "A non-null value must be provided for actionGroupState" }
    /**
     * The unique identifier of the agent to which the action group belongs.
     */
    public val agentId: kotlin.String = requireNotNull(builder.agentId) { "A non-null value must be provided for agentId" }
    /**
     * The version of the agent to which the action group belongs.
     */
    public val agentVersion: kotlin.String = requireNotNull(builder.agentVersion) { "A non-null value must be provided for agentVersion" }
    /**
     * Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema. For more information, see [Action group OpenAPI schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html).
     */
    public val apiSchema: aws.sdk.kotlin.services.bedrockagent.model.ApiSchema? = builder.apiSchema
    /**
     * 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 action group 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 action group.
     */
    public val description: kotlin.String? = builder.description
    /**
     * Defines functions that each define parameters that the agent needs to invoke from the user. Each function represents an action in an action group.
     */
    public val functionSchema: aws.sdk.kotlin.services.bedrockagent.model.FunctionSchema? = builder.functionSchema
    /**
     * If this field is set as `AMAZON.UserInput`, the agent can request the user for additional information when trying to complete a task. The `description`, `apiSchema`, and `actionGroupExecutor` fields must be blank for this action group.
     *
     * During orchestration, if the agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an [Observation](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html) reprompting the user for more information.
     */
    public val parentActionSignature: aws.sdk.kotlin.services.bedrockagent.model.ActionGroupSignature? = builder.parentActionSignature
    /**
     * The time at which the action group 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.AgentActionGroup = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("AgentActionGroup(")
        append("actionGroupExecutor=$actionGroupExecutor,")
        append("actionGroupId=$actionGroupId,")
        append("actionGroupName=$actionGroupName,")
        append("actionGroupState=$actionGroupState,")
        append("agentId=$agentId,")
        append("agentVersion=$agentVersion,")
        append("apiSchema=$apiSchema,")
        append("clientToken=$clientToken,")
        append("createdAt=$createdAt,")
        append("description=$description,")
        append("functionSchema=$functionSchema,")
        append("parentActionSignature=$parentActionSignature,")
        append("updatedAt=$updatedAt")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = actionGroupExecutor?.hashCode() ?: 0
        result = 31 * result + (actionGroupId.hashCode())
        result = 31 * result + (actionGroupName.hashCode())
        result = 31 * result + (actionGroupState.hashCode())
        result = 31 * result + (agentId.hashCode())
        result = 31 * result + (agentVersion.hashCode())
        result = 31 * result + (apiSchema?.hashCode() ?: 0)
        result = 31 * result + (clientToken?.hashCode() ?: 0)
        result = 31 * result + (createdAt.hashCode())
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (functionSchema?.hashCode() ?: 0)
        result = 31 * result + (parentActionSignature?.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 AgentActionGroup

        if (actionGroupExecutor != other.actionGroupExecutor) return false
        if (actionGroupId != other.actionGroupId) return false
        if (actionGroupName != other.actionGroupName) return false
        if (actionGroupState != other.actionGroupState) return false
        if (agentId != other.agentId) return false
        if (agentVersion != other.agentVersion) return false
        if (apiSchema != other.apiSchema) return false
        if (clientToken != other.clientToken) return false
        if (createdAt != other.createdAt) return false
        if (description != other.description) return false
        if (functionSchema != other.functionSchema) return false
        if (parentActionSignature != other.parentActionSignature) return false
        if (updatedAt != other.updatedAt) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the Lambda function containing the business logic that is carried out upon invoking the action or the custom control method for handling the information elicited from the user.
         */
        public var actionGroupExecutor: aws.sdk.kotlin.services.bedrockagent.model.ActionGroupExecutor? = null
        /**
         * The unique identifier of the action group.
         */
        public var actionGroupId: kotlin.String? = null
        /**
         * The name of the action group.
         */
        public var actionGroupName: kotlin.String? = null
        /**
         * Specifies whether the action group is available for the agent to invoke or not when sending an [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) request.
         */
        public var actionGroupState: aws.sdk.kotlin.services.bedrockagent.model.ActionGroupState? = null
        /**
         * The unique identifier of the agent to which the action group belongs.
         */
        public var agentId: kotlin.String? = null
        /**
         * The version of the agent to which the action group belongs.
         */
        public var agentVersion: kotlin.String? = null
        /**
         * Contains either details about the S3 object containing the OpenAPI schema for the action group or the JSON or YAML-formatted payload defining the schema. For more information, see [Action group OpenAPI schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html).
         */
        public var apiSchema: aws.sdk.kotlin.services.bedrockagent.model.ApiSchema? = 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 action group was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The description of the action group.
         */
        public var description: kotlin.String? = null
        /**
         * Defines functions that each define parameters that the agent needs to invoke from the user. Each function represents an action in an action group.
         */
        public var functionSchema: aws.sdk.kotlin.services.bedrockagent.model.FunctionSchema? = null
        /**
         * If this field is set as `AMAZON.UserInput`, the agent can request the user for additional information when trying to complete a task. The `description`, `apiSchema`, and `actionGroupExecutor` fields must be blank for this action group.
         *
         * During orchestration, if the agent determines that it needs to invoke an API in an action group, but doesn't have enough information to complete the API request, it will invoke this action group instead and return an [Observation](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html) reprompting the user for more information.
         */
        public var parentActionSignature: aws.sdk.kotlin.services.bedrockagent.model.ActionGroupSignature? = null
        /**
         * The time at which the action group 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.AgentActionGroup) : this() {
            this.actionGroupExecutor = x.actionGroupExecutor
            this.actionGroupId = x.actionGroupId
            this.actionGroupName = x.actionGroupName
            this.actionGroupState = x.actionGroupState
            this.agentId = x.agentId
            this.agentVersion = x.agentVersion
            this.apiSchema = x.apiSchema
            this.clientToken = x.clientToken
            this.createdAt = x.createdAt
            this.description = x.description
            this.functionSchema = x.functionSchema
            this.parentActionSignature = x.parentActionSignature
            this.updatedAt = x.updatedAt
        }

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

        internal fun correctErrors(): Builder {
            if (actionGroupId == null) actionGroupId = ""
            if (actionGroupName == null) actionGroupName = ""
            if (actionGroupState == null) actionGroupState = ActionGroupState.SdkUnknown("no value provided")
            if (agentId == null) agentId = ""
            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