commonMain.aws.sdk.kotlin.services.appsync.serde.ResolverDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appsync-jvm Show documentation
Show all versions of appsync-jvm Show documentation
The AWS SDK for Kotlin client for AppSync
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appsync.serde
import aws.sdk.kotlin.services.appsync.model.Resolver
import aws.sdk.kotlin.services.appsync.model.ResolverKind
import aws.sdk.kotlin.services.appsync.model.ResolverLevelMetricsConfig
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
internal fun deserializeResolverDocument(deserializer: Deserializer): Resolver {
val builder = Resolver.Builder()
val CACHINGCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("cachingConfig"))
val CODE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("code"))
val DATASOURCENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("dataSourceName"))
val FIELDNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("fieldName"))
val KIND_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("kind"))
val MAXBATCHSIZE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("maxBatchSize"))
val METRICSCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("metricsConfig"))
val PIPELINECONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("pipelineConfig"))
val REQUESTMAPPINGTEMPLATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("requestMappingTemplate"))
val RESOLVERARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("resolverArn"))
val RESPONSEMAPPINGTEMPLATE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("responseMappingTemplate"))
val RUNTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("runtime"))
val SYNCCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("syncConfig"))
val TYPENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("typeName"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CACHINGCONFIG_DESCRIPTOR)
field(CODE_DESCRIPTOR)
field(DATASOURCENAME_DESCRIPTOR)
field(FIELDNAME_DESCRIPTOR)
field(KIND_DESCRIPTOR)
field(MAXBATCHSIZE_DESCRIPTOR)
field(METRICSCONFIG_DESCRIPTOR)
field(PIPELINECONFIG_DESCRIPTOR)
field(REQUESTMAPPINGTEMPLATE_DESCRIPTOR)
field(RESOLVERARN_DESCRIPTOR)
field(RESPONSEMAPPINGTEMPLATE_DESCRIPTOR)
field(RUNTIME_DESCRIPTOR)
field(SYNCCONFIG_DESCRIPTOR)
field(TYPENAME_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CACHINGCONFIG_DESCRIPTOR.index -> builder.cachingConfig = deserializeCachingConfigDocument(deserializer)
CODE_DESCRIPTOR.index -> builder.code = deserializeString()
DATASOURCENAME_DESCRIPTOR.index -> builder.dataSourceName = deserializeString()
FIELDNAME_DESCRIPTOR.index -> builder.fieldName = deserializeString()
KIND_DESCRIPTOR.index -> builder.kind = deserializeString().let { ResolverKind.fromValue(it) }
MAXBATCHSIZE_DESCRIPTOR.index -> builder.maxBatchSize = deserializeInt()
METRICSCONFIG_DESCRIPTOR.index -> builder.metricsConfig = deserializeString().let { ResolverLevelMetricsConfig.fromValue(it) }
PIPELINECONFIG_DESCRIPTOR.index -> builder.pipelineConfig = deserializePipelineConfigDocument(deserializer)
REQUESTMAPPINGTEMPLATE_DESCRIPTOR.index -> builder.requestMappingTemplate = deserializeString()
RESOLVERARN_DESCRIPTOR.index -> builder.resolverArn = deserializeString()
RESPONSEMAPPINGTEMPLATE_DESCRIPTOR.index -> builder.responseMappingTemplate = deserializeString()
RUNTIME_DESCRIPTOR.index -> builder.runtime = deserializeAppSyncRuntimeDocument(deserializer)
SYNCCONFIG_DESCRIPTOR.index -> builder.syncConfig = deserializeSyncConfigDocument(deserializer)
TYPENAME_DESCRIPTOR.index -> builder.typeName = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}