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

commonMain.aws.sdk.kotlin.services.codebuild.serde.ProjectSourceDocumentDeserializer.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.ProjectSource
import aws.sdk.kotlin.services.codebuild.model.SourceType
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 deserializeProjectSourceDocument(deserializer: Deserializer): ProjectSource {
    val builder = ProjectSource.Builder()
    val AUTH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("auth"))
    val BUILDSTATUSCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("buildStatusConfig"))
    val BUILDSPEC_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("buildspec"))
    val GITCLONEDEPTH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("gitCloneDepth"))
    val GITSUBMODULESCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("gitSubmodulesConfig"))
    val INSECURESSL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("insecureSsl"))
    val LOCATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("location"))
    val REPORTBUILDSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("reportBuildStatus"))
    val SOURCEIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("sourceIdentifier"))
    val TYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("type"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AUTH_DESCRIPTOR)
        field(BUILDSTATUSCONFIG_DESCRIPTOR)
        field(BUILDSPEC_DESCRIPTOR)
        field(GITCLONEDEPTH_DESCRIPTOR)
        field(GITSUBMODULESCONFIG_DESCRIPTOR)
        field(INSECURESSL_DESCRIPTOR)
        field(LOCATION_DESCRIPTOR)
        field(REPORTBUILDSTATUS_DESCRIPTOR)
        field(SOURCEIDENTIFIER_DESCRIPTOR)
        field(TYPE_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AUTH_DESCRIPTOR.index -> builder.auth = deserializeSourceAuthDocument(deserializer)
                BUILDSTATUSCONFIG_DESCRIPTOR.index -> builder.buildStatusConfig = deserializeBuildStatusConfigDocument(deserializer)
                BUILDSPEC_DESCRIPTOR.index -> builder.buildspec = deserializeString()
                GITCLONEDEPTH_DESCRIPTOR.index -> builder.gitCloneDepth = deserializeInt()
                GITSUBMODULESCONFIG_DESCRIPTOR.index -> builder.gitSubmodulesConfig = deserializeGitSubmodulesConfigDocument(deserializer)
                INSECURESSL_DESCRIPTOR.index -> builder.insecureSsl = deserializeBoolean()
                LOCATION_DESCRIPTOR.index -> builder.location = deserializeString()
                REPORTBUILDSTATUS_DESCRIPTOR.index -> builder.reportBuildStatus = deserializeBoolean()
                SOURCEIDENTIFIER_DESCRIPTOR.index -> builder.sourceIdentifier = deserializeString()
                TYPE_DESCRIPTOR.index -> builder.type = deserializeString().let { SourceType.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy