vsphere/distributed_virtual_port_setting_structure.go
func schemaVMwareDVSPortSetting() map[string]*schema.Schema {
	return map[string]*schema.Schema{
		// VmwareDistributedVirtualSwitchVlanIdSpec
		"vlan_id": {
			Type:          schema.TypeInt,
			Optional:      true,
			Computed:      true,
			Description:   "The VLAN ID for single VLAN mode. 0 denotes no VLAN.",
			ConflictsWith: []string{"vlan_range", "port_private_secondary_vlan_id"},
			ValidateFunc:  validation.IntBetween(0, 4094),
		},

		// VmwareDistributedVirtualSwitchTrunkVlanSpec
		"vlan_range": {
			Type:          schema.TypeSet,
			Optional:      true,
			Computed:      true,
			Description:   "The VLAN ID for single VLAN mode. 0 denotes no VLAN.",
			ConflictsWith: []string{"vlan_id", "port_private_secondary_vlan_id"},
			Elem: &schema.Resource{
				Schema: map[string]*schema.Schema{
					"min_vlan": {
						Type:         schema.TypeInt,
						Required:     true,
						Description:  "The minimum VLAN to use in the range.",
						ValidateFunc: validation.IntBetween(0, 4094),
					},
					"max_vlan": {
						Type:         schema.TypeInt,
						Required:     true,
						Description:  "The minimum VLAN to use in the range.",
						ValidateFunc: validation.IntBetween(0, 4094),
					},
				},
			},
		},

		// VmwareDistributedVirtualSwitchPvlanSpec
		"port_private_secondary_vlan_id": {
			Type:          schema.TypeInt,
			Optional:      true,
			Computed:      true,
			Description:   "The secondary VLAN ID for this port.",
			ConflictsWith: []string{"vlan_id", "vlan_range"},
			ValidateFunc:  validation.IntBetween(1, 4094),
		},

		// VmwareUplinkPortTeamingPolicy/DVSFailureCriteria
		"check_beacon": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Enable beacon probing on the ports this policy applies to.",
		},

		// VmwareUplinkPortTeamingPolicy/VMwareUplinkPortOrderPolicy
		"active_uplinks": {
			Type:        schema.TypeList,
			Optional:    true,
			Computed:    true,
			Description: "List of active uplinks used for load balancing, matching the names of the uplinks assigned in the DVS.",
			Elem:        &schema.Schema{Type: schema.TypeString},
		},
		"standby_uplinks": {
			Type:        schema.TypeList,
			Optional:    true,
			Computed:    true,
			Description: "List of active uplinks used for load balancing, matching the names of the uplinks assigned in the DVS.",
			Elem:        &schema.Schema{Type: schema.TypeString},
		},

		// VmwareUplinkPortTeamingPolicy
		"teaming_policy": {
			Type:         schema.TypeString,
			Optional:     true,
			Computed:     true,
			Description:  "The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, failover_explicit, or loadbalance_loadbased.",
			ValidateFunc: validation.StringInSlice(vmwareUplinkPortTeamingPolicyModeAllowedValues, false),
		},
		"notify_switches": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.",
		},
		"failback": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.",
		},

		// DVSSecurityPolicy
		"allow_promiscuous": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.",
		},
		"allow_forged_transmits": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.",
		},
		"allow_mac_changes": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Controls whether or not the Media Access Control (MAC) address can be changed.",
		},

		// VMwareUplinkLacpPolicy
		"lacp_enabled": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Whether or not to enable LACP on all uplink ports.",
		},
		"lacp_mode": {
			Type:         schema.TypeString,
			Optional:     true,
			Computed:     true,
			Description:  "The uplink LACP mode to use. Can be one of active or passive.",
			ValidateFunc: validation.StringInSlice(vmwareUplinkLacpPolicyModeAllowedValues, false),
		},

		// DVSTrafficShapingPolicy - ingress
		"ingress_shaping_average_bandwidth": {
			Type:        schema.TypeInt,
			Optional:    true,
			Computed:    true,
			Description: "The average ingress bandwidth in bits per second if ingress shaping is enabled on the port.",
		},
		"ingress_shaping_burst_size": {
			Type:        schema.TypeInt,
			Optional:    true,
			Computed:    true,
			Description: "The maximum ingress burst size allowed in bytes if ingress shaping is enabled on the port.",
		},
		"ingress_shaping_enabled": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "True if the traffic shaper is enabled for ingress traffic on the port.",
		},
		"ingress_shaping_peak_bandwidth": {
			Type:        schema.TypeInt,
			Optional:    true,
			Computed:    true,
			Description: "The peak ingress bandwidth during bursts in bits per second if ingress traffic shaping is enabled on the port.",
		},

		// DVSTrafficShapingPolicy - egress
		"egress_shaping_average_bandwidth": {
			Type:        schema.TypeInt,
			Optional:    true,
			Computed:    true,
			Description: "The average egress bandwidth in bits per second if egress shaping is enabled on the port.",
		},
		"egress_shaping_burst_size": {
			Type:        schema.TypeInt,
			Optional:    true,
			Computed:    true,
			Description: "The maximum egress burst size allowed in bytes if egress shaping is enabled on the port.",
		},
		"egress_shaping_enabled": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "True if the traffic shaper is enabled for egress traffic on the port.",
		},
		"egress_shaping_peak_bandwidth": {
			Type:        schema.TypeInt,
			Optional:    true,
			Computed:    true,
			Description: "The peak egress bandwidth during bursts in bits per second if egress traffic shaping is enabled on the port.",
		},

		// VMwareDVSPortSetting
		"block_all_ports": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Indicates whether to block all ports by default.",
		},
		"netflow_enabled": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Indicates whether to enable netflow on all ports.",
		},
		"tx_uplink": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "If true, a copy of packets sent to the switch will always be forwarded to an uplink in addition to the regular packet forwarded done by the switch.",
		},
		"directpath_gen2_allowed": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Allow VMDirectPath Gen2 on the ports this policy applies to.",
		},
	}
}
func schemaVMwareDVSPortSetting() map[string]*schema.Schema {
	return map[string]*schema.Schema{
		// VmwareDistributedVirtualSwitchVlanIdSpec
		"vlan_id": {
			Type:          schema.TypeInt,
			Optional:      true,
			Computed:      true,
			Description:   "The VLAN ID for single VLAN mode. 0 denotes no VLAN.",
			ConflictsWith: []string{"vlan_range", "port_private_secondary_vlan_id"},
			ValidateFunc:  validation.IntBetween(0, 4094),
		},

		// VmwareDistributedVirtualSwitchTrunkVlanSpec
		"vlan_range": {
			Type:          schema.TypeSet,
			Optional:      true,
			Computed:      true,
			Description:   "The VLAN ID for single VLAN mode. 0 denotes no VLAN.",
			ConflictsWith: []string{"vlan_id", "port_private_secondary_vlan_id"},
			Elem: &schema.Resource{
				Schema: map[string]*schema.Schema{
					"min_vlan": {
						Type:         schema.TypeInt,
						Required:     true,
						Description:  "The minimum VLAN to use in the range.",
						ValidateFunc: validation.IntBetween(0, 4094),
					},
					"max_vlan": {
						Type:         schema.TypeInt,
						Required:     true,
						Description:  "The minimum VLAN to use in the range.",
						ValidateFunc: validation.IntBetween(0, 4094),
					},
				},
			},
		},

		// VmwareDistributedVirtualSwitchPvlanSpec
		"port_private_secondary_vlan_id": {
			Type:          schema.TypeInt,
			Optional:      true,
			Computed:      true,
			Description:   "The secondary VLAN ID for this port.",
			ConflictsWith: []string{"vlan_id", "vlan_range"},
			ValidateFunc:  validation.IntBetween(1, 4094),
		},

		// VmwareUplinkPortTeamingPolicy/DVSFailureCriteria
		"check_beacon": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Enable beacon probing on the ports this policy applies to.",
		},

		// VmwareUplinkPortTeamingPolicy/VMwareUplinkPortOrderPolicy
		"active_uplinks": {
			Type:        schema.TypeList,
			Optional:    true,
			Computed:    true,
			Description: "List of active uplinks used for load balancing, matching the names of the uplinks assigned in the DVS.",
			Elem:        &schema.Schema{Type: schema.TypeString},
		},
		"standby_uplinks": {
			Type:        schema.TypeList,
			Optional:    true,
			Computed:    true,
			Description: "List of active uplinks used for load balancing, matching the names of the uplinks assigned in the DVS.",
			Elem:        &schema.Schema{Type: schema.TypeString},
		},

		// VmwareUplinkPortTeamingPolicy
		"teaming_policy": {
			Type:         schema.TypeString,
			Optional:     true,
			Computed:     true,
			Description:  "The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, failover_explicit, or loadbalance_loadbased.",
			ValidateFunc: validation.StringInSlice(vmwareUplinkPortTeamingPolicyModeAllowedValues, false),
		},
		"notify_switches": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.",
		},
		"failback": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.",
		},

		// DVSSecurityPolicy
		"allow_promiscuous": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.",
		},
		"allow_forged_transmits": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.",
		},
		"allow_mac_changes": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Controls whether or not the Media Access Control (MAC) address can be changed.",
		},

		// VMwareUplinkLacpPolicy
		"lacp_enabled": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Whether or not to enable LACP on all uplink ports.",
		},
		"lacp_mode": {
			Type:         schema.TypeString,
			Optional:     true,
			Computed:     true,
			Description:  "The uplink LACP mode to use. Can be one of active or passive.",
			ValidateFunc: validation.StringInSlice(vmwareUplinkLacpPolicyModeAllowedValues, false),
		},

		// DVSTrafficShapingPolicy - ingress
		"ingress_shaping_average_bandwidth": {
			Type:        schema.TypeInt,
			Optional:    true,
			Computed:    true,
			Description: "The average ingress bandwidth in bits per second if ingress shaping is enabled on the port.",
		},
		"ingress_shaping_burst_size": {
			Type:        schema.TypeInt,
			Optional:    true,
			Computed:    true,
			Description: "The maximum ingress burst size allowed in bytes if ingress shaping is enabled on the port.",
		},
		"ingress_shaping_enabled": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "True if the traffic shaper is enabled for ingress traffic on the port.",
		},
		"ingress_shaping_peak_bandwidth": {
			Type:        schema.TypeInt,
			Optional:    true,
			Computed:    true,
			Description: "The peak ingress bandwidth during bursts in bits per second if ingress traffic shaping is enabled on the port.",
		},

		// DVSTrafficShapingPolicy - egress
		"egress_shaping_average_bandwidth": {
			Type:        schema.TypeInt,
			Optional:    true,
			Computed:    true,
			Description: "The average egress bandwidth in bits per second if egress shaping is enabled on the port.",
		},
		"egress_shaping_burst_size": {
			Type:        schema.TypeInt,
			Optional:    true,
			Computed:    true,
			Description: "The maximum egress burst size allowed in bytes if egress shaping is enabled on the port.",
		},
		"egress_shaping_enabled": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "True if the traffic shaper is enabled for egress traffic on the port.",
		},
		"egress_shaping_peak_bandwidth": {
			Type:        schema.TypeInt,
			Optional:    true,
			Computed:    true,
			Description: "The peak egress bandwidth during bursts in bits per second if egress traffic shaping is enabled on the port.",
		},

		// VMwareDVSPortSetting
		"block_all_ports": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Indicates whether to block all ports by default.",
		},
		"netflow_enabled": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Indicates whether to enable netflow on all ports.",
		},
		"tx_uplink": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "If true, a copy of packets sent to the switch will always be forwarded to an uplink in addition to the regular packet forwarded done by the switch.",
		},
		"directpath_gen2_allowed": {
			Type:        schema.TypeBool,
			Optional:    true,
			Computed:    true,
			Description: "Allow VMDirectPath Gen2 on the ports this policy applies to.",
		},
	}
}
// schemaVMwareDVSPortSetting returns schema items for resources that
// need to work with a VMwareDVSPortSetting.