commonMain.aws.sdk.kotlin.services.qldb.model.DescribeLedgerResponse.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of qldb-jvm Show documentation
Show all versions of qldb-jvm Show documentation
The AWS SDK for Kotlin client for QLDB
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.qldb.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant
public class DescribeLedgerResponse private constructor(builder: Builder) {
/**
* The Amazon Resource Name (ARN) for the ledger.
*/
public val arn: kotlin.String? = builder.arn
/**
* The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)
*/
public val creationDateTime: aws.smithy.kotlin.runtime.time.Instant? = builder.creationDateTime
/**
* Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, this feature is enabled (`true`) by default.
*
* If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the `UpdateLedger` operation to set this parameter to `false`.
*/
public val deletionProtection: kotlin.Boolean? = builder.deletionProtection
/**
* Information about the encryption of data at rest in the ledger. This includes the current status, the KMS key, and when the key became inaccessible (in the case of an error). If this parameter is undefined, the ledger uses an Amazon Web Services owned KMS key for encryption.
*/
public val encryptionDescription: aws.sdk.kotlin.services.qldb.model.LedgerEncryptionDescription? = builder.encryptionDescription
/**
* The name of the ledger.
*/
public val name: kotlin.String? = builder.name
/**
* The permissions mode of the ledger.
*/
public val permissionsMode: aws.sdk.kotlin.services.qldb.model.PermissionsMode? = builder.permissionsMode
/**
* The current status of the ledger.
*/
public val state: aws.sdk.kotlin.services.qldb.model.LedgerState? = builder.state
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.qldb.model.DescribeLedgerResponse = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("DescribeLedgerResponse(")
append("arn=$arn,")
append("creationDateTime=$creationDateTime,")
append("deletionProtection=$deletionProtection,")
append("encryptionDescription=$encryptionDescription,")
append("name=$name,")
append("permissionsMode=$permissionsMode,")
append("state=$state")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = arn?.hashCode() ?: 0
result = 31 * result + (creationDateTime?.hashCode() ?: 0)
result = 31 * result + (deletionProtection?.hashCode() ?: 0)
result = 31 * result + (encryptionDescription?.hashCode() ?: 0)
result = 31 * result + (name?.hashCode() ?: 0)
result = 31 * result + (permissionsMode?.hashCode() ?: 0)
result = 31 * result + (state?.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 DescribeLedgerResponse
if (arn != other.arn) return false
if (creationDateTime != other.creationDateTime) return false
if (deletionProtection != other.deletionProtection) return false
if (encryptionDescription != other.encryptionDescription) return false
if (name != other.name) return false
if (permissionsMode != other.permissionsMode) return false
if (state != other.state) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.qldb.model.DescribeLedgerResponse = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The Amazon Resource Name (ARN) for the ledger.
*/
public var arn: kotlin.String? = null
/**
* The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)
*/
public var creationDateTime: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* Specifies whether the ledger is protected from being deleted by any user. If not defined during ledger creation, this feature is enabled (`true`) by default.
*
* If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the `UpdateLedger` operation to set this parameter to `false`.
*/
public var deletionProtection: kotlin.Boolean? = null
/**
* Information about the encryption of data at rest in the ledger. This includes the current status, the KMS key, and when the key became inaccessible (in the case of an error). If this parameter is undefined, the ledger uses an Amazon Web Services owned KMS key for encryption.
*/
public var encryptionDescription: aws.sdk.kotlin.services.qldb.model.LedgerEncryptionDescription? = null
/**
* The name of the ledger.
*/
public var name: kotlin.String? = null
/**
* The permissions mode of the ledger.
*/
public var permissionsMode: aws.sdk.kotlin.services.qldb.model.PermissionsMode? = null
/**
* The current status of the ledger.
*/
public var state: aws.sdk.kotlin.services.qldb.model.LedgerState? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.qldb.model.DescribeLedgerResponse) : this() {
this.arn = x.arn
this.creationDateTime = x.creationDateTime
this.deletionProtection = x.deletionProtection
this.encryptionDescription = x.encryptionDescription
this.name = x.name
this.permissionsMode = x.permissionsMode
this.state = x.state
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.qldb.model.DescribeLedgerResponse = DescribeLedgerResponse(this)
/**
* construct an [aws.sdk.kotlin.services.qldb.model.LedgerEncryptionDescription] inside the given [block]
*/
public fun encryptionDescription(block: aws.sdk.kotlin.services.qldb.model.LedgerEncryptionDescription.Builder.() -> kotlin.Unit) {
this.encryptionDescription = aws.sdk.kotlin.services.qldb.model.LedgerEncryptionDescription.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}