
commonMain.aws.sdk.kotlin.services.appmesh.model.HttpGatewayRouteAction.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 HttpGatewayRouteAction private constructor(builder: Builder) {
/**
* The gateway route action to rewrite.
*/
public val rewrite: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRouteRewrite? = builder.rewrite
/**
* An object that represents the target that traffic is routed to when a request matches the gateway route.
*/
public val target: aws.sdk.kotlin.services.appmesh.model.GatewayRouteTarget? = builder.target
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.appmesh.model.HttpGatewayRouteAction = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("HttpGatewayRouteAction(")
append("rewrite=$rewrite,")
append("target=$target")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = rewrite?.hashCode() ?: 0
result = 31 * result + (target?.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 HttpGatewayRouteAction
if (rewrite != other.rewrite) return false
if (target != other.target) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.appmesh.model.HttpGatewayRouteAction = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The gateway route action to rewrite.
*/
public var rewrite: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRouteRewrite? = null
/**
* An object that represents the target that traffic is routed to when a request matches the gateway route.
*/
public var target: aws.sdk.kotlin.services.appmesh.model.GatewayRouteTarget? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRouteAction) : this() {
this.rewrite = x.rewrite
this.target = x.target
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.appmesh.model.HttpGatewayRouteAction = HttpGatewayRouteAction(this)
/**
* construct an [aws.sdk.kotlin.services.appmesh.model.HttpGatewayRouteRewrite] inside the given [block]
*/
public fun rewrite(block: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRouteRewrite.Builder.() -> kotlin.Unit) {
this.rewrite = aws.sdk.kotlin.services.appmesh.model.HttpGatewayRouteRewrite.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appmesh.model.GatewayRouteTarget] inside the given [block]
*/
public fun target(block: aws.sdk.kotlin.services.appmesh.model.GatewayRouteTarget.Builder.() -> kotlin.Unit) {
this.target = aws.sdk.kotlin.services.appmesh.model.GatewayRouteTarget.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy