commonMain.aws.sdk.kotlin.services.iotsitewise.model.ResourceAlreadyExistsException.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iotsitewise-jvm Show documentation
Show all versions of iotsitewise-jvm Show documentation
The AWS SDK for Kotlin client for IoTSiteWise
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.iotsitewise.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.ServiceErrorMetadata
/**
* The resource already exists.
*/
public class ResourceAlreadyExistsException private constructor(builder: Builder) : IotSiteWiseException(builder.message) {
/**
* The ARN of the resource that already exists.
*/
public val resourceArn: kotlin.String = requireNotNull(builder.resourceArn) { "A non-null value must be provided for resourceArn" }
/**
* The ID of the resource that already exists.
*/
public val resourceId: kotlin.String = requireNotNull(builder.resourceId) { "A non-null value must be provided for resourceId" }
init {
sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Client
}
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.iotsitewise.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()
result = 31 * result + (resourceArn.hashCode())
result = 31 * result + (resourceId.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 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.iotsitewise.model.ResourceAlreadyExistsException = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
public var message: kotlin.String? = null
/**
* The ARN of the resource that already exists.
*/
public var resourceArn: kotlin.String? = null
/**
* The ID of the resource that already exists.
*/
public var resourceId: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.iotsitewise.model.ResourceAlreadyExistsException) : this() {
this.message = x.message
this.resourceArn = x.resourceArn
this.resourceId = x.resourceId
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.iotsitewise.model.ResourceAlreadyExistsException = ResourceAlreadyExistsException(this)
internal fun correctErrors(): Builder {
if (message == null) message = ""
if (resourceArn == null) resourceArn = ""
if (resourceId == null) resourceId = ""
return this
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy