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

commonMain.aws.sdk.kotlin.services.vpclattice.model.RuleAction.kt Maven / Gradle / Ivy

There is a newer version: 1.3.77
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.vpclattice.model



/**
 * Describes the action for a rule.
 */
public sealed class RuleAction {
    /**
     * The fixed response action. The rule returns a custom HTTP response.
     */
    public data class FixedResponse(val value: aws.sdk.kotlin.services.vpclattice.model.FixedResponseAction) : aws.sdk.kotlin.services.vpclattice.model.RuleAction() {
    }

    /**
     * The forward action. Traffic that matches the rule is forwarded to the specified target groups.
     */
    public data class Forward(val value: aws.sdk.kotlin.services.vpclattice.model.ForwardAction) : aws.sdk.kotlin.services.vpclattice.model.RuleAction() {
    }

    public object SdkUnknown : aws.sdk.kotlin.services.vpclattice.model.RuleAction() {
    }

    /**
     * Casts this [RuleAction] as a [FixedResponse] and retrieves its [aws.sdk.kotlin.services.vpclattice.model.FixedResponseAction] value. Throws an exception if the [RuleAction] is not a
     * [FixedResponse].
     */
    public fun asFixedResponse(): aws.sdk.kotlin.services.vpclattice.model.FixedResponseAction = (this as RuleAction.FixedResponse).value

    /**
     * Casts this [RuleAction] as a [FixedResponse] and retrieves its [aws.sdk.kotlin.services.vpclattice.model.FixedResponseAction] value. Returns null if the [RuleAction] is not a [FixedResponse].
     */
    public fun asFixedResponseOrNull(): aws.sdk.kotlin.services.vpclattice.model.FixedResponseAction? = (this as? RuleAction.FixedResponse)?.value

    /**
     * Casts this [RuleAction] as a [Forward] and retrieves its [aws.sdk.kotlin.services.vpclattice.model.ForwardAction] value. Throws an exception if the [RuleAction] is not a
     * [Forward].
     */
    public fun asForward(): aws.sdk.kotlin.services.vpclattice.model.ForwardAction = (this as RuleAction.Forward).value

    /**
     * Casts this [RuleAction] as a [Forward] and retrieves its [aws.sdk.kotlin.services.vpclattice.model.ForwardAction] value. Returns null if the [RuleAction] is not a [Forward].
     */
    public fun asForwardOrNull(): aws.sdk.kotlin.services.vpclattice.model.ForwardAction? = (this as? RuleAction.Forward)?.value
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy