commonMain.aws.sdk.kotlin.services.codestarconnections.serde.RevisionDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codestarconnections-jvm Show documentation
Show all versions of codestarconnections-jvm Show documentation
The AWS SDK for Kotlin client for CodeStar connections
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codestarconnections.serde
import aws.sdk.kotlin.services.codestarconnections.model.ProviderType
import aws.sdk.kotlin.services.codestarconnections.model.Revision
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 deserializeRevisionDocument(deserializer: Deserializer): Revision {
val builder = Revision.Builder()
val BRANCH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Branch"))
val DIRECTORY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Directory"))
val OWNERID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OwnerId"))
val PROVIDERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ProviderType"))
val REPOSITORYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RepositoryName"))
val SHA_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Sha"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(BRANCH_DESCRIPTOR)
field(DIRECTORY_DESCRIPTOR)
field(OWNERID_DESCRIPTOR)
field(PROVIDERTYPE_DESCRIPTOR)
field(REPOSITORYNAME_DESCRIPTOR)
field(SHA_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
BRANCH_DESCRIPTOR.index -> builder.branch = deserializeString()
DIRECTORY_DESCRIPTOR.index -> builder.directory = deserializeString()
OWNERID_DESCRIPTOR.index -> builder.ownerId = deserializeString()
PROVIDERTYPE_DESCRIPTOR.index -> builder.providerType = deserializeString().let { ProviderType.fromValue(it) }
REPOSITORYNAME_DESCRIPTOR.index -> builder.repositoryName = deserializeString()
SHA_DESCRIPTOR.index -> builder.sha = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy