commonMain.aws.sdk.kotlin.services.configservice.model.RetentionConfiguration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of configservice-jvm Show documentation
Show all versions of configservice-jvm Show documentation
The AWS SDK for Kotlin client for Config Service
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.configservice.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* An object with the name of the retention configuration and the retention period in days. The object stores the configuration for data retention in Config.
*/
public class RetentionConfiguration private constructor(builder: Builder) {
/**
* The name of the retention configuration object.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* Number of days Config stores your historical information.
*
* Currently, only applicable to the configuration item history.
*/
public val retentionPeriodInDays: kotlin.Int = requireNotNull(builder.retentionPeriodInDays) { "A non-null value must be provided for retentionPeriodInDays" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.configservice.model.RetentionConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("RetentionConfiguration(")
append("name=$name,")
append("retentionPeriodInDays=$retentionPeriodInDays")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = name.hashCode()
result = 31 * result + (retentionPeriodInDays)
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 RetentionConfiguration
if (name != other.name) return false
if (retentionPeriodInDays != other.retentionPeriodInDays) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.configservice.model.RetentionConfiguration = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The name of the retention configuration object.
*/
public var name: kotlin.String? = null
/**
* Number of days Config stores your historical information.
*
* Currently, only applicable to the configuration item history.
*/
public var retentionPeriodInDays: kotlin.Int? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.configservice.model.RetentionConfiguration) : this() {
this.name = x.name
this.retentionPeriodInDays = x.retentionPeriodInDays
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.configservice.model.RetentionConfiguration = RetentionConfiguration(this)
internal fun correctErrors(): Builder {
if (name == null) name = ""
if (retentionPeriodInDays == null) retentionPeriodInDays = 0
return this
}
}
}