commonMain.aws.sdk.kotlin.services.appstream.serde.UpdateFleetOperationSerializer.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.ComputeCapacity
import aws.sdk.kotlin.services.appstream.model.DomainJoinInfo
import aws.sdk.kotlin.services.appstream.model.FleetAttribute
import aws.sdk.kotlin.services.appstream.model.PlatformType
import aws.sdk.kotlin.services.appstream.model.S3Location
import aws.sdk.kotlin.services.appstream.model.StreamView
import aws.sdk.kotlin.services.appstream.model.UpdateFleetRequest
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.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 UpdateFleetOperationSerializer: HttpSerialize {
override suspend fun serialize(context: ExecutionContext, input: UpdateFleetRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeUpdateFleetOperationBody(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 serializeUpdateFleetOperationBody(context: ExecutionContext, input: UpdateFleetRequest): ByteArray {
val serializer = JsonSerializer()
val ATTRIBUTESTODELETE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AttributesToDelete"))
val COMPUTECAPACITY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ComputeCapacity"))
val DELETEVPCCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("DeleteVpcConfig"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val DISCONNECTTIMEOUTINSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("DisconnectTimeoutInSeconds"))
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 IDLEDISCONNECTTIMEOUTINSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("IdleDisconnectTimeoutInSeconds"))
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 MAXCONCURRENTSESSIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaxConcurrentSessions"))
val MAXSESSIONSPERINSTANCE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaxSessionsPerInstance"))
val MAXUSERDURATIONINSECONDS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("MaxUserDurationInSeconds"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val PLATFORM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("Platform"))
val SESSIONSCRIPTS3LOCATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SessionScriptS3Location"))
val STREAMVIEW_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("StreamView"))
val USBDEVICEFILTERSTRINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("UsbDeviceFilterStrings"))
val VPCCONFIG_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("VpcConfig"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ATTRIBUTESTODELETE_DESCRIPTOR)
field(COMPUTECAPACITY_DESCRIPTOR)
field(DELETEVPCCONFIG_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(DISCONNECTTIMEOUTINSECONDS_DESCRIPTOR)
field(DISPLAYNAME_DESCRIPTOR)
field(DOMAINJOININFO_DESCRIPTOR)
field(ENABLEDEFAULTINTERNETACCESS_DESCRIPTOR)
field(IAMROLEARN_DESCRIPTOR)
field(IDLEDISCONNECTTIMEOUTINSECONDS_DESCRIPTOR)
field(IMAGEARN_DESCRIPTOR)
field(IMAGENAME_DESCRIPTOR)
field(INSTANCETYPE_DESCRIPTOR)
field(MAXCONCURRENTSESSIONS_DESCRIPTOR)
field(MAXSESSIONSPERINSTANCE_DESCRIPTOR)
field(MAXUSERDURATIONINSECONDS_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(PLATFORM_DESCRIPTOR)
field(SESSIONSCRIPTS3LOCATION_DESCRIPTOR)
field(STREAMVIEW_DESCRIPTOR)
field(USBDEVICEFILTERSTRINGS_DESCRIPTOR)
field(VPCCONFIG_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
if (input.attributesToDelete != null) {
listField(ATTRIBUTESTODELETE_DESCRIPTOR) {
for (el0 in input.attributesToDelete) {
serializeString(el0.value)
}
}
}
input.computeCapacity?.let { field(COMPUTECAPACITY_DESCRIPTOR, it, ::serializeComputeCapacityDocument) }
input.deleteVpcConfig?.let { field(DELETEVPCCONFIG_DESCRIPTOR, it) }
input.description?.let { field(DESCRIPTION_DESCRIPTOR, it) }
input.disconnectTimeoutInSeconds?.let { field(DISCONNECTTIMEOUTINSECONDS_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.idleDisconnectTimeoutInSeconds?.let { field(IDLEDISCONNECTTIMEOUTINSECONDS_DESCRIPTOR, it) }
input.imageArn?.let { field(IMAGEARN_DESCRIPTOR, it) }
input.imageName?.let { field(IMAGENAME_DESCRIPTOR, it) }
input.instanceType?.let { field(INSTANCETYPE_DESCRIPTOR, it) }
input.maxConcurrentSessions?.let { field(MAXCONCURRENTSESSIONS_DESCRIPTOR, it) }
input.maxSessionsPerInstance?.let { field(MAXSESSIONSPERINSTANCE_DESCRIPTOR, it) }
input.maxUserDurationInSeconds?.let { field(MAXUSERDURATIONINSECONDS_DESCRIPTOR, it) }
input.name?.let { field(NAME_DESCRIPTOR, it) }
input.platform?.let { field(PLATFORM_DESCRIPTOR, it.value) }
input.sessionScriptS3Location?.let { field(SESSIONSCRIPTS3LOCATION_DESCRIPTOR, it, ::serializeS3LocationDocument) }
input.streamView?.let { field(STREAMVIEW_DESCRIPTOR, it.value) }
if (input.usbDeviceFilterStrings != null) {
listField(USBDEVICEFILTERSTRINGS_DESCRIPTOR) {
for (el0 in input.usbDeviceFilterStrings) {
serializeString(el0)
}
}
}
input.vpcConfig?.let { field(VPCCONFIG_DESCRIPTOR, it, ::serializeVpcConfigDocument) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy