vsphere/distributed_virtual_port_setting_structure.go
func expandVmwareDistributedVirtualSwitchTrunkVlanSpec(d *schema.ResourceData) *types.VmwareDistributedVirtualSwitchTrunkVlanSpec {
	var ranges []types.NumericRange
	data := d.Get("vlan_range").(*schema.Set).List()
	for _, v := range data {
		log.Printf("[DEBUG] processing range: %#v", v)
		r := v.(map[string]interface{})
		min := r["min_vlan"].(int)
		max := r["max_vlan"].(int)
		rng := types.NumericRange{
			Start: int32(min),
			End:   int32(max),
		}
		ranges = append(ranges, rng)
	}

	if len(ranges) < 1 {
		return nil
	}

	obj := &types.VmwareDistributedVirtualSwitchTrunkVlanSpec{
		VlanId: ranges,
	}
	return obj
}
func expandVmwareDistributedVirtualSwitchTrunkVlanSpec(d *schema.ResourceData) *types.VmwareDistributedVirtualSwitchTrunkVlanSpec {
	var ranges []types.NumericRange
	data := d.Get("vlan_range").(*schema.Set).List()
	for _, v := range data {
		log.Printf("[DEBUG] processing range: %#v", v)
		r := v.(map[string]interface{})
		min := r["min_vlan"].(int)
		max := r["max_vlan"].(int)
		rng := types.NumericRange{
			Start: int32(min),
			End:   int32(max),
		}
		ranges = append(ranges, rng)
	}

	if len(ranges) < 1 {
		return nil
	}

	obj := &types.VmwareDistributedVirtualSwitchTrunkVlanSpec{
		VlanId: ranges,
	}
	return obj
}
// expandVmwareDistributedVirtualSwitchTrunkVlanSpec reads certain ResourceData keys and
// returns a VmwareDistributedVirtualSwitchTrunkVlanSpec.