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

commonMain.aws.sdk.kotlin.services.elasticbeanstalk.model.Listener.kt Maven / Gradle / Ivy

There is a newer version: 1.3.31
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.elasticbeanstalk.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Describes the properties of a Listener for the LoadBalancer.
 */
public class Listener private constructor(builder: Builder) {
    /**
     * The port that is used by the Listener.
     */
    public val port: kotlin.Int = builder.port
    /**
     * The protocol that is used by the Listener.
     */
    public val protocol: kotlin.String? = builder.protocol

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

    override fun toString(): kotlin.String = buildString {
        append("Listener(")
        append("port=$port,")
        append("protocol=$protocol")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = port
        result = 31 * result + (protocol?.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 Listener

        if (port != other.port) return false
        if (protocol != other.protocol) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The port that is used by the Listener.
         */
        public var port: kotlin.Int = 0
        /**
         * The protocol that is used by the Listener.
         */
        public var protocol: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.elasticbeanstalk.model.Listener) : this() {
            this.port = x.port
            this.protocol = x.protocol
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy