vsphere/host_virtual_switch_structure.go
func expandHostVirtualSwitchSpec(d *schema.ResourceData) *types.HostVirtualSwitchSpec {
	obj := &types.HostVirtualSwitchSpec{
		Mtu:      int32(d.Get("mtu").(int)),
		NumPorts: int32(d.Get("number_of_ports").(int)),
		Bridge:   expandHostVirtualSwitchBondBridge(d),
		Policy:   expandHostNetworkPolicy(d),
	}
	// If there are no NICs, we need to nil-out Bridge, as a
	// HostVirtualSwitchBondBridge with no NICs is an invalid config.
	if len(obj.Bridge.(*types.HostVirtualSwitchBondBridge).NicDevice) < 1 {
		obj.Bridge = nil
	}
	return obj
}
func expandHostVirtualSwitchSpec(d *schema.ResourceData) *types.HostVirtualSwitchSpec {
	obj := &types.HostVirtualSwitchSpec{
		Mtu:      int32(d.Get("mtu").(int)),
		NumPorts: int32(d.Get("number_of_ports").(int)),
		Bridge:   expandHostVirtualSwitchBondBridge(d),
		Policy:   expandHostNetworkPolicy(d),
	}
	// If there are no NICs, we need to nil-out Bridge, as a
	// HostVirtualSwitchBondBridge with no NICs is an invalid config.
	if len(obj.Bridge.(*types.HostVirtualSwitchBondBridge).NicDevice) < 1 {
		obj.Bridge = nil
	}
	return obj
}
func expandHostVirtualSwitchSpec ( d * schema . ResourceData ) * types . HostVirtualSwitchSpec { obj := & types . HostVirtualSwitchSpec { Mtu : int32 ( d . Get ( " " ) . ( int ) ) , NumPorts : int32 ( d . Get ( " " ) . ( int ) ) , Bridge : expandHostVirtualSwitchBondBridge ( d ) , Policy : expandHostNetworkPolicy ( d ) , } // If there are no NICs, we need to nil-out Bridge, as a // HostVirtualSwitchBondBridge with no NICs is an invalid config. if len ( obj . Bridge . ( * types . HostVirtualSwitchBondBridge ) . NicDevice ) < 1 { obj . Bridge = nil } return obj }
// expandHostVirtualSwitchSpec reads certain ResourceData keys and returns a
// HostVirtualSwitchSpec.
expandHostVirtualSwitchSpec reads certain ResourceData keys and returns a HostVirtualSwitchSpec .