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

commonMain.aws.sdk.kotlin.services.backup.model.CreateBackupPlanRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.backup.model

import aws.smithy.kotlin.runtime.SdkDsl

public class CreateBackupPlanRequest private constructor(builder: Builder) {
    /**
     * Specifies the body of a backup plan. Includes a `BackupPlanName` and one or more sets of `Rules`.
     */
    public val backupPlan: aws.sdk.kotlin.services.backup.model.BackupPlanInput? = builder.backupPlan
    /**
     * To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a key-value pair. The specified tags are assigned to all backups created with this plan.
     */
    public val backupPlanTags: Map? = builder.backupPlanTags
    /**
     * Identifies the request and allows failed requests to be retried without the risk of running the operation twice. If the request includes a `CreatorRequestId` that matches an existing backup plan, that plan is returned. This parameter is optional.
     *
     * If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.
     */
    public val creatorRequestId: kotlin.String? = builder.creatorRequestId

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

    override fun toString(): kotlin.String = buildString {
        append("CreateBackupPlanRequest(")
        append("backupPlan=$backupPlan,")
        append("backupPlanTags=*** Sensitive Data Redacted ***,")
        append("creatorRequestId=$creatorRequestId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = backupPlan?.hashCode() ?: 0
        result = 31 * result + (backupPlanTags?.hashCode() ?: 0)
        result = 31 * result + (creatorRequestId?.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 CreateBackupPlanRequest

        if (backupPlan != other.backupPlan) return false
        if (backupPlanTags != other.backupPlanTags) return false
        if (creatorRequestId != other.creatorRequestId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Specifies the body of a backup plan. Includes a `BackupPlanName` and one or more sets of `Rules`.
         */
        public var backupPlan: aws.sdk.kotlin.services.backup.model.BackupPlanInput? = null
        /**
         * To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a key-value pair. The specified tags are assigned to all backups created with this plan.
         */
        public var backupPlanTags: Map? = null
        /**
         * Identifies the request and allows failed requests to be retried without the risk of running the operation twice. If the request includes a `CreatorRequestId` that matches an existing backup plan, that plan is returned. This parameter is optional.
         *
         * If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.
         */
        public var creatorRequestId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.backup.model.CreateBackupPlanRequest) : this() {
            this.backupPlan = x.backupPlan
            this.backupPlanTags = x.backupPlanTags
            this.creatorRequestId = x.creatorRequestId
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy