commonMain.aws.sdk.kotlin.services.bedrockruntime.model.GuardrailInvocationMetrics.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 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
/**
* The invocation metrics for the guardrail.
*/
public class GuardrailInvocationMetrics private constructor(builder: Builder) {
/**
* The coverage details for the guardrail invocation metrics.
*/
public val guardrailCoverage: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailCoverage? = builder.guardrailCoverage
/**
* The processing latency details for the guardrail invocation metrics.
*/
public val guardrailProcessingLatency: kotlin.Long? = builder.guardrailProcessingLatency
/**
* The usage details for the guardrail invocation metrics.
*/
public val usage: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailUsage? = builder.usage
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailInvocationMetrics = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("GuardrailInvocationMetrics(")
append("guardrailCoverage=$guardrailCoverage,")
append("guardrailProcessingLatency=$guardrailProcessingLatency,")
append("usage=$usage")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = guardrailCoverage?.hashCode() ?: 0
result = 31 * result + (guardrailProcessingLatency?.hashCode() ?: 0)
result = 31 * result + (usage?.hashCode() ?: 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 GuardrailInvocationMetrics
if (guardrailCoverage != other.guardrailCoverage) return false
if (guardrailProcessingLatency != other.guardrailProcessingLatency) return false
if (usage != other.usage) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailInvocationMetrics = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The coverage details for the guardrail invocation metrics.
*/
public var guardrailCoverage: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailCoverage? = null
/**
* The processing latency details for the guardrail invocation metrics.
*/
public var guardrailProcessingLatency: kotlin.Long? = null
/**
* The usage details for the guardrail invocation metrics.
*/
public var usage: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailUsage? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailInvocationMetrics) : this() {
this.guardrailCoverage = x.guardrailCoverage
this.guardrailProcessingLatency = x.guardrailProcessingLatency
this.usage = x.usage
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockruntime.model.GuardrailInvocationMetrics = GuardrailInvocationMetrics(this)
/**
* construct an [aws.sdk.kotlin.services.bedrockruntime.model.GuardrailCoverage] inside the given [block]
*/
public fun guardrailCoverage(block: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailCoverage.Builder.() -> kotlin.Unit) {
this.guardrailCoverage = aws.sdk.kotlin.services.bedrockruntime.model.GuardrailCoverage.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.bedrockruntime.model.GuardrailUsage] inside the given [block]
*/
public fun usage(block: aws.sdk.kotlin.services.bedrockruntime.model.GuardrailUsage.Builder.() -> kotlin.Unit) {
this.usage = aws.sdk.kotlin.services.bedrockruntime.model.GuardrailUsage.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy