commonMain.aws.sdk.kotlin.services.appstream.serde.UpdateStackOperationSerializer.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.ApplicationSettings
import aws.sdk.kotlin.services.appstream.model.StackAttribute
import aws.sdk.kotlin.services.appstream.model.StorageConnector
import aws.sdk.kotlin.services.appstream.model.StreamingExperienceSettings
import aws.sdk.kotlin.services.appstream.model.UpdateStackRequest
import aws.sdk.kotlin.services.appstream.model.UserSetting
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 UpdateStackOperationSerializer: HttpSerialize {
override suspend fun serialize(context: ExecutionContext, input: UpdateStackRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeUpdateStackOperationBody(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 serializeUpdateStackOperationBody(context: ExecutionContext, input: UpdateStackRequest): ByteArray {
val serializer = JsonSerializer()
val ACCESSENDPOINTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AccessEndpoints"))
val APPLICATIONSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ApplicationSettings"))
val ATTRIBUTESTODELETE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AttributesToDelete"))
val DELETESTORAGECONNECTORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("DeleteStorageConnectors"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Description"))
val DISPLAYNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DisplayName"))
val EMBEDHOSTDOMAINS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("EmbedHostDomains"))
val FEEDBACKURL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("FeedbackURL"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Name"))
val REDIRECTURL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RedirectURL"))
val STORAGECONNECTORS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("StorageConnectors"))
val STREAMINGEXPERIENCESETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("StreamingExperienceSettings"))
val USERSETTINGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("UserSettings"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACCESSENDPOINTS_DESCRIPTOR)
field(APPLICATIONSETTINGS_DESCRIPTOR)
field(ATTRIBUTESTODELETE_DESCRIPTOR)
field(DELETESTORAGECONNECTORS_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(DISPLAYNAME_DESCRIPTOR)
field(EMBEDHOSTDOMAINS_DESCRIPTOR)
field(FEEDBACKURL_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(REDIRECTURL_DESCRIPTOR)
field(STORAGECONNECTORS_DESCRIPTOR)
field(STREAMINGEXPERIENCESETTINGS_DESCRIPTOR)
field(USERSETTINGS_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
if (input.accessEndpoints != null) {
listField(ACCESSENDPOINTS_DESCRIPTOR) {
for (el0 in input.accessEndpoints) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeAccessEndpointDocument))
}
}
}
input.applicationSettings?.let { field(APPLICATIONSETTINGS_DESCRIPTOR, it, ::serializeApplicationSettingsDocument) }
if (input.attributesToDelete != null) {
listField(ATTRIBUTESTODELETE_DESCRIPTOR) {
for (el0 in input.attributesToDelete) {
serializeString(el0.value)
}
}
}
input.deleteStorageConnectors?.let { field(DELETESTORAGECONNECTORS_DESCRIPTOR, it) }
input.description?.let { field(DESCRIPTION_DESCRIPTOR, it) }
input.displayName?.let { field(DISPLAYNAME_DESCRIPTOR, it) }
if (input.embedHostDomains != null) {
listField(EMBEDHOSTDOMAINS_DESCRIPTOR) {
for (el0 in input.embedHostDomains) {
serializeString(el0)
}
}
}
input.feedbackUrl?.let { field(FEEDBACKURL_DESCRIPTOR, it) }
input.name?.let { field(NAME_DESCRIPTOR, it) }
input.redirectUrl?.let { field(REDIRECTURL_DESCRIPTOR, it) }
if (input.storageConnectors != null) {
listField(STORAGECONNECTORS_DESCRIPTOR) {
for (el0 in input.storageConnectors) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeStorageConnectorDocument))
}
}
}
input.streamingExperienceSettings?.let { field(STREAMINGEXPERIENCESETTINGS_DESCRIPTOR, it, ::serializeStreamingExperienceSettingsDocument) }
if (input.userSettings != null) {
listField(USERSETTINGS_DESCRIPTOR) {
for (el0 in input.userSettings) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeUserSettingDocument))
}
}
}
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy