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

commonMain.aws.sdk.kotlin.services.codecatalyst.model.DevEnvironmentSessionConfiguration.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.codecatalyst.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Information about the configuration of a Dev Environment session.
 */
public class DevEnvironmentSessionConfiguration private constructor(builder: Builder) {
    /**
     * Information about optional commands that will be run on the Dev Environment when the SSH session begins.
     */
    public val executeCommandSessionConfiguration: aws.sdk.kotlin.services.codecatalyst.model.ExecuteCommandSessionConfiguration? = builder.executeCommandSessionConfiguration
    /**
     * The type of the session.
     */
    public val sessionType: aws.sdk.kotlin.services.codecatalyst.model.DevEnvironmentSessionType = requireNotNull(builder.sessionType) { "A non-null value must be provided for sessionType" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.codecatalyst.model.DevEnvironmentSessionConfiguration = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("DevEnvironmentSessionConfiguration(")
        append("executeCommandSessionConfiguration=$executeCommandSessionConfiguration,")
        append("sessionType=$sessionType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = executeCommandSessionConfiguration?.hashCode() ?: 0
        result = 31 * result + (sessionType.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 DevEnvironmentSessionConfiguration

        if (executeCommandSessionConfiguration != other.executeCommandSessionConfiguration) return false
        if (sessionType != other.sessionType) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.codecatalyst.model.DevEnvironmentSessionConfiguration = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * Information about optional commands that will be run on the Dev Environment when the SSH session begins.
         */
        public var executeCommandSessionConfiguration: aws.sdk.kotlin.services.codecatalyst.model.ExecuteCommandSessionConfiguration? = null
        /**
         * The type of the session.
         */
        public var sessionType: aws.sdk.kotlin.services.codecatalyst.model.DevEnvironmentSessionType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codecatalyst.model.DevEnvironmentSessionConfiguration) : this() {
            this.executeCommandSessionConfiguration = x.executeCommandSessionConfiguration
            this.sessionType = x.sessionType
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.codecatalyst.model.DevEnvironmentSessionConfiguration = DevEnvironmentSessionConfiguration(this)

        /**
         * construct an [aws.sdk.kotlin.services.codecatalyst.model.ExecuteCommandSessionConfiguration] inside the given [block]
         */
        public fun executeCommandSessionConfiguration(block: aws.sdk.kotlin.services.codecatalyst.model.ExecuteCommandSessionConfiguration.Builder.() -> kotlin.Unit) {
            this.executeCommandSessionConfiguration = aws.sdk.kotlin.services.codecatalyst.model.ExecuteCommandSessionConfiguration.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (sessionType == null) sessionType = DevEnvironmentSessionType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy