// Code generated by "./generator ./com.deepin.daemon.uadp"; DO NOT EDIT.

package uadp

import (
	"unsafe"

	"github.com/godbus/dbus"
	"github.com/linuxdeepin/go-lib/dbusutil/proxy"
)

type Uadp interface {
	uadp // interface com.deepin.daemon.Uadp
	proxy.Object
}

type objectUadp struct {
	interfaceUadp // interface com.deepin.daemon.Uadp
	proxy.ImplObject
}

func NewUadp(conn *dbus.Conn) Uadp {
	obj := new(objectUadp)
	obj.ImplObject.Init_(conn, "com.deepin.daemon.Uadp", "/com/deepin/daemon/Uadp")
	return obj
}

type uadp interface {
	GoSetDataKey(flags dbus.Flags, ch chan *dbus.Call, exePath string, keyName string, dataKey string, keyringKey string) *dbus.Call
	SetDataKey(flags dbus.Flags, exePath string, keyName string, dataKey string, keyringKey string) error
	GoGetDataKey(flags dbus.Flags, ch chan *dbus.Call, exePath string, keyName string, keyringKey string) *dbus.Call
	GetDataKey(flags dbus.Flags, exePath string, keyName string, keyringKey string) (string, error)
}

type interfaceUadp struct{}

func (v *interfaceUadp) GetObject_() *proxy.ImplObject {
	return (*proxy.ImplObject)(unsafe.Pointer(v))
}

func (*interfaceUadp) GetInterfaceName_() string {
	return "com.deepin.daemon.Uadp"
}

// method SetDataKey

func (v *interfaceUadp) GoSetDataKey(flags dbus.Flags, ch chan *dbus.Call, exePath string, keyName string, dataKey string, keyringKey string) *dbus.Call {
	return v.GetObject_().Go_(v.GetInterfaceName_()+".SetDataKey", flags, ch, exePath, keyName, dataKey, keyringKey)
}

func (v *interfaceUadp) SetDataKey(flags dbus.Flags, exePath string, keyName string, dataKey string, keyringKey string) error {
	return (<-v.GoSetDataKey(flags, make(chan *dbus.Call, 1), exePath, keyName, dataKey, keyringKey).Done).Err
}

// method GetDataKey

func (v *interfaceUadp) GoGetDataKey(flags dbus.Flags, ch chan *dbus.Call, exePath string, keyName string, keyringKey string) *dbus.Call {
	return v.GetObject_().Go_(v.GetInterfaceName_()+".GetDataKey", flags, ch, exePath, keyName, keyringKey)
}

func (*interfaceUadp) StoreGetDataKey(call *dbus.Call) (dataKey string, err error) {
	err = call.Store(&dataKey)
	return
}

func (v *interfaceUadp) GetDataKey(flags dbus.Flags, exePath string, keyName string, keyringKey string) (string, error) {
	return v.StoreGetDataKey(
		<-v.GoGetDataKey(flags, make(chan *dbus.Call, 1), exePath, keyName, keyringKey).Done)
}
