commonMain.aws.sdk.kotlin.services.ssmincidents.serde.SsmAutomationDocumentSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ssmincidents-jvm Show documentation
Show all versions of ssmincidents-jvm Show documentation
The AWS SDK for Kotlin client for SSM Incidents
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.ssmincidents.serde
import aws.sdk.kotlin.services.ssmincidents.model.SsmAutomation
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 serializeSsmAutomationDocument(serializer: Serializer, input: SsmAutomation) {
val DOCUMENTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("documentName"))
val DOCUMENTVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("documentVersion"))
val DYNAMICPARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("dynamicParameters"))
val PARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("parameters"))
val PARAMETERS_C0_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List)
val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("roleArn"))
val TARGETACCOUNT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("targetAccount"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DOCUMENTNAME_DESCRIPTOR)
field(DOCUMENTVERSION_DESCRIPTOR)
field(DYNAMICPARAMETERS_DESCRIPTOR)
field(PARAMETERS_DESCRIPTOR)
field(ROLEARN_DESCRIPTOR)
field(TARGETACCOUNT_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
field(ROLEARN_DESCRIPTOR, input.roleArn)
field(DOCUMENTNAME_DESCRIPTOR, input.documentName)
input.documentVersion?.let { field(DOCUMENTVERSION_DESCRIPTOR, it) }
input.targetAccount?.let { field(TARGETACCOUNT_DESCRIPTOR, it.value) }
if (input.parameters != null) {
mapField(PARAMETERS_DESCRIPTOR) {
input.parameters.forEach { (key, value) ->
listEntry(key, PARAMETERS_C0_DESCRIPTOR) {
for (el1 in value) {
serializeString(el1)
}
}
}
}
}
if (input.dynamicParameters != null) {
mapField(DYNAMICPARAMETERS_DESCRIPTOR) {
input.dynamicParameters.forEach { (key, value) -> entry(key, asSdkSerializable(value, ::serializeDynamicSsmParameterValueDocument)) }
}
}
}
}