commonMain.aws.sdk.kotlin.services.servicediscovery.model.ServiceAlreadyExists.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 service can't be created because a service with the same name already exists.
*/
public class ServiceAlreadyExists private constructor(builder: Builder) : ServiceDiscoveryException(builder.message) {
/**
* The `CreatorRequestId` that was used to create the service.
*/
public val creatorRequestId: kotlin.String? = builder.creatorRequestId
/**
* The ID of the existing service.
*/
public val serviceId: kotlin.String? = builder.serviceId
init {
sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Client
}
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.servicediscovery.model.ServiceAlreadyExists = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ServiceAlreadyExists(")
append("creatorRequestId=$creatorRequestId,")
append("message=$message,")
append("serviceId=$serviceId")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = creatorRequestId?.hashCode() ?: 0
result = 31 * result + (message?.hashCode() ?: 0)
result = 31 * result + (serviceId?.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 ServiceAlreadyExists
if (creatorRequestId != other.creatorRequestId) return false
if (message != other.message) return false
if (serviceId != other.serviceId) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.servicediscovery.model.ServiceAlreadyExists = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The `CreatorRequestId` that was used to create the service.
*/
public var creatorRequestId: kotlin.String? = null
public var message: kotlin.String? = null
/**
* The ID of the existing service.
*/
public var serviceId: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.servicediscovery.model.ServiceAlreadyExists) : this() {
this.creatorRequestId = x.creatorRequestId
this.message = x.message
this.serviceId = x.serviceId
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.servicediscovery.model.ServiceAlreadyExists = ServiceAlreadyExists(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy