commonMain.aws.sdk.kotlin.services.vpclattice.model.HttpMatch.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 criteria that can be applied to incoming requests.
*/
public class HttpMatch private constructor(builder: Builder) {
/**
* The header matches. Matches incoming requests with rule based on request header value before applying rule action.
*/
public val headerMatches: List? = builder.headerMatches
/**
* The HTTP method type.
*/
public val method: kotlin.String? = builder.method
/**
* The path match.
*/
public val pathMatch: aws.sdk.kotlin.services.vpclattice.model.PathMatch? = builder.pathMatch
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.vpclattice.model.HttpMatch = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("HttpMatch(")
append("headerMatches=$headerMatches,")
append("method=$method,")
append("pathMatch=$pathMatch")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = headerMatches?.hashCode() ?: 0
result = 31 * result + (method?.hashCode() ?: 0)
result = 31 * result + (pathMatch?.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 HttpMatch
if (headerMatches != other.headerMatches) return false
if (method != other.method) return false
if (pathMatch != other.pathMatch) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.vpclattice.model.HttpMatch = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The header matches. Matches incoming requests with rule based on request header value before applying rule action.
*/
public var headerMatches: List? = null
/**
* The HTTP method type.
*/
public var method: kotlin.String? = null
/**
* The path match.
*/
public var pathMatch: aws.sdk.kotlin.services.vpclattice.model.PathMatch? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.vpclattice.model.HttpMatch) : this() {
this.headerMatches = x.headerMatches
this.method = x.method
this.pathMatch = x.pathMatch
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.vpclattice.model.HttpMatch = HttpMatch(this)
/**
* construct an [aws.sdk.kotlin.services.vpclattice.model.PathMatch] inside the given [block]
*/
public fun pathMatch(block: aws.sdk.kotlin.services.vpclattice.model.PathMatch.Builder.() -> kotlin.Unit) {
this.pathMatch = aws.sdk.kotlin.services.vpclattice.model.PathMatch.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}