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

commonMain.aws.sdk.kotlin.services.batch.model.CreateSchedulingPolicyRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.batch.model



/**
 * Contains the parameters for `CreateSchedulingPolicy`.
 */
public class CreateSchedulingPolicyRequest private constructor(builder: Builder) {
    /**
     * The fair share policy of the scheduling policy.
     */
    public val fairsharePolicy: aws.sdk.kotlin.services.batch.model.FairsharePolicy? = builder.fairsharePolicy
    /**
     * The name of the scheduling policy. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
     */
    public val name: kotlin.String? = builder.name
    /**
     * The tags that you apply to the scheduling policy to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see [Tagging Amazon Web Services Resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in *Amazon Web Services General Reference*.
     *
     * These tags can be updated or removed using the [TagResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html) and [UntagResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html) API operations.
     */
    public val tags: Map? = builder.tags

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

    override fun toString(): kotlin.String = buildString {
        append("CreateSchedulingPolicyRequest(")
        append("fairsharePolicy=$fairsharePolicy,")
        append("name=$name,")
        append("tags=$tags")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = fairsharePolicy?.hashCode() ?: 0
        result = 31 * result + (name?.hashCode() ?: 0)
        result = 31 * result + (tags?.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 CreateSchedulingPolicyRequest

        if (fairsharePolicy != other.fairsharePolicy) return false
        if (name != other.name) return false
        if (tags != other.tags) return false

        return true
    }

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

    public class Builder {
        /**
         * The fair share policy of the scheduling policy.
         */
        public var fairsharePolicy: aws.sdk.kotlin.services.batch.model.FairsharePolicy? = null
        /**
         * The name of the scheduling policy. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
         */
        public var name: kotlin.String? = null
        /**
         * The tags that you apply to the scheduling policy to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see [Tagging Amazon Web Services Resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in *Amazon Web Services General Reference*.
         *
         * These tags can be updated or removed using the [TagResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html) and [UntagResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html) API operations.
         */
        public var tags: Map? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.batch.model.CreateSchedulingPolicyRequest) : this() {
            this.fairsharePolicy = x.fairsharePolicy
            this.name = x.name
            this.tags = x.tags
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy