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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.CreatePromptVersionResponse.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

public class CreatePromptVersionResponse private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the version of the prompt.
     */
    public val arn: kotlin.String = requireNotNull(builder.arn) { "A non-null value must be provided for arn" }
    /**
     * The time at which the prompt 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 to encrypt the version of the prompt.
     */
    public val customerEncryptionKeyArn: kotlin.String? = builder.customerEncryptionKeyArn
    /**
     * The name of the default variant for the prompt. This value must match the `name` field in the relevant [PromptVariant](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html) object.
     */
    public val defaultVariant: kotlin.String? = builder.defaultVariant
    /**
     * A description for the version.
     */
    public val description: kotlin.String? = builder.description
    /**
     * The unique identifier of the prompt.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
    /**
     * The name of the prompt.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The time at which the prompt 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 objects, each containing details about a variant of the prompt.
     */
    public val variants: List? = builder.variants
    /**
     * The version of the prompt that was created. Versions are numbered incrementally, starting from 1.
     */
    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.CreatePromptVersionResponse = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("CreatePromptVersionResponse(")
        append("arn=$arn,")
        append("createdAt=$createdAt,")
        append("customerEncryptionKeyArn=$customerEncryptionKeyArn,")
        append("defaultVariant=$defaultVariant,")
        append("description=$description,")
        append("id=$id,")
        append("name=$name,")
        append("updatedAt=$updatedAt,")
        append("variants=*** Sensitive Data Redacted ***,")
        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 + (defaultVariant?.hashCode() ?: 0)
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (id.hashCode())
        result = 31 * result + (name.hashCode())
        result = 31 * result + (updatedAt.hashCode())
        result = 31 * result + (variants?.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 CreatePromptVersionResponse

        if (arn != other.arn) return false
        if (createdAt != other.createdAt) return false
        if (customerEncryptionKeyArn != other.customerEncryptionKeyArn) return false
        if (defaultVariant != other.defaultVariant) return false
        if (description != other.description) return false
        if (id != other.id) return false
        if (name != other.name) return false
        if (updatedAt != other.updatedAt) return false
        if (variants != other.variants) return false
        if (version != other.version) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the version of the prompt.
         */
        public var arn: kotlin.String? = null
        /**
         * The time at which the prompt was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The Amazon Resource Name (ARN) of the KMS key to encrypt the version of the prompt.
         */
        public var customerEncryptionKeyArn: kotlin.String? = null
        /**
         * The name of the default variant for the prompt. This value must match the `name` field in the relevant [PromptVariant](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html) object.
         */
        public var defaultVariant: kotlin.String? = null
        /**
         * A description for the version.
         */
        public var description: kotlin.String? = null
        /**
         * The unique identifier of the prompt.
         */
        public var id: kotlin.String? = null
        /**
         * The name of the prompt.
         */
        public var name: kotlin.String? = null
        /**
         * The time at which the prompt was last updated.
         */
        public var updatedAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * A list of objects, each containing details about a variant of the prompt.
         */
        public var variants: List? = null
        /**
         * The version of the prompt that was created. Versions are numbered incrementally, starting from 1.
         */
        public var version: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.CreatePromptVersionResponse) : this() {
            this.arn = x.arn
            this.createdAt = x.createdAt
            this.customerEncryptionKeyArn = x.customerEncryptionKeyArn
            this.defaultVariant = x.defaultVariant
            this.description = x.description
            this.id = x.id
            this.name = x.name
            this.updatedAt = x.updatedAt
            this.variants = x.variants
            this.version = x.version
        }

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

        internal fun correctErrors(): Builder {
            if (arn == null) arn = ""
            if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
            if (id == null) id = ""
            if (name == null) name = ""
            if (updatedAt == null) updatedAt = Instant.fromEpochSeconds(0)
            if (version == null) version = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy