commonMain.aws.sdk.kotlin.services.ssmincidents.serde.IncidentTemplateDocumentSerializer.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.IncidentTemplate
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 serializeIncidentTemplateDocument(serializer: Serializer, input: IncidentTemplate) {
val DEDUPESTRING_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("dedupeString"))
val IMPACT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("impact"))
val INCIDENTTAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("incidentTags"))
val NOTIFICATIONTARGETS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("notificationTargets"))
val SUMMARY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("summary"))
val TITLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("title"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DEDUPESTRING_DESCRIPTOR)
field(IMPACT_DESCRIPTOR)
field(INCIDENTTAGS_DESCRIPTOR)
field(NOTIFICATIONTARGETS_DESCRIPTOR)
field(SUMMARY_DESCRIPTOR)
field(TITLE_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
field(TITLE_DESCRIPTOR, input.title)
field(IMPACT_DESCRIPTOR, input.impact)
input.summary?.let { field(SUMMARY_DESCRIPTOR, it) }
input.dedupeString?.let { field(DEDUPESTRING_DESCRIPTOR, it) }
if (input.notificationTargets != null) {
listField(NOTIFICATIONTARGETS_DESCRIPTOR) {
for (el0 in input.notificationTargets) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeNotificationTargetItemDocument))
}
}
}
if (input.incidentTags != null) {
mapField(INCIDENTTAGS_DESCRIPTOR) {
input.incidentTags.forEach { (key, value) ->
entry(key, value)
}
}
}
}
}