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

commonMain.aws.sdk.kotlin.services.appmesh.model.DnsServiceDiscovery.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.appmesh.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * An object that represents the DNS service discovery information for your virtual node.
 */
public class DnsServiceDiscovery private constructor(builder: Builder) {
    /**
     * Specifies the DNS service discovery hostname for the virtual node.
     */
    public val hostname: kotlin.String = requireNotNull(builder.hostname) { "A non-null value must be provided for hostname" }
    /**
     * The preferred IP version that this virtual node uses. Setting the IP preference on the virtual node only overrides the IP preference set for the mesh on this specific node.
     */
    public val ipPreference: aws.sdk.kotlin.services.appmesh.model.IpPreference? = builder.ipPreference
    /**
     * Specifies the DNS response type for the virtual node.
     */
    public val responseType: aws.sdk.kotlin.services.appmesh.model.DnsResponseType? = builder.responseType

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

    override fun toString(): kotlin.String = buildString {
        append("DnsServiceDiscovery(")
        append("hostname=$hostname,")
        append("ipPreference=$ipPreference,")
        append("responseType=$responseType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = hostname.hashCode()
        result = 31 * result + (ipPreference?.hashCode() ?: 0)
        result = 31 * result + (responseType?.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 DnsServiceDiscovery

        if (hostname != other.hostname) return false
        if (ipPreference != other.ipPreference) return false
        if (responseType != other.responseType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Specifies the DNS service discovery hostname for the virtual node.
         */
        public var hostname: kotlin.String? = null
        /**
         * The preferred IP version that this virtual node uses. Setting the IP preference on the virtual node only overrides the IP preference set for the mesh on this specific node.
         */
        public var ipPreference: aws.sdk.kotlin.services.appmesh.model.IpPreference? = null
        /**
         * Specifies the DNS response type for the virtual node.
         */
        public var responseType: aws.sdk.kotlin.services.appmesh.model.DnsResponseType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appmesh.model.DnsServiceDiscovery) : this() {
            this.hostname = x.hostname
            this.ipPreference = x.ipPreference
            this.responseType = x.responseType
        }

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

        internal fun correctErrors(): Builder {
            if (hostname == null) hostname = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy