All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.kafka.transform.ClusterOperationV2SummaryDocumentDeserializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.kafka.transform

import aws.sdk.kotlin.services.kafka.model.ClusterOperationV2Summary
import aws.sdk.kotlin.services.kafka.model.ClusterType
import aws.smithy.kotlin.runtime.serde.Deserializer
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.asSdkSerializable
import aws.smithy.kotlin.runtime.serde.deserializeList
import aws.smithy.kotlin.runtime.serde.deserializeMap
import aws.smithy.kotlin.runtime.serde.deserializeStruct
import aws.smithy.kotlin.runtime.serde.field
import aws.smithy.kotlin.runtime.serde.json.JsonDeserializer
import aws.smithy.kotlin.runtime.serde.json.JsonSerialName
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import aws.smithy.kotlin.runtime.time.Instant

internal fun deserializeClusterOperationV2SummaryDocument(deserializer: Deserializer): ClusterOperationV2Summary {
    val builder = ClusterOperationV2Summary.Builder()
    val CLUSTERARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("clusterArn"))
    val CLUSTERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("clusterType"))
    val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("endTime"))
    val OPERATIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("operationArn"))
    val OPERATIONSTATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("operationState"))
    val OPERATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("operationType"))
    val STARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("startTime"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(CLUSTERARN_DESCRIPTOR)
        field(CLUSTERTYPE_DESCRIPTOR)
        field(ENDTIME_DESCRIPTOR)
        field(OPERATIONARN_DESCRIPTOR)
        field(OPERATIONSTATE_DESCRIPTOR)
        field(OPERATIONTYPE_DESCRIPTOR)
        field(STARTTIME_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                CLUSTERARN_DESCRIPTOR.index -> builder.clusterArn = deserializeString()
                CLUSTERTYPE_DESCRIPTOR.index -> builder.clusterType = deserializeString().let { ClusterType.fromValue(it) }
                ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeString().let { Instant.fromIso8601(it) }
                OPERATIONARN_DESCRIPTOR.index -> builder.operationArn = deserializeString()
                OPERATIONSTATE_DESCRIPTOR.index -> builder.operationState = deserializeString()
                OPERATIONTYPE_DESCRIPTOR.index -> builder.operationType = deserializeString()
                STARTTIME_DESCRIPTOR.index -> builder.startTime = deserializeString().let { Instant.fromIso8601(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy