
commonMain.aws.sdk.kotlin.services.iot.model.ResourceAlreadyExistsException.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.iot.model
import aws.smithy.kotlin.runtime.ServiceErrorMetadata
/**
* The resource already exists.
*/
public class ResourceAlreadyExistsException private constructor(builder: Builder) : IotException() {
/**
* The message for the exception.
*/
override val message: kotlin.String? = builder.message
/**
* The ARN of the resource that caused the exception.
*/
public val resourceArn: kotlin.String? = builder.resourceArn
/**
* The ID of the resource that caused the exception.
*/
public val resourceId: kotlin.String? = builder.resourceId
init {
sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Client
}
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.iot.model.ResourceAlreadyExistsException = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ResourceAlreadyExistsException(")
append("message=$message,")
append("resourceArn=$resourceArn,")
append("resourceId=$resourceId")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = message?.hashCode() ?: 0
result = 31 * result + (resourceArn?.hashCode() ?: 0)
result = 31 * result + (resourceId?.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 ResourceAlreadyExistsException
if (message != other.message) return false
if (resourceArn != other.resourceArn) return false
if (resourceId != other.resourceId) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.iot.model.ResourceAlreadyExistsException = Builder(this).apply(block).build()
public class Builder {
/**
* The message for the exception.
*/
public var message: kotlin.String? = null
/**
* The ARN of the resource that caused the exception.
*/
public var resourceArn: kotlin.String? = null
/**
* The ID of the resource that caused the exception.
*/
public var resourceId: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.iot.model.ResourceAlreadyExistsException) : this() {
this.message = x.message
this.resourceArn = x.resourceArn
this.resourceId = x.resourceId
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.iot.model.ResourceAlreadyExistsException = ResourceAlreadyExistsException(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy