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

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

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

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

func (obj *Timedated) SetTime(arg0 int64, arg1 bool, arg2 string) (_err error) {
	_err = obj.core.Call("com.deepin.daemon.Timedated.SetTime", 0, arg0, arg1, arg2).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

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

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

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

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

	return obj, nil
}
