commonMain.aws.sdk.kotlin.services.backup.model.CreateLegalHoldRequest.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.backup.model
import aws.smithy.kotlin.runtime.SdkDsl
public class CreateLegalHoldRequest private constructor(builder: Builder) {
/**
* This is the string description of the legal hold.
*/
public val description: kotlin.String? = builder.description
/**
* This is a user-chosen string used to distinguish between otherwise identical calls. Retrying a successful request with the same idempotency token results in a success message with no action taken.
*/
public val idempotencyToken: kotlin.String? = builder.idempotencyToken
/**
* 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
/**
* Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.
*/
public val tags: Map? = builder.tags
/**
* This is the string title of 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.CreateLegalHoldRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateLegalHoldRequest(")
append("description=$description,")
append("idempotencyToken=$idempotencyToken,")
append("recoveryPointSelection=$recoveryPointSelection,")
append("tags=*** Sensitive Data Redacted ***,")
append("title=$title")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = description?.hashCode() ?: 0
result = 31 * result + (idempotencyToken?.hashCode() ?: 0)
result = 31 * result + (recoveryPointSelection?.hashCode() ?: 0)
result = 31 * result + (tags?.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 CreateLegalHoldRequest
if (description != other.description) return false
if (idempotencyToken != other.idempotencyToken) return false
if (recoveryPointSelection != other.recoveryPointSelection) return false
if (tags != other.tags) return false
if (title != other.title) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.backup.model.CreateLegalHoldRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* This is the string description of the legal hold.
*/
public var description: kotlin.String? = null
/**
* This is a user-chosen string used to distinguish between otherwise identical calls. Retrying a successful request with the same idempotency token results in a success message with no action taken.
*/
public var idempotencyToken: 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
/**
* Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.
*/
public var tags: Map? = null
/**
* This is the string title of the legal hold.
*/
public var title: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.backup.model.CreateLegalHoldRequest) : this() {
this.description = x.description
this.idempotencyToken = x.idempotencyToken
this.recoveryPointSelection = x.recoveryPointSelection
this.tags = x.tags
this.title = x.title
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.backup.model.CreateLegalHoldRequest = CreateLegalHoldRequest(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
}
}
}