commonMain.aws.sdk.kotlin.services.codedeploy.serde.ApplicationInfoDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codedeploy-jvm Show documentation
Show all versions of codedeploy-jvm Show documentation
The AWS SDK for Kotlin client for CodeDeploy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codedeploy.serde
import aws.sdk.kotlin.services.codedeploy.model.ApplicationInfo
import aws.sdk.kotlin.services.codedeploy.model.ComputePlatform
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
internal fun deserializeApplicationInfoDocument(deserializer: Deserializer): ApplicationInfo {
val builder = ApplicationInfo.Builder()
val APPLICATIONID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("applicationId"))
val APPLICATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("applicationName"))
val COMPUTEPLATFORM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("computePlatform"))
val CREATETIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("createTime"))
val GITHUBACCOUNTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("gitHubAccountName"))
val LINKEDTOGITHUB_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("linkedToGitHub"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(APPLICATIONID_DESCRIPTOR)
field(APPLICATIONNAME_DESCRIPTOR)
field(COMPUTEPLATFORM_DESCRIPTOR)
field(CREATETIME_DESCRIPTOR)
field(GITHUBACCOUNTNAME_DESCRIPTOR)
field(LINKEDTOGITHUB_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
APPLICATIONID_DESCRIPTOR.index -> builder.applicationId = deserializeString()
APPLICATIONNAME_DESCRIPTOR.index -> builder.applicationName = deserializeString()
COMPUTEPLATFORM_DESCRIPTOR.index -> builder.computePlatform = deserializeString().let { ComputePlatform.fromValue(it) }
CREATETIME_DESCRIPTOR.index -> builder.createTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
GITHUBACCOUNTNAME_DESCRIPTOR.index -> builder.gitHubAccountName = deserializeString()
LINKEDTOGITHUB_DESCRIPTOR.index -> builder.linkedToGitHub = deserializeBoolean()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}