commonMain.aws.sdk.kotlin.services.codepipeline.transform.PutThirdPartyJobFailureResultOperationSerializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codepipeline Show documentation
Show all versions of codepipeline Show documentation
The AWS Kotlin client for CodePipeline
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codepipeline.transform
import aws.sdk.kotlin.services.codepipeline.model.FailureDetails
import aws.sdk.kotlin.services.codepipeline.model.PutThirdPartyJobFailureResultRequest
import aws.smithy.kotlin.runtime.http.HttpBody
import aws.smithy.kotlin.runtime.http.HttpMethod
import aws.smithy.kotlin.runtime.http.content.ByteArrayContent
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 PutThirdPartyJobFailureResultOperationSerializer: HttpSerialize {
override suspend fun serialize(context: ExecutionContext, input: PutThirdPartyJobFailureResultRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path = "/"
}
val payload = serializePutThirdPartyJobFailureResultOperationBody(context, input)
builder.body = ByteArrayContent(payload)
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/x-amz-json-1.1")
}
return builder
}
}
private fun serializePutThirdPartyJobFailureResultOperationBody(context: ExecutionContext, input: PutThirdPartyJobFailureResultRequest): ByteArray {
val serializer = JsonSerializer()
val CLIENTTOKEN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("clientToken"))
val FAILUREDETAILS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("failureDetails"))
val JOBID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("jobId"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(CLIENTTOKEN_DESCRIPTOR)
field(FAILUREDETAILS_DESCRIPTOR)
field(JOBID_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.clientToken?.let { field(CLIENTTOKEN_DESCRIPTOR, it) }
input.failureDetails?.let { field(FAILUREDETAILS_DESCRIPTOR, it, ::serializeFailureDetailsDocument) }
input.jobId?.let { field(JOBID_DESCRIPTOR, it) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy