commonMain.aws.sdk.kotlin.services.neptune.serde.StorageQuotaExceededFaultDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neptune-jvm Show documentation
Show all versions of neptune-jvm Show documentation
The AWS SDK for Kotlin client for Neptune
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.neptune.serde
import aws.sdk.kotlin.services.neptune.model.StorageQuotaExceededFault
import aws.smithy.kotlin.runtime.http.HttpCall
import aws.smithy.kotlin.runtime.http.operation.HttpDeserializer
import aws.smithy.kotlin.runtime.http.response.HttpResponse
import aws.smithy.kotlin.runtime.operation.ExecutionContext
import aws.smithy.kotlin.runtime.serde.SdkFieldDescriptor
import aws.smithy.kotlin.runtime.serde.SdkObjectDescriptor
import aws.smithy.kotlin.runtime.serde.SerialKind
import aws.smithy.kotlin.runtime.serde.deserializeStruct
import aws.smithy.kotlin.runtime.serde.getOrDeserializeErr
import aws.smithy.kotlin.runtime.serde.xml.tryData
import aws.smithy.kotlin.runtime.serde.xml.xmlTagReader
internal class StorageQuotaExceededFaultDeserializer: HttpDeserializer.NonStreaming {
override fun deserialize(context: ExecutionContext, call: HttpCall, payload: ByteArray?): StorageQuotaExceededFault {
val response = call.response
val builder = StorageQuotaExceededFault.Builder()
if (payload != null) {
deserializeStorageQuotaExceededFaultError(builder, payload)
}
builder.correctErrors()
return builder.build()
}
}
internal fun deserializeStorageQuotaExceededFaultError(builder: StorageQuotaExceededFault.Builder, payload: ByteArray) {
val root = xmlTagReader(payload)
val errReader = unwrapWrappedXmlErrorResponse(root)
loop@while (true) {
val curr = errReader.nextTag() ?: break@loop
when (curr.tagName) {
// message com.amazonaws.neptune#StorageQuotaExceededFault$message
"message" -> builder.message = curr.tryData()
.getOrDeserializeErr { "expected (string: `com.amazonaws.neptune#ExceptionMessage`)" }
else -> {}
}
curr.drop()
}
}