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

commonMain.aws.sdk.kotlin.services.ecr.model.Resource.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.ecr.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Details about the resource involved in a finding.
 */
public class Resource private constructor(builder: Builder) {
    /**
     * An object that contains details about the resource involved in a finding.
     */
    public val details: aws.sdk.kotlin.services.ecr.model.ResourceDetails? = builder.details
    /**
     * The ID of the resource.
     */
    public val id: kotlin.String? = builder.id
    /**
     * The tags attached to the resource.
     */
    public val tags: Map? = builder.tags
    /**
     * The type of resource.
     */
    public val type: kotlin.String? = builder.type

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

    override fun toString(): kotlin.String = buildString {
        append("Resource(")
        append("details=$details,")
        append("id=$id,")
        append("tags=$tags,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = details?.hashCode() ?: 0
        result = 31 * result + (id?.hashCode() ?: 0)
        result = 31 * result + (tags?.hashCode() ?: 0)
        result = 31 * result + (type?.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 Resource

        if (details != other.details) return false
        if (id != other.id) return false
        if (tags != other.tags) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An object that contains details about the resource involved in a finding.
         */
        public var details: aws.sdk.kotlin.services.ecr.model.ResourceDetails? = null
        /**
         * The ID of the resource.
         */
        public var id: kotlin.String? = null
        /**
         * The tags attached to the resource.
         */
        public var tags: Map? = null
        /**
         * The type of resource.
         */
        public var type: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ecr.model.Resource) : this() {
            this.details = x.details
            this.id = x.id
            this.tags = x.tags
            this.type = x.type
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.ecr.model.ResourceDetails] inside the given [block]
         */
        public fun details(block: aws.sdk.kotlin.services.ecr.model.ResourceDetails.Builder.() -> kotlin.Unit) {
            this.details = aws.sdk.kotlin.services.ecr.model.ResourceDetails.invoke(block)
        }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy