fn build_attrval_set()

in src/data.rs [740:770]


fn build_attrval_set(ktype: &str, kval: &[JsonValue]) -> AttributeValue {
    debug!(
        "Constructing an AttributeValue for (type: {:?}, val: {:#?})",
        ktype, kval
    );

    let mut attrval: AttributeValue = AttributeValue {
        ..Default::default()
    };
    match ktype {
        "SS" => {
            attrval.ss = Some(
                kval.iter()
                    .map(|x| x.as_str().unwrap().to_string())
                    .collect(),
            )
        }
        "NS" => {
            attrval.ns = Some(
                kval.iter()
                    .map(|x| x.as_i64().unwrap().to_string())
                    .collect(),
            )
        }
        // NOTE: Currently BS is not supported.
        // "BS": Vec<bytes::Bytes> (serialize_with = "::rusoto_core::serialization::SerdeBlobList::serialize_blob_list")
        _ => panic!("ERROR: Unknown DynamoDB Data Type: {}", ktype),
    }

    attrval
}