code: func expandVMwareDVSPortSetting(d *schema.ResourceData) *types.VMwareDVSPortSetting {
  	obj := &types.VMwareDVSPortSetting{
  		DVPortSetting: types.DVPortSetting{
  			Blocked:                 structure.GetBoolPolicy(d, "block_all_ports"),
  			InShapingPolicy:         expandDVSTrafficShapingPolicyIngress(d),
  			OutShapingPolicy:        expandDVSTrafficShapingPolicyEgress(d),
  			VmDirectPathGen2Allowed: structure.GetBoolPolicy(d, "directpath_gen2_allowed"),
  		},
  		Vlan:                expandBaseVmwareDistributedVirtualSwitchVlanSpec(d),
  		UplinkTeamingPolicy: expandVmwareUplinkPortTeamingPolicy(d),
  		SecurityPolicy:      expandDVSSecurityPolicy(d),
  		IpfixEnabled:        structure.GetBoolPolicy(d, "netflow_enabled"),
  		TxUplink:            structure.GetBoolPolicy(d, "tx_uplink"),
  		LacpPolicy:          expandVMwareUplinkLacpPolicy(d),
  	}
  
  	if structure.AllFieldsEmpty(obj) {
  		return nil
  	}
  	return obj
  }
docs: // expandVMwareDVSPortSetting reads certain ResourceData keys and
  // returns a VMwareDVSPortSetting.