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

commonMain.aws.sdk.kotlin.services.bedrock.model.CreateGuardrailResponse.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.bedrock.model

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant

public class CreateGuardrailResponse private constructor(builder: Builder) {
    /**
     * The time at which the guardrail was created.
     */
    public val createdAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createdAt) { "A non-null value must be provided for createdAt" }
    /**
     * The ARN of the guardrail.
     */
    public val guardrailArn: kotlin.String = requireNotNull(builder.guardrailArn) { "A non-null value must be provided for guardrailArn" }
    /**
     * The unique identifier of the guardrail that was created.
     */
    public val guardrailId: kotlin.String = requireNotNull(builder.guardrailId) { "A non-null value must be provided for guardrailId" }
    /**
     * The version of the guardrail that was created. This value will always be `DRAFT`.
     */
    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.bedrock.model.CreateGuardrailResponse = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("CreateGuardrailResponse(")
        append("createdAt=$createdAt,")
        append("guardrailArn=$guardrailArn,")
        append("guardrailId=$guardrailId,")
        append("version=$version")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = createdAt.hashCode()
        result = 31 * result + (guardrailArn.hashCode())
        result = 31 * result + (guardrailId.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 CreateGuardrailResponse

        if (createdAt != other.createdAt) return false
        if (guardrailArn != other.guardrailArn) return false
        if (guardrailId != other.guardrailId) return false
        if (version != other.version) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The time at which the guardrail was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The ARN of the guardrail.
         */
        public var guardrailArn: kotlin.String? = null
        /**
         * The unique identifier of the guardrail that was created.
         */
        public var guardrailId: kotlin.String? = null
        /**
         * The version of the guardrail that was created. This value will always be `DRAFT`.
         */
        public var version: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrock.model.CreateGuardrailResponse) : this() {
            this.createdAt = x.createdAt
            this.guardrailArn = x.guardrailArn
            this.guardrailId = x.guardrailId
            this.version = x.version
        }

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

        internal fun correctErrors(): Builder {
            if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
            if (guardrailArn == null) guardrailArn = ""
            if (guardrailId == null) guardrailId = ""
            if (version == null) version = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy