def all (self): postUri = ""; __data__ = None queryParams = { }; response = requests.get( self.base + postUri, params = queryParams, verify=False, headers = {'X-BM-ApiKey' : self.apiKey, 'Accept' : 'application/json', 'X-BM-ClientVersion' : ITodoList_VERSION}, data = json.dumps(__data__)); 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__ return self.handleResult__(serder.ListSerDer(__ItemValueSerDer__(__VTodoSerDer__())), response)
def parseInternal(self, value, instance): uidValue = value['uid'] instance.uid = serder.STRING.parse(uidValue) versionValue = value['version'] instance.version = serder.LONG.parse(versionValue) from netbluemind.todolist.api.VTodo import VTodo from netbluemind.todolist.api.VTodo import __VTodoSerDer__ valueValue = value['value'] instance.value = __VTodoSerDer__().parse(valueValue) sendNotificationValue = value['sendNotification'] instance.sendNotification = serder.BOOLEAN.parse(sendNotificationValue) return instance
def update (self, uid , todo ): postUri = "/{uid}"; __data__ = None postUri = postUri.replace("{uid}",uid); from netbluemind.todolist.api.VTodo import VTodo from netbluemind.todolist.api.VTodo import __VTodoSerDer__ __data__ = __VTodoSerDer__().encode(todo) queryParams = { }; response = requests.post( self.base + postUri, params = queryParams, verify=False, headers = {'X-BM-ApiKey' : self.apiKey, 'Accept' : 'application/json', 'X-BM-ClientVersion' : ITodoList_VERSION}, data = json.dumps(__data__)); return self.handleResult__(None, response)
def encodeInternal(self, value, instance): uidValue = value.uid instance["uid"] = serder.STRING.encode(uidValue) versionValue = value.version instance["version"] = serder.LONG.encode(versionValue) from netbluemind.todolist.api.VTodo import VTodo from netbluemind.todolist.api.VTodo import __VTodoSerDer__ valueValue = value.value instance["value"] = __VTodoSerDer__().encode(valueValue) sendNotificationValue = value.sendNotification instance["sendNotification"] = serder.BOOLEAN.encode(sendNotificationValue) return instance
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 search (self, query ): postUri = "/_search"; __data__ = None from netbluemind.todolist.api.VTodoQuery import VTodoQuery from netbluemind.todolist.api.VTodoQuery import __VTodoQuerySerDer__ __data__ = __VTodoQuerySerDer__().encode(query) queryParams = { }; response = requests.post( self.base + postUri, params = queryParams, verify=False, headers = {'X-BM-ApiKey' : self.apiKey, 'Accept' : 'application/json', 'X-BM-ClientVersion' : ITodoList_VERSION}, data = json.dumps(__data__)); 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__ from netbluemind.core.api.ListResult import ListResult from netbluemind.core.api.ListResult import __ListResultSerDer__ return self.handleResult__(__ListResultSerDer__(__ItemValueSerDer__(__VTodoSerDer__())), response)
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