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

commonMain.aws.sdk.kotlin.services.applicationdiscoveryservice.model.NeighborConnectionDetail.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.applicationdiscoveryservice.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Details about neighboring servers.
 */
public class NeighborConnectionDetail private constructor(builder: Builder) {
    /**
     * The number of open network connections with the neighboring server.
     */
    public val connectionsCount: kotlin.Long = builder.connectionsCount
    /**
     * The destination network port for the connection.
     */
    public val destinationPort: kotlin.Int? = builder.destinationPort
    /**
     * The ID of the server that accepted the network connection.
     */
    public val destinationServerId: kotlin.String = requireNotNull(builder.destinationServerId) { "A non-null value must be provided for destinationServerId" }
    /**
     * The ID of the server that opened the network connection.
     */
    public val sourceServerId: kotlin.String = requireNotNull(builder.sourceServerId) { "A non-null value must be provided for sourceServerId" }
    /**
     * The network protocol used for the connection.
     */
    public val transportProtocol: kotlin.String? = builder.transportProtocol

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

    override fun toString(): kotlin.String = buildString {
        append("NeighborConnectionDetail(")
        append("connectionsCount=$connectionsCount,")
        append("destinationPort=$destinationPort,")
        append("destinationServerId=$destinationServerId,")
        append("sourceServerId=$sourceServerId,")
        append("transportProtocol=$transportProtocol")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = connectionsCount.hashCode()
        result = 31 * result + (destinationPort ?: 0)
        result = 31 * result + (destinationServerId.hashCode())
        result = 31 * result + (sourceServerId.hashCode())
        result = 31 * result + (transportProtocol?.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 NeighborConnectionDetail

        if (connectionsCount != other.connectionsCount) return false
        if (destinationPort != other.destinationPort) return false
        if (destinationServerId != other.destinationServerId) return false
        if (sourceServerId != other.sourceServerId) return false
        if (transportProtocol != other.transportProtocol) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The number of open network connections with the neighboring server.
         */
        public var connectionsCount: kotlin.Long = 0L
        /**
         * The destination network port for the connection.
         */
        public var destinationPort: kotlin.Int? = null
        /**
         * The ID of the server that accepted the network connection.
         */
        public var destinationServerId: kotlin.String? = null
        /**
         * The ID of the server that opened the network connection.
         */
        public var sourceServerId: kotlin.String? = null
        /**
         * The network protocol used for the connection.
         */
        public var transportProtocol: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.applicationdiscoveryservice.model.NeighborConnectionDetail) : this() {
            this.connectionsCount = x.connectionsCount
            this.destinationPort = x.destinationPort
            this.destinationServerId = x.destinationServerId
            this.sourceServerId = x.sourceServerId
            this.transportProtocol = x.transportProtocol
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy