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

commonMain.aws.sdk.kotlin.services.lexmodelbuildingservice.model.ResourceInUseException.kt Maven / Gradle / Ivy

There is a newer version: 1.4.2
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.lexmodelbuildingservice.model

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.ServiceErrorMetadata

/**
 * The resource that you are attempting to delete is referred to by another resource. Use this information to remove references to the resource that you are trying to delete.
 *
 * The body of the exception contains a JSON object that describes the resource.
 *
 * `{ "resourceType": BOT | BOTALIAS | BOTCHANNEL | INTENT,`
 *
 * `"resourceReference": {`
 *
 * `"name": string, "version": string } }`
 */
public class ResourceInUseException private constructor(builder: Builder) : LexModelBuildingException() {

    /**
     * Describes the resource that refers to the resource that you are attempting to delete. This object is returned as part of the `ResourceInUseException` exception.
     */
    public val exampleReference: aws.sdk.kotlin.services.lexmodelbuildingservice.model.ResourceReference? = builder.exampleReference
    public val referenceType: aws.sdk.kotlin.services.lexmodelbuildingservice.model.ReferenceType? = builder.referenceType

    init {
        sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Client
    }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.lexmodelbuildingservice.model.ResourceInUseException = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("ResourceInUseException(")
        append("exampleReference=$exampleReference,")
        append("referenceType=$referenceType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = exampleReference?.hashCode() ?: 0
        result = 31 * result + (referenceType?.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 ResourceInUseException

        if (exampleReference != other.exampleReference) return false
        if (referenceType != other.referenceType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Describes the resource that refers to the resource that you are attempting to delete. This object is returned as part of the `ResourceInUseException` exception.
         */
        public var exampleReference: aws.sdk.kotlin.services.lexmodelbuildingservice.model.ResourceReference? = null
        public var referenceType: aws.sdk.kotlin.services.lexmodelbuildingservice.model.ReferenceType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lexmodelbuildingservice.model.ResourceInUseException) : this() {
            this.exampleReference = x.exampleReference
            this.referenceType = x.referenceType
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.lexmodelbuildingservice.model.ResourceReference] inside the given [block]
         */
        public fun exampleReference(block: aws.sdk.kotlin.services.lexmodelbuildingservice.model.ResourceReference.Builder.() -> kotlin.Unit) {
            this.exampleReference = aws.sdk.kotlin.services.lexmodelbuildingservice.model.ResourceReference.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy