public void setAttributeType(string chars) { StockAttributeJSON.TypeValueKnownValues known = StockAttributeJSON.stringToValue(chars); StockAttributeJSON.TypeValue new_value = new StockAttributeJSON.TypeValue(); if (known == StockAttributeJSON.TypeValueKnownValues.Value__none) { new_value.in_known_list = false; new_value.string_value = chars; } else { new_value.in_known_list = true; new_value.list_value = known; } setAttributeType(new_value); }