commonMain.aws.sdk.kotlin.services.xray.serde.GetTimeSeriesServiceStatisticsOperationSerializer.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.xray.serde
import aws.sdk.kotlin.services.xray.model.GetTimeSeriesServiceStatisticsRequest
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
import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
internal class GetTimeSeriesServiceStatisticsOperationSerializer: HttpSerializer.NonStreaming {
override fun serialize(context: ExecutionContext, input: GetTimeSeriesServiceStatisticsRequest): HttpRequestBuilder {
val builder = HttpRequestBuilder()
builder.method = HttpMethod.POST
builder.url {
path.encoded = "/TimeSeriesServiceStatistics"
}
val payload = serializeGetTimeSeriesServiceStatisticsOperationBody(context, input)
builder.body = HttpBody.fromBytes(payload)
if (builder.body !is HttpBody.Empty) {
builder.headers.setMissing("Content-Type", "application/json")
}
return builder
}
}
private fun serializeGetTimeSeriesServiceStatisticsOperationBody(context: ExecutionContext, input: GetTimeSeriesServiceStatisticsRequest): ByteArray {
val serializer = JsonSerializer()
val ENDTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("EndTime"))
val ENTITYSELECTOREXPRESSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("EntitySelectorExpression"))
val FORECASTSTATISTICS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("ForecastStatistics"))
val GROUPARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("GroupARN"))
val GROUPNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("GroupName"))
val NEXTTOKEN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("NextToken"))
val PERIOD_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Integer, JsonSerialName("Period"))
val STARTTIME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("StartTime"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ENDTIME_DESCRIPTOR)
field(ENTITYSELECTOREXPRESSION_DESCRIPTOR)
field(FORECASTSTATISTICS_DESCRIPTOR)
field(GROUPARN_DESCRIPTOR)
field(GROUPNAME_DESCRIPTOR)
field(NEXTTOKEN_DESCRIPTOR)
field(PERIOD_DESCRIPTOR)
field(STARTTIME_DESCRIPTOR)
}
serializer.serializeStruct(OBJ_DESCRIPTOR) {
input.endTime?.let { field(ENDTIME_DESCRIPTOR, it, TimestampFormat.EPOCH_SECONDS) }
input.entitySelectorExpression?.let { field(ENTITYSELECTOREXPRESSION_DESCRIPTOR, it) }
input.forecastStatistics?.let { field(FORECASTSTATISTICS_DESCRIPTOR, it) }
input.groupArn?.let { field(GROUPARN_DESCRIPTOR, it) }
input.groupName?.let { field(GROUPNAME_DESCRIPTOR, it) }
input.nextToken?.let { field(NEXTTOKEN_DESCRIPTOR, it) }
input.period?.let { field(PERIOD_DESCRIPTOR, it) }
input.startTime?.let { field(STARTTIME_DESCRIPTOR, it, TimestampFormat.EPOCH_SECONDS) }
}
return serializer.toByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy