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

commonMain.aws.sdk.kotlin.services.dlm.model.CrossRegionCopyDeprecateRule.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.dlm.model



/**
 * **[AMI policies only]** Specifies an AMI deprecation rule for cross-Region AMI copies created by an AMI policy.
 */
public class CrossRegionCopyDeprecateRule private constructor(builder: Builder) {
    /**
     * The period after which to deprecate the cross-Region AMI copies. The period must be less than or equal to the cross-Region AMI copy retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.
     */
    public val interval: kotlin.Int = builder.interval
    /**
     * The unit of time in which to measure the **Interval**. For example, to deprecate a cross-Region AMI copy after 3 months, specify `Interval=3` and `IntervalUnit=MONTHS`.
     */
    public val intervalUnit: aws.sdk.kotlin.services.dlm.model.RetentionIntervalUnitValues? = builder.intervalUnit

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

    override fun toString(): kotlin.String = buildString {
        append("CrossRegionCopyDeprecateRule(")
        append("interval=$interval,")
        append("intervalUnit=$intervalUnit)")
    }

    override fun hashCode(): kotlin.Int {
        var result = interval
        result = 31 * result + (intervalUnit?.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 CrossRegionCopyDeprecateRule

        if (interval != other.interval) return false
        if (intervalUnit != other.intervalUnit) return false

        return true
    }

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

    public class Builder {
        /**
         * The period after which to deprecate the cross-Region AMI copies. The period must be less than or equal to the cross-Region AMI copy retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.
         */
        public var interval: kotlin.Int = 0
        /**
         * The unit of time in which to measure the **Interval**. For example, to deprecate a cross-Region AMI copy after 3 months, specify `Interval=3` and `IntervalUnit=MONTHS`.
         */
        public var intervalUnit: aws.sdk.kotlin.services.dlm.model.RetentionIntervalUnitValues? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.dlm.model.CrossRegionCopyDeprecateRule) : this() {
            this.interval = x.interval
            this.intervalUnit = x.intervalUnit
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.dlm.model.CrossRegionCopyDeprecateRule = CrossRegionCopyDeprecateRule(this)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy