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

commonMain.aws.sdk.kotlin.services.ssm.model.PatchRule.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.ssm.model



/**
 * Defines an approval rule for a patch baseline.
 */
public class PatchRule private constructor(builder: Builder) {
    /**
     * The number of days after the release date of each patch matched by the rule that the patch is marked as approved in the patch baseline. For example, a value of `7` means that patches are approved seven days after they are released. Not supported on Debian Server or Ubuntu Server.
     */
    public val approveAfterDays: kotlin.Int? = builder.approveAfterDays
    /**
     * The cutoff date for auto approval of released patches. Any patches released on or before this date are installed automatically. Not supported on Debian Server or Ubuntu Server.
     *
     * Enter dates in the format `YYYY-MM-DD`. For example, `2021-12-31`.
     */
    public val approveUntilDate: kotlin.String? = builder.approveUntilDate
    /**
     * A compliance severity level for all approved patches in a patch baseline.
     */
    public val complianceLevel: aws.sdk.kotlin.services.ssm.model.PatchComplianceLevel? = builder.complianceLevel
    /**
     * For managed nodes identified by the approval rule filters, enables a patch baseline to apply non-security updates available in the specified repository. The default value is `false`. Applies to Linux managed nodes only.
     */
    public val enableNonSecurity: kotlin.Boolean? = builder.enableNonSecurity
    /**
     * The patch filter group that defines the criteria for the rule.
     */
    public val patchFilterGroup: aws.sdk.kotlin.services.ssm.model.PatchFilterGroup? = builder.patchFilterGroup

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

    override fun toString(): kotlin.String = buildString {
        append("PatchRule(")
        append("approveAfterDays=$approveAfterDays,")
        append("approveUntilDate=$approveUntilDate,")
        append("complianceLevel=$complianceLevel,")
        append("enableNonSecurity=$enableNonSecurity,")
        append("patchFilterGroup=$patchFilterGroup")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = approveAfterDays ?: 0
        result = 31 * result + (approveUntilDate?.hashCode() ?: 0)
        result = 31 * result + (complianceLevel?.hashCode() ?: 0)
        result = 31 * result + (enableNonSecurity?.hashCode() ?: 0)
        result = 31 * result + (patchFilterGroup?.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 PatchRule

        if (approveAfterDays != other.approveAfterDays) return false
        if (approveUntilDate != other.approveUntilDate) return false
        if (complianceLevel != other.complianceLevel) return false
        if (enableNonSecurity != other.enableNonSecurity) return false
        if (patchFilterGroup != other.patchFilterGroup) return false

        return true
    }

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

    public class Builder {
        /**
         * The number of days after the release date of each patch matched by the rule that the patch is marked as approved in the patch baseline. For example, a value of `7` means that patches are approved seven days after they are released. Not supported on Debian Server or Ubuntu Server.
         */
        public var approveAfterDays: kotlin.Int? = null
        /**
         * The cutoff date for auto approval of released patches. Any patches released on or before this date are installed automatically. Not supported on Debian Server or Ubuntu Server.
         *
         * Enter dates in the format `YYYY-MM-DD`. For example, `2021-12-31`.
         */
        public var approveUntilDate: kotlin.String? = null
        /**
         * A compliance severity level for all approved patches in a patch baseline.
         */
        public var complianceLevel: aws.sdk.kotlin.services.ssm.model.PatchComplianceLevel? = null
        /**
         * For managed nodes identified by the approval rule filters, enables a patch baseline to apply non-security updates available in the specified repository. The default value is `false`. Applies to Linux managed nodes only.
         */
        public var enableNonSecurity: kotlin.Boolean? = null
        /**
         * The patch filter group that defines the criteria for the rule.
         */
        public var patchFilterGroup: aws.sdk.kotlin.services.ssm.model.PatchFilterGroup? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssm.model.PatchRule) : this() {
            this.approveAfterDays = x.approveAfterDays
            this.approveUntilDate = x.approveUntilDate
            this.complianceLevel = x.complianceLevel
            this.enableNonSecurity = x.enableNonSecurity
            this.patchFilterGroup = x.patchFilterGroup
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy