commonMain.aws.sdk.kotlin.services.appflow.serde.AuthenticationConfigDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appflow-jvm Show documentation
Show all versions of appflow-jvm Show documentation
The AWS SDK for Kotlin client for Appflow
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appflow.serde
import aws.sdk.kotlin.services.appflow.model.AuthenticationConfig
import aws.sdk.kotlin.services.appflow.model.CustomAuthConfig
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
internal fun deserializeAuthenticationConfigDocument(deserializer: Deserializer): AuthenticationConfig {
val builder = AuthenticationConfig.Builder()
val CUSTOMAUTHCONFIGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("customAuthConfigs"))
val ISAPIKEYAUTHSUPPORTED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isApiKeyAuthSupported"))
val ISBASICAUTHSUPPORTED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isBasicAuthSupported"))
val ISCUSTOMAUTHSUPPORTED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isCustomAuthSupported"))
val ISOAUTH2SUPPORTED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("isOAuth2Supported"))
val OAUTH2DEFAULTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("oAuth2Defaults"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CUSTOMAUTHCONFIGS_DESCRIPTOR)
field(ISAPIKEYAUTHSUPPORTED_DESCRIPTOR)
field(ISBASICAUTHSUPPORTED_DESCRIPTOR)
field(ISCUSTOMAUTHSUPPORTED_DESCRIPTOR)
field(ISOAUTH2SUPPORTED_DESCRIPTOR)
field(OAUTH2DEFAULTS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
CUSTOMAUTHCONFIGS_DESCRIPTOR.index -> builder.customAuthConfigs =
deserializer.deserializeList(CUSTOMAUTHCONFIGS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeCustomAuthConfigDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
ISAPIKEYAUTHSUPPORTED_DESCRIPTOR.index -> builder.isApiKeyAuthSupported = deserializeBoolean()
ISBASICAUTHSUPPORTED_DESCRIPTOR.index -> builder.isBasicAuthSupported = deserializeBoolean()
ISCUSTOMAUTHSUPPORTED_DESCRIPTOR.index -> builder.isCustomAuthSupported = deserializeBoolean()
ISOAUTH2SUPPORTED_DESCRIPTOR.index -> builder.isOAuth2Supported = deserializeBoolean()
OAUTH2DEFAULTS_DESCRIPTOR.index -> builder.oAuth2Defaults = deserializeOAuth2DefaultsDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}