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

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

	Device               *dbusPropertyBlockDevice
	PreferredDevice      *dbusPropertyBlockPreferredDevice
	Symlinks             *dbusPropertyBlockSymlinks
	DeviceNumber         *dbusPropertyBlockDeviceNumber
	Id                   *dbusPropertyBlockId
	Size                 *dbusPropertyBlockSize
	ReadOnly             *dbusPropertyBlockReadOnly
	Drive                *dbusPropertyBlockDrive
	MDRaid               *dbusPropertyBlockMDRaid
	MDRaidMember         *dbusPropertyBlockMDRaidMember
	IdUsage              *dbusPropertyBlockIdUsage
	IdType               *dbusPropertyBlockIdType
	IdVersion            *dbusPropertyBlockIdVersion
	IdLabel              *dbusPropertyBlockIdLabel
	IdUUID               *dbusPropertyBlockIdUUID
	Configuration        *dbusPropertyBlockConfiguration
	CryptoBackingDevice  *dbusPropertyBlockCryptoBackingDevice
	HintPartitionable    *dbusPropertyBlockHintPartitionable
	HintSystem           *dbusPropertyBlockHintSystem
	HintIgnore           *dbusPropertyBlockHintIgnore
	HintAuto             *dbusPropertyBlockHintAuto
	HintName             *dbusPropertyBlockHintName
	HintIconName         *dbusPropertyBlockHintIconName
	HintSymbolicIconName *dbusPropertyBlockHintSymbolicIconName
}

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

	obj.Device.Reset()
	obj.PreferredDevice.Reset()
	obj.Symlinks.Reset()
	obj.DeviceNumber.Reset()
	obj.Id.Reset()
	obj.Size.Reset()
	obj.ReadOnly.Reset()
	obj.Drive.Reset()
	obj.MDRaid.Reset()
	obj.MDRaidMember.Reset()
	obj.IdUsage.Reset()
	obj.IdType.Reset()
	obj.IdVersion.Reset()
	obj.IdLabel.Reset()
	obj.IdUUID.Reset()
	obj.Configuration.Reset()
	obj.CryptoBackingDevice.Reset()
	obj.HintPartitionable.Reset()
	obj.HintSystem.Reset()
	obj.HintIgnore.Reset()
	obj.HintAuto.Reset()
	obj.HintName.Reset()
	obj.HintIconName.Reset()
	obj.HintSymbolicIconName.Reset()
}

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

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

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

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

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

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

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

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

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

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

func (this *dbusPropertyBlockDevice) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.Device is not writable")
}

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

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

func (this *dbusPropertyBlockPreferredDevice) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.PreferredDevice is not writable")
}

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

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

func (this *dbusPropertyBlockSymlinks) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.Symlinks is not writable")
}

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

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

func (this *dbusPropertyBlockDeviceNumber) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.DeviceNumber is not writable")
}

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

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

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

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

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

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

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

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

func (this *dbusPropertyBlockReadOnly) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.ReadOnly is not writable")
}

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

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

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

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

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

func (this *dbusPropertyBlockMDRaid) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.MDRaid is not writable")
}

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

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

func (this *dbusPropertyBlockMDRaidMember) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.MDRaidMember is not writable")
}

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

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

func (this *dbusPropertyBlockIdUsage) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.IdUsage is not writable")
}

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

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

func (this *dbusPropertyBlockIdType) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.IdType is not writable")
}

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

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

func (this *dbusPropertyBlockIdVersion) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.IdVersion is not writable")
}

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

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

func (this *dbusPropertyBlockIdLabel) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.IdLabel is not writable")
}

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

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

func (this *dbusPropertyBlockIdUUID) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.IdUUID is not writable")
}

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

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

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

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

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

func (this *dbusPropertyBlockCryptoBackingDevice) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.CryptoBackingDevice is not writable")
}

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

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

func (this *dbusPropertyBlockHintPartitionable) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.HintPartitionable is not writable")
}

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

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

func (this *dbusPropertyBlockHintSystem) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.HintSystem is not writable")
}

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

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

func (this *dbusPropertyBlockHintIgnore) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.HintIgnore is not writable")
}

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

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

func (this *dbusPropertyBlockHintAuto) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.HintAuto is not writable")
}

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

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

func (this *dbusPropertyBlockHintName) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.HintName is not writable")
}

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

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

func (this *dbusPropertyBlockHintIconName) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.HintIconName is not writable")
}

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

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

func (this *dbusPropertyBlockHintSymbolicIconName) SetValue(notwritable interface{}) {
	fmt.Println("org.freedesktop.UDisks2.Block.HintSymbolicIconName is not writable")
}

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

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

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

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

	obj.Device = &dbusPropertyBlockDevice{&property.BaseObserver{}, core}
	obj.PreferredDevice = &dbusPropertyBlockPreferredDevice{&property.BaseObserver{}, core}
	obj.Symlinks = &dbusPropertyBlockSymlinks{&property.BaseObserver{}, core}
	obj.DeviceNumber = &dbusPropertyBlockDeviceNumber{&property.BaseObserver{}, core}
	obj.Id = &dbusPropertyBlockId{&property.BaseObserver{}, core}
	obj.Size = &dbusPropertyBlockSize{&property.BaseObserver{}, core}
	obj.ReadOnly = &dbusPropertyBlockReadOnly{&property.BaseObserver{}, core}
	obj.Drive = &dbusPropertyBlockDrive{&property.BaseObserver{}, core}
	obj.MDRaid = &dbusPropertyBlockMDRaid{&property.BaseObserver{}, core}
	obj.MDRaidMember = &dbusPropertyBlockMDRaidMember{&property.BaseObserver{}, core}
	obj.IdUsage = &dbusPropertyBlockIdUsage{&property.BaseObserver{}, core}
	obj.IdType = &dbusPropertyBlockIdType{&property.BaseObserver{}, core}
	obj.IdVersion = &dbusPropertyBlockIdVersion{&property.BaseObserver{}, core}
	obj.IdLabel = &dbusPropertyBlockIdLabel{&property.BaseObserver{}, core}
	obj.IdUUID = &dbusPropertyBlockIdUUID{&property.BaseObserver{}, core}
	obj.Configuration = &dbusPropertyBlockConfiguration{&property.BaseObserver{}, core}
	obj.CryptoBackingDevice = &dbusPropertyBlockCryptoBackingDevice{&property.BaseObserver{}, core}
	obj.HintPartitionable = &dbusPropertyBlockHintPartitionable{&property.BaseObserver{}, core}
	obj.HintSystem = &dbusPropertyBlockHintSystem{&property.BaseObserver{}, core}
	obj.HintIgnore = &dbusPropertyBlockHintIgnore{&property.BaseObserver{}, core}
	obj.HintAuto = &dbusPropertyBlockHintAuto{&property.BaseObserver{}, core}
	obj.HintName = &dbusPropertyBlockHintName{&property.BaseObserver{}, core}
	obj.HintIconName = &dbusPropertyBlockHintIconName{&property.BaseObserver{}, core}
	obj.HintSymbolicIconName = &dbusPropertyBlockHintSymbolicIconName{&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.Block',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.Block" {
				props := v.Body[1].(map[string]dbus.Variant)
				for key, _ := range props {
					if false {
					} else if key == "Device" {
						obj.Device.Notify()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	runtime.SetFinalizer(obj, func(_obj *Block) { DestroyBlock(_obj) })
	return obj, nil
}
