commonMain.aws.sdk.kotlin.services.vpclattice.model.ForwardAction.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vpclattice-jvm Show documentation
Show all versions of vpclattice-jvm Show documentation
The AWS SDK for Kotlin client for VPC Lattice
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.vpclattice.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Describes a forward action. You can use forward actions to route requests to one or more target groups.
*/
public class ForwardAction private constructor(builder: Builder) {
/**
* The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic.
*
* The default value is 1. This means that if only one target group is provided, there is no need to set the weight; 100% of the traffic goes to that target group.
*/
public val targetGroups: List = requireNotNull(builder.targetGroups) { "A non-null value must be provided for targetGroups" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.vpclattice.model.ForwardAction = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ForwardAction(")
append("targetGroups=$targetGroups")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = targetGroups.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 ForwardAction
if (targetGroups != other.targetGroups) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.vpclattice.model.ForwardAction = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic.
*
* The default value is 1. This means that if only one target group is provided, there is no need to set the weight; 100% of the traffic goes to that target group.
*/
public var targetGroups: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.vpclattice.model.ForwardAction) : this() {
this.targetGroups = x.targetGroups
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.vpclattice.model.ForwardAction = ForwardAction(this)
internal fun correctErrors(): Builder {
if (targetGroups == null) targetGroups = emptyList()
return this
}
}
}