added function to convert between resource type and values