commonMain.aws.sdk.kotlin.services.amplifybackend.serde.CreateBackendAuthUserPoolConfigDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of amplifybackend-jvm Show documentation
Show all versions of amplifybackend-jvm Show documentation
The AWS SDK for Kotlin client for AmplifyBackend
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.amplifybackend.serde
import aws.sdk.kotlin.services.amplifybackend.model.CreateBackendAuthUserPoolConfig
import aws.sdk.kotlin.services.amplifybackend.model.RequiredSignUpAttributesElement
import aws.sdk.kotlin.services.amplifybackend.model.SignInMethod
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 deserializeCreateBackendAuthUserPoolConfigDocument(deserializer: Deserializer): CreateBackendAuthUserPoolConfig {
val builder = CreateBackendAuthUserPoolConfig.Builder()
val FORGOTPASSWORD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("forgotPassword"))
val MFA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("mfa"))
val OAUTH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("oAuth"))
val PASSWORDPOLICY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("passwordPolicy"))
val REQUIREDSIGNUPATTRIBUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("requiredSignUpAttributes"))
val SIGNINMETHOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("signInMethod"))
val USERPOOLNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("userPoolName"))
val VERIFICATIONMESSAGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("verificationMessage"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(FORGOTPASSWORD_DESCRIPTOR)
field(MFA_DESCRIPTOR)
field(OAUTH_DESCRIPTOR)
field(PASSWORDPOLICY_DESCRIPTOR)
field(REQUIREDSIGNUPATTRIBUTES_DESCRIPTOR)
field(SIGNINMETHOD_DESCRIPTOR)
field(USERPOOLNAME_DESCRIPTOR)
field(VERIFICATIONMESSAGE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
FORGOTPASSWORD_DESCRIPTOR.index -> builder.forgotPassword = deserializeCreateBackendAuthForgotPasswordConfigDocument(deserializer)
MFA_DESCRIPTOR.index -> builder.mfa = deserializeCreateBackendAuthMfaConfigDocument(deserializer)
OAUTH_DESCRIPTOR.index -> builder.oAuth = deserializeCreateBackendAuthOAuthConfigDocument(deserializer)
PASSWORDPOLICY_DESCRIPTOR.index -> builder.passwordPolicy = deserializeCreateBackendAuthPasswordPolicyConfigDocument(deserializer)
REQUIREDSIGNUPATTRIBUTES_DESCRIPTOR.index -> builder.requiredSignUpAttributes =
deserializer.deserializeList(REQUIREDSIGNUPATTRIBUTES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { RequiredSignUpAttributesElement.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
SIGNINMETHOD_DESCRIPTOR.index -> builder.signInMethod = deserializeString().let { SignInMethod.fromValue(it) }
USERPOOLNAME_DESCRIPTOR.index -> builder.userPoolName = deserializeString()
VERIFICATIONMESSAGE_DESCRIPTOR.index -> builder.verificationMessage = deserializeCreateBackendAuthVerificationMessageConfigDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}