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

commonMain.aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRoute.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 gRPC gateway route.
 */
public class GrpcGatewayRoute private constructor(builder: Builder) {
    /**
     * An object that represents the action to take if a match is determined.
     */
    public val action: aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteAction? = builder.action
    /**
     * An object that represents the criteria for determining a request match.
     */
    public val match: aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteMatch? = builder.match

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRoute = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("GrpcGatewayRoute(")
        append("action=$action,")
        append("match=$match")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = action?.hashCode() ?: 0
        result = 31 * result + (match?.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 GrpcGatewayRoute

        if (action != other.action) return false
        if (match != other.match) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRoute = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * An object that represents the action to take if a match is determined.
         */
        public var action: aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteAction? = null
        /**
         * An object that represents the criteria for determining a request match.
         */
        public var match: aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteMatch? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRoute) : this() {
            this.action = x.action
            this.match = x.match
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteAction] inside the given [block]
         */
        public fun action(block: aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteAction.Builder.() -> kotlin.Unit) {
            this.action = aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteAction.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteMatch] inside the given [block]
         */
        public fun match(block: aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteMatch.Builder.() -> kotlin.Unit) {
            this.match = aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRouteMatch.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy