commonMain.aws.sdk.kotlin.services.codestarconnections.serde.UpdateSyncConfigurationOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codestarconnections-jvm Show documentation
Show all versions of codestarconnections-jvm Show documentation
The AWS SDK for Kotlin client for CodeStar connections
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codestarconnections.serde
import aws.sdk.kotlin.services.codestarconnections.model.PublishDeploymentStatus
import aws.sdk.kotlin.services.codestarconnections.model.SyncConfigurationType
import aws.sdk.kotlin.services.codestarconnections.model.TriggerResourceUpdateOn
import aws.sdk.kotlin.services.codestarconnections.model.UpdateSyncConfigurationRequest
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 UpdateSyncConfigurationOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: UpdateSyncConfigurationRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/"
}
val payload = serializeUpdateSyncConfigurationOperationBody(context, input)
builder.body = HttpBody.fromBytes(payload)
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/x-amz-json-1.0")
}
return builder
}
}
private fun serializeUpdateSyncConfigurationOperationBody(context: ExecutionContext, input: UpdateSyncConfigurationRequest): ByteArray {
val serializer = JsonSerializer()
val BRANCH_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Branch"))
val CONFIGFILE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ConfigFile"))
val PUBLISHDEPLOYMENTSTATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("PublishDeploymentStatus"))
val REPOSITORYLINKID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RepositoryLinkId"))
val RESOURCENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("ResourceName"))
val ROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RoleArn"))
val SYNCTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("SyncType"))
val TRIGGERRESOURCEUPDATEON_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("TriggerResourceUpdateOn"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(BRANCH_DESCRIPTOR)
field(CONFIGFILE_DESCRIPTOR)
field(PUBLISHDEPLOYMENTSTATUS_DESCRIPTOR)
field(REPOSITORYLINKID_DESCRIPTOR)
field(RESOURCENAME_DESCRIPTOR)
field(ROLEARN_DESCRIPTOR)
field(SYNCTYPE_DESCRIPTOR)
field(TRIGGERRESOURCEUPDATEON_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.branch?.let { field(BRANCH_DESCRIPTOR, it) }
input.configFile?.let { field(CONFIGFILE_DESCRIPTOR, it) }
input.publishDeploymentStatus?.let { field(PUBLISHDEPLOYMENTSTATUS_DESCRIPTOR, it.value) }
input.repositoryLinkId?.let { field(REPOSITORYLINKID_DESCRIPTOR, it) }
input.resourceName?.let { field(RESOURCENAME_DESCRIPTOR, it) }
input.roleArn?.let { field(ROLEARN_DESCRIPTOR, it) }
input.syncType?.let { field(SYNCTYPE_DESCRIPTOR, it.value) }
input.triggerResourceUpdateOn?.let { field(TRIGGERRESOURCEUPDATEON_DESCRIPTOR, it.value) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy