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

commonMain.aws.sdk.kotlin.services.codebuild.serde.ProjectDocumentDeserializer.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.Project
import aws.sdk.kotlin.services.codebuild.model.ProjectArtifacts
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.ProjectVisibilityType
import aws.sdk.kotlin.services.codebuild.model.Tag
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 deserializeProjectDocument(deserializer: Deserializer): Project {
    val builder = Project.Builder()
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("arn"))
    val ARTIFACTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("artifacts"))
    val AUTORETRYLIMIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("autoRetryLimit"))
    val BADGE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("badge"))
    val BUILDBATCHCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("buildBatchConfig"))
    val CACHE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("cache"))
    val CONCURRENTBUILDLIMIT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("concurrentBuildLimit"))
    val CREATED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("created"))
    val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
    val ENCRYPTIONKEY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("encryptionKey"))
    val ENVIRONMENT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("environment"))
    val FILESYSTEMLOCATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("fileSystemLocations"))
    val LASTMODIFIED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("lastModified"))
    val LOGSCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("logsConfig"))
    val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
    val PROJECTVISIBILITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("projectVisibility"))
    val PUBLICPROJECTALIAS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("publicProjectAlias"))
    val QUEUEDTIMEOUTINMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("queuedTimeoutInMinutes"))
    val RESOURCEACCESSROLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("resourceAccessRole"))
    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 TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("tags"))
    val TIMEOUTINMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("timeoutInMinutes"))
    val VPCCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("vpcConfig"))
    val WEBHOOK_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("webhook"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(ARTIFACTS_DESCRIPTOR)
        field(AUTORETRYLIMIT_DESCRIPTOR)
        field(BADGE_DESCRIPTOR)
        field(BUILDBATCHCONFIG_DESCRIPTOR)
        field(CACHE_DESCRIPTOR)
        field(CONCURRENTBUILDLIMIT_DESCRIPTOR)
        field(CREATED_DESCRIPTOR)
        field(DESCRIPTION_DESCRIPTOR)
        field(ENCRYPTIONKEY_DESCRIPTOR)
        field(ENVIRONMENT_DESCRIPTOR)
        field(FILESYSTEMLOCATIONS_DESCRIPTOR)
        field(LASTMODIFIED_DESCRIPTOR)
        field(LOGSCONFIG_DESCRIPTOR)
        field(NAME_DESCRIPTOR)
        field(PROJECTVISIBILITY_DESCRIPTOR)
        field(PUBLICPROJECTALIAS_DESCRIPTOR)
        field(QUEUEDTIMEOUTINMINUTES_DESCRIPTOR)
        field(RESOURCEACCESSROLE_DESCRIPTOR)
        field(SECONDARYARTIFACTS_DESCRIPTOR)
        field(SECONDARYSOURCEVERSIONS_DESCRIPTOR)
        field(SECONDARYSOURCES_DESCRIPTOR)
        field(SERVICEROLE_DESCRIPTOR)
        field(SOURCE_DESCRIPTOR)
        field(SOURCEVERSION_DESCRIPTOR)
        field(TAGS_DESCRIPTOR)
        field(TIMEOUTINMINUTES_DESCRIPTOR)
        field(VPCCONFIG_DESCRIPTOR)
        field(WEBHOOK_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                ARN_DESCRIPTOR.index -> builder.arn = deserializeString()
                ARTIFACTS_DESCRIPTOR.index -> builder.artifacts = deserializeProjectArtifactsDocument(deserializer)
                AUTORETRYLIMIT_DESCRIPTOR.index -> builder.autoRetryLimit = deserializeInt()
                BADGE_DESCRIPTOR.index -> builder.badge = deserializeProjectBadgeDocument(deserializer)
                BUILDBATCHCONFIG_DESCRIPTOR.index -> builder.buildBatchConfig = deserializeProjectBuildBatchConfigDocument(deserializer)
                CACHE_DESCRIPTOR.index -> builder.cache = deserializeProjectCacheDocument(deserializer)
                CONCURRENTBUILDLIMIT_DESCRIPTOR.index -> builder.concurrentBuildLimit = deserializeInt()
                CREATED_DESCRIPTOR.index -> builder.created = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
                ENCRYPTIONKEY_DESCRIPTOR.index -> builder.encryptionKey = deserializeString()
                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
                    }
                LASTMODIFIED_DESCRIPTOR.index -> builder.lastModified = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                LOGSCONFIG_DESCRIPTOR.index -> builder.logsConfig = deserializeLogsConfigDocument(deserializer)
                NAME_DESCRIPTOR.index -> builder.name = deserializeString()
                PROJECTVISIBILITY_DESCRIPTOR.index -> builder.projectVisibility = deserializeString().let { ProjectVisibilityType.fromValue(it) }
                PUBLICPROJECTALIAS_DESCRIPTOR.index -> builder.publicProjectAlias = deserializeString()
                QUEUEDTIMEOUTINMINUTES_DESCRIPTOR.index -> builder.queuedTimeoutInMinutes = deserializeInt()
                RESOURCEACCESSROLE_DESCRIPTOR.index -> builder.resourceAccessRole = deserializeString()
                SECONDARYARTIFACTS_DESCRIPTOR.index -> builder.secondaryArtifacts =
                    deserializer.deserializeList(SECONDARYARTIFACTS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeProjectArtifactsDocument(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()
                TAGS_DESCRIPTOR.index -> builder.tags =
                    deserializer.deserializeList(TAGS_DESCRIPTOR) {
                        val col0 = mutableListOf()
                        while (hasNextElement()) {
                            val el0 = if (nextHasValue()) { deserializeTagDocument(deserializer) } else { deserializeNull(); continue }
                            col0.add(el0)
                        }
                        col0
                    }
                TIMEOUTINMINUTES_DESCRIPTOR.index -> builder.timeoutInMinutes = deserializeInt()
                VPCCONFIG_DESCRIPTOR.index -> builder.vpcConfig = deserializeVpcConfigDocument(deserializer)
                WEBHOOK_DESCRIPTOR.index -> builder.webhook = deserializeWebhookDocument(deserializer)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy