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

commonMain.aws.sdk.kotlin.services.appmesh.model.AwsCloudMapServiceDiscovery.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 Cloud Map service discovery information for your virtual node.
 *
 * Cloud Map is not available in the eu-south-1 Region.
 */
public class AwsCloudMapServiceDiscovery private constructor(builder: Builder) {
    /**
     * A string map that contains attributes with values that you can use to filter instances by any custom attribute that you specified when you registered the instance. Only instances that match all of the specified key/value pairs will be returned.
     */
    public val attributes: List? = builder.attributes
    /**
     * 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
    /**
     * The name of the Cloud Map namespace to use.
     */
    public val namespaceName: kotlin.String = requireNotNull(builder.namespaceName) { "A non-null value must be provided for namespaceName" }
    /**
     * The name of the Cloud Map service to use.
     */
    public val serviceName: kotlin.String = requireNotNull(builder.serviceName) { "A non-null value must be provided for serviceName" }

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

    override fun toString(): kotlin.String = buildString {
        append("AwsCloudMapServiceDiscovery(")
        append("attributes=$attributes,")
        append("ipPreference=$ipPreference,")
        append("namespaceName=$namespaceName,")
        append("serviceName=$serviceName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = attributes?.hashCode() ?: 0
        result = 31 * result + (ipPreference?.hashCode() ?: 0)
        result = 31 * result + (namespaceName.hashCode())
        result = 31 * result + (serviceName.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 AwsCloudMapServiceDiscovery

        if (attributes != other.attributes) return false
        if (ipPreference != other.ipPreference) return false
        if (namespaceName != other.namespaceName) return false
        if (serviceName != other.serviceName) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A string map that contains attributes with values that you can use to filter instances by any custom attribute that you specified when you registered the instance. Only instances that match all of the specified key/value pairs will be returned.
         */
        public var attributes: List? = 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
        /**
         * The name of the Cloud Map namespace to use.
         */
        public var namespaceName: kotlin.String? = null
        /**
         * The name of the Cloud Map service to use.
         */
        public var serviceName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appmesh.model.AwsCloudMapServiceDiscovery) : this() {
            this.attributes = x.attributes
            this.ipPreference = x.ipPreference
            this.namespaceName = x.namespaceName
            this.serviceName = x.serviceName
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy