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

commonMain.aws.sdk.kotlin.services.codestarconnections.serde.SyncConfigurationDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.codestarconnections.serde

import aws.sdk.kotlin.services.codestarconnections.model.ProviderType
import aws.sdk.kotlin.services.codestarconnections.model.PublishDeploymentStatus
import aws.sdk.kotlin.services.codestarconnections.model.SyncConfiguration
import aws.sdk.kotlin.services.codestarconnections.model.SyncConfigurationType
import aws.sdk.kotlin.services.codestarconnections.model.TriggerResourceUpdateOn
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 deserializeSyncConfigurationDocument(deserializer: Deserializer): SyncConfiguration {
    val builder = SyncConfiguration.Builder()
    val BRANCH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Branch"))
    val CONFIGFILE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigFile"))
    val OWNERID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OwnerId"))
    val PROVIDERTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("ProviderType"))
    val PUBLISHDEPLOYMENTSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("PublishDeploymentStatus"))
    val REPOSITORYLINKID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RepositoryLinkId"))
    val REPOSITORYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RepositoryName"))
    val RESOURCENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceName"))
    val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RoleArn"))
    val SYNCTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("SyncType"))
    val TRIGGERRESOURCEUPDATEON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("TriggerResourceUpdateOn"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(BRANCH_DESCRIPTOR)
        field(CONFIGFILE_DESCRIPTOR)
        field(OWNERID_DESCRIPTOR)
        field(PROVIDERTYPE_DESCRIPTOR)
        field(PUBLISHDEPLOYMENTSTATUS_DESCRIPTOR)
        field(REPOSITORYLINKID_DESCRIPTOR)
        field(REPOSITORYNAME_DESCRIPTOR)
        field(RESOURCENAME_DESCRIPTOR)
        field(ROLEARN_DESCRIPTOR)
        field(SYNCTYPE_DESCRIPTOR)
        field(TRIGGERRESOURCEUPDATEON_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                BRANCH_DESCRIPTOR.index -> builder.branch = deserializeString()
                CONFIGFILE_DESCRIPTOR.index -> builder.configFile = deserializeString()
                OWNERID_DESCRIPTOR.index -> builder.ownerId = deserializeString()
                PROVIDERTYPE_DESCRIPTOR.index -> builder.providerType = deserializeString().let { ProviderType.fromValue(it) }
                PUBLISHDEPLOYMENTSTATUS_DESCRIPTOR.index -> builder.publishDeploymentStatus = deserializeString().let { PublishDeploymentStatus.fromValue(it) }
                REPOSITORYLINKID_DESCRIPTOR.index -> builder.repositoryLinkId = deserializeString()
                REPOSITORYNAME_DESCRIPTOR.index -> builder.repositoryName = deserializeString()
                RESOURCENAME_DESCRIPTOR.index -> builder.resourceName = deserializeString()
                ROLEARN_DESCRIPTOR.index -> builder.roleArn = deserializeString()
                SYNCTYPE_DESCRIPTOR.index -> builder.syncType = deserializeString().let { SyncConfigurationType.fromValue(it) }
                TRIGGERRESOURCEUPDATEON_DESCRIPTOR.index -> builder.triggerResourceUpdateOn = deserializeString().let { TriggerResourceUpdateOn.fromValue(it) }
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy