commonMain.aws.sdk.kotlin.services.appstream.transform.UpdateApplicationOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appstream-jvm Show documentation
Show all versions of appstream-jvm Show documentation
The AWS SDK for Kotlin client for AppStream
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.appstream.transform
import aws.sdk.kotlin.services.appstream.model.ApplicationAttribute
import aws.sdk.kotlin.services.appstream.model.S3Location
import aws.sdk.kotlin.services.appstream.model.UpdateApplicationRequest
import aws.smithy.kotlin.runtime.http.HttpBody
import aws.smithy.kotlin.runtime.http.HttpMethod
import aws.smithy.kotlin.runtime.http.content.ByteArrayContent
import aws.smithy.kotlin.runtime.http.operation.HttpSerialize
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 UpdateApplicationOperationSerializer: HttpSerialize {
override suspend fun serialize(context: ExecutionContext, input: UpdateApplicationRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path = "/"
}
val payload = serializeUpdateApplicationOperationBody(context, input)
builder.body = ByteArrayContent(payload)
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/x-amz-json-1.1")
}
return builder
}
}
private fun serializeUpdateApplicationOperationBody(context: ExecutionContext, input: UpdateApplicationRequest): ByteArray {
val serializer = JsonSerializer()
val APPBLOCKARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AppBlockArn"))
val ATTRIBUTESTODELETE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AttributesToDelete"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val DISPLAYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DisplayName"))
val ICONS3LOCATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("IconS3Location"))
val LAUNCHPARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LaunchParameters"))
val LAUNCHPATH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LaunchPath"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val WORKINGDIRECTORY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("WorkingDirectory"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(APPBLOCKARN_DESCRIPTOR)
field(ATTRIBUTESTODELETE_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(DISPLAYNAME_DESCRIPTOR)
field(ICONS3LOCATION_DESCRIPTOR)
field(LAUNCHPARAMETERS_DESCRIPTOR)
field(LAUNCHPATH_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(WORKINGDIRECTORY_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.appBlockArn?.let { field(APPBLOCKARN_DESCRIPTOR, it) }
if (input.attributesToDelete != null) {
listField(ATTRIBUTESTODELETE_DESCRIPTOR) {
for (el0 in input.attributesToDelete) {
serializeString(el0.value)
}
}
}
input.description?.let { field(DESCRIPTION_DESCRIPTOR, it) }
input.displayName?.let { field(DISPLAYNAME_DESCRIPTOR, it) }
input.iconS3Location?.let { field(ICONS3LOCATION_DESCRIPTOR, it, ::serializeS3LocationDocument) }
input.launchParameters?.let { field(LAUNCHPARAMETERS_DESCRIPTOR, it) }
input.launchPath?.let { field(LAUNCHPATH_DESCRIPTOR, it) }
input.name?.let { field(NAME_DESCRIPTOR, it) }
input.workingDirectory?.let { field(WORKINGDIRECTORY_DESCRIPTOR, it) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy