commonMain.aws.sdk.kotlin.services.appstream.transform.CreateImageBuilderOperationSerializer.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.AccessEndpoint
import aws.sdk.kotlin.services.appstream.model.CreateImageBuilderRequest
import aws.sdk.kotlin.services.appstream.model.DomainJoinInfo
import aws.sdk.kotlin.services.appstream.model.VpcConfig
import aws.smithy.kotlin.runtime.client.ExecutionContext
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.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 CreateImageBuilderOperationSerializer: HttpSerialize {
override suspend fun serialize(context: ExecutionContext, input: CreateImageBuilderRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path = "/"
}
val payload = serializeCreateImageBuilderOperationBody(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 serializeCreateImageBuilderOperationBody(context: ExecutionContext, input: CreateImageBuilderRequest): ByteArray {
val serializer = JsonSerializer()
val ACCESSENDPOINTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AccessEndpoints"))
val APPSTREAMAGENTVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AppstreamAgentVersion"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val DISPLAYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DisplayName"))
val DOMAINJOININFO_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("DomainJoinInfo"))
val ENABLEDEFAULTINTERNETACCESS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("EnableDefaultInternetAccess"))
val IAMROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("IamRoleArn"))
val IMAGEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ImageArn"))
val IMAGENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ImageName"))
val INSTANCETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("InstanceType"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("Tags"))
val VPCCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("VpcConfig"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACCESSENDPOINTS_DESCRIPTOR)
field(APPSTREAMAGENTVERSION_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(DISPLAYNAME_DESCRIPTOR)
field(DOMAINJOININFO_DESCRIPTOR)
field(ENABLEDEFAULTINTERNETACCESS_DESCRIPTOR)
field(IAMROLEARN_DESCRIPTOR)
field(IMAGEARN_DESCRIPTOR)
field(IMAGENAME_DESCRIPTOR)
field(INSTANCETYPE_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(VPCCONFIG_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
if (input.accessEndpoints != null) {
listField(ACCESSENDPOINTS_DESCRIPTOR) {
for (el0 in input.accessEndpoints) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeAccessEndpointDocument))
}
}
}
input.appstreamAgentVersion?.let { field(APPSTREAMAGENTVERSION_DESCRIPTOR, it) }
input.description?.let { field(DESCRIPTION_DESCRIPTOR, it) }
input.displayName?.let { field(DISPLAYNAME_DESCRIPTOR, it) }
input.domainJoinInfo?.let { field(DOMAINJOININFO_DESCRIPTOR, it, ::serializeDomainJoinInfoDocument) }
input.enableDefaultInternetAccess?.let { field(ENABLEDEFAULTINTERNETACCESS_DESCRIPTOR, it) }
input.iamRoleArn?.let { field(IAMROLEARN_DESCRIPTOR, it) }
input.imageArn?.let { field(IMAGEARN_DESCRIPTOR, it) }
input.imageName?.let { field(IMAGENAME_DESCRIPTOR, it) }
input.instanceType?.let { field(INSTANCETYPE_DESCRIPTOR, it) }
input.name?.let { field(NAME_DESCRIPTOR, it) }
if (input.tags != null) {
mapField(TAGS_DESCRIPTOR) {
input.tags.forEach { (key, value) -> entry(key, value) }
}
}
input.vpcConfig?.let { field(VPCCONFIG_DESCRIPTOR, it, ::serializeVpcConfigDocument) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy