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

commonMain.aws.sdk.kotlin.services.elasticloadbalancingv2.model.Rule.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 a rule.
 */
public class Rule private constructor(builder: Builder) {
    /**
     * The actions. Each rule must include exactly one of the following types of actions: `forward`, `redirect`, or `fixed-response`, and it must be the last action to be performed.
     */
    public val actions: List? = builder.actions
    /**
     * The conditions. Each rule can include zero or one of the following conditions: `http-request-method`, `host-header`, `path-pattern`, and `source-ip`, and zero or more of the following conditions: `http-header` and `query-string`.
     */
    public val conditions: List? = builder.conditions
    /**
     * Indicates whether this is the default rule.
     */
    public val isDefault: kotlin.Boolean? = builder.isDefault
    /**
     * The priority.
     */
    public val priority: kotlin.String? = builder.priority
    /**
     * The Amazon Resource Name (ARN) of the rule.
     */
    public val ruleArn: kotlin.String? = builder.ruleArn

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

    override fun toString(): kotlin.String = buildString {
        append("Rule(")
        append("actions=$actions,")
        append("conditions=$conditions,")
        append("isDefault=$isDefault,")
        append("priority=$priority,")
        append("ruleArn=$ruleArn")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = actions?.hashCode() ?: 0
        result = 31 * result + (conditions?.hashCode() ?: 0)
        result = 31 * result + (isDefault?.hashCode() ?: 0)
        result = 31 * result + (priority?.hashCode() ?: 0)
        result = 31 * result + (ruleArn?.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 Rule

        if (actions != other.actions) return false
        if (conditions != other.conditions) return false
        if (isDefault != other.isDefault) return false
        if (priority != other.priority) return false
        if (ruleArn != other.ruleArn) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The actions. Each rule must include exactly one of the following types of actions: `forward`, `redirect`, or `fixed-response`, and it must be the last action to be performed.
         */
        public var actions: List? = null
        /**
         * The conditions. Each rule can include zero or one of the following conditions: `http-request-method`, `host-header`, `path-pattern`, and `source-ip`, and zero or more of the following conditions: `http-header` and `query-string`.
         */
        public var conditions: List? = null
        /**
         * Indicates whether this is the default rule.
         */
        public var isDefault: kotlin.Boolean? = null
        /**
         * The priority.
         */
        public var priority: kotlin.String? = null
        /**
         * The Amazon Resource Name (ARN) of the rule.
         */
        public var ruleArn: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.elasticloadbalancingv2.model.Rule) : this() {
            this.actions = x.actions
            this.conditions = x.conditions
            this.isDefault = x.isDefault
            this.priority = x.priority
            this.ruleArn = x.ruleArn
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy