
commonMain.aws.sdk.kotlin.services.emrcontainers.model.ContainerLogRotationConfiguration.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.emrcontainers.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* The settings for container log rotation.
*/
public class ContainerLogRotationConfiguration private constructor(builder: Builder) {
/**
* The number of files to keep in container after rotation.
*/
public val maxFilesToKeep: kotlin.Int = requireNotNull(builder.maxFilesToKeep) { "A non-null value must be provided for maxFilesToKeep" }
/**
* The file size at which to rotate logs. Minimum of 2KB, Maximum of 2GB.
*/
public val rotationSize: kotlin.String = requireNotNull(builder.rotationSize) { "A non-null value must be provided for rotationSize" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.emrcontainers.model.ContainerLogRotationConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ContainerLogRotationConfiguration(")
append("maxFilesToKeep=$maxFilesToKeep,")
append("rotationSize=$rotationSize")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = maxFilesToKeep
result = 31 * result + (rotationSize.hashCode())
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 ContainerLogRotationConfiguration
if (maxFilesToKeep != other.maxFilesToKeep) return false
if (rotationSize != other.rotationSize) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.emrcontainers.model.ContainerLogRotationConfiguration = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The number of files to keep in container after rotation.
*/
public var maxFilesToKeep: kotlin.Int? = null
/**
* The file size at which to rotate logs. Minimum of 2KB, Maximum of 2GB.
*/
public var rotationSize: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.emrcontainers.model.ContainerLogRotationConfiguration) : this() {
this.maxFilesToKeep = x.maxFilesToKeep
this.rotationSize = x.rotationSize
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.emrcontainers.model.ContainerLogRotationConfiguration = ContainerLogRotationConfiguration(this)
internal fun correctErrors(): Builder {
if (maxFilesToKeep == null) maxFilesToKeep = 0
if (rotationSize == null) rotationSize = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy