commonMain.aws.sdk.kotlin.services.appstream.serde.UpdateAppBlockBuilderOperationSerializer.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.serde
import aws.sdk.kotlin.services.appstream.model.AccessEndpoint
import aws.sdk.kotlin.services.appstream.model.AppBlockBuilderAttribute
import aws.sdk.kotlin.services.appstream.model.PlatformType
import aws.sdk.kotlin.services.appstream.model.UpdateAppBlockBuilderRequest
import aws.sdk.kotlin.services.appstream.model.VpcConfig
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 UpdateAppBlockBuilderOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: UpdateAppBlockBuilderRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeUpdateAppBlockBuilderOperationBody(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 serializeUpdateAppBlockBuilderOperationBody(context: ExecutionContext, input: UpdateAppBlockBuilderRequest): ByteArray {
val serializer = JsonSerializer()
val ACCESSENDPOINTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AccessEndpoints"))
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 ENABLEDEFAULTINTERNETACCESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("EnableDefaultInternetAccess"))
val IAMROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("IamRoleArn"))
val INSTANCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("InstanceType"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val PLATFORM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Platform"))
val VPCCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("VpcConfig"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACCESSENDPOINTS_DESCRIPTOR)
field(ATTRIBUTESTODELETE_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(DISPLAYNAME_DESCRIPTOR)
field(ENABLEDEFAULTINTERNETACCESS_DESCRIPTOR)
field(IAMROLEARN_DESCRIPTOR)
field(INSTANCETYPE_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(PLATFORM_DESCRIPTOR)
field(VPCCONFIG_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
if (input.accessEndpoints != null) {
listField(ACCESSENDPOINTS_DESCRIPTOR) {
for (el0 in input.accessEndpoints) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeAccessEndpointDocument))
}
}
}
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.enableDefaultInternetAccess?.let { field(ENABLEDEFAULTINTERNETACCESS_DESCRIPTOR, it) }
input.iamRoleArn?.let { field(IAMROLEARN_DESCRIPTOR, it) }
input.instanceType?.let { field(INSTANCETYPE_DESCRIPTOR, it) }
input.name?.let { field(NAME_DESCRIPTOR, it) }
input.platform?.let { field(PLATFORM_DESCRIPTOR, it.value) }
input.vpcConfig?.let { field(VPCCONFIG_DESCRIPTOR, it, ::serializeVpcConfigDocument) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy