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

commonMain.aws.sdk.kotlin.services.resourcegroups.model.FailedResource.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.resourcegroups.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A resource that failed to be added to or removed from a group.
 */
public class FailedResource private constructor(builder: Builder) {
    /**
     * The error code associated with the failure.
     */
    public val errorCode: kotlin.String? = builder.errorCode
    /**
     * The error message text associated with the failure.
     */
    public val errorMessage: kotlin.String? = builder.errorMessage
    /**
     * The Amazon resource name (ARN) of the resource that failed to be added or removed.
     */
    public val resourceArn: kotlin.String? = builder.resourceArn

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

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

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

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

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The error code associated with the failure.
         */
        public var errorCode: kotlin.String? = null
        /**
         * The error message text associated with the failure.
         */
        public var errorMessage: kotlin.String? = null
        /**
         * The Amazon resource name (ARN) of the resource that failed to be added or removed.
         */
        public var resourceArn: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.resourcegroups.model.FailedResource) : this() {
            this.errorCode = x.errorCode
            this.errorMessage = x.errorMessage
            this.resourceArn = x.resourceArn
        }

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy