commonMain.aws.sdk.kotlin.services.backup.serde.ControlScopeDocumentSerializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.backup.serde
import aws.sdk.kotlin.services.backup.model.ControlScope
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 serializeControlScopeDocument(serializer: Serializer, input: ControlScope) {
val COMPLIANCERESOURCEIDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ComplianceResourceIds"))
val COMPLIANCERESOURCETYPES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ComplianceResourceTypes"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("Tags"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(COMPLIANCERESOURCEIDS_DESCRIPTOR)
field(COMPLIANCERESOURCETYPES_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
if (input.complianceResourceIds != null) {
listField(COMPLIANCERESOURCEIDS_DESCRIPTOR) {
for (el0 in input.complianceResourceIds) {
serializeString(el0)
}
}
}
if (input.complianceResourceTypes != null) {
listField(COMPLIANCERESOURCETYPES_DESCRIPTOR) {
for (el0 in input.complianceResourceTypes) {
serializeString(el0)
}
}
}
if (input.tags != null) {
mapField(TAGS_DESCRIPTOR) {
input.tags.forEach { (key, value) ->
entry(key, value)
}
}
}
}
}