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

commonMain.aws.sdk.kotlin.services.configservice.serde.RemediationConfigurationDocumentSerializer.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.configservice.serde

import aws.sdk.kotlin.services.configservice.model.RemediationConfiguration
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.Serializer
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 serializeRemediationConfigurationDocument(serializer: Serializer, input: RemediationConfiguration) {
    val ARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Arn"))
    val AUTOMATIC_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("Automatic"))
    val CONFIGRULENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigRuleName"))
    val CREATEDBYSERVICE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CreatedByService"))
    val EXECUTIONCONTROLS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ExecutionControls"))
    val MAXIMUMAUTOMATICATTEMPTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaximumAutomaticAttempts"))
    val PARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("Parameters"))
    val RESOURCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceType"))
    val RETRYATTEMPTSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("RetryAttemptSeconds"))
    val TARGETID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TargetId"))
    val TARGETTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("TargetType"))
    val TARGETVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TargetVersion"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ARN_DESCRIPTOR)
        field(AUTOMATIC_DESCRIPTOR)
        field(CONFIGRULENAME_DESCRIPTOR)
        field(CREATEDBYSERVICE_DESCRIPTOR)
        field(EXECUTIONCONTROLS_DESCRIPTOR)
        field(MAXIMUMAUTOMATICATTEMPTS_DESCRIPTOR)
        field(PARAMETERS_DESCRIPTOR)
        field(RESOURCETYPE_DESCRIPTOR)
        field(RETRYATTEMPTSECONDS_DESCRIPTOR)
        field(TARGETID_DESCRIPTOR)
        field(TARGETTYPE_DESCRIPTOR)
        field(TARGETVERSION_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        field(CONFIGRULENAME_DESCRIPTOR, input.configRuleName)
        field(TARGETTYPE_DESCRIPTOR, input.targetType.value)
        field(TARGETID_DESCRIPTOR, input.targetId)
        input.targetVersion?.let { field(TARGETVERSION_DESCRIPTOR, it) }
        if (input.parameters != null) {
            mapField(PARAMETERS_DESCRIPTOR) {
                input.parameters.forEach { (key, value) -> entry(key, asSdkSerializable(value, ::serializeRemediationParameterValueDocument)) }
            }
        }
        input.resourceType?.let { field(RESOURCETYPE_DESCRIPTOR, it) }
        if (input.automatic != false) field(AUTOMATIC_DESCRIPTOR, input.automatic)
        input.executionControls?.let { field(EXECUTIONCONTROLS_DESCRIPTOR, it, ::serializeExecutionControlsDocument) }
        input.maximumAutomaticAttempts?.let { field(MAXIMUMAUTOMATICATTEMPTS_DESCRIPTOR, it) }
        input.retryAttemptSeconds?.let { field(RETRYATTEMPTSECONDS_DESCRIPTOR, it) }
        input.arn?.let { field(ARN_DESCRIPTOR, it) }
        input.createdByService?.let { field(CREATEDBYSERVICE_DESCRIPTOR, it) }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy