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

commonMain.aws.sdk.kotlin.services.deadline.model.JobRunAsUser.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.deadline.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Identifies the user for a job.
 */
public class JobRunAsUser private constructor(builder: Builder) {
    /**
     * The user and group that the jobs in the queue run as.
     */
    public val posix: aws.sdk.kotlin.services.deadline.model.PosixUser? = builder.posix
    /**
     * Specifies whether the job should run using the queue's system user or if the job should run using the worker agent system user.
     */
    public val runAs: aws.sdk.kotlin.services.deadline.model.RunAs = requireNotNull(builder.runAs) { "A non-null value must be provided for runAs" }
    /**
     * Identifies a Microsoft Windows user.
     */
    public val windows: aws.sdk.kotlin.services.deadline.model.WindowsUser? = builder.windows

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

    override fun toString(): kotlin.String = buildString {
        append("JobRunAsUser(")
        append("posix=$posix,")
        append("runAs=$runAs,")
        append("windows=$windows")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = posix?.hashCode() ?: 0
        result = 31 * result + (runAs.hashCode())
        result = 31 * result + (windows?.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 JobRunAsUser

        if (posix != other.posix) return false
        if (runAs != other.runAs) return false
        if (windows != other.windows) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The user and group that the jobs in the queue run as.
         */
        public var posix: aws.sdk.kotlin.services.deadline.model.PosixUser? = null
        /**
         * Specifies whether the job should run using the queue's system user or if the job should run using the worker agent system user.
         */
        public var runAs: aws.sdk.kotlin.services.deadline.model.RunAs? = null
        /**
         * Identifies a Microsoft Windows user.
         */
        public var windows: aws.sdk.kotlin.services.deadline.model.WindowsUser? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.deadline.model.JobRunAsUser) : this() {
            this.posix = x.posix
            this.runAs = x.runAs
            this.windows = x.windows
        }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy