commonMain.aws.sdk.kotlin.services.grafana.model.UpdateError.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grafana-jvm Show documentation
Show all versions of grafana-jvm Show documentation
The AWS SDK for Kotlin client for grafana
// 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
}
}
}