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

commonMain.aws.sdk.kotlin.services.vpclattice.model.HeaderMatch.kt Maven / Gradle / Ivy

There is a newer version: 1.3.77
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.vpclattice.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Describes the constraints for a header match. Matches incoming requests with rule based on request header value before applying rule action.
 */
public class HeaderMatch private constructor(builder: Builder) {
    /**
     * Indicates whether the match is case sensitive.
     */
    public val caseSensitive: kotlin.Boolean? = builder.caseSensitive
    /**
     * The header match type.
     */
    public val match: aws.sdk.kotlin.services.vpclattice.model.HeaderMatchType? = builder.match
    /**
     * The name of the header.
     */
    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.vpclattice.model.HeaderMatch = Builder().apply(block).build()
    }

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

    override fun hashCode(): kotlin.Int {
        var result = caseSensitive?.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 HeaderMatch

        if (caseSensitive != other.caseSensitive) 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.vpclattice.model.HeaderMatch = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * Indicates whether the match is case sensitive.
         */
        public var caseSensitive: kotlin.Boolean? = null
        /**
         * The header match type.
         */
        public var match: aws.sdk.kotlin.services.vpclattice.model.HeaderMatchType? = null
        /**
         * The name of the header.
         */
        public var name: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.vpclattice.model.HeaderMatch) : this() {
            this.caseSensitive = x.caseSensitive
            this.match = x.match
            this.name = x.name
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy