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

commonMain.aws.sdk.kotlin.services.lightsail.model.UnauthenticatedException.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.lightsail.model

import aws.smithy.kotlin.runtime.ServiceErrorMetadata

/**
 * Lightsail throws this exception when the user has not been authenticated.
 */
public class UnauthenticatedException private constructor(builder: Builder) : LightsailException() {

    public val code: kotlin.String? = builder.code
    public val docs: kotlin.String? = builder.docs
    override val message: kotlin.String? = builder.message
    public val tip: kotlin.String? = builder.tip

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

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

    override fun toString(): kotlin.String = buildString {
        append("UnauthenticatedException(")
        append("code=$code,")
        append("docs=$docs,")
        append("message=$message,")
        append("tip=$tip")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = code?.hashCode() ?: 0
        result = 31 * result + (docs?.hashCode() ?: 0)
        result = 31 * result + (message?.hashCode() ?: 0)
        result = 31 * result + (tip?.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 UnauthenticatedException

        if (code != other.code) return false
        if (docs != other.docs) return false
        if (message != other.message) return false
        if (tip != other.tip) return false

        return true
    }

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

    public class Builder {
        public var code: kotlin.String? = null
        public var docs: kotlin.String? = null
        public var message: kotlin.String? = null
        public var tip: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lightsail.model.UnauthenticatedException) : this() {
            this.code = x.code
            this.docs = x.docs
            this.message = x.message
            this.tip = x.tip
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy