commonMain.aws.sdk.kotlin.services.signer.serde.PermissionDocumentDeserializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.signer.serde
import aws.sdk.kotlin.services.signer.model.Permission
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 deserializePermissionDocument(deserializer: Deserializer): Permission {
val builder = Permission.Builder()
val ACTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("action"))
val PRINCIPAL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("principal"))
val PROFILEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("profileVersion"))
val STATEMENTID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("statementId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACTION_DESCRIPTOR)
field(PRINCIPAL_DESCRIPTOR)
field(PROFILEVERSION_DESCRIPTOR)
field(STATEMENTID_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ACTION_DESCRIPTOR.index -> builder.action = deserializeString()
PRINCIPAL_DESCRIPTOR.index -> builder.principal = deserializeString()
PROFILEVERSION_DESCRIPTOR.index -> builder.profileVersion = deserializeString()
STATEMENTID_DESCRIPTOR.index -> builder.statementId = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}