commonMain.aws.sdk.kotlin.services.amplifybackend.serde.CreateBackendAuthOAuthConfigDocumentDeserializer.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.CreateBackendAuthOAuthConfig
import aws.sdk.kotlin.services.amplifybackend.model.OAuthGrantType
import aws.sdk.kotlin.services.amplifybackend.model.OAuthScopesElement
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 deserializeCreateBackendAuthOAuthConfigDocument(deserializer: Deserializer): CreateBackendAuthOAuthConfig {
val builder = CreateBackendAuthOAuthConfig.Builder()
val DOMAINPREFIX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("domainPrefix"))
val OAUTHGRANTTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("oAuthGrantType"))
val OAUTHSCOPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("oAuthScopes"))
val REDIRECTSIGNINURIS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("redirectSignInURIs"))
val REDIRECTSIGNOUTURIS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("redirectSignOutURIs"))
val SOCIALPROVIDERSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("socialProviderSettings"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DOMAINPREFIX_DESCRIPTOR)
field(OAUTHGRANTTYPE_DESCRIPTOR)
field(OAUTHSCOPES_DESCRIPTOR)
field(REDIRECTSIGNINURIS_DESCRIPTOR)
field(REDIRECTSIGNOUTURIS_DESCRIPTOR)
field(SOCIALPROVIDERSETTINGS_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
DOMAINPREFIX_DESCRIPTOR.index -> builder.domainPrefix = deserializeString()
OAUTHGRANTTYPE_DESCRIPTOR.index -> builder.oAuthGrantType = deserializeString().let { OAuthGrantType.fromValue(it) }
OAUTHSCOPES_DESCRIPTOR.index -> builder.oAuthScopes =
deserializer.deserializeList(OAUTHSCOPES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { OAuthScopesElement.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
REDIRECTSIGNINURIS_DESCRIPTOR.index -> builder.redirectSignInUris =
deserializer.deserializeList(REDIRECTSIGNINURIS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
REDIRECTSIGNOUTURIS_DESCRIPTOR.index -> builder.redirectSignOutUris =
deserializer.deserializeList(REDIRECTSIGNOUTURIS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
SOCIALPROVIDERSETTINGS_DESCRIPTOR.index -> builder.socialProviderSettings = deserializeSocialProviderSettingsDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}