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

commonMain.aws.sdk.kotlin.services.glue.serde.SourceControlDetailsDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.glue.serde

import aws.sdk.kotlin.services.glue.model.SourceControlAuthStrategy
import aws.sdk.kotlin.services.glue.model.SourceControlDetails
import aws.sdk.kotlin.services.glue.model.SourceControlProvider
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 deserializeSourceControlDetailsDocument(deserializer: Deserializer): SourceControlDetails {
    val builder = SourceControlDetails.Builder()
    val AUTHSTRATEGY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("AuthStrategy"))
    val AUTHTOKEN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AuthToken"))
    val BRANCH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Branch"))
    val FOLDER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Folder"))
    val LASTCOMMITID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LastCommitId"))
    val OWNER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Owner"))
    val PROVIDER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Provider"))
    val REPOSITORY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Repository"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AUTHSTRATEGY_DESCRIPTOR)
        field(AUTHTOKEN_DESCRIPTOR)
        field(BRANCH_DESCRIPTOR)
        field(FOLDER_DESCRIPTOR)
        field(LASTCOMMITID_DESCRIPTOR)
        field(OWNER_DESCRIPTOR)
        field(PROVIDER_DESCRIPTOR)
        field(REPOSITORY_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AUTHSTRATEGY_DESCRIPTOR.index -> builder.authStrategy = deserializeString().let { SourceControlAuthStrategy.fromValue(it) }
                AUTHTOKEN_DESCRIPTOR.index -> builder.authToken = deserializeString()
                BRANCH_DESCRIPTOR.index -> builder.branch = deserializeString()
                FOLDER_DESCRIPTOR.index -> builder.folder = deserializeString()
                LASTCOMMITID_DESCRIPTOR.index -> builder.lastCommitId = deserializeString()
                OWNER_DESCRIPTOR.index -> builder.owner = deserializeString()
                PROVIDER_DESCRIPTOR.index -> builder.provider = deserializeString().let { SourceControlProvider.fromValue(it) }
                REPOSITORY_DESCRIPTOR.index -> builder.repository = deserializeString()
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy