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

commonMain.aws.sdk.kotlin.services.apprunner.serde.ServiceDocumentDeserializer.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.apprunner.serde

import aws.sdk.kotlin.services.apprunner.model.Service
import aws.sdk.kotlin.services.apprunner.model.ServiceStatus
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

internal fun deserializeServiceDocument(deserializer: Deserializer): Service {
    val builder = Service.Builder()
    val AUTOSCALINGCONFIGURATIONSUMMARY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("AutoScalingConfigurationSummary"))
    val CREATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("CreatedAt"))
    val DELETEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("DeletedAt"))
    val ENCRYPTIONCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("EncryptionConfiguration"))
    val HEALTHCHECKCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("HealthCheckConfiguration"))
    val INSTANCECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("InstanceConfiguration"))
    val NETWORKCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("NetworkConfiguration"))
    val OBSERVABILITYCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ObservabilityConfiguration"))
    val SERVICEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServiceArn"))
    val SERVICEID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServiceId"))
    val SERVICENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServiceName"))
    val SERVICEURL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServiceUrl"))
    val SOURCECONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SourceConfiguration"))
    val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Status"))
    val UPDATEDAT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("UpdatedAt"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(AUTOSCALINGCONFIGURATIONSUMMARY_DESCRIPTOR)
        field(CREATEDAT_DESCRIPTOR)
        field(DELETEDAT_DESCRIPTOR)
        field(ENCRYPTIONCONFIGURATION_DESCRIPTOR)
        field(HEALTHCHECKCONFIGURATION_DESCRIPTOR)
        field(INSTANCECONFIGURATION_DESCRIPTOR)
        field(NETWORKCONFIGURATION_DESCRIPTOR)
        field(OBSERVABILITYCONFIGURATION_DESCRIPTOR)
        field(SERVICEARN_DESCRIPTOR)
        field(SERVICEID_DESCRIPTOR)
        field(SERVICENAME_DESCRIPTOR)
        field(SERVICEURL_DESCRIPTOR)
        field(SOURCECONFIGURATION_DESCRIPTOR)
        field(STATUS_DESCRIPTOR)
        field(UPDATEDAT_DESCRIPTOR)
    }

    deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
        loop@while (true) {
            when (findNextFieldIndex()) {
                AUTOSCALINGCONFIGURATIONSUMMARY_DESCRIPTOR.index -> builder.autoScalingConfigurationSummary = deserializeAutoScalingConfigurationSummaryDocument(deserializer)
                CREATEDAT_DESCRIPTOR.index -> builder.createdAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                DELETEDAT_DESCRIPTOR.index -> builder.deletedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                ENCRYPTIONCONFIGURATION_DESCRIPTOR.index -> builder.encryptionConfiguration = deserializeEncryptionConfigurationDocument(deserializer)
                HEALTHCHECKCONFIGURATION_DESCRIPTOR.index -> builder.healthCheckConfiguration = deserializeHealthCheckConfigurationDocument(deserializer)
                INSTANCECONFIGURATION_DESCRIPTOR.index -> builder.instanceConfiguration = deserializeInstanceConfigurationDocument(deserializer)
                NETWORKCONFIGURATION_DESCRIPTOR.index -> builder.networkConfiguration = deserializeNetworkConfigurationDocument(deserializer)
                OBSERVABILITYCONFIGURATION_DESCRIPTOR.index -> builder.observabilityConfiguration = deserializeServiceObservabilityConfigurationDocument(deserializer)
                SERVICEARN_DESCRIPTOR.index -> builder.serviceArn = deserializeString()
                SERVICEID_DESCRIPTOR.index -> builder.serviceId = deserializeString()
                SERVICENAME_DESCRIPTOR.index -> builder.serviceName = deserializeString()
                SERVICEURL_DESCRIPTOR.index -> builder.serviceUrl = deserializeString()
                SOURCECONFIGURATION_DESCRIPTOR.index -> builder.sourceConfiguration = deserializeSourceConfigurationDocument(deserializer)
                STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { ServiceStatus.fromValue(it) }
                UPDATEDAT_DESCRIPTOR.index -> builder.updatedAt = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
                null -> break@loop
                else -> skipValue()
            }
        }
    }
    builder.correctErrors()
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy