commonMain.aws.sdk.kotlin.services.bedrockagent.model.GetFlowResponse.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
public class GetFlowResponse private constructor(builder: Builder) {
/**
* The Amazon Resource Name (ARN) of the flow.
*/
public val arn: kotlin.String = requireNotNull(builder.arn) { "A non-null value must be provided for arn" }
/**
* The time at which the flow 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 the flow is encrypted with.
*/
public val customerEncryptionKeyArn: kotlin.String? = builder.customerEncryptionKeyArn
/**
* The definition of the nodes and connections between the nodes in the flow.
*/
public val definition: aws.sdk.kotlin.services.bedrockagent.model.FlowDefinition? = builder.definition
/**
* The description of the flow.
*/
public val description: kotlin.String? = builder.description
/**
* The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see [Create a service row for flows](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) in the Amazon Bedrock User Guide.
*/
public val executionRoleArn: kotlin.String = requireNotNull(builder.executionRoleArn) { "A non-null value must be provided for executionRoleArn" }
/**
* The unique identifier of the flow.
*/
public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
/**
* The name of the flow.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The status of the flow. The following statuses are possible:
* + NotPrepared – The flow has been created or updated, but hasn't been prepared. If you just created the flow, you can't test it. If you updated the flow, the `DRAFT` version won't contain the latest changes for testing. Send a [PrepareFlow](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PrepareFlow.html) request to package the latest changes into the `DRAFT` version.
* + Preparing – The flow is being prepared so that the `DRAFT` version contains the latest changes for testing.
* + Prepared – The flow is prepared and the `DRAFT` version contains the latest changes for testing.
* + Failed – The last API operation that you invoked on the flow failed. Send a [GetFlow](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlow.html) request and check the error message in the `validations` field.
*/
public val status: aws.sdk.kotlin.services.bedrockagent.model.FlowStatus = requireNotNull(builder.status) { "A non-null value must be provided for status" }
/**
* The time at which the flow was last updated.
*/
public val updatedAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.updatedAt) { "A non-null value must be provided for updatedAt" }
/**
* A list of validation error messages related to the last failed operation on the flow.
*/
public val validations: List? = builder.validations
/**
* The version of the flow for which information was retrieved.
*/
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.GetFlowResponse = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("GetFlowResponse(")
append("arn=$arn,")
append("createdAt=$createdAt,")
append("customerEncryptionKeyArn=$customerEncryptionKeyArn,")
append("definition=$definition,")
append("description=$description,")
append("executionRoleArn=$executionRoleArn,")
append("id=$id,")
append("name=$name,")
append("status=$status,")
append("updatedAt=$updatedAt,")
append("validations=$validations,")
append("version=$version")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = arn.hashCode()
result = 31 * result + (createdAt.hashCode())
result = 31 * result + (customerEncryptionKeyArn?.hashCode() ?: 0)
result = 31 * result + (definition?.hashCode() ?: 0)
result = 31 * result + (description?.hashCode() ?: 0)
result = 31 * result + (executionRoleArn.hashCode())
result = 31 * result + (id.hashCode())
result = 31 * result + (name.hashCode())
result = 31 * result + (status.hashCode())
result = 31 * result + (updatedAt.hashCode())
result = 31 * result + (validations?.hashCode() ?: 0)
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 GetFlowResponse
if (arn != other.arn) return false
if (createdAt != other.createdAt) return false
if (customerEncryptionKeyArn != other.customerEncryptionKeyArn) return false
if (definition != other.definition) return false
if (description != other.description) return false
if (executionRoleArn != other.executionRoleArn) return false
if (id != other.id) return false
if (name != other.name) return false
if (status != other.status) return false
if (updatedAt != other.updatedAt) return false
if (validations != other.validations) return false
if (version != other.version) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockagent.model.GetFlowResponse = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The Amazon Resource Name (ARN) of the flow.
*/
public var arn: kotlin.String? = null
/**
* The time at which the flow was created.
*/
public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The Amazon Resource Name (ARN) of the KMS key that the flow is encrypted with.
*/
public var customerEncryptionKeyArn: kotlin.String? = null
/**
* The definition of the nodes and connections between the nodes in the flow.
*/
public var definition: aws.sdk.kotlin.services.bedrockagent.model.FlowDefinition? = null
/**
* The description of the flow.
*/
public var description: kotlin.String? = null
/**
* The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see [Create a service row for flows](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) in the Amazon Bedrock User Guide.
*/
public var executionRoleArn: kotlin.String? = null
/**
* The unique identifier of the flow.
*/
public var id: kotlin.String? = null
/**
* The name of the flow.
*/
public var name: kotlin.String? = null
/**
* The status of the flow. The following statuses are possible:
* + NotPrepared – The flow has been created or updated, but hasn't been prepared. If you just created the flow, you can't test it. If you updated the flow, the `DRAFT` version won't contain the latest changes for testing. Send a [PrepareFlow](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PrepareFlow.html) request to package the latest changes into the `DRAFT` version.
* + Preparing – The flow is being prepared so that the `DRAFT` version contains the latest changes for testing.
* + Prepared – The flow is prepared and the `DRAFT` version contains the latest changes for testing.
* + Failed – The last API operation that you invoked on the flow failed. Send a [GetFlow](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlow.html) request and check the error message in the `validations` field.
*/
public var status: aws.sdk.kotlin.services.bedrockagent.model.FlowStatus? = null
/**
* The time at which the flow was last updated.
*/
public var updatedAt: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* A list of validation error messages related to the last failed operation on the flow.
*/
public var validations: List? = null
/**
* The version of the flow for which information was retrieved.
*/
public var version: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.GetFlowResponse) : this() {
this.arn = x.arn
this.createdAt = x.createdAt
this.customerEncryptionKeyArn = x.customerEncryptionKeyArn
this.definition = x.definition
this.description = x.description
this.executionRoleArn = x.executionRoleArn
this.id = x.id
this.name = x.name
this.status = x.status
this.updatedAt = x.updatedAt
this.validations = x.validations
this.version = x.version
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockagent.model.GetFlowResponse = GetFlowResponse(this)
/**
* construct an [aws.sdk.kotlin.services.bedrockagent.model.FlowDefinition] inside the given [block]
*/
public fun definition(block: aws.sdk.kotlin.services.bedrockagent.model.FlowDefinition.Builder.() -> kotlin.Unit) {
this.definition = aws.sdk.kotlin.services.bedrockagent.model.FlowDefinition.invoke(block)
}
internal fun correctErrors(): Builder {
if (arn == null) arn = ""
if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
if (executionRoleArn == null) executionRoleArn = ""
if (id == null) id = ""
if (name == null) name = ""
if (status == null) status = FlowStatus.SdkUnknown("no value provided")
if (updatedAt == null) updatedAt = Instant.fromEpochSeconds(0)
if (version == null) version = ""
return this
}
}
}