def encodeInternal(self, value, instance): generationIdValue = value.generationId instance["generationId"] = serder.INT.encode(generationIdValue) from netbluemind.domain.api.Domain import Domain from netbluemind.domain.api.Domain import __DomainSerDer__ from netbluemind.core.container.model.ItemValue import ItemValue from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__ domainsValue = value.domains instance["domains"] = serder.ListSerDer( __ItemValueSerDer__(__DomainSerDer__())).encode(domainsValue) from netbluemind.server.api.Server import Server from netbluemind.server.api.Server import __ServerSerDer__ from netbluemind.core.container.model.ItemValue import ItemValue from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__ serversValue = value.servers instance["servers"] = serder.ListSerDer( __ItemValueSerDer__(__ServerSerDer__())).encode(serversValue) from netbluemind.directory.api.DirEntry import DirEntry from netbluemind.directory.api.DirEntry import __DirEntrySerDer__ from netbluemind.core.container.model.ItemValue import ItemValue from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__ entriesValue = value.entries instance["entries"] = serder.ListSerDer( __ItemValueSerDer__(__DirEntrySerDer__())).encode(entriesValue) from netbluemind.dataprotect.api.RestoreOperation import RestoreOperation from netbluemind.dataprotect.api.RestoreOperation import __RestoreOperationSerDer__ capabilitiesValue = value.capabilities instance["capabilities"] = serder.ListSerDer( __RestoreOperationSerDer__()).encode(capabilitiesValue) return instance
def parseInternal(self, value, instance): generationIdValue = value['generationId'] instance.generationId = serder.INT.parse(generationIdValue) from netbluemind.domain.api.Domain import Domain from netbluemind.domain.api.Domain import __DomainSerDer__ from netbluemind.core.container.model.ItemValue import ItemValue from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__ domainsValue = value['domains'] instance.domains = serder.ListSerDer( __ItemValueSerDer__(__DomainSerDer__())).parse(domainsValue) from netbluemind.server.api.Server import Server from netbluemind.server.api.Server import __ServerSerDer__ from netbluemind.core.container.model.ItemValue import ItemValue from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__ serversValue = value['servers'] instance.servers = serder.ListSerDer( __ItemValueSerDer__(__ServerSerDer__())).parse(serversValue) from netbluemind.directory.api.DirEntry import DirEntry from netbluemind.directory.api.DirEntry import __DirEntrySerDer__ from netbluemind.core.container.model.ItemValue import ItemValue from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__ entriesValue = value['entries'] instance.entries = serder.ListSerDer( __ItemValueSerDer__(__DirEntrySerDer__())).parse(entriesValue) from netbluemind.dataprotect.api.RestoreOperation import RestoreOperation from netbluemind.dataprotect.api.RestoreOperation import __RestoreOperationSerDer__ capabilitiesValue = value['capabilities'] instance.capabilities = serder.ListSerDer( __RestoreOperationSerDer__()).parse(capabilitiesValue) 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': IServer_VERSION }, data=json.dumps(__data__)) from netbluemind.server.api.Server import Server from netbluemind.server.api.Server import __ServerSerDer__ from netbluemind.core.container.model.ItemValue import ItemValue from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__ return self.handleResult__(__ItemValueSerDer__(__ServerSerDer__()), response)
def update(self, uid, srv): postUri = "/{uid}" __data__ = None postUri = postUri.replace("{uid}", uid) from netbluemind.server.api.Server import Server from netbluemind.server.api.Server import __ServerSerDer__ __data__ = __ServerSerDer__().encode(srv) queryParams = {} response = requests.post(self.base + postUri, params=queryParams, verify=False, headers={ 'X-BM-ApiKey': self.apiKey, 'Accept': 'application/json', 'X-BM-ClientVersion': IServer_VERSION }, data=json.dumps(__data__)) from netbluemind.core.task.api.TaskRef import TaskRef from netbluemind.core.task.api.TaskRef import __TaskRefSerDer__ return self.handleResult__(__TaskRefSerDer__(), response)