vsphere/host_network_policy_structure.go
func expandHostNicFailureCriteria(d *schema.ResourceData) *types.HostNicFailureCriteria {
	obj := &types.HostNicFailureCriteria{}

	if v, ok := d.GetOkExists("check_beacon"); ok {
		obj.CheckBeacon = structure.BoolPtr(v.(bool))
	}

	// These fields are deprecated and are set only to make things work. They are
	// not exposed to Terraform.
	obj.CheckSpeed = "minimum"
	obj.Speed = 10
	obj.CheckDuplex = structure.BoolPtr(false)
	obj.FullDuplex = structure.BoolPtr(false)
	obj.CheckErrorPercent = structure.BoolPtr(false)
	obj.Percentage = 0

	return obj
}
func expandHostNicFailureCriteria(d *schema.ResourceData) *types.HostNicFailureCriteria {
	obj := &types.HostNicFailureCriteria{}

	if v, ok := d.GetOkExists("check_beacon"); ok {
		obj.CheckBeacon = structure.BoolPtr(v.(bool))
	}

	// These fields are deprecated and are set only to make things work. They are
	// not exposed to Terraform.
	obj.CheckSpeed = "minimum"
	obj.Speed = 10
	obj.CheckDuplex = structure.BoolPtr(false)
	obj.FullDuplex = structure.BoolPtr(false)
	obj.CheckErrorPercent = structure.BoolPtr(false)
	obj.Percentage = 0

	return obj
}
func expandHostNicFailureCriteria ( d * schema . ResourceData ) * types . HostNicFailureCriteria { obj := & types . HostNicFailureCriteria { } if v , ok := d . GetOkExists ( " " ) ; ok { obj . CheckBeacon = structure . BoolPtr ( v . ( bool ) ) } // These fields are deprecated and are set only to make things work. They are // not exposed to Terraform. obj . CheckSpeed = " " obj . Speed = 10 obj . CheckDuplex = structure . BoolPtr ( false ) obj . FullDuplex = structure . BoolPtr ( false ) obj . CheckErrorPercent = structure . BoolPtr ( false ) obj . Percentage = 0 return obj }
// expandHostNicFailureCriteria reads certain ResourceData keys and returns a
// HostNicFailureCriteria.
expandHostNicFailureCriteria reads certain ResourceData keys and returns a HostNicFailureCriteria .