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

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

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

	Vendor                *dbusPropertyDriveVendor
	Model                 *dbusPropertyDriveModel
	Revision              *dbusPropertyDriveRevision
	Serial                *dbusPropertyDriveSerial
	WWN                   *dbusPropertyDriveWWN
	Id                    *dbusPropertyDriveId
	Configuration         *dbusPropertyDriveConfiguration
	Media                 *dbusPropertyDriveMedia
	MediaCompatibility    *dbusPropertyDriveMediaCompatibility
	MediaRemovable        *dbusPropertyDriveMediaRemovable
	MediaAvailable        *dbusPropertyDriveMediaAvailable
	MediaChangeDetected   *dbusPropertyDriveMediaChangeDetected
	Size                  *dbusPropertyDriveSize
	TimeDetected          *dbusPropertyDriveTimeDetected
	TimeMediaDetected     *dbusPropertyDriveTimeMediaDetected
	Optical               *dbusPropertyDriveOptical
	OpticalBlank          *dbusPropertyDriveOpticalBlank
	OpticalNumTracks      *dbusPropertyDriveOpticalNumTracks
	OpticalNumAudioTracks *dbusPropertyDriveOpticalNumAudioTracks
	OpticalNumDataTracks  *dbusPropertyDriveOpticalNumDataTracks
	OpticalNumSessions    *dbusPropertyDriveOpticalNumSessions
	RotationRate          *dbusPropertyDriveRotationRate
	ConnectionBus         *dbusPropertyDriveConnectionBus
	Seat                  *dbusPropertyDriveSeat
	Removable             *dbusPropertyDriveRemovable
	Ejectable             *dbusPropertyDriveEjectable
	SortKey               *dbusPropertyDriveSortKey
	CanPowerOff           *dbusPropertyDriveCanPowerOff
	SiblingId             *dbusPropertyDriveSiblingId
}

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

	obj.Vendor.Reset()
	obj.Model.Reset()
	obj.Revision.Reset()
	obj.Serial.Reset()
	obj.WWN.Reset()
	obj.Id.Reset()
	obj.Configuration.Reset()
	obj.Media.Reset()
	obj.MediaCompatibility.Reset()
	obj.MediaRemovable.Reset()
	obj.MediaAvailable.Reset()
	obj.MediaChangeDetected.Reset()
	obj.Size.Reset()
	obj.TimeDetected.Reset()
	obj.TimeMediaDetected.Reset()
	obj.Optical.Reset()
	obj.OpticalBlank.Reset()
	obj.OpticalNumTracks.Reset()
	obj.OpticalNumAudioTracks.Reset()
	obj.OpticalNumDataTracks.Reset()
	obj.OpticalNumSessions.Reset()
	obj.RotationRate.Reset()
	obj.ConnectionBus.Reset()
	obj.Seat.Reset()
	obj.Removable.Reset()
	obj.Ejectable.Reset()
	obj.SortKey.Reset()
	obj.CanPowerOff.Reset()
	obj.SiblingId.Reset()
}

func (obj *Drive) Eject(options map[string]dbus.Variant) (_err error) {
	_err = obj.core.Call("org.freedesktop.UDisks2.Drive.Eject", 0, options).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Drive) SetConfiguration(value map[string]dbus.Variant, options map[string]dbus.Variant) (_err error) {
	_err = obj.core.Call("org.freedesktop.UDisks2.Drive.SetConfiguration", 0, value, options).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Drive) PowerOff(options map[string]dbus.Variant) (_err error) {
	_err = obj.core.Call("org.freedesktop.UDisks2.Drive.PowerOff", 0, options).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

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

func (this *dbusPropertyDriveVendor) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.Vendor is not writable")
}

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

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

func (this *dbusPropertyDriveModel) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.Model is not writable")
}

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

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

func (this *dbusPropertyDriveRevision) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.Revision is not writable")
}

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

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

func (this *dbusPropertyDriveSerial) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.Serial is not writable")
}

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

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

func (this *dbusPropertyDriveWWN) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.WWN is not writable")
}

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

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

func (this *dbusPropertyDriveId) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.Id is not writable")
}

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

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

func (this *dbusPropertyDriveConfiguration) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.Configuration is not writable")
}

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

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

func (this *dbusPropertyDriveMedia) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.Media is not writable")
}

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

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

func (this *dbusPropertyDriveMediaCompatibility) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.MediaCompatibility is not writable")
}

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

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

func (this *dbusPropertyDriveMediaRemovable) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.MediaRemovable is not writable")
}

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

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

func (this *dbusPropertyDriveMediaAvailable) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.MediaAvailable is not writable")
}

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

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

func (this *dbusPropertyDriveMediaChangeDetected) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.MediaChangeDetected is not writable")
}

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

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

func (this *dbusPropertyDriveSize) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.Size is not writable")
}

func (this *dbusPropertyDriveSize) Get() uint64 {
	v, _ := this.GetValue()
	return v.(uint64)
}
func (this *dbusPropertyDriveSize) GetValue() (interface{} /*uint64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.UDisks2.Drive", "Size").Store(&r)
	if err == nil && r.Signature().String() == "t" {
		return r.Value().(uint64), nil
	}
	return *new(uint64), err
}
func (this *dbusPropertyDriveSize) GetType() reflect.Type {
	return reflect.TypeOf((*uint64)(nil)).Elem()
}

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

func (this *dbusPropertyDriveTimeDetected) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.TimeDetected is not writable")
}

func (this *dbusPropertyDriveTimeDetected) Get() uint64 {
	v, _ := this.GetValue()
	return v.(uint64)
}
func (this *dbusPropertyDriveTimeDetected) GetValue() (interface{} /*uint64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.UDisks2.Drive", "TimeDetected").Store(&r)
	if err == nil && r.Signature().String() == "t" {
		return r.Value().(uint64), nil
	}
	return *new(uint64), err
}
func (this *dbusPropertyDriveTimeDetected) GetType() reflect.Type {
	return reflect.TypeOf((*uint64)(nil)).Elem()
}

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

func (this *dbusPropertyDriveTimeMediaDetected) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.TimeMediaDetected is not writable")
}

func (this *dbusPropertyDriveTimeMediaDetected) Get() uint64 {
	v, _ := this.GetValue()
	return v.(uint64)
}
func (this *dbusPropertyDriveTimeMediaDetected) GetValue() (interface{} /*uint64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.UDisks2.Drive", "TimeMediaDetected").Store(&r)
	if err == nil && r.Signature().String() == "t" {
		return r.Value().(uint64), nil
	}
	return *new(uint64), err
}
func (this *dbusPropertyDriveTimeMediaDetected) GetType() reflect.Type {
	return reflect.TypeOf((*uint64)(nil)).Elem()
}

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

func (this *dbusPropertyDriveOptical) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.Optical is not writable")
}

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

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

func (this *dbusPropertyDriveOpticalBlank) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.OpticalBlank is not writable")
}

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

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

func (this *dbusPropertyDriveOpticalNumTracks) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.OpticalNumTracks is not writable")
}

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

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

func (this *dbusPropertyDriveOpticalNumAudioTracks) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.OpticalNumAudioTracks is not writable")
}

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

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

func (this *dbusPropertyDriveOpticalNumDataTracks) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.OpticalNumDataTracks is not writable")
}

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

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

func (this *dbusPropertyDriveOpticalNumSessions) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.OpticalNumSessions is not writable")
}

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

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

func (this *dbusPropertyDriveRotationRate) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.RotationRate is not writable")
}

func (this *dbusPropertyDriveRotationRate) Get() int32 {
	v, _ := this.GetValue()
	return v.(int32)
}
func (this *dbusPropertyDriveRotationRate) GetValue() (interface{} /*int32*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.UDisks2.Drive", "RotationRate").Store(&r)
	if err == nil && r.Signature().String() == "i" {
		return r.Value().(int32), nil
	}
	return *new(int32), err
}
func (this *dbusPropertyDriveRotationRate) GetType() reflect.Type {
	return reflect.TypeOf((*int32)(nil)).Elem()
}

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

func (this *dbusPropertyDriveConnectionBus) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.ConnectionBus is not writable")
}

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

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

func (this *dbusPropertyDriveSeat) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.Seat is not writable")
}

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

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

func (this *dbusPropertyDriveRemovable) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.Removable is not writable")
}

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

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

func (this *dbusPropertyDriveEjectable) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.Ejectable is not writable")
}

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

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

func (this *dbusPropertyDriveSortKey) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.SortKey is not writable")
}

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

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

func (this *dbusPropertyDriveCanPowerOff) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.CanPowerOff is not writable")
}

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

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

func (this *dbusPropertyDriveSiblingId) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Drive.SiblingId is not writable")
}

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

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

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

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

	obj.Vendor = &dbusPropertyDriveVendor{&property.BaseObserver{}, core}
	obj.Model = &dbusPropertyDriveModel{&property.BaseObserver{}, core}
	obj.Revision = &dbusPropertyDriveRevision{&property.BaseObserver{}, core}
	obj.Serial = &dbusPropertyDriveSerial{&property.BaseObserver{}, core}
	obj.WWN = &dbusPropertyDriveWWN{&property.BaseObserver{}, core}
	obj.Id = &dbusPropertyDriveId{&property.BaseObserver{}, core}
	obj.Configuration = &dbusPropertyDriveConfiguration{&property.BaseObserver{}, core}
	obj.Media = &dbusPropertyDriveMedia{&property.BaseObserver{}, core}
	obj.MediaCompatibility = &dbusPropertyDriveMediaCompatibility{&property.BaseObserver{}, core}
	obj.MediaRemovable = &dbusPropertyDriveMediaRemovable{&property.BaseObserver{}, core}
	obj.MediaAvailable = &dbusPropertyDriveMediaAvailable{&property.BaseObserver{}, core}
	obj.MediaChangeDetected = &dbusPropertyDriveMediaChangeDetected{&property.BaseObserver{}, core}
	obj.Size = &dbusPropertyDriveSize{&property.BaseObserver{}, core}
	obj.TimeDetected = &dbusPropertyDriveTimeDetected{&property.BaseObserver{}, core}
	obj.TimeMediaDetected = &dbusPropertyDriveTimeMediaDetected{&property.BaseObserver{}, core}
	obj.Optical = &dbusPropertyDriveOptical{&property.BaseObserver{}, core}
	obj.OpticalBlank = &dbusPropertyDriveOpticalBlank{&property.BaseObserver{}, core}
	obj.OpticalNumTracks = &dbusPropertyDriveOpticalNumTracks{&property.BaseObserver{}, core}
	obj.OpticalNumAudioTracks = &dbusPropertyDriveOpticalNumAudioTracks{&property.BaseObserver{}, core}
	obj.OpticalNumDataTracks = &dbusPropertyDriveOpticalNumDataTracks{&property.BaseObserver{}, core}
	obj.OpticalNumSessions = &dbusPropertyDriveOpticalNumSessions{&property.BaseObserver{}, core}
	obj.RotationRate = &dbusPropertyDriveRotationRate{&property.BaseObserver{}, core}
	obj.ConnectionBus = &dbusPropertyDriveConnectionBus{&property.BaseObserver{}, core}
	obj.Seat = &dbusPropertyDriveSeat{&property.BaseObserver{}, core}
	obj.Removable = &dbusPropertyDriveRemovable{&property.BaseObserver{}, core}
	obj.Ejectable = &dbusPropertyDriveEjectable{&property.BaseObserver{}, core}
	obj.SortKey = &dbusPropertyDriveSortKey{&property.BaseObserver{}, core}
	obj.CanPowerOff = &dbusPropertyDriveCanPowerOff{&property.BaseObserver{}, core}
	obj.SiblingId = &dbusPropertyDriveSiblingId{&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.UDisks2.Drive',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.UDisks2.Drive" {
				props := v.Body[1].(map[string]dbus.Variant)
				for key, _ := range props {
					if false {
					} else if key == "Vendor" {
						obj.Vendor.Notify()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

					} else if key == "SiblingId" {
						obj.SiblingId.Notify()
					}
				}
			} else if v.Name == "org.freedesktop.UDisks2.Drive.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 == "Vendor" {
						obj.Vendor.Notify()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	runtime.SetFinalizer(obj, func(_obj *Drive) { DestroyDrive(_obj) })
	return obj, nil
}
