commonMain.aws.sdk.kotlin.services.cloudwatchlogs.model.PutRetentionPolicyRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudwatchlogs-jvm Show documentation
Show all versions of cloudwatchlogs-jvm Show documentation
The AWS SDK for Kotlin client for CloudWatch Logs
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudwatchlogs.model
import aws.smithy.kotlin.runtime.SdkDsl
public class PutRetentionPolicyRequest private constructor(builder: Builder) {
/**
* The name of the log group.
*/
public val logGroupName: kotlin.String? = builder.logGroupName
/**
* The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.
*
* To set a log group so that its log events do not expire, use [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html).
*/
public val retentionInDays: kotlin.Int? = builder.retentionInDays
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudwatchlogs.model.PutRetentionPolicyRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PutRetentionPolicyRequest(")
append("logGroupName=$logGroupName,")
append("retentionInDays=$retentionInDays")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = logGroupName?.hashCode() ?: 0
result = 31 * result + (retentionInDays ?: 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 PutRetentionPolicyRequest
if (logGroupName != other.logGroupName) return false
if (retentionInDays != other.retentionInDays) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudwatchlogs.model.PutRetentionPolicyRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The name of the log group.
*/
public var logGroupName: kotlin.String? = null
/**
* The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.
*
* To set a log group so that its log events do not expire, use [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html).
*/
public var retentionInDays: kotlin.Int? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudwatchlogs.model.PutRetentionPolicyRequest) : this() {
this.logGroupName = x.logGroupName
this.retentionInDays = x.retentionInDays
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudwatchlogs.model.PutRetentionPolicyRequest = PutRetentionPolicyRequest(this)
internal fun correctErrors(): Builder {
return this
}
}
}