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

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

func (obj *ModemFirmware) List() (selected string, installed []map[string]dbus.Variant, _err error) {
	_err = obj.core.Call("org.freedesktop.ModemManager1.Modem.Firmware.List", 0).Store(&selected, &installed)
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *ModemFirmware) Select(uniqueid string) (_err error) {
	_err = obj.core.Call("org.freedesktop.ModemManager1.Modem.Firmware.Select", 0, uniqueid).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

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

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

	obj := &ModemFirmware{Path: path, DestName: destName, core: core}

	return obj, nil
}
