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

commonMain.aws.sdk.kotlin.services.backup.model.CreateBackupSelectionRequest.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 CreateBackupSelectionRequest private constructor(builder: Builder) {
    /**
     * Uniquely identifies the backup plan to be associated with the selection of resources.
     */
    public val backupPlanId: kotlin.String? = builder.backupPlanId
    /**
     * Specifies the body of a request to assign a set of resources to a backup plan.
     */
    public val backupSelection: aws.sdk.kotlin.services.backup.model.BackupSelection? = builder.backupSelection
    /**
     * A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. 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.CreateBackupSelectionRequest = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("CreateBackupSelectionRequest(")
        append("backupPlanId=$backupPlanId,")
        append("backupSelection=$backupSelection,")
        append("creatorRequestId=$creatorRequestId")
        append(")")
    }

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

        if (backupPlanId != other.backupPlanId) return false
        if (backupSelection != other.backupSelection) return false
        if (creatorRequestId != other.creatorRequestId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Uniquely identifies the backup plan to be associated with the selection of resources.
         */
        public var backupPlanId: kotlin.String? = null
        /**
         * Specifies the body of a request to assign a set of resources to a backup plan.
         */
        public var backupSelection: aws.sdk.kotlin.services.backup.model.BackupSelection? = null
        /**
         * A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. 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.CreateBackupSelectionRequest) : this() {
            this.backupPlanId = x.backupPlanId
            this.backupSelection = x.backupSelection
            this.creatorRequestId = x.creatorRequestId
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy