commonMain.aws.sdk.kotlin.services.backup.serde.BackupRuleInputDocumentSerializer.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.BackupRuleInput
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 serializeBackupRuleInputDocument(serializer: Serializer, input: BackupRuleInput) {
val COMPLETIONWINDOWMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("CompletionWindowMinutes"))
val COPYACTIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("CopyActions"))
val ENABLECONTINUOUSBACKUP_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("EnableContinuousBackup"))
val LIFECYCLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("Lifecycle"))
val RECOVERYPOINTTAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("RecoveryPointTags"))
val RULENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RuleName"))
val SCHEDULEEXPRESSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ScheduleExpression"))
val SCHEDULEEXPRESSIONTIMEZONE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ScheduleExpressionTimezone"))
val STARTWINDOWMINUTES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Long, JsonSerialName("StartWindowMinutes"))
val TARGETBACKUPVAULTNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TargetBackupVaultName"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(COMPLETIONWINDOWMINUTES_DESCRIPTOR)
field(COPYACTIONS_DESCRIPTOR)
field(ENABLECONTINUOUSBACKUP_DESCRIPTOR)
field(LIFECYCLE_DESCRIPTOR)
field(RECOVERYPOINTTAGS_DESCRIPTOR)
field(RULENAME_DESCRIPTOR)
field(SCHEDULEEXPRESSION_DESCRIPTOR)
field(SCHEDULEEXPRESSIONTIMEZONE_DESCRIPTOR)
field(STARTWINDOWMINUTES_DESCRIPTOR)
field(TARGETBACKUPVAULTNAME_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
field(RULENAME_DESCRIPTOR, input.ruleName)
field(TARGETBACKUPVAULTNAME_DESCRIPTOR, input.targetBackupVaultName)
input.scheduleExpression?.let { field(SCHEDULEEXPRESSION_DESCRIPTOR, it) }
input.startWindowMinutes?.let { field(STARTWINDOWMINUTES_DESCRIPTOR, it) }
input.completionWindowMinutes?.let { field(COMPLETIONWINDOWMINUTES_DESCRIPTOR, it) }
input.lifecycle?.let { field(LIFECYCLE_DESCRIPTOR, it, ::serializeLifecycleDocument) }
if (input.recoveryPointTags != null) {
mapField(RECOVERYPOINTTAGS_DESCRIPTOR) {
input.recoveryPointTags.forEach { (key, value) ->
entry(key, value)
}
}
}
if (input.copyActions != null) {
listField(COPYACTIONS_DESCRIPTOR) {
for (el0 in input.copyActions) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeCopyActionDocument))
}
}
}
input.enableContinuousBackup?.let { field(ENABLECONTINUOUSBACKUP_DESCRIPTOR, it) }
input.scheduleExpressionTimezone?.let { field(SCHEDULEEXPRESSIONTIMEZONE_DESCRIPTOR, it) }
}
}