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

commonMain.aws.sdk.kotlin.services.appmesh.model.HttpGatewayRouteRewrite.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 representing the gateway route to rewrite.
 */
public class HttpGatewayRouteRewrite private constructor(builder: Builder) {
    /**
     * The host name to rewrite.
     */
    public val hostname: aws.sdk.kotlin.services.appmesh.model.GatewayRouteHostnameRewrite? = builder.hostname
    /**
     * The path to rewrite.
     */
    public val path: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRoutePathRewrite? = builder.path
    /**
     * The specified beginning characters to rewrite.
     */
    public val prefix: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRoutePrefixRewrite? = builder.prefix

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

    override fun toString(): kotlin.String = buildString {
        append("HttpGatewayRouteRewrite(")
        append("hostname=$hostname,")
        append("path=$path,")
        append("prefix=$prefix")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = hostname?.hashCode() ?: 0
        result = 31 * result + (path?.hashCode() ?: 0)
        result = 31 * result + (prefix?.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 HttpGatewayRouteRewrite

        if (hostname != other.hostname) return false
        if (path != other.path) return false
        if (prefix != other.prefix) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The host name to rewrite.
         */
        public var hostname: aws.sdk.kotlin.services.appmesh.model.GatewayRouteHostnameRewrite? = null
        /**
         * The path to rewrite.
         */
        public var path: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRoutePathRewrite? = null
        /**
         * The specified beginning characters to rewrite.
         */
        public var prefix: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRoutePrefixRewrite? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appmesh.model.HttpGatewayRouteRewrite) : this() {
            this.hostname = x.hostname
            this.path = x.path
            this.prefix = x.prefix
        }

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

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy