def parseInternal(self, value, instance): from netbluemind.user.api.User import User from netbluemind.user.api.User import __UserSerDer__ userValue = value['user'] instance.user = __UserSerDer__().parse(userValue) from netbluemind.todolist.api.VTodo import VTodo from netbluemind.todolist.api.VTodo import __VTodoSerDer__ from netbluemind.core.container.model.ItemValue import ItemValue from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__ todoValue = value['todo'] instance.todo = __ItemValueSerDer__(__VTodoSerDer__()).parse(todoValue) from netbluemind.icalendar.api.ICalendarElementVAlarm import ICalendarElementVAlarm from netbluemind.icalendar.api.ICalendarElementVAlarm import __ICalendarElementVAlarmSerDer__ valarmValue = value['valarm'] instance.valarm = __ICalendarElementVAlarmSerDer__().parse(valarmValue) return instance
def encodeInternal(self, value, instance): from netbluemind.user.api.User import User from netbluemind.user.api.User import __UserSerDer__ userValue = value.user instance["user"] = __UserSerDer__().encode(userValue) from netbluemind.todolist.api.VTodo import VTodo from netbluemind.todolist.api.VTodo import __VTodoSerDer__ from netbluemind.core.container.model.ItemValue import ItemValue from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__ todoValue = value.todo instance["todo"] = __ItemValueSerDer__( __VTodoSerDer__()).encode(todoValue) from netbluemind.icalendar.api.ICalendarElementVAlarm import ICalendarElementVAlarm from netbluemind.icalendar.api.ICalendarElementVAlarm import __ICalendarElementVAlarmSerDer__ valarmValue = value.valarm instance["valarm"] = __ICalendarElementVAlarmSerDer__().encode( valarmValue) return instance
def update(self, uid, user): postUri = "/{uid}" __data__ = None postUri = postUri.replace("{uid}", uid) from netbluemind.user.api.User import User from netbluemind.user.api.User import __UserSerDer__ __data__ = __UserSerDer__().encode(user) queryParams = {} response = requests.post(self.base + postUri, params=queryParams, verify=False, headers={ 'X-BM-ApiKey': self.apiKey, 'Accept': 'application/json', 'X-BM-ClientVersion': IUser_VERSION }, data=json.dumps(__data__)) return self.handleResult__(None, response)
def parseInternal(self, value, instance): uidValue = value['uid'] instance.uid = serder.STRING.parse(uidValue) domainUidValue = value['domainUid'] instance.domainUid = serder.STRING.parse(domainUidValue) displayNameValue = value['displayName'] instance.displayName = serder.STRING.parse(displayNameValue) from netbluemind.user.api.User import User from netbluemind.user.api.User import __UserSerDer__ valueValue = value['value'] instance.value = __UserSerDer__().parse(valueValue) rolesValue = value['roles'] instance.roles = serder.SetSerDer(serder.STRING).parse(rolesValue) rolesByOUValue = value['rolesByOU'] instance.rolesByOU = serder.MapSerDer(serder.SetSerDer( serder.STRING)).parse(rolesByOUValue) settingsValue = value['settings'] instance.settings = serder.MapSerDer( serder.STRING).parse(settingsValue) return instance
def getComplete(self, uid): postUri = "/{uid}/complete" __data__ = None postUri = postUri.replace("{uid}", uid) queryParams = {} response = requests.get(self.base + postUri, params=queryParams, verify=False, headers={ 'X-BM-ApiKey': self.apiKey, 'Accept': 'application/json', 'X-BM-ClientVersion': IUser_VERSION }, data=json.dumps(__data__)) from netbluemind.user.api.User import User from netbluemind.user.api.User import __UserSerDer__ from netbluemind.core.container.model.ItemValue import ItemValue from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__ return self.handleResult__(__ItemValueSerDer__(__UserSerDer__()), response)
def encodeInternal(self, value, instance): uidValue = value.uid instance["uid"] = serder.STRING.encode(uidValue) domainUidValue = value.domainUid instance["domainUid"] = serder.STRING.encode(domainUidValue) displayNameValue = value.displayName instance["displayName"] = serder.STRING.encode(displayNameValue) from netbluemind.user.api.User import User from netbluemind.user.api.User import __UserSerDer__ valueValue = value.value instance["value"] = __UserSerDer__().encode(valueValue) rolesValue = value.roles instance["roles"] = serder.SetSerDer(serder.STRING).encode(rolesValue) rolesByOUValue = value.rolesByOU instance["rolesByOU"] = serder.MapSerDer( serder.SetSerDer(serder.STRING)).encode(rolesByOUValue) settingsValue = value.settings instance["settings"] = serder.MapSerDer( serder.STRING).encode(settingsValue) return instance