pub fn parse_from_row(values: &HashMap<String, Vec<String>>) -> Self {
        let hoodie_size = get_value(values, "Hoodie");
        let fleece_size = get_value(values, "Patagonia Fleece");
        let womens_shirt_size = get_value(values, "Women's Tee");
        let unisex_shirt_size = get_value(values, "Unisex Tee");
        let kids_shirt_size = get_value(values, "Onesie / Toddler / Youth Sizes");
        let mut contents = String::new();
        if !hoodie_size.is_empty() && !hoodie_size.contains("N/A") {
            contents += &format!("1 x Oxide Hoodie, Size: {}\n", hoodie_size);
        }
        if !fleece_size.is_empty() && !fleece_size.contains("N/A") {
            contents += &format!("1 x Oxide Fleece, Size: {}\n", fleece_size);
        }
        if !womens_shirt_size.is_empty() && !womens_shirt_size.contains("N/A") {
            contents += &format!("1 x Oxide Women's Shirt, Size: {}\n", womens_shirt_size);
        }
        if !unisex_shirt_size.is_empty() && !unisex_shirt_size.contains("N/A") {
            contents += &format!("1 x Oxide Unisex Shirt, Size: {}\n", unisex_shirt_size);
        }
        if !kids_shirt_size.is_empty() && !kids_shirt_size.contains("N/A") {
            contents += &format!("1 x Oxide Kids Shirt, Size: {}\n", kids_shirt_size);
        }

        let mut country = get_value(values, "Country");
        if country.is_empty() {
            country = "US".to_string();
        }
        NewOutboundShipment {
            created_time: NewOutboundShipment::parse_timestamp(&get_value(values, "Timestamp")),
            name: get_value(values, "Name"),
            email: get_value(values, "Email Address").to_lowercase(),
            phone: get_value(values, "Phone number"),
            street_1: get_value(values, "Street address line 1").to_uppercase(),
            street_2: get_value(values, "Street address line 2").to_uppercase(),
            city: get_value(values, "City").to_uppercase(),
            state: get_value(values, "State").to_uppercase(),
            zipcode: get_value(values, "Zipcode").to_uppercase(),
            country,
            address_formatted: String::new(),
            latitude: Default::default(),
            longitude: Default::default(),
            contents: contents.trim().to_string(),
            carrier: Default::default(),
            pickup_date: None,
            delivered_time: None,
            shipped_time: None,
            shippo_id: Default::default(),
            status: "Queued".to_string(),
            tracking_link: Default::default(),
            oxide_tracking_link: Default::default(),
            tracking_number: Default::default(),
            tracking_status: Default::default(),
            cost: Default::default(),
            label_link: Default::default(),
            eta: None,
            messages: Default::default(),
            notes: Default::default(),
            geocode_cache: Default::default(),
            local_pickup: false,
            link_to_package_pickup: Default::default(),
        }
    }
/// Parse the sheet columns from single Google Sheets row values.
/// This is what we get back from the webhook.
Parse the sheet columns from single Google Sheets row values.
This is what we get back from the webhook.
Parse the sheet columns from single Google Sheets row values . This is what we get back from the webhook .
pub fn parse_from_row(values: &HashMap<String, Vec<String>>) -> Self {
        let hoodie_size = get_value(values, "Hoodie");
        let fleece_size = get_value(values, "Patagonia Fleece");
        let womens_shirt_size = get_value(values, "Women's Tee");
        let unisex_shirt_size = get_value(values, "Unisex Tee");
        let kids_shirt_size = get_value(values, "Onesie / Toddler / Youth Sizes");
        let mut contents = String::new();
        if !hoodie_size.is_empty() && !hoodie_size.contains("N/A") {
            contents += &format!("1 x Oxide Hoodie, Size: {}\n", hoodie_size);
        }
        if !fleece_size.is_empty() && !fleece_size.contains("N/A") {
            contents += &format!("1 x Oxide Fleece, Size: {}\n", fleece_size);
        }
        if !womens_shirt_size.is_empty() && !womens_shirt_size.contains("N/A") {
            contents += &format!("1 x Oxide Women's Shirt, Size: {}\n", womens_shirt_size);
        }
        if !unisex_shirt_size.is_empty() && !unisex_shirt_size.contains("N/A") {
            contents += &format!("1 x Oxide Unisex Shirt, Size: {}\n", unisex_shirt_size);
        }
        if !kids_shirt_size.is_empty() && !kids_shirt_size.contains("N/A") {
            contents += &format!("1 x Oxide Kids Shirt, Size: {}\n", kids_shirt_size);
        }
        let mut country = get_value(values, "Country");
        if country.is_empty() {
            country = "US".to_string();
        }
        NewOutboundShipment {
            created_time: NewOutboundShipment::parse_timestamp(&get_value(values, "Timestamp")),
            name: get_value(values, "Name"),
            email: get_value(values, "Email Address").to_lowercase(),
            phone: get_value(values, "Phone number"),
            street_1: get_value(values, "Street address line 1").to_uppercase(),
            street_2: get_value(values, "Street address line 2").to_uppercase(),
            city: get_value(values, "City").to_uppercase(),
            state: get_value(values, "State").to_uppercase(),
            zipcode: get_value(values, "Zipcode").to_uppercase(),
            country,
            address_formatted: String::new(),
            latitude: Default::default(),
            longitude: Default::default(),
            contents: contents.trim().to_string(),
            carrier: Default::default(),
            pickup_date: None,
            delivered_time: None,
            shipped_time: None,
            shippo_id: Default::default(),
            status: "Queued".to_string(),
            tracking_link: Default::default(),
            oxide_tracking_link: Default::default(),
            tracking_number: Default::default(),
            tracking_status: Default::default(),
            cost: Default::default(),
            label_link: Default::default(),
            eta: None,
            messages: Default::default(),
            notes: Default::default(),
            geocode_cache: Default::default(),
            local_pickup: false,
            link_to_package_pickup: Default::default(),
        }
    }
pub fn parse_from_row ( values : & HashMap < String , Vec < String > > ) -> Self { let hoodie_size = get_value ( values , " " ) ; let fleece_size = get_value ( values , " " ) ; let womens_shirt_size = get_value ( values , " " ) ; let unisex_shirt_size = get_value ( values , " " ) ; let kids_shirt_size = get_value ( values , " " ) ; let mut contents = String :: new ( ) ; if ! hoodie_size . is_empty ( ) && ! hoodie_size . contains ( " " ) { contents += & format ! ( " \n " hoodie_size ) ; } if ! fleece_size . is_empty ( ) && ! fleece_size . contains ( " " ) { contents += & format ! ( " \n " fleece_size ) ; } if ! womens_shirt_size . is_empty ( ) && ! womens_shirt_size . contains ( " " ) { contents += & format ! ( " \n " womens_shirt_size ) ; } if ! unisex_shirt_size . is_empty ( ) && ! unisex_shirt_size . contains ( " " ) { contents += & format ! ( " \n " unisex_shirt_size ) ; } if ! kids_shirt_size . is_empty ( ) && ! kids_shirt_size . contains ( " " ) { contents += & format ! ( " \n " kids_shirt_size ) ; } let mut country = get_value ( values , " " ) ; if country . is_empty ( ) { country = " " . to_string ( ) ; } NewOutboundShipment { created_time : NewOutboundShipment :: parse_timestamp ( & get_value ( values , " " ) ) , name : get_value ( values , " " ) , email : get_value ( values , " " ) . to_lowercase ( ) , phone : get_value ( values , " " ) , street_1 : get_value ( values , " " ) . to_uppercase ( ) , street_2 : get_value ( values , " " ) . to_uppercase ( ) , city : get_value ( values , " " ) . to_uppercase ( ) , state : get_value ( values , " " ) . to_uppercase ( ) , zipcode : get_value ( values , " " ) . to_uppercase ( ) , country , address_formatted : String :: new ( ) , latitude : Default :: default ( ) , longitude : Default :: default ( ) , contents : contents . trim ( ) . to_string ( ) , carrier : Default :: default ( ) , pickup_date : None , delivered_time : None , shipped_time : None , shippo_id : Default :: default ( ) , status : " " . to_string ( ) , tracking_link : Default :: default ( ) , oxide_tracking_link : Default :: default ( ) , tracking_number : Default :: default ( ) , tracking_status : Default :: default ( ) , cost : Default :: default ( ) , label_link : Default :: default ( ) , eta : None , messages : Default :: default ( ) , notes : Default :: default ( ) , geocode_cache : Default :: default ( ) , local_pickup : false , link_to_package_pickup : Default :: default ( ) , } }
Parse the sheet columns from single Google Sheets row values.
Parse the sheet columns from single Google Sheets row values .
values
&HashMap<String, Vec<String>>
values
&HashMap<String, Vec<String>>