commonMain.aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamMetadataEvent.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockruntime.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* A conversation stream metadata event.
*/
public class ConverseStreamMetadataEvent private constructor(builder: Builder) {
/**
* The metrics for the conversation stream metadata event.
*/
public val metrics: aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamMetrics? = builder.metrics
/**
* The trace object in the response from [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) that contains information about the guardrail behavior.
*/
public val trace: aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamTrace? = builder.trace
/**
* Usage information for the conversation stream event.
*/
public val usage: aws.sdk.kotlin.services.bedrockruntime.model.TokenUsage? = builder.usage
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamMetadataEvent = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ConverseStreamMetadataEvent(")
append("metrics=$metrics,")
append("trace=$trace,")
append("usage=$usage")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = metrics?.hashCode() ?: 0
result = 31 * result + (trace?.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 ConverseStreamMetadataEvent
if (metrics != other.metrics) return false
if (trace != other.trace) return false
if (usage != other.usage) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamMetadataEvent = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The metrics for the conversation stream metadata event.
*/
public var metrics: aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamMetrics? = null
/**
* The trace object in the response from [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) that contains information about the guardrail behavior.
*/
public var trace: aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamTrace? = null
/**
* Usage information for the conversation stream event.
*/
public var usage: aws.sdk.kotlin.services.bedrockruntime.model.TokenUsage? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamMetadataEvent) : this() {
this.metrics = x.metrics
this.trace = x.trace
this.usage = x.usage
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamMetadataEvent = ConverseStreamMetadataEvent(this)
/**
* construct an [aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamMetrics] inside the given [block]
*/
public fun metrics(block: aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamMetrics.Builder.() -> kotlin.Unit) {
this.metrics = aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamMetrics.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamTrace] inside the given [block]
*/
public fun trace(block: aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamTrace.Builder.() -> kotlin.Unit) {
this.trace = aws.sdk.kotlin.services.bedrockruntime.model.ConverseStreamTrace.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.bedrockruntime.model.TokenUsage] inside the given [block]
*/
public fun usage(block: aws.sdk.kotlin.services.bedrockruntime.model.TokenUsage.Builder.() -> kotlin.Unit) {
this.usage = aws.sdk.kotlin.services.bedrockruntime.model.TokenUsage.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy