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

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 Manager struct {
	Path     dbus.ObjectPath
	DestName string
	core     *dbus.Object

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

	JobList             *dbusPropertyManagerJobList
	SystemArchitectures *dbusPropertyManagerSystemArchitectures
	UpgradableApps      *dbusPropertyManagerUpgradableApps
	SystemOnChanging    *dbusPropertyManagerSystemOnChanging
	AutoClean           *dbusPropertyManagerAutoClean
}

func (obj *Manager) _createSignalChan() <-chan *dbus.Signal {
	obj.signalsLocker.Lock()
	ch := getBus().Signal()
	obj.signals[ch] = struct{}{}
	obj.signalsLocker.Unlock()
	return ch
}
func (obj *Manager) _deleteSignalChan(ch <-chan *dbus.Signal) {
	obj.signalsLocker.Lock()
	delete(obj.signals, ch)
	getBus().DetachSignal(ch)
	obj.signalsLocker.Unlock()
}
func DestroyManager(obj *Manager) {
	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='com.deepin.lastore.Manager',sender='" + obj.DestName + "',member='PropertiesChanged'")

	obj.JobList.Reset()
	obj.SystemArchitectures.Reset()
	obj.UpgradableApps.Reset()
	obj.SystemOnChanging.Reset()
	obj.AutoClean.Reset()
}

func (obj *Manager) CleanArchives() (arg0 dbus.ObjectPath, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.CleanArchives", 0).Store(&arg0)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) CleanJob(arg0 string) (_err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.CleanJob", 0, arg0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) DistUpgrade() (arg0 dbus.ObjectPath, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.DistUpgrade", 0).Store(&arg0)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) InstallPackage(arg0 string, arg1 string) (arg2 dbus.ObjectPath, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.InstallPackage", 0, arg0, arg1).Store(&arg2)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) PackageDesktopPath(arg0 string) (arg1 string, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.PackageDesktopPath", 0, arg0).Store(&arg1)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) PackageExists(arg0 string) (arg1 bool, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.PackageExists", 0, arg0).Store(&arg1)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) PackageInstallable(arg0 string) (arg1 bool, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.PackageInstallable", 0, arg0).Store(&arg1)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) PackagesDownloadSize(arg0 []string) (arg1 int64, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.PackagesDownloadSize", 0, arg0).Store(&arg1)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) PauseJob(arg0 string) (_err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.PauseJob", 0, arg0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) PrepareDistUpgrade() (arg0 dbus.ObjectPath, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.PrepareDistUpgrade", 0).Store(&arg0)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) RecordLocaleInfo(arg0 string) (_err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.RecordLocaleInfo", 0, arg0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) RemovePackage(arg0 string, arg1 string) (arg2 dbus.ObjectPath, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.RemovePackage", 0, arg0, arg1).Store(&arg2)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) SetAutoClean(arg0 bool) (_err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.SetAutoClean", 0, arg0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) SetCurrentX11Id(arg0 string, arg1 string) (_err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.SetCurrentX11Id", 0, arg0, arg1).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) SetLogger(arg0 string, arg1 string, arg2 string) (_err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.SetLogger", 0, arg0, arg1, arg2).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) SetRegion(arg0 string) (_err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.SetRegion", 0, arg0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) StartJob(arg0 string) (_err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.StartJob", 0, arg0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) UpdatePackage(arg0 string, arg1 string) (arg2 dbus.ObjectPath, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.UpdatePackage", 0, arg0, arg1).Store(&arg2)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Manager) UpdateSource() (arg0 dbus.ObjectPath, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Manager.UpdateSource", 0).Store(&arg0)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

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

func (this *dbusPropertyManagerJobList) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Manager.JobList is not writable")
}

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

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

func (this *dbusPropertyManagerSystemArchitectures) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Manager.SystemArchitectures is not writable")
}

func (this *dbusPropertyManagerSystemArchitectures) Get() []string {
	v, _ := this.GetValue()
	return v.([]string)
}
func (this *dbusPropertyManagerSystemArchitectures) GetValue() (interface{} /*[]string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "com.deepin.lastore.Manager", "SystemArchitectures").Store(&r)
	if err == nil && r.Signature().String() == "as" {
		return r.Value().([]string), nil
	}
	return *new([]string), err
}
func (this *dbusPropertyManagerSystemArchitectures) GetType() reflect.Type {
	return reflect.TypeOf((*[]string)(nil)).Elem()
}

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

func (this *dbusPropertyManagerUpgradableApps) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Manager.UpgradableApps is not writable")
}

func (this *dbusPropertyManagerUpgradableApps) Get() []string {
	v, _ := this.GetValue()
	return v.([]string)
}
func (this *dbusPropertyManagerUpgradableApps) GetValue() (interface{} /*[]string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "com.deepin.lastore.Manager", "UpgradableApps").Store(&r)
	if err == nil && r.Signature().String() == "as" {
		return r.Value().([]string), nil
	}
	return *new([]string), err
}
func (this *dbusPropertyManagerUpgradableApps) GetType() reflect.Type {
	return reflect.TypeOf((*[]string)(nil)).Elem()
}

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

func (this *dbusPropertyManagerSystemOnChanging) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Manager.SystemOnChanging is not writable")
}

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

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

func (this *dbusPropertyManagerAutoClean) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Manager.AutoClean is not writable")
}

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

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

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

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

	obj.JobList = &dbusPropertyManagerJobList{&property.BaseObserver{}, core}
	obj.SystemArchitectures = &dbusPropertyManagerSystemArchitectures{&property.BaseObserver{}, core}
	obj.UpgradableApps = &dbusPropertyManagerUpgradableApps{&property.BaseObserver{}, core}
	obj.SystemOnChanging = &dbusPropertyManagerSystemOnChanging{&property.BaseObserver{}, core}
	obj.AutoClean = &dbusPropertyManagerAutoClean{&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='com.deepin.lastore.Manager',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) == "com.deepin.lastore.Manager" {
				props := v.Body[1].(map[string]dbus.Variant)
				for key, _ := range props {
					if false {
					} else if key == "JobList" {
						obj.JobList.Notify()

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

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

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

					} else if key == "AutoClean" {
						obj.AutoClean.Notify()
					}
				}
			} else if v.Name == "com.deepin.lastore.Manager.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 == "JobList" {
						obj.JobList.Notify()

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

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

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

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

	runtime.SetFinalizer(obj, func(_obj *Manager) { DestroyManager(_obj) })
	return obj, nil
}

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

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

	AutoCheckUpdates    *dbusPropertyUpdaterAutoCheckUpdates
	AutoDownloadUpdates *dbusPropertyUpdaterAutoDownloadUpdates
	MirrorSource        *dbusPropertyUpdaterMirrorSource
	UpdatableApps       *dbusPropertyUpdaterUpdatableApps
	UpdatablePackages   *dbusPropertyUpdaterUpdatablePackages
}

func (obj *Updater) _createSignalChan() <-chan *dbus.Signal {
	obj.signalsLocker.Lock()
	ch := getBus().Signal()
	obj.signals[ch] = struct{}{}
	obj.signalsLocker.Unlock()
	return ch
}
func (obj *Updater) _deleteSignalChan(ch <-chan *dbus.Signal) {
	obj.signalsLocker.Lock()
	delete(obj.signals, ch)
	getBus().DetachSignal(ch)
	obj.signalsLocker.Unlock()
}
func DestroyUpdater(obj *Updater) {
	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='com.deepin.lastore.Updater',sender='" + obj.DestName + "',member='PropertiesChanged'")

	obj.AutoCheckUpdates.Reset()
	obj.AutoDownloadUpdates.Reset()
	obj.MirrorSource.Reset()
	obj.UpdatableApps.Reset()
	obj.UpdatablePackages.Reset()
}

func (obj *Updater) ApplicationUpdateInfos(arg0 string) (arg1 [][]interface{}, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Updater.ApplicationUpdateInfos", 0, arg0).Store(&arg1)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Updater) ListMirrorSources(arg0 string) (arg1 [][]interface{}, _err error) {
	_err = obj.core.Call("com.deepin.lastore.Updater.ListMirrorSources", 0, arg0).Store(&arg1)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Updater) RestoreSystemSource() (_err error) {
	_err = obj.core.Call("com.deepin.lastore.Updater.RestoreSystemSource", 0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Updater) SetAutoCheckUpdates(arg0 bool) (_err error) {
	_err = obj.core.Call("com.deepin.lastore.Updater.SetAutoCheckUpdates", 0, arg0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Updater) SetAutoDownloadUpdates(arg0 bool) (_err error) {
	_err = obj.core.Call("com.deepin.lastore.Updater.SetAutoDownloadUpdates", 0, arg0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Updater) SetMirrorSource(arg0 string) (_err error) {
	_err = obj.core.Call("com.deepin.lastore.Updater.SetMirrorSource", 0, arg0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

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

func (this *dbusPropertyUpdaterAutoCheckUpdates) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Updater.AutoCheckUpdates is not writable")
}

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

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

func (this *dbusPropertyUpdaterAutoDownloadUpdates) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Updater.AutoDownloadUpdates is not writable")
}

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

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

func (this *dbusPropertyUpdaterMirrorSource) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Updater.MirrorSource is not writable")
}

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

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

func (this *dbusPropertyUpdaterUpdatableApps) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Updater.UpdatableApps is not writable")
}

func (this *dbusPropertyUpdaterUpdatableApps) Get() []string {
	v, _ := this.GetValue()
	return v.([]string)
}
func (this *dbusPropertyUpdaterUpdatableApps) GetValue() (interface{} /*[]string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "com.deepin.lastore.Updater", "UpdatableApps").Store(&r)
	if err == nil && r.Signature().String() == "as" {
		return r.Value().([]string), nil
	}
	return *new([]string), err
}
func (this *dbusPropertyUpdaterUpdatableApps) GetType() reflect.Type {
	return reflect.TypeOf((*[]string)(nil)).Elem()
}

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

func (this *dbusPropertyUpdaterUpdatablePackages) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Updater.UpdatablePackages is not writable")
}

func (this *dbusPropertyUpdaterUpdatablePackages) Get() []string {
	v, _ := this.GetValue()
	return v.([]string)
}
func (this *dbusPropertyUpdaterUpdatablePackages) GetValue() (interface{} /*[]string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "com.deepin.lastore.Updater", "UpdatablePackages").Store(&r)
	if err == nil && r.Signature().String() == "as" {
		return r.Value().([]string), nil
	}
	return *new([]string), err
}
func (this *dbusPropertyUpdaterUpdatablePackages) GetType() reflect.Type {
	return reflect.TypeOf((*[]string)(nil)).Elem()
}

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

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

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

	obj.AutoCheckUpdates = &dbusPropertyUpdaterAutoCheckUpdates{&property.BaseObserver{}, core}
	obj.AutoDownloadUpdates = &dbusPropertyUpdaterAutoDownloadUpdates{&property.BaseObserver{}, core}
	obj.MirrorSource = &dbusPropertyUpdaterMirrorSource{&property.BaseObserver{}, core}
	obj.UpdatableApps = &dbusPropertyUpdaterUpdatableApps{&property.BaseObserver{}, core}
	obj.UpdatablePackages = &dbusPropertyUpdaterUpdatablePackages{&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='com.deepin.lastore.Updater',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) == "com.deepin.lastore.Updater" {
				props := v.Body[1].(map[string]dbus.Variant)
				for key, _ := range props {
					if false {
					} else if key == "AutoCheckUpdates" {
						obj.AutoCheckUpdates.Notify()

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

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

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

					} else if key == "UpdatablePackages" {
						obj.UpdatablePackages.Notify()
					}
				}
			} else if v.Name == "com.deepin.lastore.Updater.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 == "AutoCheckUpdates" {
						obj.AutoCheckUpdates.Notify()

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

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

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

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

	runtime.SetFinalizer(obj, func(_obj *Updater) { DestroyUpdater(_obj) })
	return obj, nil
}

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

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

	Id          *dbusPropertyJobId
	Name        *dbusPropertyJobName
	Packages    *dbusPropertyJobPackages
	Type        *dbusPropertyJobType
	Status      *dbusPropertyJobStatus
	Progress    *dbusPropertyJobProgress
	Speed       *dbusPropertyJobSpeed
	Description *dbusPropertyJobDescription
	Cancelable  *dbusPropertyJobCancelable
}

func (obj *Job) _createSignalChan() <-chan *dbus.Signal {
	obj.signalsLocker.Lock()
	ch := getBus().Signal()
	obj.signals[ch] = struct{}{}
	obj.signalsLocker.Unlock()
	return ch
}
func (obj *Job) _deleteSignalChan(ch <-chan *dbus.Signal) {
	obj.signalsLocker.Lock()
	delete(obj.signals, ch)
	getBus().DetachSignal(ch)
	obj.signalsLocker.Unlock()
}
func DestroyJob(obj *Job) {
	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='com.deepin.lastore.Job',sender='" + obj.DestName + "',member='PropertiesChanged'")

	obj.Id.Reset()
	obj.Name.Reset()
	obj.Packages.Reset()
	obj.Type.Reset()
	obj.Status.Reset()
	obj.Progress.Reset()
	obj.Speed.Reset()
	obj.Description.Reset()
	obj.Cancelable.Reset()
}

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

func (this *dbusPropertyJobId) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Job.Id is not writable")
}

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

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

func (this *dbusPropertyJobName) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Job.Name is not writable")
}

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

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

func (this *dbusPropertyJobPackages) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Job.Packages is not writable")
}

func (this *dbusPropertyJobPackages) Get() []string {
	v, _ := this.GetValue()
	return v.([]string)
}
func (this *dbusPropertyJobPackages) GetValue() (interface{} /*[]string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "com.deepin.lastore.Job", "Packages").Store(&r)
	if err == nil && r.Signature().String() == "as" {
		return r.Value().([]string), nil
	}
	return *new([]string), err
}
func (this *dbusPropertyJobPackages) GetType() reflect.Type {
	return reflect.TypeOf((*[]string)(nil)).Elem()
}

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

func (this *dbusPropertyJobType) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Job.Type is not writable")
}

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

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

func (this *dbusPropertyJobStatus) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Job.Status is not writable")
}

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

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

func (this *dbusPropertyJobProgress) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Job.Progress is not writable")
}

func (this *dbusPropertyJobProgress) Get() float64 {
	v, _ := this.GetValue()
	return v.(float64)
}
func (this *dbusPropertyJobProgress) GetValue() (interface{} /*float64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "com.deepin.lastore.Job", "Progress").Store(&r)
	if err == nil && r.Signature().String() == "d" {
		return r.Value().(float64), nil
	}
	return *new(float64), err
}
func (this *dbusPropertyJobProgress) GetType() reflect.Type {
	return reflect.TypeOf((*float64)(nil)).Elem()
}

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

func (this *dbusPropertyJobSpeed) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Job.Speed is not writable")
}

func (this *dbusPropertyJobSpeed) Get() float64 {
	v, _ := this.GetValue()
	return v.(float64)
}
func (this *dbusPropertyJobSpeed) GetValue() (interface{} /*float64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "com.deepin.lastore.Job", "Speed").Store(&r)
	if err == nil && r.Signature().String() == "d" {
		return r.Value().(float64), nil
	}
	return *new(float64), err
}
func (this *dbusPropertyJobSpeed) GetType() reflect.Type {
	return reflect.TypeOf((*float64)(nil)).Elem()
}

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

func (this *dbusPropertyJobDescription) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Job.Description is not writable")
}

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

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

func (this *dbusPropertyJobCancelable) SetValue(notwritable interface{}) {
	fmt.Println("com.deepin.lastore.Job.Cancelable is not writable")
}

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

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

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

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

	obj.Id = &dbusPropertyJobId{&property.BaseObserver{}, core}
	obj.Name = &dbusPropertyJobName{&property.BaseObserver{}, core}
	obj.Packages = &dbusPropertyJobPackages{&property.BaseObserver{}, core}
	obj.Type = &dbusPropertyJobType{&property.BaseObserver{}, core}
	obj.Status = &dbusPropertyJobStatus{&property.BaseObserver{}, core}
	obj.Progress = &dbusPropertyJobProgress{&property.BaseObserver{}, core}
	obj.Speed = &dbusPropertyJobSpeed{&property.BaseObserver{}, core}
	obj.Description = &dbusPropertyJobDescription{&property.BaseObserver{}, core}
	obj.Cancelable = &dbusPropertyJobCancelable{&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='com.deepin.lastore.Job',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) == "com.deepin.lastore.Job" {
				props := v.Body[1].(map[string]dbus.Variant)
				for key, _ := range props {
					if false {
					} else if key == "Id" {
						obj.Id.Notify()

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

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

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

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

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

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

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

					} else if key == "Cancelable" {
						obj.Cancelable.Notify()
					}
				}
			} else if v.Name == "com.deepin.lastore.Job.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 == "Id" {
						obj.Id.Notify()

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

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

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

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

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

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

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

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

	runtime.SetFinalizer(obj, func(_obj *Job) { DestroyJob(_obj) })
	return obj, nil
}
