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

commonMain.aws.sdk.kotlin.services.appmesh.model.GrpcRouteMetadata.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 match metadata for the route.
 */
public class GrpcRouteMetadata private constructor(builder: Builder) {
    /**
     * Specify `True` to match anything except the match criteria. The default value is `False`.
     */
    public val invert: kotlin.Boolean? = builder.invert
    /**
     * An object that represents the data to match from the request.
     */
    public val match: aws.sdk.kotlin.services.appmesh.model.GrpcRouteMetadataMatchMethod? = builder.match
    /**
     * The name of the route.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }

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

    override fun toString(): kotlin.String = buildString {
        append("GrpcRouteMetadata(")
        append("invert=$invert,")
        append("match=$match,")
        append("name=$name")
        append(")")
    }

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

        if (invert != other.invert) return false
        if (match != other.match) return false
        if (name != other.name) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Specify `True` to match anything except the match criteria. The default value is `False`.
         */
        public var invert: kotlin.Boolean? = null
        /**
         * An object that represents the data to match from the request.
         */
        public var match: aws.sdk.kotlin.services.appmesh.model.GrpcRouteMetadataMatchMethod? = null
        /**
         * The name of the route.
         */
        public var name: kotlin.String? = null

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

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

        internal fun correctErrors(): Builder {
            if (name == null) name = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy