vsphere/distributed_virtual_switch_structure.go
func expandVMwareDVSConfigSpec(d *schema.ResourceData) *types.VMwareDVSConfigSpec {
	obj := &types.VMwareDVSConfigSpec{
		DVSConfigSpec: types.DVSConfigSpec{
			Name:                                d.Get("name").(string),
			ConfigVersion:                       d.Get("config_version").(string),
			DefaultPortConfig:                   expandVMwareDVSPortSetting(d),
			Host:                                expandSliceOfDistributedVirtualSwitchHostMemberConfigSpec(d),
			Description:                         d.Get("description").(string),
			Contact:                             expandDVSContactInfo(d),
			SwitchIpAddress:                     d.Get("ipv4_address").(string),
			InfrastructureTrafficResourceConfig: expandSliceOfDvsHostInfrastructureTrafficResource(d),
			NetworkResourceControlVersion:       d.Get("network_resource_control_version").(string),
			UplinkPortPolicy:                    expandDVSNameArrayUplinkPortPolicy(d),
		},
		MaxMtu:                      int32(d.Get("max_mtu").(int)),
		LinkDiscoveryProtocolConfig: expandLinkDiscoveryProtocolConfig(d),
		IpfixConfig:                 expandVMwareIpfixConfig(d),
		LacpApiVersion:              d.Get("lacp_api_version").(string),
		MulticastFilteringMode:      d.Get("multicast_filtering_mode").(string),
	}
	return obj
}
func expandVMwareDVSConfigSpec(d *schema.ResourceData) *types.VMwareDVSConfigSpec {
	obj := &types.VMwareDVSConfigSpec{
		DVSConfigSpec: types.DVSConfigSpec{
			Name:                                d.Get("name").(string),
			ConfigVersion:                       d.Get("config_version").(string),
			DefaultPortConfig:                   expandVMwareDVSPortSetting(d),
			Host:                                expandSliceOfDistributedVirtualSwitchHostMemberConfigSpec(d),
			Description:                         d.Get("description").(string),
			Contact:                             expandDVSContactInfo(d),
			SwitchIpAddress:                     d.Get("ipv4_address").(string),
			InfrastructureTrafficResourceConfig: expandSliceOfDvsHostInfrastructureTrafficResource(d),
			NetworkResourceControlVersion:       d.Get("network_resource_control_version").(string),
			UplinkPortPolicy:                    expandDVSNameArrayUplinkPortPolicy(d),
		},
		MaxMtu:                      int32(d.Get("max_mtu").(int)),
		LinkDiscoveryProtocolConfig: expandLinkDiscoveryProtocolConfig(d),
		IpfixConfig:                 expandVMwareIpfixConfig(d),
		LacpApiVersion:              d.Get("lacp_api_version").(string),
		MulticastFilteringMode:      d.Get("multicast_filtering_mode").(string),
	}
	return obj
}
// expandVMwareDVSConfigSpec reads certain ResourceData keys and
// returns a VMwareDVSConfigSpec.