commonMain.aws.sdk.kotlin.services.codebuild.serde.BuildBatchDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codebuild-jvm Show documentation
Show all versions of codebuild-jvm Show documentation
The AWS SDK for Kotlin client for CodeBuild
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codebuild.serde
import aws.sdk.kotlin.services.codebuild.model.BuildArtifacts
import aws.sdk.kotlin.services.codebuild.model.BuildBatch
import aws.sdk.kotlin.services.codebuild.model.BuildBatchPhase
import aws.sdk.kotlin.services.codebuild.model.BuildGroup
import aws.sdk.kotlin.services.codebuild.model.ProjectFileSystemLocation
import aws.sdk.kotlin.services.codebuild.model.ProjectSource
import aws.sdk.kotlin.services.codebuild.model.ProjectSourceVersion
import aws.sdk.kotlin.services.codebuild.model.StatusType
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
import kotlin.collections.mutableListOf
internal fun deserializeBuildBatchDocument(deserializer: Deserializer): BuildBatch {
val builder = BuildBatch.Builder()
val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
val ARTIFACTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("artifacts"))
val BUILDBATCHCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("buildBatchConfig"))
val BUILDBATCHNUMBER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("buildBatchNumber"))
val BUILDBATCHSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("buildBatchStatus"))
val BUILDGROUPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("buildGroups"))
val BUILDTIMEOUTINMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("buildTimeoutInMinutes"))
val CACHE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("cache"))
val COMPLETE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("complete"))
val CURRENTPHASE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("currentPhase"))
val DEBUGSESSIONENABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("debugSessionEnabled"))
val ENCRYPTIONKEY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("encryptionKey"))
val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("endTime"))
val ENVIRONMENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("environment"))
val FILESYSTEMLOCATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("fileSystemLocations"))
val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("id"))
val INITIATOR_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("initiator"))
val LOGCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("logConfig"))
val PHASES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("phases"))
val PROJECTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("projectName"))
val QUEUEDTIMEOUTINMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("queuedTimeoutInMinutes"))
val RESOLVEDSOURCEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("resolvedSourceVersion"))
val SECONDARYARTIFACTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("secondaryArtifacts"))
val SECONDARYSOURCEVERSIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("secondarySourceVersions"))
val SECONDARYSOURCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("secondarySources"))
val SERVICEROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("serviceRole"))
val SOURCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("source"))
val SOURCEVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("sourceVersion"))
val STARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("startTime"))
val VPCCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("vpcConfig"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ARN_DESCRIPTOR)
field(ARTIFACTS_DESCRIPTOR)
field(BUILDBATCHCONFIG_DESCRIPTOR)
field(BUILDBATCHNUMBER_DESCRIPTOR)
field(BUILDBATCHSTATUS_DESCRIPTOR)
field(BUILDGROUPS_DESCRIPTOR)
field(BUILDTIMEOUTINMINUTES_DESCRIPTOR)
field(CACHE_DESCRIPTOR)
field(COMPLETE_DESCRIPTOR)
field(CURRENTPHASE_DESCRIPTOR)
field(DEBUGSESSIONENABLED_DESCRIPTOR)
field(ENCRYPTIONKEY_DESCRIPTOR)
field(ENDTIME_DESCRIPTOR)
field(ENVIRONMENT_DESCRIPTOR)
field(FILESYSTEMLOCATIONS_DESCRIPTOR)
field(ID_DESCRIPTOR)
field(INITIATOR_DESCRIPTOR)
field(LOGCONFIG_DESCRIPTOR)
field(PHASES_DESCRIPTOR)
field(PROJECTNAME_DESCRIPTOR)
field(QUEUEDTIMEOUTINMINUTES_DESCRIPTOR)
field(RESOLVEDSOURCEVERSION_DESCRIPTOR)
field(SECONDARYARTIFACTS_DESCRIPTOR)
field(SECONDARYSOURCEVERSIONS_DESCRIPTOR)
field(SECONDARYSOURCES_DESCRIPTOR)
field(SERVICEROLE_DESCRIPTOR)
field(SOURCE_DESCRIPTOR)
field(SOURCEVERSION_DESCRIPTOR)
field(STARTTIME_DESCRIPTOR)
field(VPCCONFIG_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
ARTIFACTS_DESCRIPTOR.index -> builder.artifacts = deserializeBuildArtifactsDocument(deserializer)
BUILDBATCHCONFIG_DESCRIPTOR.index -> builder.buildBatchConfig = deserializeProjectBuildBatchConfigDocument(deserializer)
BUILDBATCHNUMBER_DESCRIPTOR.index -> builder.buildBatchNumber = deserializeLong()
BUILDBATCHSTATUS_DESCRIPTOR.index -> builder.buildBatchStatus = deserializeString().let { StatusType.fromValue(it) }
BUILDGROUPS_DESCRIPTOR.index -> builder.buildGroups =
deserializer.deserializeList(BUILDGROUPS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeBuildGroupDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
BUILDTIMEOUTINMINUTES_DESCRIPTOR.index -> builder.buildTimeoutInMinutes = deserializeInt()
CACHE_DESCRIPTOR.index -> builder.cache = deserializeProjectCacheDocument(deserializer)
COMPLETE_DESCRIPTOR.index -> builder.complete = deserializeBoolean()
CURRENTPHASE_DESCRIPTOR.index -> builder.currentPhase = deserializeString()
DEBUGSESSIONENABLED_DESCRIPTOR.index -> builder.debugSessionEnabled = deserializeBoolean()
ENCRYPTIONKEY_DESCRIPTOR.index -> builder.encryptionKey = deserializeString()
ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
ENVIRONMENT_DESCRIPTOR.index -> builder.environment = deserializeProjectEnvironmentDocument(deserializer)
FILESYSTEMLOCATIONS_DESCRIPTOR.index -> builder.fileSystemLocations =
deserializer.deserializeList(FILESYSTEMLOCATIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeProjectFileSystemLocationDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
ID_DESCRIPTOR.index -> builder.id = deserializeString()
INITIATOR_DESCRIPTOR.index -> builder.initiator = deserializeString()
LOGCONFIG_DESCRIPTOR.index -> builder.logConfig = deserializeLogsConfigDocument(deserializer)
PHASES_DESCRIPTOR.index -> builder.phases =
deserializer.deserializeList(PHASES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeBuildBatchPhaseDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
PROJECTNAME_DESCRIPTOR.index -> builder.projectName = deserializeString()
QUEUEDTIMEOUTINMINUTES_DESCRIPTOR.index -> builder.queuedTimeoutInMinutes = deserializeInt()
RESOLVEDSOURCEVERSION_DESCRIPTOR.index -> builder.resolvedSourceVersion = deserializeString()
SECONDARYARTIFACTS_DESCRIPTOR.index -> builder.secondaryArtifacts =
deserializer.deserializeList(SECONDARYARTIFACTS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeBuildArtifactsDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
SECONDARYSOURCEVERSIONS_DESCRIPTOR.index -> builder.secondarySourceVersions =
deserializer.deserializeList(SECONDARYSOURCEVERSIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeProjectSourceVersionDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
SECONDARYSOURCES_DESCRIPTOR.index -> builder.secondarySources =
deserializer.deserializeList(SECONDARYSOURCES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeProjectSourceDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
SERVICEROLE_DESCRIPTOR.index -> builder.serviceRole = deserializeString()
SOURCE_DESCRIPTOR.index -> builder.source = deserializeProjectSourceDocument(deserializer)
SOURCEVERSION_DESCRIPTOR.index -> builder.sourceVersion = deserializeString()
STARTTIME_DESCRIPTOR.index -> builder.startTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
VPCCONFIG_DESCRIPTOR.index -> builder.vpcConfig = deserializeVpcConfigDocument(deserializer)
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}