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

commonMain.aws.sdk.kotlin.services.grafana.model.UpdateError.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.grafana.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A structure containing information about one error encountered while performing an [UpdatePermissions](https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdatePermissions.html) operation.
 */
public class UpdateError private constructor(builder: Builder) {
    /**
     * Specifies which permission update caused the error.
     */
    public val causedBy: aws.sdk.kotlin.services.grafana.model.UpdateInstruction? = builder.causedBy
    /**
     * The error code.
     */
    public val code: kotlin.Int = requireNotNull(builder.code) { "A non-null value must be provided for code" }
    /**
     * The message for this error.
     */
    public val message: kotlin.String = requireNotNull(builder.message) { "A non-null value must be provided for message" }

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

    override fun toString(): kotlin.String = buildString {
        append("UpdateError(")
        append("causedBy=$causedBy,")
        append("code=$code,")
        append("message=$message")
        append(")")
    }

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

        if (causedBy != other.causedBy) return false
        if (code != other.code) return false
        if (message != other.message) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Specifies which permission update caused the error.
         */
        public var causedBy: aws.sdk.kotlin.services.grafana.model.UpdateInstruction? = null
        /**
         * The error code.
         */
        public var code: kotlin.Int? = null
        /**
         * The message for this error.
         */
        public var message: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.grafana.model.UpdateError) : this() {
            this.causedBy = x.causedBy
            this.code = x.code
            this.message = x.message
        }

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

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

        internal fun correctErrors(): Builder {
            if (code == null) code = 0
            if (message == null) message = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy