commonMain.aws.sdk.kotlin.services.grafana.serde.WorkspaceDescriptionDocumentDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grafana-jvm Show documentation
Show all versions of grafana-jvm Show documentation
The AWS SDK for Kotlin client for grafana
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.grafana.serde
import aws.sdk.kotlin.services.grafana.model.AccountAccessType
import aws.sdk.kotlin.services.grafana.model.DataSourceType
import aws.sdk.kotlin.services.grafana.model.LicenseType
import aws.sdk.kotlin.services.grafana.model.NotificationDestinationType
import aws.sdk.kotlin.services.grafana.model.PermissionType
import aws.sdk.kotlin.services.grafana.model.WorkspaceDescription
import aws.sdk.kotlin.services.grafana.model.WorkspaceStatus
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 aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.TimestampFormat
import kotlin.collections.mutableListOf
import kotlin.collections.mutableMapOf
internal fun deserializeWorkspaceDescriptionDocument(deserializer: Deserializer): WorkspaceDescription {
val builder = WorkspaceDescription.Builder()
val ACCOUNTACCESSTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("accountAccessType"))
val AUTHENTICATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("authentication"))
val CREATED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("created"))
val DATASOURCES_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("dataSources"))
val DESCRIPTION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("description"))
val ENDPOINT_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("endpoint"))
val FREETRIALCONSUMED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Boolean, JsonSerialName("freeTrialConsumed"))
val FREETRIALEXPIRATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("freeTrialExpiration"))
val GRAFANATOKEN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("grafanaToken"))
val GRAFANAVERSION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("grafanaVersion"))
val ID_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("id"))
val LICENSEEXPIRATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("licenseExpiration"))
val LICENSETYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("licenseType"))
val MODIFIED_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Timestamp, JsonSerialName("modified"))
val NAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("name"))
val NETWORKACCESSCONTROL_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("networkAccessControl"))
val NOTIFICATIONDESTINATIONS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("notificationDestinations"))
val ORGANIZATIONROLENAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("organizationRoleName"))
val ORGANIZATIONALUNITS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.List, JsonSerialName("organizationalUnits"))
val PERMISSIONTYPE_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("permissionType"))
val STACKSETNAME_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("stackSetName"))
val STATUS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("status"))
val TAGS_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Map, JsonSerialName("tags"))
val VPCCONFIGURATION_DESCRIPTOR = SdkFieldDescriptor(SerialKind.Struct, JsonSerialName("vpcConfiguration"))
val WORKSPACEROLEARN_DESCRIPTOR = SdkFieldDescriptor(SerialKind.String, JsonSerialName("workspaceRoleArn"))
val OBJ_DESCRIPTOR = SdkObjectDescriptor.build {
field(ACCOUNTACCESSTYPE_DESCRIPTOR)
field(AUTHENTICATION_DESCRIPTOR)
field(CREATED_DESCRIPTOR)
field(DATASOURCES_DESCRIPTOR)
field(DESCRIPTION_DESCRIPTOR)
field(ENDPOINT_DESCRIPTOR)
field(FREETRIALCONSUMED_DESCRIPTOR)
field(FREETRIALEXPIRATION_DESCRIPTOR)
field(GRAFANATOKEN_DESCRIPTOR)
field(GRAFANAVERSION_DESCRIPTOR)
field(ID_DESCRIPTOR)
field(LICENSEEXPIRATION_DESCRIPTOR)
field(LICENSETYPE_DESCRIPTOR)
field(MODIFIED_DESCRIPTOR)
field(NAME_DESCRIPTOR)
field(NETWORKACCESSCONTROL_DESCRIPTOR)
field(NOTIFICATIONDESTINATIONS_DESCRIPTOR)
field(ORGANIZATIONROLENAME_DESCRIPTOR)
field(ORGANIZATIONALUNITS_DESCRIPTOR)
field(PERMISSIONTYPE_DESCRIPTOR)
field(STACKSETNAME_DESCRIPTOR)
field(STATUS_DESCRIPTOR)
field(TAGS_DESCRIPTOR)
field(VPCCONFIGURATION_DESCRIPTOR)
field(WORKSPACEROLEARN_DESCRIPTOR)
}
deserializer.deserializeStruct(OBJ_DESCRIPTOR) {
loop@while (true) {
when (findNextFieldIndex()) {
ACCOUNTACCESSTYPE_DESCRIPTOR.index -> builder.accountAccessType = deserializeString().let { AccountAccessType.fromValue(it) }
AUTHENTICATION_DESCRIPTOR.index -> builder.authentication = deserializeAuthenticationSummaryDocument(deserializer)
CREATED_DESCRIPTOR.index -> builder.created = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
DATASOURCES_DESCRIPTOR.index -> builder.dataSources =
deserializer.deserializeList(DATASOURCES_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { DataSourceType.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
DESCRIPTION_DESCRIPTOR.index -> builder.description = deserializeString()
ENDPOINT_DESCRIPTOR.index -> builder.endpoint = deserializeString()
FREETRIALCONSUMED_DESCRIPTOR.index -> builder.freeTrialConsumed = deserializeBoolean()
FREETRIALEXPIRATION_DESCRIPTOR.index -> builder.freeTrialExpiration = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
GRAFANATOKEN_DESCRIPTOR.index -> builder.grafanaToken = deserializeString()
GRAFANAVERSION_DESCRIPTOR.index -> builder.grafanaVersion = deserializeString()
ID_DESCRIPTOR.index -> builder.id = deserializeString()
LICENSEEXPIRATION_DESCRIPTOR.index -> builder.licenseExpiration = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
LICENSETYPE_DESCRIPTOR.index -> builder.licenseType = deserializeString().let { LicenseType.fromValue(it) }
MODIFIED_DESCRIPTOR.index -> builder.modified = deserializeInstant(TimestampFormat.EPOCH_SECONDS)
NAME_DESCRIPTOR.index -> builder.name = deserializeString()
NETWORKACCESSCONTROL_DESCRIPTOR.index -> builder.networkAccessControl = deserializeNetworkAccessConfigurationDocument(deserializer)
NOTIFICATIONDESTINATIONS_DESCRIPTOR.index -> builder.notificationDestinations =
deserializer.deserializeList(NOTIFICATIONDESTINATIONS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString().let { NotificationDestinationType.fromValue(it) } } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
ORGANIZATIONROLENAME_DESCRIPTOR.index -> builder.organizationRoleName = deserializeString()
ORGANIZATIONALUNITS_DESCRIPTOR.index -> builder.organizationalUnits =
deserializer.deserializeList(ORGANIZATIONALUNITS_DESCRIPTOR) {
val col0 = mutableListOf()
while (hasNextElement()) {
val el0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
col0.add(el0)
}
col0
}
PERMISSIONTYPE_DESCRIPTOR.index -> builder.permissionType = deserializeString().let { PermissionType.fromValue(it) }
STACKSETNAME_DESCRIPTOR.index -> builder.stackSetName = deserializeString()
STATUS_DESCRIPTOR.index -> builder.status = deserializeString().let { WorkspaceStatus.fromValue(it) }
TAGS_DESCRIPTOR.index -> builder.tags =
deserializer.deserializeMap(TAGS_DESCRIPTOR) {
val map0 = mutableMapOf()
while (hasNextEntry()) {
val k0 = key()
val v0 = if (nextHasValue()) { deserializeString() } else { deserializeNull(); continue }
map0[k0] = v0
}
map0
}
VPCCONFIGURATION_DESCRIPTOR.index -> builder.vpcConfiguration = deserializeVpcConfigurationDocument(deserializer)
WORKSPACEROLEARN_DESCRIPTOR.index -> builder.workspaceRoleArn = deserializeString()
null -> break@loop
else -> skipValue()
}
}
}
builder.correctErrors()
return builder.build()
}