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

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

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

package aws.sdk.kotlin.services.route53recoveryreadiness.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The resource element of a resource set.
 */
public class Resource private constructor(builder: Builder) {
    /**
     * The component identifier of the resource, generated when DNS target resource is used.
     */
    public val componentId: kotlin.String? = builder.componentId
    /**
     * The DNS target resource.
     */
    public val dnsTargetResource: aws.sdk.kotlin.services.route53recoveryreadiness.model.DnsTargetResource? = builder.dnsTargetResource
    /**
     * A list of recovery group Amazon Resource Names (ARNs) and cell ARNs that this resource is contained within.
     */
    public val readinessScopes: List? = builder.readinessScopes
    /**
     * The Amazon Resource Name (ARN) of the Amazon Web Services resource.
     */
    public val resourceArn: kotlin.String? = builder.resourceArn

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

    override fun toString(): kotlin.String = buildString {
        append("Resource(")
        append("componentId=$componentId,")
        append("dnsTargetResource=$dnsTargetResource,")
        append("readinessScopes=$readinessScopes,")
        append("resourceArn=$resourceArn")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = componentId?.hashCode() ?: 0
        result = 31 * result + (dnsTargetResource?.hashCode() ?: 0)
        result = 31 * result + (readinessScopes?.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 Resource

        if (componentId != other.componentId) return false
        if (dnsTargetResource != other.dnsTargetResource) return false
        if (readinessScopes != other.readinessScopes) return false
        if (resourceArn != other.resourceArn) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The component identifier of the resource, generated when DNS target resource is used.
         */
        public var componentId: kotlin.String? = null
        /**
         * The DNS target resource.
         */
        public var dnsTargetResource: aws.sdk.kotlin.services.route53recoveryreadiness.model.DnsTargetResource? = null
        /**
         * A list of recovery group Amazon Resource Names (ARNs) and cell ARNs that this resource is contained within.
         */
        public var readinessScopes: List? = null
        /**
         * The Amazon Resource Name (ARN) of the Amazon Web Services resource.
         */
        public var resourceArn: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.route53recoveryreadiness.model.Resource) : this() {
            this.componentId = x.componentId
            this.dnsTargetResource = x.dnsTargetResource
            this.readinessScopes = x.readinessScopes
            this.resourceArn = x.resourceArn
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy