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

commonMain.aws.sdk.kotlin.services.dataexchange.model.CreateJobRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.dataexchange.model

import aws.smithy.kotlin.runtime.SdkDsl

public class CreateJobRequest private constructor(builder: Builder) {
    /**
     * The details for the CreateJob request.
     */
    public val details: aws.sdk.kotlin.services.dataexchange.model.RequestDetails? = builder.details
    /**
     * The type of job to be created.
     */
    public val type: aws.sdk.kotlin.services.dataexchange.model.Type = requireNotNull(builder.type) { "A non-null value must be provided for type" }

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

    override fun toString(): kotlin.String = buildString {
        append("CreateJobRequest(")
        append("details=$details,")
        append("type=$type")
        append(")")
    }

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

        if (details != other.details) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The details for the CreateJob request.
         */
        public var details: aws.sdk.kotlin.services.dataexchange.model.RequestDetails? = null
        /**
         * The type of job to be created.
         */
        public var type: aws.sdk.kotlin.services.dataexchange.model.Type? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.dataexchange.model.CreateJobRequest) : this() {
            this.details = x.details
            this.type = x.type
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy