commonMain.aws.sdk.kotlin.services.servicediscovery.model.NamespaceAlreadyExists.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.servicediscovery.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.ServiceErrorMetadata
/**
* The namespace that you're trying to create already exists.
*/
public class NamespaceAlreadyExists private constructor(builder: Builder) : ServiceDiscoveryException(builder.message) {
/**
* The `CreatorRequestId` that was used to create the namespace.
*/
public val creatorRequestId: kotlin.String? = builder.creatorRequestId
/**
* The ID of the existing namespace.
*/
public val namespaceId: kotlin.String? = builder.namespaceId
init {
sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Client
}
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.servicediscovery.model.NamespaceAlreadyExists = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("NamespaceAlreadyExists(")
append("creatorRequestId=$creatorRequestId,")
append("message=$message,")
append("namespaceId=$namespaceId")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = creatorRequestId?.hashCode() ?: 0
result = 31 * result + (message?.hashCode() ?: 0)
result = 31 * result + (namespaceId?.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 NamespaceAlreadyExists
if (creatorRequestId != other.creatorRequestId) return false
if (message != other.message) return false
if (namespaceId != other.namespaceId) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.servicediscovery.model.NamespaceAlreadyExists = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The `CreatorRequestId` that was used to create the namespace.
*/
public var creatorRequestId: kotlin.String? = null
public var message: kotlin.String? = null
/**
* The ID of the existing namespace.
*/
public var namespaceId: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.servicediscovery.model.NamespaceAlreadyExists) : this() {
this.creatorRequestId = x.creatorRequestId
this.message = x.message
this.namespaceId = x.namespaceId
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.servicediscovery.model.NamespaceAlreadyExists = NamespaceAlreadyExists(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy