All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.codebuild.serde.BuildDocumentDeserializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.77
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.codebuild.serde

import aws.sdk.kotlin.services.codebuild.model.Build
import aws.sdk.kotlin.services.codebuild.model.BuildArtifacts
import aws.sdk.kotlin.services.codebuild.model.BuildPhase
import aws.sdk.kotlin.services.codebuild.model.ExportedEnvironmentVariable
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 deserializeBuildDocument(deserializer: Deserializer): Build {
    val builder = Build.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val ARTIFACTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("artifacts"))
    val AUTORETRYCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("autoRetryConfig"))
    val BUILDBATCHARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("buildBatchArn"))
    val BUILDCOMPLETE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("buildComplete"))
    val BUILDNUMBER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("buildNumber"))
    val BUILDSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("buildStatus"))
    val CACHE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("cache"))
    val CURRENTPHASE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("currentPhase"))
    val DEBUGSESSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("debugSession"))
    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 EXPORTEDENVIRONMENTVARIABLES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("exportedEnvironmentVariables"))
    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 LOGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("logs"))
    val NETWORKINTERFACE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("networkInterface"))
    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 REPORTARNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("reportArns"))
    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 TIMEOUTINMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("timeoutInMinutes"))
    val VPCCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("vpcConfig"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(ARTIFACTS_DESCRIPTOR)
        field(AUTORETRYCONFIG_DESCRIPTOR)
        field(BUILDBATCHARN_DESCRIPTOR)
        field(BUILDCOMPLETE_DESCRIPTOR)
        field(BUILDNUMBER_DESCRIPTOR)
        field(BUILDSTATUS_DESCRIPTOR)
        field(CACHE_DESCRIPTOR)
        field(CURRENTPHASE_DESCRIPTOR)
        field(DEBUGSESSION_DESCRIPTOR)
        field(ENCRYPTIONKEY_DESCRIPTOR)
        field(ENDTIME_DESCRIPTOR)
        field(ENVIRONMENT_DESCRIPTOR)
        field(EXPORTEDENVIRONMENTVARIABLES_DESCRIPTOR)
        field(FILESYSTEMLOCATIONS_DESCRIPTOR)
        field(ID_DESCRIPTOR)
        field(INITIATOR_DESCRIPTOR)
        field(LOGS_DESCRIPTOR)
        field(NETWORKINTERFACE_DESCRIPTOR)
        field(PHASES_DESCRIPTOR)
        field(PROJECTNAME_DESCRIPTOR)
        field(QUEUEDTIMEOUTINMINUTES_DESCRIPTOR)
        field(REPORTARNS_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(TIMEOUTINMINUTES_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)
                AUTORETRYCONFIG_DESCRIPTOR.index -> builder.autoRetryConfig = deserializeAutoRetryConfigDocument(deserializer)
                BUILDBATCHARN_DESCRIPTOR.index -> builder.buildBatchArn = deserializeString()
                BUILDCOMPLETE_DESCRIPTOR.index -> builder.buildComplete = deserializeBoolean()
                BUILDNUMBER_DESCRIPTOR.index -> builder.buildNumber = deserializeLong()
                BUILDSTATUS_DESCRIPTOR.index -> builder.buildStatus = deserializeString().let { StatusType.fromValue(it) }
                CACHE_DESCRIPTOR.index -> builder.cache = deserializeProjectCacheDocument(deserializer)
                CURRENTPHASE_DESCRIPTOR.index -> builder.currentPhase = deserializeString()
                DEBUGSESSION_DESCRIPTOR.index -> builder.debugSession = deserializeDebugSessionDocument(deserializer)
                ENCRYPTIONKEY_DESCRIPTOR.index -> builder.encryptionKey = deserializeString()
                ENDTIME_DESCRIPTOR.index -> builder.endTime = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                ENVIRONMENT_DESCRIPTOR.index -> builder.environment = deserializeProjectEnvironmentDocument(deserializer)
                EXPORTEDENVIRONMENTVARIABLES_DESCRIPTOR.index -> builder.exportedEnvironmentVariables =
                    deserializer.deserializeList(EXPORTEDENVIRONMENTVARIABLES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeExportedEnvironmentVariableDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                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()
                LOGS_DESCRIPTOR.index -> builder.logs = deserializeLogsLocationDocument(deserializer)
                NETWORKINTERFACE_DESCRIPTOR.index -> builder.networkInterface = deserializeNetworkInterfaceDocument(deserializer)
                PHASES_DESCRIPTOR.index -> builder.phases =
                    deserializer.deserializeList(PHASES_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeBuildPhaseDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                PROJECTNAME_DESCRIPTOR.index -> builder.projectName = deserializeString()
                QUEUEDTIMEOUTINMINUTES_DESCRIPTOR.index -> builder.queuedTimeoutInMinutes = deserializeInt()
                REPORTARNS_DESCRIPTOR.index -> builder.reportArns =
                    deserializer.deserializeList(REPORTARNS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                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)
                TIMEOUTINMINUTES_DESCRIPTOR.index -> builder.timeoutInMinutes = deserializeInt()
                VPCCONFIG_DESCRIPTOR.index -> builder.vpcConfig = deserializeVpcConfigDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy