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

commonMain.aws.sdk.kotlin.services.backup.model.CreateLegalHoldResponse.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
import aws.smithy.kotlin.runtime.time.Instant

public class CreateLegalHoldResponse private constructor(builder: Builder) {
    /**
     * Time in number format when legal hold was created.
     */
    public val creationDate: aws.smithy.kotlin.runtime.time.Instant? = builder.creationDate
    /**
     * This is the returned string description of the legal hold.
     */
    public val description: kotlin.String? = builder.description
    /**
     * This is the ARN (Amazon Resource Number) of the created legal hold.
     */
    public val legalHoldArn: kotlin.String? = builder.legalHoldArn
    /**
     * Legal hold ID returned for the specified legal hold on a recovery point.
     */
    public val legalHoldId: kotlin.String? = builder.legalHoldId
    /**
     * This specifies criteria to assign a set of resources, such as resource types or backup vaults.
     */
    public val recoveryPointSelection: aws.sdk.kotlin.services.backup.model.RecoveryPointSelection? = builder.recoveryPointSelection
    /**
     * This displays the status of the legal hold returned after creating the legal hold. Statuses can be `ACTIVE`, `PENDING`, `CANCELED`, `CANCELING`, or `FAILED`.
     */
    public val status: aws.sdk.kotlin.services.backup.model.LegalHoldStatus? = builder.status
    /**
     * This is the string title of the legal hold returned after creating the legal hold.
     */
    public val title: kotlin.String? = builder.title

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

    override fun toString(): kotlin.String = buildString {
        append("CreateLegalHoldResponse(")
        append("creationDate=$creationDate,")
        append("description=$description,")
        append("legalHoldArn=$legalHoldArn,")
        append("legalHoldId=$legalHoldId,")
        append("recoveryPointSelection=$recoveryPointSelection,")
        append("status=$status,")
        append("title=$title")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = creationDate?.hashCode() ?: 0
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (legalHoldArn?.hashCode() ?: 0)
        result = 31 * result + (legalHoldId?.hashCode() ?: 0)
        result = 31 * result + (recoveryPointSelection?.hashCode() ?: 0)
        result = 31 * result + (status?.hashCode() ?: 0)
        result = 31 * result + (title?.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 CreateLegalHoldResponse

        if (creationDate != other.creationDate) return false
        if (description != other.description) return false
        if (legalHoldArn != other.legalHoldArn) return false
        if (legalHoldId != other.legalHoldId) return false
        if (recoveryPointSelection != other.recoveryPointSelection) return false
        if (status != other.status) return false
        if (title != other.title) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Time in number format when legal hold was created.
         */
        public var creationDate: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * This is the returned string description of the legal hold.
         */
        public var description: kotlin.String? = null
        /**
         * This is the ARN (Amazon Resource Number) of the created legal hold.
         */
        public var legalHoldArn: kotlin.String? = null
        /**
         * Legal hold ID returned for the specified legal hold on a recovery point.
         */
        public var legalHoldId: kotlin.String? = null
        /**
         * This specifies criteria to assign a set of resources, such as resource types or backup vaults.
         */
        public var recoveryPointSelection: aws.sdk.kotlin.services.backup.model.RecoveryPointSelection? = null
        /**
         * This displays the status of the legal hold returned after creating the legal hold. Statuses can be `ACTIVE`, `PENDING`, `CANCELED`, `CANCELING`, or `FAILED`.
         */
        public var status: aws.sdk.kotlin.services.backup.model.LegalHoldStatus? = null
        /**
         * This is the string title of the legal hold returned after creating the legal hold.
         */
        public var title: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.backup.model.CreateLegalHoldResponse) : this() {
            this.creationDate = x.creationDate
            this.description = x.description
            this.legalHoldArn = x.legalHoldArn
            this.legalHoldId = x.legalHoldId
            this.recoveryPointSelection = x.recoveryPointSelection
            this.status = x.status
            this.title = x.title
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy