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

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

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

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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Defines a condition under which a trigger fires.
 */
public class Condition private constructor(builder: Builder) {
    /**
     * The state of the crawler to which this condition applies.
     */
    public val crawlState: aws.sdk.kotlin.services.glue.model.CrawlState? = builder.crawlState
    /**
     * The name of the crawler to which this condition applies.
     */
    public val crawlerName: kotlin.String? = builder.crawlerName
    /**
     * The name of the job whose `JobRuns` this condition applies to, and on which this trigger waits.
     */
    public val jobName: kotlin.String? = builder.jobName
    /**
     * A logical operator.
     */
    public val logicalOperator: aws.sdk.kotlin.services.glue.model.LogicalOperator? = builder.logicalOperator
    /**
     * The condition state. Currently, the only job states that a trigger can listen for are `SUCCEEDED`, `STOPPED`, `FAILED`, and `TIMEOUT`. The only crawler states that a trigger can listen for are `SUCCEEDED`, `FAILED`, and `CANCELLED`.
     */
    public val state: aws.sdk.kotlin.services.glue.model.JobRunState? = builder.state

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

    override fun toString(): kotlin.String = buildString {
        append("Condition(")
        append("crawlState=$crawlState,")
        append("crawlerName=$crawlerName,")
        append("jobName=$jobName,")
        append("logicalOperator=$logicalOperator,")
        append("state=$state")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = crawlState?.hashCode() ?: 0
        result = 31 * result + (crawlerName?.hashCode() ?: 0)
        result = 31 * result + (jobName?.hashCode() ?: 0)
        result = 31 * result + (logicalOperator?.hashCode() ?: 0)
        result = 31 * result + (state?.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 Condition

        if (crawlState != other.crawlState) return false
        if (crawlerName != other.crawlerName) return false
        if (jobName != other.jobName) return false
        if (logicalOperator != other.logicalOperator) return false
        if (state != other.state) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The state of the crawler to which this condition applies.
         */
        public var crawlState: aws.sdk.kotlin.services.glue.model.CrawlState? = null
        /**
         * The name of the crawler to which this condition applies.
         */
        public var crawlerName: kotlin.String? = null
        /**
         * The name of the job whose `JobRuns` this condition applies to, and on which this trigger waits.
         */
        public var jobName: kotlin.String? = null
        /**
         * A logical operator.
         */
        public var logicalOperator: aws.sdk.kotlin.services.glue.model.LogicalOperator? = null
        /**
         * The condition state. Currently, the only job states that a trigger can listen for are `SUCCEEDED`, `STOPPED`, `FAILED`, and `TIMEOUT`. The only crawler states that a trigger can listen for are `SUCCEEDED`, `FAILED`, and `CANCELLED`.
         */
        public var state: aws.sdk.kotlin.services.glue.model.JobRunState? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.Condition) : this() {
            this.crawlState = x.crawlState
            this.crawlerName = x.crawlerName
            this.jobName = x.jobName
            this.logicalOperator = x.logicalOperator
            this.state = x.state
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy