/*This file is automatically generated by pkg.deepin.io/dbus-generator. Don't edit it*/
package networkmanager

import "pkg.deepin.io/lib/dbus"
import "pkg.deepin.io/lib/dbus/property"
import "reflect"
import "sync"
import "runtime"
import "fmt"
import "errors"

/*prevent compile error*/
var _ = fmt.Println
var _ = runtime.SetFinalizer
var _ = sync.NewCond
var _ = reflect.TypeOf
var _ = property.BaseObserver{}

type Device struct {
	Path     dbus.ObjectPath
	DestName string
	core     *dbus.Object

	signals       map[<-chan *dbus.Signal]struct{}
	signalsLocker sync.Mutex

	Udi                  *dbusPropertyDeviceUdi
	Interface            *dbusPropertyDeviceInterface
	IpInterface          *dbusPropertyDeviceIpInterface
	Driver               *dbusPropertyDeviceDriver
	DriverVersion        *dbusPropertyDeviceDriverVersion
	FirmwareVersion      *dbusPropertyDeviceFirmwareVersion
	Capabilities         *dbusPropertyDeviceCapabilities
	Ip4Address           *dbusPropertyDeviceIp4Address
	State                *dbusPropertyDeviceState
	StateReason          *dbusPropertyDeviceStateReason
	ActiveConnection     *dbusPropertyDeviceActiveConnection
	Ip4Config            *dbusPropertyDeviceIp4Config
	Dhcp4Config          *dbusPropertyDeviceDhcp4Config
	Ip6Config            *dbusPropertyDeviceIp6Config
	Dhcp6Config          *dbusPropertyDeviceDhcp6Config
	Managed              *dbusPropertyDeviceManaged
	Autoconnect          *dbusPropertyDeviceAutoconnect
	FirmwareMissing      *dbusPropertyDeviceFirmwareMissing
	NmPluginMissing      *dbusPropertyDeviceNmPluginMissing
	DeviceType           *dbusPropertyDeviceDeviceType
	AvailableConnections *dbusPropertyDeviceAvailableConnections
	PhysicalPortId       *dbusPropertyDevicePhysicalPortId
	Mtu                  *dbusPropertyDeviceMtu
	Metered              *dbusPropertyDeviceMetered
	LldpNeighbors        *dbusPropertyDeviceLldpNeighbors
	Real                 *dbusPropertyDeviceReal
}

func (obj *Device) _createSignalChan() <-chan *dbus.Signal {
	obj.signalsLocker.Lock()
	ch := getBus().Signal()
	obj.signals[ch] = struct{}{}
	obj.signalsLocker.Unlock()
	return ch
}
func (obj *Device) _deleteSignalChan(ch <-chan *dbus.Signal) {
	obj.signalsLocker.Lock()
	delete(obj.signals, ch)
	getBus().DetachSignal(ch)
	obj.signalsLocker.Unlock()
}
func DestroyDevice(obj *Device) {
	obj.signalsLocker.Lock()
	defer obj.signalsLocker.Unlock()
	if obj.signals == nil {
		return
	}
	for ch, _ := range obj.signals {
		getBus().DetachSignal(ch)
	}
	obj.signals = nil

	runtime.SetFinalizer(obj, nil)

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='org.freedesktop.DBus.Properties',sender='" + obj.DestName + "',member='PropertiesChanged'")
	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='org.freedesktop.NetworkManager.Device',sender='" + obj.DestName + "',member='PropertiesChanged'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='org.freedesktop.NetworkManager.Device',sender='" + obj.DestName + "',member='StateChanged'")

	obj.Udi.Reset()
	obj.Interface.Reset()
	obj.IpInterface.Reset()
	obj.Driver.Reset()
	obj.DriverVersion.Reset()
	obj.FirmwareVersion.Reset()
	obj.Capabilities.Reset()
	obj.Ip4Address.Reset()
	obj.State.Reset()
	obj.StateReason.Reset()
	obj.ActiveConnection.Reset()
	obj.Ip4Config.Reset()
	obj.Dhcp4Config.Reset()
	obj.Ip6Config.Reset()
	obj.Dhcp6Config.Reset()
	obj.Managed.Reset()
	obj.Autoconnect.Reset()
	obj.FirmwareMissing.Reset()
	obj.NmPluginMissing.Reset()
	obj.DeviceType.Reset()
	obj.AvailableConnections.Reset()
	obj.PhysicalPortId.Reset()
	obj.Mtu.Reset()
	obj.Metered.Reset()
	obj.LldpNeighbors.Reset()
	obj.Real.Reset()
}

func (obj *Device) Reapply(connection map[string]map[string]dbus.Variant, version_id uint64, flags uint32) (_err error) {
	_err = obj.core.Call("org.freedesktop.NetworkManager.Device.Reapply", 0, connection, version_id, flags).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Device) GetAppliedConnection(flags uint32) (connection map[string]map[string]dbus.Variant, version_id uint64, _err error) {
	_err = obj.core.Call("org.freedesktop.NetworkManager.Device.GetAppliedConnection", 0, flags).Store(&connection, &version_id)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Device) Disconnect() (_err error) {
	_err = obj.core.Call("org.freedesktop.NetworkManager.Device.Disconnect", 0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Device) Delete() (_err error) {
	_err = obj.core.Call("org.freedesktop.NetworkManager.Device.Delete", 0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Device) ConnectStateChanged(callback func(new_state uint32, old_state uint32, reason uint32)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "org.freedesktop.NetworkManager.Device.StateChanged" || 3 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*uint32)(nil)).Elem() {
				continue
			}
			if reflect.TypeOf(v.Body[1]) != reflect.TypeOf((*uint32)(nil)).Elem() {
				continue
			}
			if reflect.TypeOf(v.Body[2]) != reflect.TypeOf((*uint32)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(uint32), v.Body[1].(uint32), v.Body[2].(uint32))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

type dbusPropertyDeviceUdi struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceUdi) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.Udi is not writable")
}

func (this *dbusPropertyDeviceUdi) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyDeviceUdi) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Udi").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyDeviceUdi) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyDeviceInterface struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceInterface) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.Interface is not writable")
}

func (this *dbusPropertyDeviceInterface) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyDeviceInterface) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Interface").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyDeviceInterface) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyDeviceIpInterface struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceIpInterface) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.IpInterface is not writable")
}

func (this *dbusPropertyDeviceIpInterface) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyDeviceIpInterface) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "IpInterface").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyDeviceIpInterface) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyDeviceDriver struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceDriver) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.Driver is not writable")
}

func (this *dbusPropertyDeviceDriver) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyDeviceDriver) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Driver").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyDeviceDriver) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyDeviceDriverVersion struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceDriverVersion) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.DriverVersion is not writable")
}

func (this *dbusPropertyDeviceDriverVersion) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyDeviceDriverVersion) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "DriverVersion").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyDeviceDriverVersion) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyDeviceFirmwareVersion struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceFirmwareVersion) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.FirmwareVersion is not writable")
}

func (this *dbusPropertyDeviceFirmwareVersion) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyDeviceFirmwareVersion) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "FirmwareVersion").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyDeviceFirmwareVersion) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyDeviceCapabilities struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceCapabilities) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.Capabilities is not writable")
}

func (this *dbusPropertyDeviceCapabilities) Get() uint32 {
	v, _ := this.GetValue()
	return v.(uint32)
}
func (this *dbusPropertyDeviceCapabilities) GetValue() (interface{} /*uint32*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Capabilities").Store(&r)
	if err == nil && r.Signature().String() == "u" {
		return r.Value().(uint32), nil
	}
	return *new(uint32), err
}
func (this *dbusPropertyDeviceCapabilities) GetType() reflect.Type {
	return reflect.TypeOf((*uint32)(nil)).Elem()
}

type dbusPropertyDeviceIp4Address struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceIp4Address) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.Ip4Address is not writable")
}

func (this *dbusPropertyDeviceIp4Address) Get() uint32 {
	v, _ := this.GetValue()
	return v.(uint32)
}
func (this *dbusPropertyDeviceIp4Address) GetValue() (interface{} /*uint32*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Ip4Address").Store(&r)
	if err == nil && r.Signature().String() == "u" {
		return r.Value().(uint32), nil
	}
	return *new(uint32), err
}
func (this *dbusPropertyDeviceIp4Address) GetType() reflect.Type {
	return reflect.TypeOf((*uint32)(nil)).Elem()
}

type dbusPropertyDeviceState struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceState) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.State is not writable")
}

func (this *dbusPropertyDeviceState) Get() uint32 {
	v, _ := this.GetValue()
	return v.(uint32)
}
func (this *dbusPropertyDeviceState) GetValue() (interface{} /*uint32*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "State").Store(&r)
	if err == nil && r.Signature().String() == "u" {
		return r.Value().(uint32), nil
	}
	return *new(uint32), err
}
func (this *dbusPropertyDeviceState) GetType() reflect.Type {
	return reflect.TypeOf((*uint32)(nil)).Elem()
}

type dbusPropertyDeviceStateReason struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceStateReason) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.StateReason is not writable")
}

func (this *dbusPropertyDeviceStateReason) Get() []interface{} {
	v, _ := this.GetValue()
	return v.([]interface{})
}
func (this *dbusPropertyDeviceStateReason) GetValue() (interface{} /*[]interface {}*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "StateReason").Store(&r)
	if err == nil && r.Signature().String() == "(uu)" {
		return r.Value().([]interface{}), nil
	}
	return *new([]interface{}), err
}
func (this *dbusPropertyDeviceStateReason) GetType() reflect.Type {
	return reflect.TypeOf((*[]interface{})(nil)).Elem()
}

type dbusPropertyDeviceActiveConnection struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceActiveConnection) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.ActiveConnection is not writable")
}

func (this *dbusPropertyDeviceActiveConnection) Get() dbus.ObjectPath {
	v, _ := this.GetValue()
	return v.(dbus.ObjectPath)
}
func (this *dbusPropertyDeviceActiveConnection) GetValue() (interface{} /*dbus.ObjectPath*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "ActiveConnection").Store(&r)
	if err == nil && r.Signature().String() == "o" {
		return r.Value().(dbus.ObjectPath), nil
	}
	return *new(dbus.ObjectPath), err
}
func (this *dbusPropertyDeviceActiveConnection) GetType() reflect.Type {
	return reflect.TypeOf((*dbus.ObjectPath)(nil)).Elem()
}

type dbusPropertyDeviceIp4Config struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceIp4Config) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.Ip4Config is not writable")
}

func (this *dbusPropertyDeviceIp4Config) Get() dbus.ObjectPath {
	v, _ := this.GetValue()
	return v.(dbus.ObjectPath)
}
func (this *dbusPropertyDeviceIp4Config) GetValue() (interface{} /*dbus.ObjectPath*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Ip4Config").Store(&r)
	if err == nil && r.Signature().String() == "o" {
		return r.Value().(dbus.ObjectPath), nil
	}
	return *new(dbus.ObjectPath), err
}
func (this *dbusPropertyDeviceIp4Config) GetType() reflect.Type {
	return reflect.TypeOf((*dbus.ObjectPath)(nil)).Elem()
}

type dbusPropertyDeviceDhcp4Config struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceDhcp4Config) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.Dhcp4Config is not writable")
}

func (this *dbusPropertyDeviceDhcp4Config) Get() dbus.ObjectPath {
	v, _ := this.GetValue()
	return v.(dbus.ObjectPath)
}
func (this *dbusPropertyDeviceDhcp4Config) GetValue() (interface{} /*dbus.ObjectPath*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Dhcp4Config").Store(&r)
	if err == nil && r.Signature().String() == "o" {
		return r.Value().(dbus.ObjectPath), nil
	}
	return *new(dbus.ObjectPath), err
}
func (this *dbusPropertyDeviceDhcp4Config) GetType() reflect.Type {
	return reflect.TypeOf((*dbus.ObjectPath)(nil)).Elem()
}

type dbusPropertyDeviceIp6Config struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceIp6Config) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.Ip6Config is not writable")
}

func (this *dbusPropertyDeviceIp6Config) Get() dbus.ObjectPath {
	v, _ := this.GetValue()
	return v.(dbus.ObjectPath)
}
func (this *dbusPropertyDeviceIp6Config) GetValue() (interface{} /*dbus.ObjectPath*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Ip6Config").Store(&r)
	if err == nil && r.Signature().String() == "o" {
		return r.Value().(dbus.ObjectPath), nil
	}
	return *new(dbus.ObjectPath), err
}
func (this *dbusPropertyDeviceIp6Config) GetType() reflect.Type {
	return reflect.TypeOf((*dbus.ObjectPath)(nil)).Elem()
}

type dbusPropertyDeviceDhcp6Config struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceDhcp6Config) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.Dhcp6Config is not writable")
}

func (this *dbusPropertyDeviceDhcp6Config) Get() dbus.ObjectPath {
	v, _ := this.GetValue()
	return v.(dbus.ObjectPath)
}
func (this *dbusPropertyDeviceDhcp6Config) GetValue() (interface{} /*dbus.ObjectPath*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Dhcp6Config").Store(&r)
	if err == nil && r.Signature().String() == "o" {
		return r.Value().(dbus.ObjectPath), nil
	}
	return *new(dbus.ObjectPath), err
}
func (this *dbusPropertyDeviceDhcp6Config) GetType() reflect.Type {
	return reflect.TypeOf((*dbus.ObjectPath)(nil)).Elem()
}

type dbusPropertyDeviceManaged struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceManaged) SetValue(v interface{} /*bool*/) {
	if reflect.TypeOf(v) == reflect.TypeOf((*bool)(nil)).Elem() {
		this.core.Call("org.freedesktop.DBus.Properties.Set", 0, "org.freedesktop.NetworkManager.Device", "Managed", dbus.MakeVariant(v))
	} else {
		fmt.Println("The property Managed of org.freedesktop.NetworkManager.Device is an bool but Set with an ", reflect.TypeOf(v))
	}
}
func (this *dbusPropertyDeviceManaged) Set(v bool) {
	this.SetValue(v)
}

func (this *dbusPropertyDeviceManaged) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyDeviceManaged) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Managed").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyDeviceManaged) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyDeviceAutoconnect struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceAutoconnect) SetValue(v interface{} /*bool*/) {
	if reflect.TypeOf(v) == reflect.TypeOf((*bool)(nil)).Elem() {
		this.core.Call("org.freedesktop.DBus.Properties.Set", 0, "org.freedesktop.NetworkManager.Device", "Autoconnect", dbus.MakeVariant(v))
	} else {
		fmt.Println("The property Autoconnect of org.freedesktop.NetworkManager.Device is an bool but Set with an ", reflect.TypeOf(v))
	}
}
func (this *dbusPropertyDeviceAutoconnect) Set(v bool) {
	this.SetValue(v)
}

func (this *dbusPropertyDeviceAutoconnect) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyDeviceAutoconnect) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Autoconnect").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyDeviceAutoconnect) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyDeviceFirmwareMissing struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceFirmwareMissing) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.FirmwareMissing is not writable")
}

func (this *dbusPropertyDeviceFirmwareMissing) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyDeviceFirmwareMissing) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "FirmwareMissing").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyDeviceFirmwareMissing) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyDeviceNmPluginMissing struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceNmPluginMissing) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.NmPluginMissing is not writable")
}

func (this *dbusPropertyDeviceNmPluginMissing) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyDeviceNmPluginMissing) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "NmPluginMissing").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyDeviceNmPluginMissing) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyDeviceDeviceType struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceDeviceType) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.DeviceType is not writable")
}

func (this *dbusPropertyDeviceDeviceType) Get() uint32 {
	v, _ := this.GetValue()
	return v.(uint32)
}
func (this *dbusPropertyDeviceDeviceType) GetValue() (interface{} /*uint32*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "DeviceType").Store(&r)
	if err == nil && r.Signature().String() == "u" {
		return r.Value().(uint32), nil
	}
	return *new(uint32), err
}
func (this *dbusPropertyDeviceDeviceType) GetType() reflect.Type {
	return reflect.TypeOf((*uint32)(nil)).Elem()
}

type dbusPropertyDeviceAvailableConnections struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceAvailableConnections) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.AvailableConnections is not writable")
}

func (this *dbusPropertyDeviceAvailableConnections) Get() []dbus.ObjectPath {
	v, _ := this.GetValue()
	return v.([]dbus.ObjectPath)
}
func (this *dbusPropertyDeviceAvailableConnections) GetValue() (interface{} /*[]dbus.ObjectPath*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "AvailableConnections").Store(&r)
	if err == nil && r.Signature().String() == "ao" {
		return r.Value().([]dbus.ObjectPath), nil
	}
	return *new([]dbus.ObjectPath), err
}
func (this *dbusPropertyDeviceAvailableConnections) GetType() reflect.Type {
	return reflect.TypeOf((*[]dbus.ObjectPath)(nil)).Elem()
}

type dbusPropertyDevicePhysicalPortId struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDevicePhysicalPortId) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.PhysicalPortId is not writable")
}

func (this *dbusPropertyDevicePhysicalPortId) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyDevicePhysicalPortId) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "PhysicalPortId").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyDevicePhysicalPortId) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyDeviceMtu struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceMtu) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.Mtu is not writable")
}

func (this *dbusPropertyDeviceMtu) Get() uint32 {
	v, _ := this.GetValue()
	return v.(uint32)
}
func (this *dbusPropertyDeviceMtu) GetValue() (interface{} /*uint32*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Mtu").Store(&r)
	if err == nil && r.Signature().String() == "u" {
		return r.Value().(uint32), nil
	}
	return *new(uint32), err
}
func (this *dbusPropertyDeviceMtu) GetType() reflect.Type {
	return reflect.TypeOf((*uint32)(nil)).Elem()
}

type dbusPropertyDeviceMetered struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceMetered) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.Metered is not writable")
}

func (this *dbusPropertyDeviceMetered) Get() uint32 {
	v, _ := this.GetValue()
	return v.(uint32)
}
func (this *dbusPropertyDeviceMetered) GetValue() (interface{} /*uint32*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Metered").Store(&r)
	if err == nil && r.Signature().String() == "u" {
		return r.Value().(uint32), nil
	}
	return *new(uint32), err
}
func (this *dbusPropertyDeviceMetered) GetType() reflect.Type {
	return reflect.TypeOf((*uint32)(nil)).Elem()
}

type dbusPropertyDeviceLldpNeighbors struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceLldpNeighbors) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.LldpNeighbors is not writable")
}

func (this *dbusPropertyDeviceLldpNeighbors) Get() []map[string]dbus.Variant {
	v, _ := this.GetValue()
	return v.([]map[string]dbus.Variant)
}
func (this *dbusPropertyDeviceLldpNeighbors) GetValue() (interface{} /*[]map[string]dbus.Variant*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "LldpNeighbors").Store(&r)
	if err == nil && r.Signature().String() == "aa{sv}" {
		return r.Value().([]map[string]dbus.Variant), nil
	}
	return *new([]map[string]dbus.Variant), err
}
func (this *dbusPropertyDeviceLldpNeighbors) GetType() reflect.Type {
	return reflect.TypeOf((*[]map[string]dbus.Variant)(nil)).Elem()
}

type dbusPropertyDeviceReal struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyDeviceReal) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.NetworkManager.Device.Real is not writable")
}

func (this *dbusPropertyDeviceReal) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyDeviceReal) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager.Device", "Real").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyDeviceReal) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

func NewDevice(destName string, path dbus.ObjectPath) (*Device, error) {
	if !path.IsValid() {
		return nil, errors.New("The path of '" + string(path) + "' is invalid.")
	}

	core := getBus().Object(destName, path)

	obj := &Device{Path: path, DestName: destName, core: core, signals: make(map[<-chan *dbus.Signal]struct{})}

	obj.Udi = &dbusPropertyDeviceUdi{&property.BaseObserver{}, core}
	obj.Interface = &dbusPropertyDeviceInterface{&property.BaseObserver{}, core}
	obj.IpInterface = &dbusPropertyDeviceIpInterface{&property.BaseObserver{}, core}
	obj.Driver = &dbusPropertyDeviceDriver{&property.BaseObserver{}, core}
	obj.DriverVersion = &dbusPropertyDeviceDriverVersion{&property.BaseObserver{}, core}
	obj.FirmwareVersion = &dbusPropertyDeviceFirmwareVersion{&property.BaseObserver{}, core}
	obj.Capabilities = &dbusPropertyDeviceCapabilities{&property.BaseObserver{}, core}
	obj.Ip4Address = &dbusPropertyDeviceIp4Address{&property.BaseObserver{}, core}
	obj.State = &dbusPropertyDeviceState{&property.BaseObserver{}, core}
	obj.StateReason = &dbusPropertyDeviceStateReason{&property.BaseObserver{}, core}
	obj.ActiveConnection = &dbusPropertyDeviceActiveConnection{&property.BaseObserver{}, core}
	obj.Ip4Config = &dbusPropertyDeviceIp4Config{&property.BaseObserver{}, core}
	obj.Dhcp4Config = &dbusPropertyDeviceDhcp4Config{&property.BaseObserver{}, core}
	obj.Ip6Config = &dbusPropertyDeviceIp6Config{&property.BaseObserver{}, core}
	obj.Dhcp6Config = &dbusPropertyDeviceDhcp6Config{&property.BaseObserver{}, core}
	obj.Managed = &dbusPropertyDeviceManaged{&property.BaseObserver{}, core}
	obj.Autoconnect = &dbusPropertyDeviceAutoconnect{&property.BaseObserver{}, core}
	obj.FirmwareMissing = &dbusPropertyDeviceFirmwareMissing{&property.BaseObserver{}, core}
	obj.NmPluginMissing = &dbusPropertyDeviceNmPluginMissing{&property.BaseObserver{}, core}
	obj.DeviceType = &dbusPropertyDeviceDeviceType{&property.BaseObserver{}, core}
	obj.AvailableConnections = &dbusPropertyDeviceAvailableConnections{&property.BaseObserver{}, core}
	obj.PhysicalPortId = &dbusPropertyDevicePhysicalPortId{&property.BaseObserver{}, core}
	obj.Mtu = &dbusPropertyDeviceMtu{&property.BaseObserver{}, core}
	obj.Metered = &dbusPropertyDeviceMetered{&property.BaseObserver{}, core}
	obj.LldpNeighbors = &dbusPropertyDeviceLldpNeighbors{&property.BaseObserver{}, core}
	obj.Real = &dbusPropertyDeviceReal{&property.BaseObserver{}, core}

	dbusAddMatch("type='signal',path='" + string(path) + "',interface='org.freedesktop.DBus.Properties',sender='" + destName + "',member='PropertiesChanged'")
	dbusAddMatch("type='signal',path='" + string(path) + "',interface='org.freedesktop.NetworkManager.Device',sender='" + destName + "',member='PropertiesChanged'")
	sigChan := obj._createSignalChan()
	go func() {
		typeString := reflect.TypeOf("")
		typeKeyValues := reflect.TypeOf(map[string]dbus.Variant{})
		typeArrayValues := reflect.TypeOf([]string{})
		for v := range sigChan {
			if v.Name == "org.freedesktop.DBus.Properties.PropertiesChanged" &&
				len(v.Body) == 3 &&
				reflect.TypeOf(v.Body[0]) == typeString &&
				reflect.TypeOf(v.Body[1]) == typeKeyValues &&
				reflect.TypeOf(v.Body[2]) == typeArrayValues &&
				v.Body[0].(string) == "org.freedesktop.NetworkManager.Device" {
				props := v.Body[1].(map[string]dbus.Variant)
				for key, _ := range props {
					if false {
					} else if key == "Udi" {
						obj.Udi.Notify()

					} else if key == "Interface" {
						obj.Interface.Notify()

					} else if key == "IpInterface" {
						obj.IpInterface.Notify()

					} else if key == "Driver" {
						obj.Driver.Notify()

					} else if key == "DriverVersion" {
						obj.DriverVersion.Notify()

					} else if key == "FirmwareVersion" {
						obj.FirmwareVersion.Notify()

					} else if key == "Capabilities" {
						obj.Capabilities.Notify()

					} else if key == "Ip4Address" {
						obj.Ip4Address.Notify()

					} else if key == "State" {
						obj.State.Notify()

					} else if key == "StateReason" {
						obj.StateReason.Notify()

					} else if key == "ActiveConnection" {
						obj.ActiveConnection.Notify()

					} else if key == "Ip4Config" {
						obj.Ip4Config.Notify()

					} else if key == "Dhcp4Config" {
						obj.Dhcp4Config.Notify()

					} else if key == "Ip6Config" {
						obj.Ip6Config.Notify()

					} else if key == "Dhcp6Config" {
						obj.Dhcp6Config.Notify()

					} else if key == "Managed" {
						obj.Managed.Notify()

					} else if key == "Autoconnect" {
						obj.Autoconnect.Notify()

					} else if key == "FirmwareMissing" {
						obj.FirmwareMissing.Notify()

					} else if key == "NmPluginMissing" {
						obj.NmPluginMissing.Notify()

					} else if key == "DeviceType" {
						obj.DeviceType.Notify()

					} else if key == "AvailableConnections" {
						obj.AvailableConnections.Notify()

					} else if key == "PhysicalPortId" {
						obj.PhysicalPortId.Notify()

					} else if key == "Mtu" {
						obj.Mtu.Notify()

					} else if key == "Metered" {
						obj.Metered.Notify()

					} else if key == "LldpNeighbors" {
						obj.LldpNeighbors.Notify()

					} else if key == "Real" {
						obj.Real.Notify()
					}
				}
			} else if v.Name == "org.freedesktop.NetworkManager.Device.PropertiesChanged" && len(v.Body) == 1 && reflect.TypeOf(v.Body[0]) == typeKeyValues {
				for key, _ := range v.Body[0].(map[string]dbus.Variant) {
					if false {
					} else if key == "Udi" {
						obj.Udi.Notify()

					} else if key == "Interface" {
						obj.Interface.Notify()

					} else if key == "IpInterface" {
						obj.IpInterface.Notify()

					} else if key == "Driver" {
						obj.Driver.Notify()

					} else if key == "DriverVersion" {
						obj.DriverVersion.Notify()

					} else if key == "FirmwareVersion" {
						obj.FirmwareVersion.Notify()

					} else if key == "Capabilities" {
						obj.Capabilities.Notify()

					} else if key == "Ip4Address" {
						obj.Ip4Address.Notify()

					} else if key == "State" {
						obj.State.Notify()

					} else if key == "StateReason" {
						obj.StateReason.Notify()

					} else if key == "ActiveConnection" {
						obj.ActiveConnection.Notify()

					} else if key == "Ip4Config" {
						obj.Ip4Config.Notify()

					} else if key == "Dhcp4Config" {
						obj.Dhcp4Config.Notify()

					} else if key == "Ip6Config" {
						obj.Ip6Config.Notify()

					} else if key == "Dhcp6Config" {
						obj.Dhcp6Config.Notify()

					} else if key == "Managed" {
						obj.Managed.Notify()

					} else if key == "Autoconnect" {
						obj.Autoconnect.Notify()

					} else if key == "FirmwareMissing" {
						obj.FirmwareMissing.Notify()

					} else if key == "NmPluginMissing" {
						obj.NmPluginMissing.Notify()

					} else if key == "DeviceType" {
						obj.DeviceType.Notify()

					} else if key == "AvailableConnections" {
						obj.AvailableConnections.Notify()

					} else if key == "PhysicalPortId" {
						obj.PhysicalPortId.Notify()

					} else if key == "Mtu" {
						obj.Mtu.Notify()

					} else if key == "Metered" {
						obj.Metered.Notify()

					} else if key == "LldpNeighbors" {
						obj.LldpNeighbors.Notify()

					} else if key == "Real" {
						obj.Real.Notify()
					}
				}
			}
		}
	}()

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='org.freedesktop.NetworkManager.Device',sender='" + obj.DestName + "',member='StateChanged'")

	runtime.SetFinalizer(obj, func(_obj *Device) { DestroyDevice(_obj) })
	return obj, nil
}
