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

commonMain.aws.sdk.kotlin.services.datasync.serde.UpdateLocationAzureBlobOperationSerializer.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.datasync.serde

import aws.sdk.kotlin.services.datasync.model.AzureAccessTier
import aws.sdk.kotlin.services.datasync.model.AzureBlobAuthenticationType
import aws.sdk.kotlin.services.datasync.model.AzureBlobSasConfiguration
import aws.sdk.kotlin.services.datasync.model.AzureBlobType
import aws.sdk.kotlin.services.datasync.model.UpdateLocationAzureBlobRequest
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 UpdateLocationAzureBlobOperationSerializer: HttpSerializer.NonStreaming {
    override fun serialize(context: ExecutionContext, input: UpdateLocationAzureBlobRequest): HttpRequestBuilder {
        val builder = HttpRequestBuilder()
        builder.method = HttpMethod.POST

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

        val payload = serializeUpdateLocationAzureBlobOperationBody(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 serializeUpdateLocationAzureBlobOperationBody(context: ExecutionContext, input: UpdateLocationAzureBlobRequest): ByteArray {
    val serializer = JsonSerializer()
    val ACCESSTIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("AccessTier"))
    val AGENTARNS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("AgentArns"))
    val AUTHENTICATIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("AuthenticationType"))
    val BLOBTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("BlobType"))
    val LOCATIONARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("LocationArn"))
    val SASCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("SasConfiguration"))
    val SUBDIRECTORY_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Subdirectory"))
    val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
        field(ACCESSTIER_DESCRIPTOR)
        field(AGENTARNS_DESCRIPTOR)
        field(AUTHENTICATIONTYPE_DESCRIPTOR)
        field(BLOBTYPE_DESCRIPTOR)
        field(LOCATIONARN_DESCRIPTOR)
        field(SASCONFIGURATION_DESCRIPTOR)
        field(SUBDIRECTORY_DESCRIPTOR)
    }

    serializer.serializeStruct(OBJ_DESCRIPTOR) {
        input.accessTier?.let { field(ACCESSTIER_DESCRIPTOR, it.value) }
        if (input.agentArns != null) {
            listField(AGENTARNS_DESCRIPTOR) {
                for (el0 in input.agentArns) {
                    serializeString(el0)
                }
            }
        }
        input.authenticationType?.let { field(AUTHENTICATIONTYPE_DESCRIPTOR, it.value) }
        input.blobType?.let { field(BLOBTYPE_DESCRIPTOR, it.value) }
        input.locationArn?.let { field(LOCATIONARN_DESCRIPTOR, it) }
        input.sasConfiguration?.let { field(SASCONFIGURATION_DESCRIPTOR, it, ::serializeAzureBlobSasConfigurationDocument) }
        input.subdirectory?.let { field(SUBDIRECTORY_DESCRIPTOR, it) }
    }
    return serializer.toByteArray()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy