commonMain.aws.sdk.kotlin.services.configservice.serde.PutOrganizationConformancePackOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of configservice-jvm Show documentation
Show all versions of configservice-jvm Show documentation
The AWS Kotlin client for Config Service
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.configservice.serde
import aws.sdk.kotlin.services.configservice.model.ConformancePackInputParameter
import aws.sdk.kotlin.services.configservice.model.PutOrganizationConformancePackRequest
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 PutOrganizationConformancePackOperationSerializer: HttpSerialize {
override suspend fun serialize(context: ExecutionContext, input: PutOrganizationConformancePackRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path = "/"
}
val payload = serializePutOrganizationConformancePackOperationBody(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 serializePutOrganizationConformancePackOperationBody(context: ExecutionContext, input: PutOrganizationConformancePackRequest): ByteArray {
val serializer = JsonSerializer()
val CONFORMANCEPACKINPUTPARAMETERS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ConformancePackInputParameters"))
val DELIVERYS3BUCKET_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DeliveryS3Bucket"))
val DELIVERYS3KEYPREFIX_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("DeliveryS3KeyPrefix"))
val EXCLUDEDACCOUNTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ExcludedAccounts"))
val ORGANIZATIONCONFORMANCEPACKNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OrganizationConformancePackName"))
val TEMPLATEBODY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TemplateBody"))
val TEMPLATES3URI_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("TemplateS3Uri"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CONFORMANCEPACKINPUTPARAMETERS_DESCRIPTOR)
field(DELIVERYS3BUCKET_DESCRIPTOR)
field(DELIVERYS3KEYPREFIX_DESCRIPTOR)
field(EXCLUDEDACCOUNTS_DESCRIPTOR)
field(ORGANIZATIONCONFORMANCEPACKNAME_DESCRIPTOR)
field(TEMPLATEBODY_DESCRIPTOR)
field(TEMPLATES3URI_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
if (input.conformancePackInputParameters != null) {
listField(CONFORMANCEPACKINPUTPARAMETERS_DESCRIPTOR) {
for (el0 in input.conformancePackInputParameters) {
serializeSdkSerializable(asSdkSerializable(el0, ::serializeConformancePackInputParameterDocument))
}
}
}
input.deliveryS3Bucket?.let { field(DELIVERYS3BUCKET_DESCRIPTOR, it) }
input.deliveryS3KeyPrefix?.let { field(DELIVERYS3KEYPREFIX_DESCRIPTOR, it) }
if (input.excludedAccounts != null) {
listField(EXCLUDEDACCOUNTS_DESCRIPTOR) {
for (el0 in input.excludedAccounts) {
serializeString(el0)
}
}
}
input.organizationConformancePackName?.let { field(ORGANIZATIONCONFORMANCEPACKNAME_DESCRIPTOR, it) }
input.templateBody?.let { field(TEMPLATEBODY_DESCRIPTOR, it) }
input.templateS3Uri?.let { field(TEMPLATES3URI_DESCRIPTOR, it) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy