commonMain.aws.sdk.kotlin.services.bedrockruntime.model.ModelStreamErrorException.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
import aws.smithy.kotlin.runtime.ServiceErrorMetadata
/**
* An error occurred while streaming the response. Retry your request.
*/
public class ModelStreamErrorException private constructor(builder: Builder) : BedrockRuntimeException(builder.message) {
/**
* The original message.
*/
public val originalMessage: kotlin.String? = builder.originalMessage
/**
* The original status code.
*/
public val originalStatusCode: kotlin.Int? = builder.originalStatusCode
init {
sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Client
}
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.bedrockruntime.model.ModelStreamErrorException = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ModelStreamErrorException(")
append("message=$message,")
append("originalMessage=$originalMessage,")
append("originalStatusCode=$originalStatusCode")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = message?.hashCode() ?: 0
result = 31 * result + (originalMessage?.hashCode() ?: 0)
result = 31 * result + (originalStatusCode ?: 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 ModelStreamErrorException
if (message != other.message) return false
if (originalMessage != other.originalMessage) return false
if (originalStatusCode != other.originalStatusCode) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.bedrockruntime.model.ModelStreamErrorException = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
public var message: kotlin.String? = null
/**
* The original message.
*/
public var originalMessage: kotlin.String? = null
/**
* The original status code.
*/
public var originalStatusCode: kotlin.Int? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.bedrockruntime.model.ModelStreamErrorException) : this() {
this.message = x.message
this.originalMessage = x.originalMessage
this.originalStatusCode = x.originalStatusCode
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.bedrockruntime.model.ModelStreamErrorException = ModelStreamErrorException(this)
internal fun correctErrors(): Builder {
return this
}
}
}