commonMain.aws.sdk.kotlin.services.vpclattice.model.RuleUpdate.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vpclattice-jvm Show documentation
Show all versions of vpclattice-jvm Show documentation
The AWS SDK for Kotlin client for VPC Lattice
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.vpclattice.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Describes a rule update.
*/
public class RuleUpdate private constructor(builder: Builder) {
/**
* The rule action.
*/
public val action: aws.sdk.kotlin.services.vpclattice.model.RuleAction? = builder.action
/**
* The rule match.
*/
public val match: aws.sdk.kotlin.services.vpclattice.model.RuleMatch? = builder.match
/**
* The rule priority. A listener can't have multiple rules with the same priority.
*/
public val priority: kotlin.Int? = builder.priority
/**
* The ID or Amazon Resource Name (ARN) of the rule.
*/
public val ruleIdentifier: kotlin.String = requireNotNull(builder.ruleIdentifier) { "A non-null value must be provided for ruleIdentifier" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.vpclattice.model.RuleUpdate = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("RuleUpdate(")
append("action=$action,")
append("match=$match,")
append("priority=$priority,")
append("ruleIdentifier=$ruleIdentifier")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = action?.hashCode() ?: 0
result = 31 * result + (match?.hashCode() ?: 0)
result = 31 * result + (priority ?: 0)
result = 31 * result + (ruleIdentifier.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 RuleUpdate
if (action != other.action) return false
if (match != other.match) return false
if (priority != other.priority) return false
if (ruleIdentifier != other.ruleIdentifier) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.vpclattice.model.RuleUpdate = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The rule action.
*/
public var action: aws.sdk.kotlin.services.vpclattice.model.RuleAction? = null
/**
* The rule match.
*/
public var match: aws.sdk.kotlin.services.vpclattice.model.RuleMatch? = null
/**
* The rule priority. A listener can't have multiple rules with the same priority.
*/
public var priority: kotlin.Int? = null
/**
* The ID or Amazon Resource Name (ARN) of the rule.
*/
public var ruleIdentifier: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.vpclattice.model.RuleUpdate) : this() {
this.action = x.action
this.match = x.match
this.priority = x.priority
this.ruleIdentifier = x.ruleIdentifier
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.vpclattice.model.RuleUpdate = RuleUpdate(this)
internal fun correctErrors(): Builder {
if (ruleIdentifier == null) ruleIdentifier = ""
return this
}
}
}