
commonMain.aws.sdk.kotlin.services.appmesh.model.HttpRoute.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appmesh.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* An object that represents an HTTP or HTTP/2 route type.
*/
public class HttpRoute private constructor(builder: Builder) {
/**
* An object that represents the action to take if a match is determined.
*/
public val action: aws.sdk.kotlin.services.appmesh.model.HttpRouteAction? = builder.action
/**
* An object that represents the criteria for determining a request match.
*/
public val match: aws.sdk.kotlin.services.appmesh.model.HttpRouteMatch? = builder.match
/**
* An object that represents a retry policy.
*/
public val retryPolicy: aws.sdk.kotlin.services.appmesh.model.HttpRetryPolicy? = builder.retryPolicy
/**
* An object that represents types of timeouts.
*/
public val timeout: aws.sdk.kotlin.services.appmesh.model.HttpTimeout? = builder.timeout
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.appmesh.model.HttpRoute = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("HttpRoute(")
append("action=$action,")
append("match=$match,")
append("retryPolicy=$retryPolicy,")
append("timeout=$timeout")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = action?.hashCode() ?: 0
result = 31 * result + (match?.hashCode() ?: 0)
result = 31 * result + (retryPolicy?.hashCode() ?: 0)
result = 31 * result + (timeout?.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 HttpRoute
if (action != other.action) return false
if (match != other.match) return false
if (retryPolicy != other.retryPolicy) return false
if (timeout != other.timeout) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.appmesh.model.HttpRoute = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* An object that represents the action to take if a match is determined.
*/
public var action: aws.sdk.kotlin.services.appmesh.model.HttpRouteAction? = null
/**
* An object that represents the criteria for determining a request match.
*/
public var match: aws.sdk.kotlin.services.appmesh.model.HttpRouteMatch? = null
/**
* An object that represents a retry policy.
*/
public var retryPolicy: aws.sdk.kotlin.services.appmesh.model.HttpRetryPolicy? = null
/**
* An object that represents types of timeouts.
*/
public var timeout: aws.sdk.kotlin.services.appmesh.model.HttpTimeout? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.appmesh.model.HttpRoute) : this() {
this.action = x.action
this.match = x.match
this.retryPolicy = x.retryPolicy
this.timeout = x.timeout
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.appmesh.model.HttpRoute = HttpRoute(this)
/**
* construct an [aws.sdk.kotlin.services.appmesh.model.HttpRouteAction] inside the given [block]
*/
public fun action(block: aws.sdk.kotlin.services.appmesh.model.HttpRouteAction.Builder.() -> kotlin.Unit) {
this.action = aws.sdk.kotlin.services.appmesh.model.HttpRouteAction.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appmesh.model.HttpRouteMatch] inside the given [block]
*/
public fun match(block: aws.sdk.kotlin.services.appmesh.model.HttpRouteMatch.Builder.() -> kotlin.Unit) {
this.match = aws.sdk.kotlin.services.appmesh.model.HttpRouteMatch.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appmesh.model.HttpRetryPolicy] inside the given [block]
*/
public fun retryPolicy(block: aws.sdk.kotlin.services.appmesh.model.HttpRetryPolicy.Builder.() -> kotlin.Unit) {
this.retryPolicy = aws.sdk.kotlin.services.appmesh.model.HttpRetryPolicy.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.appmesh.model.HttpTimeout] inside the given [block]
*/
public fun timeout(block: aws.sdk.kotlin.services.appmesh.model.HttpTimeout.Builder.() -> kotlin.Unit) {
this.timeout = aws.sdk.kotlin.services.appmesh.model.HttpTimeout.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy