commonMain.aws.sdk.kotlin.services.partnercentralselling.serde.ProjectDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of partnercentralselling-jvm Show documentation
Show all versions of partnercentralselling-jvm Show documentation
The AWS SDK for Kotlin client for PartnerCentral Selling
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.partnercentralselling.serde
import aws.sdk.kotlin.services.partnercentralselling.model.CompetitorName
import aws.sdk.kotlin.services.partnercentralselling.model.DeliveryModel
import aws.sdk.kotlin.services.partnercentralselling.model.ExpectedCustomerSpend
import aws.sdk.kotlin.services.partnercentralselling.model.Project
import aws.sdk.kotlin.services.partnercentralselling.model.SalesActivity
import aws.smithy.kotlin.runtime.serde.Deserializer
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.serializeList
import aws.smithy.kotlin.runtime.serde.serializeMap
import aws.smithy.kotlin.runtime.serde.serializeStruct
import kotlin.collections.mutableListOf
internal fun deserializeProjectDocument(deserializer: Deserializer): Project {
val builder = Project.Builder()
val ADDITIONALCOMMENTS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("AdditionalComments"))
val APNPROGRAMS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ApnPrograms"))
val COMPETITORNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Enum, JsonSerialName("CompetitorName"))
val CUSTOMERBUSINESSPROBLEM_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CustomerBusinessProblem"))
val CUSTOMERUSECASE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("CustomerUseCase"))
val DELIVERYMODELS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("DeliveryModels"))
val EXPECTEDCUSTOMERSPEND_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("ExpectedCustomerSpend"))
val OTHERCOMPETITORNAMES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OtherCompetitorNames"))
val OTHERSOLUTIONDESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("OtherSolutionDescription"))
val RELATEDOPPORTUNITYIDENTIFIER_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("RelatedOpportunityIdentifier"))
val SALESACTIVITIES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("SalesActivities"))
val TITLE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("Title"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ADDITIONALCOMMENTS_DESCRIPTOR)
field(APNPROGRAMS_DESCRIPTOR)
field(COMPETITORNAME_DESCRIPTOR)
field(CUSTOMERBUSINESSPROBLEM_DESCRIPTOR)
field(CUSTOMERUSECASE_DESCRIPTOR)
field(DELIVERYMODELS_DESCRIPTOR)
field(EXPECTEDCUSTOMERSPEND_DESCRIPTOR)
field(OTHERCOMPETITORNAMES_DESCRIPTOR)
field(OTHERSOLUTIONDESCRIPTION_DESCRIPTOR)
field(RELATEDOPPORTUNITYIDENTIFIER_DESCRIPTOR)
field(SALESACTIVITIES_DESCRIPTOR)
field(TITLE_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ADDITIONALCOMMENTS_DESCRIPTOR.index -> builder.additionalComments = deserializeString()
APNPROGRAMS_DESCRIPTOR.index -> builder.apnPrograms =
deserializer.deserializeList(APNPROGRAMS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
COMPETITORNAME_DESCRIPTOR.index -> builder.competitorName = deserializeString().let { CompetitorName.fromValue(it) }
CUSTOMERBUSINESSPROBLEM_DESCRIPTOR.index -> builder.customerBusinessProblem = deserializeString()
CUSTOMERUSECASE_DESCRIPTOR.index -> builder.customerUseCase = deserializeString()
DELIVERYMODELS_DESCRIPTOR.index -> builder.deliveryModels =
deserializer.deserializeList(DELIVERYMODELS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { DeliveryModel.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
EXPECTEDCUSTOMERSPEND_DESCRIPTOR.index -> builder.expectedCustomerSpend =
deserializer.deserializeList(EXPECTEDCUSTOMERSPEND_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeExpectedCustomerSpendDocument(deserializer) } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
OTHERCOMPETITORNAMES_DESCRIPTOR.index -> builder.otherCompetitorNames = deserializeString()
OTHERSOLUTIONDESCRIPTION_DESCRIPTOR.index -> builder.otherSolutionDescription = deserializeString()
RELATEDOPPORTUNITYIDENTIFIER_DESCRIPTOR.index -> builder.relatedOpportunityIdentifier = deserializeString()
SALESACTIVITIES_DESCRIPTOR.index -> builder.salesActivities =
deserializer.deserializeList(SALESACTIVITIES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { SalesActivity.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
TITLE_DESCRIPTOR.index -> builder.title = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}