commonMain.aws.sdk.kotlin.services.bedrockruntime.model.ConverseMetrics.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrockruntime-jvm Show documentation
Show all versions of bedrockruntime-jvm Show documentation
The AWS SDK for Kotlin client for Bedrock Runtime
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockruntime.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Metrics for a call to [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html).
*/
public class ConverseMetrics private constructor(builder: Builder) {
/**
* The latency of the call to `Converse`, in milliseconds.
*/
public val latencyMs: kotlin.Long = requireNotNull(builder.latencyMs) { "A non-null value must be provided for latencyMs" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockruntime.model.ConverseMetrics = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ConverseMetrics(")
append("latencyMs=$latencyMs")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = latencyMs.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 ConverseMetrics
if (latencyMs != other.latencyMs) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockruntime.model.ConverseMetrics = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The latency of the call to `Converse`, in milliseconds.
*/
public var latencyMs: kotlin.Long? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockruntime.model.ConverseMetrics) : this() {
this.latencyMs = x.latencyMs
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockruntime.model.ConverseMetrics = ConverseMetrics(this)
internal fun correctErrors(): Builder {
if (latencyMs == null) latencyMs = 0L
return this
}
}
}