
commonMain.aws.sdk.kotlin.services.appmesh.model.HttpRouteAction.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 action to take if a match is determined.
*/
public class HttpRouteAction private constructor(builder: Builder) {
/**
* An object that represents the targets that traffic is routed to when a request matches the route.
*/
public val weightedTargets: List = requireNotNull(builder.weightedTargets) { "A non-null value must be provided for weightedTargets" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.appmesh.model.HttpRouteAction = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("HttpRouteAction(")
append("weightedTargets=$weightedTargets")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = weightedTargets.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 HttpRouteAction
if (weightedTargets != other.weightedTargets) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.appmesh.model.HttpRouteAction = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* An object that represents the targets that traffic is routed to when a request matches the route.
*/
public var weightedTargets: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.appmesh.model.HttpRouteAction) : this() {
this.weightedTargets = x.weightedTargets
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.appmesh.model.HttpRouteAction = HttpRouteAction(this)
internal fun correctErrors(): Builder {
if (weightedTargets == null) weightedTargets = emptyList()
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy