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 search(self, query): postUri = "/_search" __data__ = None from netbluemind.directory.api.DirEntryQuery import DirEntryQuery from netbluemind.directory.api.DirEntryQuery import __DirEntryQuerySerDer__ __data__ = __DirEntryQuerySerDer__().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': IDirectory_VERSION }, data=json.dumps(__data__)) 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__ from netbluemind.core.api.ListResult import ListResult from netbluemind.core.api.ListResult import __ListResultSerDer__ return self.handleResult__( __ListResultSerDer__(__ItemValueSerDer__(__DirEntrySerDer__())), response)
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 getRoot(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': IDirectory_VERSION }, data=json.dumps(__data__)) from netbluemind.directory.api.DirEntry import DirEntry from netbluemind.directory.api.DirEntry import __DirEntrySerDer__ return self.handleResult__(__DirEntrySerDer__(), response)
def getEntries(self, path): postUri = "/_childs" __data__ = None __data__ = serder.STRING.encode(path) queryParams = {} response = requests.post(self.base + postUri, params=queryParams, verify=False, headers={ 'X-BM-ApiKey': self.apiKey, 'Accept': 'application/json', 'X-BM-ClientVersion': IDirectory_VERSION }, data=json.dumps(__data__)) from netbluemind.directory.api.DirEntry import DirEntry from netbluemind.directory.api.DirEntry import __DirEntrySerDer__ return self.handleResult__(serder.ListSerDer(__DirEntrySerDer__()), response)