commonMain.aws.sdk.kotlin.services.bedrockagent.model.Function.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
/**
* Defines parameters that the agent needs to invoke from the user to complete the function. Corresponds to an action in an action group.
*
* This data type is used in the following API operations:
* + [CreateAgentActionGroup request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_RequestSyntax)
* + [CreateAgentActionGroup response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_ResponseSyntax)
* + [UpdateAgentActionGroup request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_RequestSyntax)
* + [UpdateAgentActionGroup response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_ResponseSyntax)
* + [GetAgentActionGroup response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetAgentActionGroup.html#API_agent_GetAgentActionGroup_ResponseSyntax)
*/
public class Function private constructor(builder: Builder) {
/**
* A description of the function and its purpose.
*/
public val description: kotlin.String? = builder.description
/**
* A name for the function.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The parameters that the agent elicits from the user to fulfill the function.
*/
public val parameters: Map? = builder.parameters
/**
* Contains information if user confirmation is required to invoke the function.
*/
public val requireConfirmation: aws.sdk.kotlin.services.bedrockagent.model.RequireConfirmation? = builder.requireConfirmation
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockagent.model.Function = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Function(")
append("description=$description,")
append("name=$name,")
append("parameters=$parameters,")
append("requireConfirmation=$requireConfirmation")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = description?.hashCode() ?: 0
result = 31 * result + (name.hashCode())
result = 31 * result + (parameters?.hashCode() ?: 0)
result = 31 * result + (requireConfirmation?.hashCode() ?: 0)
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 Function
if (description != other.description) return false
if (name != other.name) return false
if (parameters != other.parameters) return false
if (requireConfirmation != other.requireConfirmation) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.Function = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A description of the function and its purpose.
*/
public var description: kotlin.String? = null
/**
* A name for the function.
*/
public var name: kotlin.String? = null
/**
* The parameters that the agent elicits from the user to fulfill the function.
*/
public var parameters: Map? = null
/**
* Contains information if user confirmation is required to invoke the function.
*/
public var requireConfirmation: aws.sdk.kotlin.services.bedrockagent.model.RequireConfirmation? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.Function) : this() {
this.description = x.description
this.name = x.name
this.parameters = x.parameters
this.requireConfirmation = x.requireConfirmation
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.Function = Function(this)
internal fun correctErrors(): Builder {
if (name == null) name = ""
return this
}
}
}