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

commonMain.aws.sdk.kotlin.services.route53recoverycontrolconfig.model.CreateSafetyRuleRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.route53recoverycontrolconfig.model



/**
 * The request body that you include when you create a safety rule.
 */
public class CreateSafetyRuleRequest private constructor(builder: Builder) {
    /**
     * The assertion rule requested.
     */
    public val assertionRule: aws.sdk.kotlin.services.route53recoverycontrolconfig.model.NewAssertionRule? = builder.assertionRule
    /**
     * A unique, case-sensitive string of up to 64 ASCII characters. To make an idempotent API request with an action, specify a client token in the request.
     */
    public val clientToken: kotlin.String? = builder.clientToken
    /**
     * The gating rule requested.
     */
    public val gatingRule: aws.sdk.kotlin.services.route53recoverycontrolconfig.model.NewGatingRule? = builder.gatingRule
    /**
     * The tags associated with the safety rule.
     */
    public val tags: Map? = builder.tags

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

    override fun toString(): kotlin.String = buildString {
        append("CreateSafetyRuleRequest(")
        append("assertionRule=$assertionRule,")
        append("clientToken=$clientToken,")
        append("gatingRule=$gatingRule,")
        append("tags=$tags")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = assertionRule?.hashCode() ?: 0
        result = 31 * result + (clientToken?.hashCode() ?: 0)
        result = 31 * result + (gatingRule?.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 CreateSafetyRuleRequest

        if (assertionRule != other.assertionRule) return false
        if (clientToken != other.clientToken) return false
        if (gatingRule != other.gatingRule) return false
        if (tags != other.tags) return false

        return true
    }

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

    public class Builder {
        /**
         * The assertion rule requested.
         */
        public var assertionRule: aws.sdk.kotlin.services.route53recoverycontrolconfig.model.NewAssertionRule? = null
        /**
         * A unique, case-sensitive string of up to 64 ASCII characters. To make an idempotent API request with an action, specify a client token in the request.
         */
        public var clientToken: kotlin.String? = null
        /**
         * The gating rule requested.
         */
        public var gatingRule: aws.sdk.kotlin.services.route53recoverycontrolconfig.model.NewGatingRule? = null
        /**
         * The tags associated with the safety rule.
         */
        public var tags: Map? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.route53recoverycontrolconfig.model.CreateSafetyRuleRequest) : this() {
            this.assertionRule = x.assertionRule
            this.clientToken = x.clientToken
            this.gatingRule = x.gatingRule
            this.tags = x.tags
        }

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy