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

commonMain.aws.sdk.kotlin.services.elasticloadbalancingv2.model.FixedResponseActionConfig.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.elasticloadbalancingv2.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Information about an action that returns a custom HTTP response.
 */
public class FixedResponseActionConfig private constructor(builder: Builder) {
    /**
     * The content type.
     *
     * Valid Values: text/plain | text/css | text/html | application/javascript | application/json
     */
    public val contentType: kotlin.String? = builder.contentType
    /**
     * The message.
     */
    public val messageBody: kotlin.String? = builder.messageBody
    /**
     * The HTTP response code (2XX, 4XX, or 5XX).
     */
    public val statusCode: kotlin.String? = builder.statusCode

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

    override fun toString(): kotlin.String = buildString {
        append("FixedResponseActionConfig(")
        append("contentType=$contentType,")
        append("messageBody=$messageBody,")
        append("statusCode=$statusCode")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = contentType?.hashCode() ?: 0
        result = 31 * result + (messageBody?.hashCode() ?: 0)
        result = 31 * result + (statusCode?.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 FixedResponseActionConfig

        if (contentType != other.contentType) return false
        if (messageBody != other.messageBody) return false
        if (statusCode != other.statusCode) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The content type.
         *
         * Valid Values: text/plain | text/css | text/html | application/javascript | application/json
         */
        public var contentType: kotlin.String? = null
        /**
         * The message.
         */
        public var messageBody: kotlin.String? = null
        /**
         * The HTTP response code (2XX, 4XX, or 5XX).
         */
        public var statusCode: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.elasticloadbalancingv2.model.FixedResponseActionConfig) : this() {
            this.contentType = x.contentType
            this.messageBody = x.messageBody
            this.statusCode = x.statusCode
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy