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

commonMain.aws.sdk.kotlin.services.nimble.model.StreamConfigurationCreate.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.nimble.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Configuration for streaming workstations created using this launch profile.
 */
public class StreamConfigurationCreate private constructor(builder: Builder) {
    /**
     * Indicates if a streaming session created from this launch profile should be terminated automatically or retained without termination after being in a `STOPPED` state.
     * + When `ACTIVATED`, the streaming session is scheduled for termination after being in the `STOPPED` state for the time specified in `maxStoppedSessionLengthInMinutes`.
     * + When `DEACTIVATED`, the streaming session can remain in the `STOPPED` state indefinitely.
     *
     * This parameter is only allowed when `sessionPersistenceMode` is `ACTIVATED`. When allowed, the default value for this parameter is `DEACTIVATED`.
     */
    public val automaticTerminationMode: aws.sdk.kotlin.services.nimble.model.AutomaticTerminationMode? = builder.automaticTerminationMode
    /**
     * Allows or deactivates the use of the system clipboard to copy and paste between the streaming session and streaming client.
     */
    public val clipboardMode: aws.sdk.kotlin.services.nimble.model.StreamingClipboardMode = requireNotNull(builder.clipboardMode) { "A non-null value must be provided for clipboardMode" }
    /**
     * The EC2 instance types that users can select from when launching a streaming session with this launch profile.
     */
    public val ec2InstanceTypes: List = requireNotNull(builder.ec2InstanceTypes) { "A non-null value must be provided for ec2InstanceTypes" }
    /**
     * The length of time, in minutes, that a streaming session can be active before it is stopped or terminated. After this point, Nimble Studio automatically terminates or stops the session. The default length of time is 690 minutes, and the maximum length of time is 30 days.
     */
    public val maxSessionLengthInMinutes: kotlin.Int = builder.maxSessionLengthInMinutes
    /**
     * Integer that determines if you can start and stop your sessions and how long a session can stay in the `STOPPED` state. The default value is 0. The maximum value is 5760.
     *
     * This field is allowed only when `sessionPersistenceMode` is `ACTIVATED` and `automaticTerminationMode` is `ACTIVATED`.
     *
     * If the value is set to 0, your sessions can’t be `STOPPED`. If you then call `StopStreamingSession`, the session fails. If the time that a session stays in the `READY` state exceeds the `maxSessionLengthInMinutes` value, the session will automatically be terminated (instead of `STOPPED`).
     *
     * If the value is set to a positive number, the session can be stopped. You can call `StopStreamingSession` to stop sessions in the `READY` state. If the time that a session stays in the `READY` state exceeds the `maxSessionLengthInMinutes` value, the session will automatically be stopped (instead of terminated).
     */
    public val maxStoppedSessionLengthInMinutes: kotlin.Int = builder.maxStoppedSessionLengthInMinutes
    /**
     * Configures how streaming sessions are backed up when launched from this launch profile.
     */
    public val sessionBackup: aws.sdk.kotlin.services.nimble.model.StreamConfigurationSessionBackup? = builder.sessionBackup
    /**
     * Determine if a streaming session created from this launch profile can configure persistent storage. This means that `volumeConfiguration` and `automaticTerminationMode` are configured.
     */
    public val sessionPersistenceMode: aws.sdk.kotlin.services.nimble.model.SessionPersistenceMode? = builder.sessionPersistenceMode
    /**
     * The upload storage for a streaming workstation that is created using this launch profile.
     */
    public val sessionStorage: aws.sdk.kotlin.services.nimble.model.StreamConfigurationSessionStorage? = builder.sessionStorage
    /**
     * The streaming images that users can select from when launching a streaming session with this launch profile.
     */
    public val streamingImageIds: List = requireNotNull(builder.streamingImageIds) { "A non-null value must be provided for streamingImageIds" }
    /**
     * Custom volume configuration for the root volumes that are attached to streaming sessions.
     *
     * This parameter is only allowed when `sessionPersistenceMode` is `ACTIVATED`.
     */
    public val volumeConfiguration: aws.sdk.kotlin.services.nimble.model.VolumeConfiguration? = builder.volumeConfiguration

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

    override fun toString(): kotlin.String = buildString {
        append("StreamConfigurationCreate(")
        append("automaticTerminationMode=$automaticTerminationMode,")
        append("clipboardMode=$clipboardMode,")
        append("ec2InstanceTypes=$ec2InstanceTypes,")
        append("maxSessionLengthInMinutes=$maxSessionLengthInMinutes,")
        append("maxStoppedSessionLengthInMinutes=$maxStoppedSessionLengthInMinutes,")
        append("sessionBackup=$sessionBackup,")
        append("sessionPersistenceMode=$sessionPersistenceMode,")
        append("sessionStorage=$sessionStorage,")
        append("streamingImageIds=$streamingImageIds,")
        append("volumeConfiguration=$volumeConfiguration")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = automaticTerminationMode?.hashCode() ?: 0
        result = 31 * result + (clipboardMode.hashCode())
        result = 31 * result + (ec2InstanceTypes.hashCode())
        result = 31 * result + (maxSessionLengthInMinutes)
        result = 31 * result + (maxStoppedSessionLengthInMinutes)
        result = 31 * result + (sessionBackup?.hashCode() ?: 0)
        result = 31 * result + (sessionPersistenceMode?.hashCode() ?: 0)
        result = 31 * result + (sessionStorage?.hashCode() ?: 0)
        result = 31 * result + (streamingImageIds.hashCode())
        result = 31 * result + (volumeConfiguration?.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 StreamConfigurationCreate

        if (automaticTerminationMode != other.automaticTerminationMode) return false
        if (clipboardMode != other.clipboardMode) return false
        if (ec2InstanceTypes != other.ec2InstanceTypes) return false
        if (maxSessionLengthInMinutes != other.maxSessionLengthInMinutes) return false
        if (maxStoppedSessionLengthInMinutes != other.maxStoppedSessionLengthInMinutes) return false
        if (sessionBackup != other.sessionBackup) return false
        if (sessionPersistenceMode != other.sessionPersistenceMode) return false
        if (sessionStorage != other.sessionStorage) return false
        if (streamingImageIds != other.streamingImageIds) return false
        if (volumeConfiguration != other.volumeConfiguration) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Indicates if a streaming session created from this launch profile should be terminated automatically or retained without termination after being in a `STOPPED` state.
         * + When `ACTIVATED`, the streaming session is scheduled for termination after being in the `STOPPED` state for the time specified in `maxStoppedSessionLengthInMinutes`.
         * + When `DEACTIVATED`, the streaming session can remain in the `STOPPED` state indefinitely.
         *
         * This parameter is only allowed when `sessionPersistenceMode` is `ACTIVATED`. When allowed, the default value for this parameter is `DEACTIVATED`.
         */
        public var automaticTerminationMode: aws.sdk.kotlin.services.nimble.model.AutomaticTerminationMode? = null
        /**
         * Allows or deactivates the use of the system clipboard to copy and paste between the streaming session and streaming client.
         */
        public var clipboardMode: aws.sdk.kotlin.services.nimble.model.StreamingClipboardMode? = null
        /**
         * The EC2 instance types that users can select from when launching a streaming session with this launch profile.
         */
        public var ec2InstanceTypes: List? = null
        /**
         * The length of time, in minutes, that a streaming session can be active before it is stopped or terminated. After this point, Nimble Studio automatically terminates or stops the session. The default length of time is 690 minutes, and the maximum length of time is 30 days.
         */
        public var maxSessionLengthInMinutes: kotlin.Int = 690
        /**
         * Integer that determines if you can start and stop your sessions and how long a session can stay in the `STOPPED` state. The default value is 0. The maximum value is 5760.
         *
         * This field is allowed only when `sessionPersistenceMode` is `ACTIVATED` and `automaticTerminationMode` is `ACTIVATED`.
         *
         * If the value is set to 0, your sessions can’t be `STOPPED`. If you then call `StopStreamingSession`, the session fails. If the time that a session stays in the `READY` state exceeds the `maxSessionLengthInMinutes` value, the session will automatically be terminated (instead of `STOPPED`).
         *
         * If the value is set to a positive number, the session can be stopped. You can call `StopStreamingSession` to stop sessions in the `READY` state. If the time that a session stays in the `READY` state exceeds the `maxSessionLengthInMinutes` value, the session will automatically be stopped (instead of terminated).
         */
        public var maxStoppedSessionLengthInMinutes: kotlin.Int = 0
        /**
         * Configures how streaming sessions are backed up when launched from this launch profile.
         */
        public var sessionBackup: aws.sdk.kotlin.services.nimble.model.StreamConfigurationSessionBackup? = null
        /**
         * Determine if a streaming session created from this launch profile can configure persistent storage. This means that `volumeConfiguration` and `automaticTerminationMode` are configured.
         */
        public var sessionPersistenceMode: aws.sdk.kotlin.services.nimble.model.SessionPersistenceMode? = null
        /**
         * The upload storage for a streaming workstation that is created using this launch profile.
         */
        public var sessionStorage: aws.sdk.kotlin.services.nimble.model.StreamConfigurationSessionStorage? = null
        /**
         * The streaming images that users can select from when launching a streaming session with this launch profile.
         */
        public var streamingImageIds: List? = null
        /**
         * Custom volume configuration for the root volumes that are attached to streaming sessions.
         *
         * This parameter is only allowed when `sessionPersistenceMode` is `ACTIVATED`.
         */
        public var volumeConfiguration: aws.sdk.kotlin.services.nimble.model.VolumeConfiguration? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.nimble.model.StreamConfigurationCreate) : this() {
            this.automaticTerminationMode = x.automaticTerminationMode
            this.clipboardMode = x.clipboardMode
            this.ec2InstanceTypes = x.ec2InstanceTypes
            this.maxSessionLengthInMinutes = x.maxSessionLengthInMinutes
            this.maxStoppedSessionLengthInMinutes = x.maxStoppedSessionLengthInMinutes
            this.sessionBackup = x.sessionBackup
            this.sessionPersistenceMode = x.sessionPersistenceMode
            this.sessionStorage = x.sessionStorage
            this.streamingImageIds = x.streamingImageIds
            this.volumeConfiguration = x.volumeConfiguration
        }

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

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

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

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

        internal fun correctErrors(): Builder {
            if (clipboardMode == null) clipboardMode = StreamingClipboardMode.SdkUnknown("no value provided")
            if (ec2InstanceTypes == null) ec2InstanceTypes = emptyList()
            if (streamingImageIds == null) streamingImageIds = emptyList()
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy