All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.codedeploy.serde.CreateDeploymentGroupOperationSerializer.kt Maven / Gradle / Ivy

There is a newer version: 1.3.78
Show newest version
// 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.CreateDeploymentGroupRequest
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.Tag
import aws.sdk.kotlin.services.codedeploy.model.TagFilter
import aws.sdk.kotlin.services.codedeploy.model.TriggerConfig
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 CreateDeploymentGroupOperationSerializer: HttpSerializer.NonStreaming {
    override fun serialize(context: ExecutionContext, input: CreateDeploymentGroupRequest): HttpRequestBuilder {
        val builder = HttpRequestBuilder()
        builder.method = HttpMethod.POST

        builder.url {
            path.encoded = "/"
        }

        val payload = serializeCreateDeploymentGroupOperationBody(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 serializeCreateDeploymentGroupOperationBody(context: ExecutionContext, input: CreateDeploymentGroupRequest): 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 DEPLOYMENTCONFIGNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("deploymentConfigName"))
    val DEPLOYMENTGROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("deploymentGroupName"))
    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 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 TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("tags"))
    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(DEPLOYMENTCONFIGNAME_DESCRIPTOR)
        field(DEPLOYMENTGROUPNAME_DESCRIPTOR)
        field(DEPLOYMENTSTYLE_DESCRIPTOR)
        field(EC2TAGFILTERS_DESCRIPTOR)
        field(EC2TAGSET_DESCRIPTOR)
        field(ECSSERVICES_DESCRIPTOR)
        field(LOADBALANCERINFO_DESCRIPTOR)
        field(ONPREMISESINSTANCETAGFILTERS_DESCRIPTOR)
        field(ONPREMISESTAGSET_DESCRIPTOR)
        field(OUTDATEDINSTANCESSTRATEGY_DESCRIPTOR)
        field(SERVICEROLEARN_DESCRIPTOR)
        field(TAGS_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.deploymentConfigName?.let { field(DEPLOYMENTCONFIGNAME_DESCRIPTOR, it) }
        input.deploymentGroupName?.let { field(DEPLOYMENTGROUPNAME_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) }
        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) }
        if (input.tags != null) {
            listField(TAGS_DESCRIPTOR) {
                for (el0 in input.tags) {
                    serializeSdkSerializable(asSdkSerializable(el0, ::serializeTagDocument))
                }
            }
        }
        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()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy