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

commonMain.aws.sdk.kotlin.services.appmesh.model.GrpcRoute.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 route type.
 */
public class GrpcRoute 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.GrpcRouteAction? = builder.action
    /**
     * An object that represents the criteria for determining a request match.
     */
    public val match: aws.sdk.kotlin.services.appmesh.model.GrpcRouteMatch? = builder.match
    /**
     * An object that represents a retry policy.
     */
    public val retryPolicy: aws.sdk.kotlin.services.appmesh.model.GrpcRetryPolicy? = builder.retryPolicy
    /**
     * An object that represents types of timeouts.
     */
    public val timeout: aws.sdk.kotlin.services.appmesh.model.GrpcTimeout? = builder.timeout

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

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

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

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

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.appmesh.model.GrpcRoute = 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.GrpcRouteAction? = null
        /**
         * An object that represents the criteria for determining a request match.
         */
        public var match: aws.sdk.kotlin.services.appmesh.model.GrpcRouteMatch? = null
        /**
         * An object that represents a retry policy.
         */
        public var retryPolicy: aws.sdk.kotlin.services.appmesh.model.GrpcRetryPolicy? = null
        /**
         * An object that represents types of timeouts.
         */
        public var timeout: aws.sdk.kotlin.services.appmesh.model.GrpcTimeout? = null

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

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

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

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy