All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.applicationdiscoveryservice.model.BatchDeleteAgentError.kt Maven / Gradle / Ivy

There is a newer version: 1.3.35
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.applicationdiscoveryservice.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * An object representing the agent or data collector that failed to delete, each containing agentId, errorMessage, and errorCode.
 */
public class BatchDeleteAgentError private constructor(builder: Builder) {
    /**
     * The ID of the agent or data collector to delete.
     */
    public val agentId: kotlin.String = requireNotNull(builder.agentId) { "A non-null value must be provided for agentId" }
    /**
     * The type of error that occurred for the delete failed agent. Valid status are: AGENT_IN_USE | NOT_FOUND | INTERNAL_SERVER_ERROR.
     */
    public val errorCode: aws.sdk.kotlin.services.applicationdiscoveryservice.model.DeleteAgentErrorCode = requireNotNull(builder.errorCode) { "A non-null value must be provided for errorCode" }
    /**
     * The description of the error that occurred for the delete failed agent.
     */
    public val errorMessage: kotlin.String = requireNotNull(builder.errorMessage) { "A non-null value must be provided for errorMessage" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.applicationdiscoveryservice.model.BatchDeleteAgentError = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("BatchDeleteAgentError(")
        append("agentId=$agentId,")
        append("errorCode=$errorCode,")
        append("errorMessage=$errorMessage")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = agentId.hashCode()
        result = 31 * result + (errorCode.hashCode())
        result = 31 * result + (errorMessage.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 BatchDeleteAgentError

        if (agentId != other.agentId) return false
        if (errorCode != other.errorCode) return false
        if (errorMessage != other.errorMessage) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.applicationdiscoveryservice.model.BatchDeleteAgentError = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The ID of the agent or data collector to delete.
         */
        public var agentId: kotlin.String? = null
        /**
         * The type of error that occurred for the delete failed agent. Valid status are: AGENT_IN_USE | NOT_FOUND | INTERNAL_SERVER_ERROR.
         */
        public var errorCode: aws.sdk.kotlin.services.applicationdiscoveryservice.model.DeleteAgentErrorCode? = null
        /**
         * The description of the error that occurred for the delete failed agent.
         */
        public var errorMessage: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.applicationdiscoveryservice.model.BatchDeleteAgentError) : this() {
            this.agentId = x.agentId
            this.errorCode = x.errorCode
            this.errorMessage = x.errorMessage
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.applicationdiscoveryservice.model.BatchDeleteAgentError = BatchDeleteAgentError(this)

        internal fun correctErrors(): Builder {
            if (agentId == null) agentId = ""
            if (errorCode == null) errorCode = DeleteAgentErrorCode.SdkUnknown("no value provided")
            if (errorMessage == null) errorMessage = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy