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

commonMain.aws.sdk.kotlin.services.cloudhsmv2.model.BackupRetentionPolicy.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudhsmv2.model



/**
 * A policy that defines the number of days to retain backups.
 */
public class BackupRetentionPolicy private constructor(builder: Builder) {
    /**
     * The type of backup retention policy. For the `DAYS` type, the value is the number of days to retain backups.
     */
    public val type: aws.sdk.kotlin.services.cloudhsmv2.model.BackupRetentionType? = builder.type
    /**
     * Use a value between 7 - 379.
     */
    public val value: kotlin.String? = builder.value

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

    override fun toString(): kotlin.String = buildString {
        append("BackupRetentionPolicy(")
        append("type=$type,")
        append("value=$value")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = type?.hashCode() ?: 0
        result = 31 * result + (value?.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 BackupRetentionPolicy

        if (type != other.type) return false
        if (value != other.value) return false

        return true
    }

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

    public class Builder {
        /**
         * The type of backup retention policy. For the `DAYS` type, the value is the number of days to retain backups.
         */
        public var type: aws.sdk.kotlin.services.cloudhsmv2.model.BackupRetentionType? = null
        /**
         * Use a value between 7 - 379.
         */
        public var value: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudhsmv2.model.BackupRetentionPolicy) : this() {
            this.type = x.type
            this.value = x.value
        }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy