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

commonMain.aws.sdk.kotlin.services.glue.model.Session.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.glue.model

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant

/**
 * The period in which a remote Spark runtime environment is running.
 */
public class Session private constructor(builder: Builder) {
    /**
     * The command object.See SessionCommand.
     */
    public val command: aws.sdk.kotlin.services.glue.model.SessionCommand? = builder.command
    /**
     * The date and time that this session is completed.
     */
    public val completedOn: aws.smithy.kotlin.runtime.time.Instant? = builder.completedOn
    /**
     * The number of connections used for the session.
     */
    public val connections: aws.sdk.kotlin.services.glue.model.ConnectionsList? = builder.connections
    /**
     * The time and date when the session was created.
     */
    public val createdOn: aws.smithy.kotlin.runtime.time.Instant? = builder.createdOn
    /**
     * A map array of key-value pairs. Max is 75 pairs.
     */
    public val defaultArguments: Map? = builder.defaultArguments
    /**
     * The description of the session.
     */
    public val description: kotlin.String? = builder.description
    /**
     * The DPUs consumed by the session (formula: ExecutionTime * MaxCapacity).
     */
    public val dpuSeconds: kotlin.Double? = builder.dpuSeconds
    /**
     * The error message displayed during the session.
     */
    public val errorMessage: kotlin.String? = builder.errorMessage
    /**
     * The total time the session ran for.
     */
    public val executionTime: kotlin.Double? = builder.executionTime
    /**
     * The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be greater than 2.0.
     */
    public val glueVersion: kotlin.String? = builder.glueVersion
    /**
     * The ID of the session.
     */
    public val id: kotlin.String? = builder.id
    /**
     * The number of minutes when idle before the session times out.
     */
    public val idleTimeout: kotlin.Int? = builder.idleTimeout
    /**
     * The number of Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory.
     */
    public val maxCapacity: kotlin.Double? = builder.maxCapacity
    /**
     * The number of workers of a defined `WorkerType` to use for the session.
     */
    public val numberOfWorkers: kotlin.Int? = builder.numberOfWorkers
    /**
     * The name of an Glue usage profile associated with the session.
     */
    public val profileName: kotlin.String? = builder.profileName
    /**
     * The code execution progress of the session.
     */
    public val progress: kotlin.Double = builder.progress
    /**
     * The name or Amazon Resource Name (ARN) of the IAM role associated with the Session.
     */
    public val role: kotlin.String? = builder.role
    /**
     * The name of the SecurityConfiguration structure to be used with the session.
     */
    public val securityConfiguration: kotlin.String? = builder.securityConfiguration
    /**
     * The session status.
     */
    public val status: aws.sdk.kotlin.services.glue.model.SessionStatus? = builder.status
    /**
     * The type of predefined worker that is allocated when a session runs. Accepts a value of `G.1X`, `G.2X`, `G.4X`, or `G.8X` for Spark sessions. Accepts the value `Z.2X` for Ray sessions.
     */
    public val workerType: aws.sdk.kotlin.services.glue.model.WorkerType? = builder.workerType

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

    override fun toString(): kotlin.String = buildString {
        append("Session(")
        append("command=$command,")
        append("completedOn=$completedOn,")
        append("connections=$connections,")
        append("createdOn=$createdOn,")
        append("defaultArguments=$defaultArguments,")
        append("description=$description,")
        append("dpuSeconds=$dpuSeconds,")
        append("errorMessage=$errorMessage,")
        append("executionTime=$executionTime,")
        append("glueVersion=$glueVersion,")
        append("id=$id,")
        append("idleTimeout=$idleTimeout,")
        append("maxCapacity=$maxCapacity,")
        append("numberOfWorkers=$numberOfWorkers,")
        append("profileName=$profileName,")
        append("progress=$progress,")
        append("role=$role,")
        append("securityConfiguration=$securityConfiguration,")
        append("status=$status,")
        append("workerType=$workerType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = command?.hashCode() ?: 0
        result = 31 * result + (completedOn?.hashCode() ?: 0)
        result = 31 * result + (connections?.hashCode() ?: 0)
        result = 31 * result + (createdOn?.hashCode() ?: 0)
        result = 31 * result + (defaultArguments?.hashCode() ?: 0)
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (dpuSeconds?.hashCode() ?: 0)
        result = 31 * result + (errorMessage?.hashCode() ?: 0)
        result = 31 * result + (executionTime?.hashCode() ?: 0)
        result = 31 * result + (glueVersion?.hashCode() ?: 0)
        result = 31 * result + (id?.hashCode() ?: 0)
        result = 31 * result + (idleTimeout ?: 0)
        result = 31 * result + (maxCapacity?.hashCode() ?: 0)
        result = 31 * result + (numberOfWorkers ?: 0)
        result = 31 * result + (profileName?.hashCode() ?: 0)
        result = 31 * result + (progress.hashCode())
        result = 31 * result + (role?.hashCode() ?: 0)
        result = 31 * result + (securityConfiguration?.hashCode() ?: 0)
        result = 31 * result + (status?.hashCode() ?: 0)
        result = 31 * result + (workerType?.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 Session

        if (command != other.command) return false
        if (completedOn != other.completedOn) return false
        if (connections != other.connections) return false
        if (createdOn != other.createdOn) return false
        if (defaultArguments != other.defaultArguments) return false
        if (description != other.description) return false
        if (!(dpuSeconds?.equals(other.dpuSeconds) ?: (other.dpuSeconds == null))) return false
        if (errorMessage != other.errorMessage) return false
        if (!(executionTime?.equals(other.executionTime) ?: (other.executionTime == null))) return false
        if (glueVersion != other.glueVersion) return false
        if (id != other.id) return false
        if (idleTimeout != other.idleTimeout) return false
        if (!(maxCapacity?.equals(other.maxCapacity) ?: (other.maxCapacity == null))) return false
        if (numberOfWorkers != other.numberOfWorkers) return false
        if (profileName != other.profileName) return false
        if (!(progress?.equals(other.progress) ?: (other.progress == null))) return false
        if (role != other.role) return false
        if (securityConfiguration != other.securityConfiguration) return false
        if (status != other.status) return false
        if (workerType != other.workerType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The command object.See SessionCommand.
         */
        public var command: aws.sdk.kotlin.services.glue.model.SessionCommand? = null
        /**
         * The date and time that this session is completed.
         */
        public var completedOn: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The number of connections used for the session.
         */
        public var connections: aws.sdk.kotlin.services.glue.model.ConnectionsList? = null
        /**
         * The time and date when the session was created.
         */
        public var createdOn: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * A map array of key-value pairs. Max is 75 pairs.
         */
        public var defaultArguments: Map? = null
        /**
         * The description of the session.
         */
        public var description: kotlin.String? = null
        /**
         * The DPUs consumed by the session (formula: ExecutionTime * MaxCapacity).
         */
        public var dpuSeconds: kotlin.Double? = null
        /**
         * The error message displayed during the session.
         */
        public var errorMessage: kotlin.String? = null
        /**
         * The total time the session ran for.
         */
        public var executionTime: kotlin.Double? = null
        /**
         * The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be greater than 2.0.
         */
        public var glueVersion: kotlin.String? = null
        /**
         * The ID of the session.
         */
        public var id: kotlin.String? = null
        /**
         * The number of minutes when idle before the session times out.
         */
        public var idleTimeout: kotlin.Int? = null
        /**
         * The number of Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory.
         */
        public var maxCapacity: kotlin.Double? = null
        /**
         * The number of workers of a defined `WorkerType` to use for the session.
         */
        public var numberOfWorkers: kotlin.Int? = null
        /**
         * The name of an Glue usage profile associated with the session.
         */
        public var profileName: kotlin.String? = null
        /**
         * The code execution progress of the session.
         */
        public var progress: kotlin.Double = 0.0
        /**
         * The name or Amazon Resource Name (ARN) of the IAM role associated with the Session.
         */
        public var role: kotlin.String? = null
        /**
         * The name of the SecurityConfiguration structure to be used with the session.
         */
        public var securityConfiguration: kotlin.String? = null
        /**
         * The session status.
         */
        public var status: aws.sdk.kotlin.services.glue.model.SessionStatus? = null
        /**
         * The type of predefined worker that is allocated when a session runs. Accepts a value of `G.1X`, `G.2X`, `G.4X`, or `G.8X` for Spark sessions. Accepts the value `Z.2X` for Ray sessions.
         */
        public var workerType: aws.sdk.kotlin.services.glue.model.WorkerType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.Session) : this() {
            this.command = x.command
            this.completedOn = x.completedOn
            this.connections = x.connections
            this.createdOn = x.createdOn
            this.defaultArguments = x.defaultArguments
            this.description = x.description
            this.dpuSeconds = x.dpuSeconds
            this.errorMessage = x.errorMessage
            this.executionTime = x.executionTime
            this.glueVersion = x.glueVersion
            this.id = x.id
            this.idleTimeout = x.idleTimeout
            this.maxCapacity = x.maxCapacity
            this.numberOfWorkers = x.numberOfWorkers
            this.profileName = x.profileName
            this.progress = x.progress
            this.role = x.role
            this.securityConfiguration = x.securityConfiguration
            this.status = x.status
            this.workerType = x.workerType
        }

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

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

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy