vsphere/distributed_virtual_port_setting_structure.go
func expandDVSTrafficShapingPolicyIngress(d *schema.ResourceData) *types.DVSTrafficShapingPolicy {
	obj := &types.DVSTrafficShapingPolicy{
		Enabled:          structure.GetBoolPolicy(d, "ingress_shaping_enabled"),
		AverageBandwidth: structure.GetLongPolicy(d, "ingress_shaping_average_bandwidth"),
		PeakBandwidth:    structure.GetLongPolicy(d, "ingress_shaping_peak_bandwidth"),
		BurstSize:        structure.GetLongPolicy(d, "ingress_shaping_burst_size"),
	}

	if structure.AllFieldsEmpty(obj) {
		return nil
	}
	return obj
}
func expandDVSTrafficShapingPolicyIngress(d *schema.ResourceData) *types.DVSTrafficShapingPolicy {
	obj := &types.DVSTrafficShapingPolicy{
		Enabled:          structure.GetBoolPolicy(d, "ingress_shaping_enabled"),
		AverageBandwidth: structure.GetLongPolicy(d, "ingress_shaping_average_bandwidth"),
		PeakBandwidth:    structure.GetLongPolicy(d, "ingress_shaping_peak_bandwidth"),
		BurstSize:        structure.GetLongPolicy(d, "ingress_shaping_burst_size"),
	}

	if structure.AllFieldsEmpty(obj) {
		return nil
	}
	return obj
}
// expandDVSTrafficShapingPolicyIngress reads certain ResourceData keys and
// returns a DVSTrafficShapingPolicy for ingress traffic.