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

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

	SmartSupported                    *dbusPropertyAtaSmartSupported
	SmartEnabled                      *dbusPropertyAtaSmartEnabled
	SmartUpdated                      *dbusPropertyAtaSmartUpdated
	SmartFailing                      *dbusPropertyAtaSmartFailing
	SmartPowerOnSeconds               *dbusPropertyAtaSmartPowerOnSeconds
	SmartTemperature                  *dbusPropertyAtaSmartTemperature
	SmartNumAttributesFailing         *dbusPropertyAtaSmartNumAttributesFailing
	SmartNumAttributesFailedInThePast *dbusPropertyAtaSmartNumAttributesFailedInThePast
	SmartNumBadSectors                *dbusPropertyAtaSmartNumBadSectors
	SmartSelftestStatus               *dbusPropertyAtaSmartSelftestStatus
	SmartSelftestPercentRemaining     *dbusPropertyAtaSmartSelftestPercentRemaining
	PmSupported                       *dbusPropertyAtaPmSupported
	PmEnabled                         *dbusPropertyAtaPmEnabled
	ApmSupported                      *dbusPropertyAtaApmSupported
	ApmEnabled                        *dbusPropertyAtaApmEnabled
	AamSupported                      *dbusPropertyAtaAamSupported
	AamEnabled                        *dbusPropertyAtaAamEnabled
	AamVendorRecommendedValue         *dbusPropertyAtaAamVendorRecommendedValue
	WriteCacheSupported               *dbusPropertyAtaWriteCacheSupported
	WriteCacheEnabled                 *dbusPropertyAtaWriteCacheEnabled
	SecurityEraseUnitMinutes          *dbusPropertyAtaSecurityEraseUnitMinutes
	SecurityEnhancedEraseUnitMinutes  *dbusPropertyAtaSecurityEnhancedEraseUnitMinutes
	SecurityFrozen                    *dbusPropertyAtaSecurityFrozen
}

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

	obj.SmartSupported.Reset()
	obj.SmartEnabled.Reset()
	obj.SmartUpdated.Reset()
	obj.SmartFailing.Reset()
	obj.SmartPowerOnSeconds.Reset()
	obj.SmartTemperature.Reset()
	obj.SmartNumAttributesFailing.Reset()
	obj.SmartNumAttributesFailedInThePast.Reset()
	obj.SmartNumBadSectors.Reset()
	obj.SmartSelftestStatus.Reset()
	obj.SmartSelftestPercentRemaining.Reset()
	obj.PmSupported.Reset()
	obj.PmEnabled.Reset()
	obj.ApmSupported.Reset()
	obj.ApmEnabled.Reset()
	obj.AamSupported.Reset()
	obj.AamEnabled.Reset()
	obj.AamVendorRecommendedValue.Reset()
	obj.WriteCacheSupported.Reset()
	obj.WriteCacheEnabled.Reset()
	obj.SecurityEraseUnitMinutes.Reset()
	obj.SecurityEnhancedEraseUnitMinutes.Reset()
	obj.SecurityFrozen.Reset()
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	obj.SmartSupported = &dbusPropertyAtaSmartSupported{&property.BaseObserver{}, core}
	obj.SmartEnabled = &dbusPropertyAtaSmartEnabled{&property.BaseObserver{}, core}
	obj.SmartUpdated = &dbusPropertyAtaSmartUpdated{&property.BaseObserver{}, core}
	obj.SmartFailing = &dbusPropertyAtaSmartFailing{&property.BaseObserver{}, core}
	obj.SmartPowerOnSeconds = &dbusPropertyAtaSmartPowerOnSeconds{&property.BaseObserver{}, core}
	obj.SmartTemperature = &dbusPropertyAtaSmartTemperature{&property.BaseObserver{}, core}
	obj.SmartNumAttributesFailing = &dbusPropertyAtaSmartNumAttributesFailing{&property.BaseObserver{}, core}
	obj.SmartNumAttributesFailedInThePast = &dbusPropertyAtaSmartNumAttributesFailedInThePast{&property.BaseObserver{}, core}
	obj.SmartNumBadSectors = &dbusPropertyAtaSmartNumBadSectors{&property.BaseObserver{}, core}
	obj.SmartSelftestStatus = &dbusPropertyAtaSmartSelftestStatus{&property.BaseObserver{}, core}
	obj.SmartSelftestPercentRemaining = &dbusPropertyAtaSmartSelftestPercentRemaining{&property.BaseObserver{}, core}
	obj.PmSupported = &dbusPropertyAtaPmSupported{&property.BaseObserver{}, core}
	obj.PmEnabled = &dbusPropertyAtaPmEnabled{&property.BaseObserver{}, core}
	obj.ApmSupported = &dbusPropertyAtaApmSupported{&property.BaseObserver{}, core}
	obj.ApmEnabled = &dbusPropertyAtaApmEnabled{&property.BaseObserver{}, core}
	obj.AamSupported = &dbusPropertyAtaAamSupported{&property.BaseObserver{}, core}
	obj.AamEnabled = &dbusPropertyAtaAamEnabled{&property.BaseObserver{}, core}
	obj.AamVendorRecommendedValue = &dbusPropertyAtaAamVendorRecommendedValue{&property.BaseObserver{}, core}
	obj.WriteCacheSupported = &dbusPropertyAtaWriteCacheSupported{&property.BaseObserver{}, core}
	obj.WriteCacheEnabled = &dbusPropertyAtaWriteCacheEnabled{&property.BaseObserver{}, core}
	obj.SecurityEraseUnitMinutes = &dbusPropertyAtaSecurityEraseUnitMinutes{&property.BaseObserver{}, core}
	obj.SecurityEnhancedEraseUnitMinutes = &dbusPropertyAtaSecurityEnhancedEraseUnitMinutes{&property.BaseObserver{}, core}
	obj.SecurityFrozen = &dbusPropertyAtaSecurityFrozen{&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.Ata',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.Ata" {
				props := v.Body[1].(map[string]dbus.Variant)
				for key, _ := range props {
					if false {
					} else if key == "SmartSupported" {
						obj.SmartSupported.Notify()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	runtime.SetFinalizer(obj, func(_obj *Ata) { DestroyAta(_obj) })
	return obj, nil
}
