commonMain.aws.sdk.kotlin.services.databasemigrationservice.serde.CreateDataMigrationOperationSerializer.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.CreateDataMigrationRequest
import aws.sdk.kotlin.services.databasemigrationservice.model.MigrationTypeValue
import aws.sdk.kotlin.services.databasemigrationservice.model.SourceDataSetting
import aws.sdk.kotlin.services.databasemigrationservice.model.Tag
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 CreateDataMigrationOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: CreateDataMigrationRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeCreateDataMigrationOperationBody(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 serializeCreateDataMigrationOperationBody(context: ExecutionContext, input: CreateDataMigrationRequest): ByteArray {
val serializer = JsonSerializer()
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 MIGRATIONPROJECTIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("MigrationProjectIdentifier"))
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 TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("Tags"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(DATAMIGRATIONNAME_DESCRIPTOR)
field(DATAMIGRATIONTYPE_DESCRIPTOR)
field(ENABLECLOUDWATCHLOGS_DESCRIPTOR)
field(MIGRATIONPROJECTIDENTIFIER_DESCRIPTOR)
field(NUMBEROFJOBS_DESCRIPTOR)
field(SELECTIONRULES_DESCRIPTOR)
field(SERVICEACCESSROLEARN_DESCRIPTOR)
field(SOURCEDATASETTINGS_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.dataMigrationName?.let { field(DATAMIGRATIONNAME_DESCRIPTOR, it) }
input.dataMigrationType?.let { field(DATAMIGRATIONTYPE_DESCRIPTOR, it.value) }
input.enableCloudwatchLogs?.let { field(ENABLECLOUDWATCHLOGS_DESCRIPTOR, it) }
input.migrationProjectIdentifier?.let { field(MIGRATIONPROJECTIDENTIFIER_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))
}
}
}
if (input.tags != null) {
listField(TAGS_DESCRIPTOR) {
for (el0 in input.tags) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeTagDocument))
}
}
}
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy