commonMain.aws.sdk.kotlin.services.appsync.serde.GraphqlApiDocumentDeserializer.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.AdditionalAuthenticationProvider
import aws.sdk.kotlin.services.appsync.model.AuthenticationType
import aws.sdk.kotlin.services.appsync.model.GraphQlApiIntrospectionConfig
import aws.sdk.kotlin.services.appsync.model.GraphQlApiType
import aws.sdk.kotlin.services.appsync.model.GraphQlApiVisibility
import aws.sdk.kotlin.services.appsync.model.GraphqlApi
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 kotlin.collections.mutableListOf
import kotlin.collections.mutableMapOf
internal fun deserializeGraphqlApiDocument(deserializer: Deserializer): GraphqlApi {
val builder = GraphqlApi.Builder()
val ADDITIONALAUTHENTICATIONPROVIDERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("additionalAuthenticationProviders"))
val APIID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("apiId"))
val APITYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("apiType"))
val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
val AUTHENTICATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("authenticationType"))
val DNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("dns"))
val ENHANCEDMETRICSCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("enhancedMetricsConfig"))
val INTROSPECTIONCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("introspectionConfig"))
val LAMBDAAUTHORIZERCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("lambdaAuthorizerConfig"))
val LOGCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("logConfig"))
val MERGEDAPIEXECUTIONROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("mergedApiExecutionRoleArn"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
val OPENIDCONNECTCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("openIDConnectConfig"))
val OWNER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("owner"))
val OWNERCONTACT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ownerContact"))
val QUERYDEPTHLIMIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("queryDepthLimit"))
val RESOLVERCOUNTLIMIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("resolverCountLimit"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("tags"))
val URIS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("uris"))
val USERPOOLCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("userPoolConfig"))
val VISIBILITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("visibility"))
val WAFWEBACLARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("wafWebAclArn"))
val XRAYENABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("xrayEnabled"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ADDITIONALAUTHENTICATIONPROVIDERS_DESCRIPTOR)
field(APIID_DESCRIPTOR)
field(APITYPE_DESCRIPTOR)
field(ARN_DESCRIPTOR)
field(AUTHENTICATIONTYPE_DESCRIPTOR)
field(DNS_DESCRIPTOR)
field(ENHANCEDMETRICSCONFIG_DESCRIPTOR)
field(INTROSPECTIONCONFIG_DESCRIPTOR)
field(LAMBDAAUTHORIZERCONFIG_DESCRIPTOR)
field(LOGCONFIG_DESCRIPTOR)
field(MERGEDAPIEXECUTIONROLEARN_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(OPENIDCONNECTCONFIG_DESCRIPTOR)
field(OWNER_DESCRIPTOR)
field(OWNERCONTACT_DESCRIPTOR)
field(QUERYDEPTHLIMIT_DESCRIPTOR)
field(RESOLVERCOUNTLIMIT_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(URIS_DESCRIPTOR)
field(USERPOOLCONFIG_DESCRIPTOR)
field(VISIBILITY_DESCRIPTOR)
field(WAFWEBACLARN_DESCRIPTOR)
field(XRAYENABLED_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ADDITIONALAUTHENTICATIONPROVIDERS_DESCRIPTOR.index -> builder.additionalAuthenticationProviders =
deserializer.deserializeList(ADDITIONALAUTHENTICATIONPROVIDERS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeAdditionalAuthenticationProviderDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
APIID_DESCRIPTOR.index -> builder.apiId = deserializeString()
APITYPE_DESCRIPTOR.index -> builder.apiType = deserializeString().let { GraphQlApiType.fromValue(it) }
ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
AUTHENTICATIONTYPE_DESCRIPTOR.index -> builder.authenticationType = deserializeString().let { AuthenticationType.fromValue(it) }
DNS_DESCRIPTOR.index -> builder.dns =
deserializer.deserializeMap(DNS_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
ENHANCEDMETRICSCONFIG_DESCRIPTOR.index -> builder.enhancedMetricsConfig = deserializeEnhancedMetricsConfigDocument(deserializer)
INTROSPECTIONCONFIG_DESCRIPTOR.index -> builder.introspectionConfig = deserializeString().let { GraphQlApiIntrospectionConfig.fromValue(it) }
LAMBDAAUTHORIZERCONFIG_DESCRIPTOR.index -> builder.lambdaAuthorizerConfig = deserializeLambdaAuthorizerConfigDocument(deserializer)
LOGCONFIG_DESCRIPTOR.index -> builder.logConfig = deserializeLogConfigDocument(deserializer)
MERGEDAPIEXECUTIONROLEARN_DESCRIPTOR.index -> builder.mergedApiExecutionRoleArn = deserializeString()
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
OPENIDCONNECTCONFIG_DESCRIPTOR.index -> builder.openIdConnectConfig = deserializeOpenIdConnectConfigDocument(deserializer)
OWNER_DESCRIPTOR.index -> builder.owner = deserializeString()
OWNERCONTACT_DESCRIPTOR.index -> builder.ownerContact = deserializeString()
QUERYDEPTHLIMIT_DESCRIPTOR.index -> builder.queryDepthLimit = deserializeInt()
RESOLVERCOUNTLIMIT_DESCRIPTOR.index -> builder.resolverCountLimit = deserializeInt()
TAGS_DESCRIPTOR.index -> builder.tags =
deserializer.deserializeMap(TAGS_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
URIS_DESCRIPTOR.index -> builder.uris =
deserializer.deserializeMap(URIS_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
USERPOOLCONFIG_DESCRIPTOR.index -> builder.userPoolConfig = deserializeUserPoolConfigDocument(deserializer)
VISIBILITY_DESCRIPTOR.index -> builder.visibility = deserializeString().let { GraphQlApiVisibility.fromValue(it) }
WAFWEBACLARN_DESCRIPTOR.index -> builder.wafWebAclArn = deserializeString()
XRAYENABLED_DESCRIPTOR.index -> builder.xrayEnabled = deserializeBoolean()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}