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

commonMain.aws.sdk.kotlin.services.appmesh.model.GatewayRouteSpec.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 gateway route specification. Specify one gateway route type.
 */
public class GatewayRouteSpec private constructor(builder: Builder) {
    /**
     * An object that represents the specification of a gRPC gateway route.
     */
    public val grpcRoute: aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRoute? = builder.grpcRoute
    /**
     * An object that represents the specification of an HTTP/2 gateway route.
     */
    public val http2Route: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRoute? = builder.http2Route
    /**
     * An object that represents the specification of an HTTP gateway route.
     */
    public val httpRoute: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRoute? = builder.httpRoute
    /**
     * The ordering of the gateway routes spec.
     */
    public val priority: kotlin.Int? = builder.priority

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

    override fun toString(): kotlin.String = buildString {
        append("GatewayRouteSpec(")
        append("grpcRoute=$grpcRoute,")
        append("http2Route=$http2Route,")
        append("httpRoute=$httpRoute,")
        append("priority=$priority")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = grpcRoute?.hashCode() ?: 0
        result = 31 * result + (http2Route?.hashCode() ?: 0)
        result = 31 * result + (httpRoute?.hashCode() ?: 0)
        result = 31 * result + (priority ?: 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 GatewayRouteSpec

        if (grpcRoute != other.grpcRoute) return false
        if (http2Route != other.http2Route) return false
        if (httpRoute != other.httpRoute) return false
        if (priority != other.priority) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An object that represents the specification of a gRPC gateway route.
         */
        public var grpcRoute: aws.sdk.kotlin.services.appmesh.model.GrpcGatewayRoute? = null
        /**
         * An object that represents the specification of an HTTP/2 gateway route.
         */
        public var http2Route: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRoute? = null
        /**
         * An object that represents the specification of an HTTP gateway route.
         */
        public var httpRoute: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRoute? = null
        /**
         * The ordering of the gateway routes spec.
         */
        public var priority: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appmesh.model.GatewayRouteSpec) : this() {
            this.grpcRoute = x.grpcRoute
            this.http2Route = x.http2Route
            this.httpRoute = x.httpRoute
            this.priority = x.priority
        }

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

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy