commonMain.aws.sdk.kotlin.services.codedeploy.serde.UpdateDeploymentGroupOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codedeploy-jvm Show documentation
Show all versions of codedeploy-jvm Show documentation
The AWS SDK for Kotlin client for CodeDeploy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codedeploy.serde
import aws.sdk.kotlin.services.codedeploy.model.AlarmConfiguration
import aws.sdk.kotlin.services.codedeploy.model.AutoRollbackConfiguration
import aws.sdk.kotlin.services.codedeploy.model.BlueGreenDeploymentConfiguration
import aws.sdk.kotlin.services.codedeploy.model.DeploymentStyle
import aws.sdk.kotlin.services.codedeploy.model.Ec2TagFilter
import aws.sdk.kotlin.services.codedeploy.model.Ec2TagSet
import aws.sdk.kotlin.services.codedeploy.model.EcsService
import aws.sdk.kotlin.services.codedeploy.model.LoadBalancerInfo
import aws.sdk.kotlin.services.codedeploy.model.OnPremisesTagSet
import aws.sdk.kotlin.services.codedeploy.model.OutdatedInstancesStrategy
import aws.sdk.kotlin.services.codedeploy.model.TagFilter
import aws.sdk.kotlin.services.codedeploy.model.TriggerConfig
import aws.sdk.kotlin.services.codedeploy.model.UpdateDeploymentGroupRequest
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 UpdateDeploymentGroupOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: UpdateDeploymentGroupRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeUpdateDeploymentGroupOperationBody(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 serializeUpdateDeploymentGroupOperationBody(context: ExecutionContext, input: UpdateDeploymentGroupRequest): ByteArray {
val serializer = JsonSerializer()
val ALARMCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("alarmConfiguration"))
val APPLICATIONNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("applicationName"))
val AUTOROLLBACKCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("autoRollbackConfiguration"))
val AUTOSCALINGGROUPS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("autoScalingGroups"))
val BLUEGREENDEPLOYMENTCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("blueGreenDeploymentConfiguration"))
val CURRENTDEPLOYMENTGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("currentDeploymentGroupName"))
val DEPLOYMENTCONFIGNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("deploymentConfigName"))
val DEPLOYMENTSTYLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("deploymentStyle"))
val EC2TAGFILTERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ec2TagFilters"))
val EC2TAGSET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("ec2TagSet"))
val ECSSERVICES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ecsServices"))
val LOADBALANCERINFO_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("loadBalancerInfo"))
val NEWDEPLOYMENTGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("newDeploymentGroupName"))
val ONPREMISESINSTANCETAGFILTERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("onPremisesInstanceTagFilters"))
val ONPREMISESTAGSET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("onPremisesTagSet"))
val OUTDATEDINSTANCESSTRATEGY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("outdatedInstancesStrategy"))
val SERVICEROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("serviceRoleArn"))
val TERMINATIONHOOKENABLED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("terminationHookEnabled"))
val TRIGGERCONFIGURATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("triggerConfigurations"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ALARMCONFIGURATION_DESCRIPTOR)
field(APPLICATIONNAME_DESCRIPTOR)
field(AUTOROLLBACKCONFIGURATION_DESCRIPTOR)
field(AUTOSCALINGGROUPS_DESCRIPTOR)
field(BLUEGREENDEPLOYMENTCONFIGURATION_DESCRIPTOR)
field(CURRENTDEPLOYMENTGROUPNAME_DESCRIPTOR)
field(DEPLOYMENTCONFIGNAME_DESCRIPTOR)
field(DEPLOYMENTSTYLE_DESCRIPTOR)
field(EC2TAGFILTERS_DESCRIPTOR)
field(EC2TAGSET_DESCRIPTOR)
field(ECSSERVICES_DESCRIPTOR)
field(LOADBALANCERINFO_DESCRIPTOR)
field(NEWDEPLOYMENTGROUPNAME_DESCRIPTOR)
field(ONPREMISESINSTANCETAGFILTERS_DESCRIPTOR)
field(ONPREMISESTAGSET_DESCRIPTOR)
field(OUTDATEDINSTANCESSTRATEGY_DESCRIPTOR)
field(SERVICEROLEARN_DESCRIPTOR)
field(TERMINATIONHOOKENABLED_DESCRIPTOR)
field(TRIGGERCONFIGURATIONS_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.alarmConfiguration?.let { field(ALARMCONFIGURATION_DESCRIPTOR, it, ::serializeAlarmConfigurationDocument) }
input.applicationName?.let { field(APPLICATIONNAME_DESCRIPTOR, it) }
input.autoRollbackConfiguration?.let { field(AUTOROLLBACKCONFIGURATION_DESCRIPTOR, it, ::serializeAutoRollbackConfigurationDocument) }
if (input.autoScalingGroups != null) {
listField(AUTOSCALINGGROUPS_DESCRIPTOR) {
for (el0 in input.autoScalingGroups) {
serializeString(el0)
}
}
}
input.blueGreenDeploymentConfiguration?.let { field(BLUEGREENDEPLOYMENTCONFIGURATION_DESCRIPTOR, it, ::serializeBlueGreenDeploymentConfigurationDocument) }
input.currentDeploymentGroupName?.let { field(CURRENTDEPLOYMENTGROUPNAME_DESCRIPTOR, it) }
input.deploymentConfigName?.let { field(DEPLOYMENTCONFIGNAME_DESCRIPTOR, it) }
input.deploymentStyle?.let { field(DEPLOYMENTSTYLE_DESCRIPTOR, it, ::serializeDeploymentStyleDocument) }
if (input.ec2TagFilters != null) {
listField(EC2TAGFILTERS_DESCRIPTOR) {
for (el0 in input.ec2TagFilters) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeEc2TagFilterDocument))
}
}
}
input.ec2TagSet?.let { field(EC2TAGSET_DESCRIPTOR, it, ::serializeEc2TagSetDocument) }
if (input.ecsServices != null) {
listField(ECSSERVICES_DESCRIPTOR) {
for (el0 in input.ecsServices) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeEcsServiceDocument))
}
}
}
input.loadBalancerInfo?.let { field(LOADBALANCERINFO_DESCRIPTOR, it, ::serializeLoadBalancerInfoDocument) }
input.newDeploymentGroupName?.let { field(NEWDEPLOYMENTGROUPNAME_DESCRIPTOR, it) }
if (input.onPremisesInstanceTagFilters != null) {
listField(ONPREMISESINSTANCETAGFILTERS_DESCRIPTOR) {
for (el0 in input.onPremisesInstanceTagFilters) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeTagFilterDocument))
}
}
}
input.onPremisesTagSet?.let { field(ONPREMISESTAGSET_DESCRIPTOR, it, ::serializeOnPremisesTagSetDocument) }
input.outdatedInstancesStrategy?.let { field(OUTDATEDINSTANCESSTRATEGY_DESCRIPTOR, it.value) }
input.serviceRoleArn?.let { field(SERVICEROLEARN_DESCRIPTOR, it) }
input.terminationHookEnabled?.let { field(TERMINATIONHOOKENABLED_DESCRIPTOR, it) }
if (input.triggerConfigurations != null) {
listField(TRIGGERCONFIGURATIONS_DESCRIPTOR) {
for (el0 in input.triggerConfigurations) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeTriggerConfigDocument))
}
}
}
}
return serializer.toByteArray()
}