commonMain.aws.sdk.kotlin.services.vpclattice.model.CreateRuleRequest.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
public class CreateRuleRequest private constructor(builder: Builder) {
/**
* The action for the default rule.
*/
public val action: aws.sdk.kotlin.services.vpclattice.model.RuleAction? = builder.action
/**
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails.
*/
public val clientToken: kotlin.String? = builder.clientToken
/**
* The ID or Amazon Resource Name (ARN) of the listener.
*/
public val listenerIdentifier: kotlin.String = requireNotNull(builder.listenerIdentifier) { "A non-null value must be provided for listenerIdentifier" }
/**
* The rule match.
*/
public val match: aws.sdk.kotlin.services.vpclattice.model.RuleMatch? = builder.match
/**
* The name of the rule. The name must be unique within the listener. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
*/
public val priority: kotlin.Int = requireNotNull(builder.priority) { "A non-null value must be provided for priority" }
/**
* The ID or Amazon Resource Name (ARN) of the service.
*/
public val serviceIdentifier: kotlin.String = requireNotNull(builder.serviceIdentifier) { "A non-null value must be provided for serviceIdentifier" }
/**
* The tags for the rule.
*/
public val tags: Map? = builder.tags
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.vpclattice.model.CreateRuleRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateRuleRequest(")
append("action=$action,")
append("clientToken=$clientToken,")
append("listenerIdentifier=$listenerIdentifier,")
append("match=$match,")
append("name=$name,")
append("priority=$priority,")
append("serviceIdentifier=$serviceIdentifier,")
append("tags=$tags")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = action?.hashCode() ?: 0
result = 31 * result + (clientToken?.hashCode() ?: 0)
result = 31 * result + (listenerIdentifier.hashCode())
result = 31 * result + (match?.hashCode() ?: 0)
result = 31 * result + (name.hashCode())
result = 31 * result + (priority)
result = 31 * result + (serviceIdentifier.hashCode())
result = 31 * result + (tags?.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 CreateRuleRequest
if (action != other.action) return false
if (clientToken != other.clientToken) return false
if (listenerIdentifier != other.listenerIdentifier) return false
if (match != other.match) return false
if (name != other.name) return false
if (priority != other.priority) return false
if (serviceIdentifier != other.serviceIdentifier) return false
if (tags != other.tags) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.vpclattice.model.CreateRuleRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The action for the default rule.
*/
public var action: aws.sdk.kotlin.services.vpclattice.model.RuleAction? = null
/**
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails.
*/
public var clientToken: kotlin.String? = null
/**
* The ID or Amazon Resource Name (ARN) of the listener.
*/
public var listenerIdentifier: kotlin.String? = null
/**
* The rule match.
*/
public var match: aws.sdk.kotlin.services.vpclattice.model.RuleMatch? = null
/**
* The name of the rule. The name must be unique within the listener. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
*/
public var name: kotlin.String? = null
/**
* The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
*/
public var priority: kotlin.Int? = null
/**
* The ID or Amazon Resource Name (ARN) of the service.
*/
public var serviceIdentifier: kotlin.String? = null
/**
* The tags for the rule.
*/
public var tags: Map? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.vpclattice.model.CreateRuleRequest) : this() {
this.action = x.action
this.clientToken = x.clientToken
this.listenerIdentifier = x.listenerIdentifier
this.match = x.match
this.name = x.name
this.priority = x.priority
this.serviceIdentifier = x.serviceIdentifier
this.tags = x.tags
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.vpclattice.model.CreateRuleRequest = CreateRuleRequest(this)
internal fun correctErrors(): Builder {
if (listenerIdentifier == null) listenerIdentifier = ""
if (name == null) name = ""
if (priority == null) priority = 0
if (serviceIdentifier == null) serviceIdentifier = ""
return this
}
}
}