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

commonMain.aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteAction.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 GrpcGatewayRouteAction private constructor(builder: Builder) {
    /**
     * The gateway route action to rewrite.
     */
    public val rewrite: aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteRewrite? = 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.GrpcGatewayRouteAction = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("GrpcGatewayRouteAction(")
        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 GrpcGatewayRouteAction

        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.GrpcGatewayRouteAction = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The gateway route action to rewrite.
         */
        public var rewrite: aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteRewrite? = 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.GrpcGatewayRouteAction) : this() {
            this.rewrite = x.rewrite
            this.target = x.target
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteRewrite] inside the given [block]
         */
        public fun rewrite(block: aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteRewrite.Builder.() -> kotlin.Unit) {
            this.rewrite = aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteRewrite.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