commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.ModifyDataMigrationOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of databasemigrationservice-jvm Show documentation
Show all versions of databasemigrationservice-jvm Show documentation
The AWS SDK for Kotlin client for Database Migration Service
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.databasemigrationservice.serde
import aws.sdk.kotlin.services.databasemigrationservice.model.MigrationTypeValue
import aws.sdk.kotlin.services.databasemigrationservice.model.ModifyDataMigrationRequest
import aws.sdk.kotlin.services.databasemigrationservice.model.SourceDataSetting
import aws.smithy.kotlin.runtime.http.HttpBody
import aws.smithy.kotlin.runtime.http.HttpMethod
import aws.smithy.kotlin.runtime.http.operation.HttpSerializer
import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder
import aws.smithy.kotlin.runtime.http.request.url
import aws.smithy.kotlin.runtime.operation.ExecutionContext
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.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.json.JsonSerializer
import aws.smithy.kotlin.runtime.serde.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
internal class ModifyDataMigrationOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: ModifyDataMigrationRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeModifyDataMigrationOperationBody(context, input)
builder.body = HttpBody.fromBytes(payload)
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/x-amz-json-1.1")
}
return builder
}
}
private fun serializeModifyDataMigrationOperationBody(context: ExecutionContext, input: ModifyDataMigrationRequest): ByteArray {
val serializer = JsonSerializer()
val DATAMIGRATIONIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DataMigrationIdentifier"))
val DATAMIGRATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DataMigrationName"))
val DATAMIGRATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("DataMigrationType"))
val ENABLECLOUDWATCHLOGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("EnableCloudwatchLogs"))
val NUMBEROFJOBS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("NumberOfJobs"))
val SELECTIONRULES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("SelectionRules"))
val SERVICEACCESSROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ServiceAccessRoleArn"))
val SOURCEDATASETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("SourceDataSettings"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DATAMIGRATIONIDENTIFIER_DESCRIPTOR)
field(DATAMIGRATIONNAME_DESCRIPTOR)
field(DATAMIGRATIONTYPE_DESCRIPTOR)
field(ENABLECLOUDWATCHLOGS_DESCRIPTOR)
field(NUMBEROFJOBS_DESCRIPTOR)
field(SELECTIONRULES_DESCRIPTOR)
field(SERVICEACCESSROLEARN_DESCRIPTOR)
field(SOURCEDATASETTINGS_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.dataMigrationIdentifier?.let { field(DATAMIGRATIONIDENTIFIER_DESCRIPTOR, it) }
input.dataMigrationName?.let { field(DATAMIGRATIONNAME_DESCRIPTOR, it) }
input.dataMigrationType?.let { field(DATAMIGRATIONTYPE_DESCRIPTOR, it.value) }
input.enableCloudwatchLogs?.let { field(ENABLECLOUDWATCHLOGS_DESCRIPTOR, it) }
input.numberOfJobs?.let { field(NUMBEROFJOBS_DESCRIPTOR, it) }
input.selectionRules?.let { field(SELECTIONRULES_DESCRIPTOR, it) }
input.serviceAccessRoleArn?.let { field(SERVICEACCESSROLEARN_DESCRIPTOR, it) }
if (input.sourceDataSettings != null) {
listField(SOURCEDATASETTINGS_DESCRIPTOR) {
for (el0 in input.sourceDataSettings) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeSourceDataSettingDocument))
}
}
}
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy