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

commonMain.aws.sdk.kotlin.services.codepipeline.model.RuleDeclaration.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.codepipeline.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Represents information about the rule to be created for an associated condition. An example would be creating a new rule for an entry condition, such as a rule that checks for a test result before allowing the run to enter the deployment stage.
 */
public class RuleDeclaration private constructor(builder: Builder) {
    /**
     * The action configuration fields for the rule.
     */
    public val configuration: Map? = builder.configuration
    /**
     * The input artifacts fields for the rule, such as specifying an input file for the rule.
     */
    public val inputArtifacts: List? = builder.inputArtifacts
    /**
     * The name of the rule that is created for the condition, such as CheckAllResults.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The Region for the condition associated with the rule.
     */
    public val region: kotlin.String? = builder.region
    /**
     * The pipeline role ARN associated with the rule.
     */
    public val roleArn: kotlin.String? = builder.roleArn
    /**
     * The ID for the rule type, which is made up of the combined values for category, owner, provider, and version.
     */
    public val ruleTypeId: aws.sdk.kotlin.services.codepipeline.model.RuleTypeId? = builder.ruleTypeId
    /**
     * The action timeout for the rule.
     */
    public val timeoutInMinutes: kotlin.Int? = builder.timeoutInMinutes

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

    override fun toString(): kotlin.String = buildString {
        append("RuleDeclaration(")
        append("configuration=$configuration,")
        append("inputArtifacts=$inputArtifacts,")
        append("name=$name,")
        append("region=$region,")
        append("roleArn=$roleArn,")
        append("ruleTypeId=$ruleTypeId,")
        append("timeoutInMinutes=$timeoutInMinutes")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = configuration?.hashCode() ?: 0
        result = 31 * result + (inputArtifacts?.hashCode() ?: 0)
        result = 31 * result + (name.hashCode())
        result = 31 * result + (region?.hashCode() ?: 0)
        result = 31 * result + (roleArn?.hashCode() ?: 0)
        result = 31 * result + (ruleTypeId?.hashCode() ?: 0)
        result = 31 * result + (timeoutInMinutes ?: 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 RuleDeclaration

        if (configuration != other.configuration) return false
        if (inputArtifacts != other.inputArtifacts) return false
        if (name != other.name) return false
        if (region != other.region) return false
        if (roleArn != other.roleArn) return false
        if (ruleTypeId != other.ruleTypeId) return false
        if (timeoutInMinutes != other.timeoutInMinutes) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The action configuration fields for the rule.
         */
        public var configuration: Map? = null
        /**
         * The input artifacts fields for the rule, such as specifying an input file for the rule.
         */
        public var inputArtifacts: List? = null
        /**
         * The name of the rule that is created for the condition, such as CheckAllResults.
         */
        public var name: kotlin.String? = null
        /**
         * The Region for the condition associated with the rule.
         */
        public var region: kotlin.String? = null
        /**
         * The pipeline role ARN associated with the rule.
         */
        public var roleArn: kotlin.String? = null
        /**
         * The ID for the rule type, which is made up of the combined values for category, owner, provider, and version.
         */
        public var ruleTypeId: aws.sdk.kotlin.services.codepipeline.model.RuleTypeId? = null
        /**
         * The action timeout for the rule.
         */
        public var timeoutInMinutes: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codepipeline.model.RuleDeclaration) : this() {
            this.configuration = x.configuration
            this.inputArtifacts = x.inputArtifacts
            this.name = x.name
            this.region = x.region
            this.roleArn = x.roleArn
            this.ruleTypeId = x.ruleTypeId
            this.timeoutInMinutes = x.timeoutInMinutes
        }

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

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

        internal fun correctErrors(): Builder {
            if (name == null) name = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy