
commonMain.aws.sdk.kotlin.services.appmesh.model.TcpRoute.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 a TCP route type.
*/
public class TcpRoute private constructor(builder: Builder) {
/**
* The action to take if a match is determined.
*/
public val action: aws.sdk.kotlin.services.appmesh.model.TcpRouteAction? = builder.action
/**
* An object that represents the criteria for determining a request match.
*/
public val match: aws.sdk.kotlin.services.appmesh.model.TcpRouteMatch? = builder.match
/**
* An object that represents types of timeouts.
*/
public val timeout: aws.sdk.kotlin.services.appmesh.model.TcpTimeout? = builder.timeout
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.appmesh.model.TcpRoute = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("TcpRoute(")
append("action=$action,")
append("match=$match,")
append("timeout=$timeout")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = action?.hashCode() ?: 0
result = 31 * result + (match?.hashCode() ?: 0)
result = 31 * result + (timeout?.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 TcpRoute
if (action != other.action) return false
if (match != other.match) return false
if (timeout != other.timeout) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.appmesh.model.TcpRoute = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The action to take if a match is determined.
*/
public var action: aws.sdk.kotlin.services.appmesh.model.TcpRouteAction? = null
/**
* An object that represents the criteria for determining a request match.
*/
public var match: aws.sdk.kotlin.services.appmesh.model.TcpRouteMatch? = null
/**
* An object that represents types of timeouts.
*/
public var timeout: aws.sdk.kotlin.services.appmesh.model.TcpTimeout? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.appmesh.model.TcpRoute) : this() {
this.action = x.action
this.match = x.match
this.timeout = x.timeout
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.appmesh.model.TcpRoute = TcpRoute(this)
/**
* construct an [aws.sdk.kotlin.services.appmesh.model.TcpRouteAction] inside the given [block]
*/
public fun action(block: aws.sdk.kotlin.services.appmesh.model.TcpRouteAction.Builder.() -> kotlin.Unit) {
this.action = aws.sdk.kotlin.services.appmesh.model.TcpRouteAction.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appmesh.model.TcpRouteMatch] inside the given [block]
*/
public fun match(block: aws.sdk.kotlin.services.appmesh.model.TcpRouteMatch.Builder.() -> kotlin.Unit) {
this.match = aws.sdk.kotlin.services.appmesh.model.TcpRouteMatch.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appmesh.model.TcpTimeout] inside the given [block]
*/
public fun timeout(block: aws.sdk.kotlin.services.appmesh.model.TcpTimeout.Builder.() -> kotlin.Unit) {
this.timeout = aws.sdk.kotlin.services.appmesh.model.TcpTimeout.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy