
commonMain.aws.sdk.kotlin.services.s3.model.Metrics.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.s3.model
/**
* A container specifying replication metrics-related settings enabling replication metrics and events.
*/
public class Metrics private constructor(builder: Builder) {
/**
* A container specifying the time threshold for emitting the `s3:Replication:OperationMissedThreshold` event.
*/
public val eventThreshold: aws.sdk.kotlin.services.s3.model.ReplicationTimeValue? = builder.eventThreshold
/**
* Specifies whether the replication metrics are enabled.
*/
public val status: aws.sdk.kotlin.services.s3.model.MetricsStatus = requireNotNull(builder.status) { "A non-null value must be provided for status" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.s3.model.Metrics = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Metrics(")
append("eventThreshold=$eventThreshold,")
append("status=$status")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = eventThreshold?.hashCode() ?: 0
result = 31 * result + (status.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 Metrics
if (eventThreshold != other.eventThreshold) return false
if (status != other.status) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.s3.model.Metrics = Builder(this).apply(block).build()
public class Builder {
/**
* A container specifying the time threshold for emitting the `s3:Replication:OperationMissedThreshold` event.
*/
public var eventThreshold: aws.sdk.kotlin.services.s3.model.ReplicationTimeValue? = null
/**
* Specifies whether the replication metrics are enabled.
*/
public var status: aws.sdk.kotlin.services.s3.model.MetricsStatus? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.s3.model.Metrics) : this() {
this.eventThreshold = x.eventThreshold
this.status = x.status
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.s3.model.Metrics = Metrics(this)
/**
* construct an [aws.sdk.kotlin.services.s3.model.ReplicationTimeValue] inside the given [block]
*/
public fun eventThreshold(block: aws.sdk.kotlin.services.s3.model.ReplicationTimeValue.Builder.() -> kotlin.Unit) {
this.eventThreshold = aws.sdk.kotlin.services.s3.model.ReplicationTimeValue.invoke(block)
}
internal fun correctErrors(): Builder {
if (status == null) status = MetricsStatus.SdkUnknown("no value provided")
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy