Exemplo n.º 1
0
 def parseInternal(self, value, instance):
     uidValue = value['uid']
     instance.uid = serder.STRING.parse(uidValue)
     from netbluemind.addressbook.api.VCard import VCard
     from netbluemind.addressbook.api.VCard import __VCardSerDer__
     valueValue = value['value']
     instance.value = __VCardSerDer__().parse(valueValue)
     photoValue = value['photo']
     instance.photo = serder.ByteArraySerDer.parse(photoValue)
     return instance
Exemplo n.º 2
0
    def encodeInternal(self, value, instance):

        uidValue = value.uid
        instance["uid"] = serder.STRING.encode(uidValue)
        from netbluemind.addressbook.api.VCard import VCard
        from netbluemind.addressbook.api.VCard import __VCardSerDer__
        valueValue = value.value
        instance["value"] = __VCardSerDer__().encode(valueValue)
        photoValue = value.photo
        instance["photo"] = serder.ByteArraySerDer.encode(photoValue)
        return instance
Exemplo n.º 3
0
	def collect (self, card ):
		postUri = "/_collect";
		__data__ = None
		from netbluemind.addressbook.api.VCard import VCard
		from netbluemind.addressbook.api.VCard import __VCardSerDer__
		__data__ = __VCardSerDer__().encode(card)

		queryParams = {   };

		response = requests.post( self.base + postUri, params = queryParams, verify=False, headers = {'X-BM-ApiKey' : self.apiKey, 'Accept' : 'application/json', 'X-BM-ClientVersion' : IAddressBook_VERSION}, data = json.dumps(__data__));
		return self.handleResult__(serder.STRING, response)
Exemplo n.º 4
0
	def update (self, uid , card ):
		postUri = "/{uid}";
		__data__ = None
		postUri = postUri.replace("{uid}",uid);
		from netbluemind.addressbook.api.VCard import VCard
		from netbluemind.addressbook.api.VCard import __VCardSerDer__
		__data__ = __VCardSerDer__().encode(card)

		queryParams = {    };

		response = requests.post( self.base + postUri, params = queryParams, verify=False, headers = {'X-BM-ApiKey' : self.apiKey, 'Accept' : 'application/json', 'X-BM-ClientVersion' : IAddressBook_VERSION}, data = json.dumps(__data__));
		return self.handleResult__(None, response)
Exemplo n.º 5
0
	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' : IAddressBook_VERSION}, data = json.dumps(__data__));
		from netbluemind.addressbook.api.VCard import VCard
		from netbluemind.addressbook.api.VCard import __VCardSerDer__
		from netbluemind.core.container.model.ItemValue import ItemValue
		from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__
		return self.handleResult__(__ItemValueSerDer__(__VCardSerDer__()), response)
Exemplo n.º 6
0
	def multipleGet (self, uids ):
		postUri = "/_mget";
		__data__ = None
		__data__ = serder.ListSerDer(serder.STRING).encode(uids)

		queryParams = {   };

		response = requests.post( self.base + postUri, params = queryParams, verify=False, headers = {'X-BM-ApiKey' : self.apiKey, 'Accept' : 'application/json', 'X-BM-ClientVersion' : IAddressBook_VERSION}, data = json.dumps(__data__));
		from netbluemind.addressbook.api.VCard import VCard
		from netbluemind.addressbook.api.VCard import __VCardSerDer__
		from netbluemind.core.container.model.ItemValue import ItemValue
		from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__
		return self.handleResult__(serder.ListSerDer(__ItemValueSerDer__(__VCardSerDer__())), response)
Exemplo n.º 7
0
 def parseInternal(self, value, instance):
     nameValue = value['name']
     instance.name = serder.STRING.parse(nameValue)
     quotaValue = value['quota']
     instance.quota = serder.INT.parse(quotaValue)
     from netbluemind.mailbox.api.MailboxRouting import MailboxRouting
     from netbluemind.mailbox.api.MailboxRouting import __MailboxRoutingSerDer__
     routingValue = value['routing']
     instance.routing = __MailboxRoutingSerDer__().parse(routingValue)
     from netbluemind.addressbook.api.VCard import VCard
     from netbluemind.addressbook.api.VCard import __VCardSerDer__
     cardValue = value['card']
     instance.card = __VCardSerDer__().parse(cardValue)
     dataLocationValue = value['dataLocation']
     instance.dataLocation = serder.STRING.parse(dataLocationValue)
     return instance
Exemplo n.º 8
0
    def getVCard(self, uid):
        postUri = "/{uid}/vcard"
        __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.addressbook.api.VCard import VCard
        from netbluemind.addressbook.api.VCard import __VCardSerDer__
        return self.handleResult__(__VCardSerDer__(), response)
Exemplo n.º 9
0
    def encodeInternal(self, value, instance):
        __DirBaseValueSerDer__().encodeInternal(value, instance)

        nameValue = value.name
        instance["name"] = serder.STRING.encode(nameValue)
        quotaValue = value.quota
        instance["quota"] = serder.INT.encode(quotaValue)
        from netbluemind.mailbox.api.MailboxRouting import MailboxRouting
        from netbluemind.mailbox.api.MailboxRouting import __MailboxRoutingSerDer__
        routingValue = value.routing
        instance["routing"] = __MailboxRoutingSerDer__().encode(routingValue)
        from netbluemind.addressbook.api.VCard import VCard
        from netbluemind.addressbook.api.VCard import __VCardSerDer__
        cardValue = value.card
        instance["card"] = __VCardSerDer__().encode(cardValue)
        dataLocationValue = value.dataLocation
        instance["dataLocation"] = serder.STRING.encode(dataLocationValue)
        return instance
Exemplo n.º 10
0
 def parseInternal(self, value, instance):
     loginValue = value['login']
     instance.login = serder.STRING.parse(loginValue)
     passwordValue = value['password']
     instance.password = serder.STRING.parse(passwordValue)
     from netbluemind.addressbook.api.VCard import VCard
     from netbluemind.addressbook.api.VCard import __VCardSerDer__
     contactInfosValue = value['contactInfos']
     instance.contactInfos = __VCardSerDer__().parse(contactInfosValue)
     from netbluemind.mailbox.api.MailboxRouting import MailboxRouting
     from netbluemind.mailbox.api.MailboxRouting import __MailboxRoutingSerDer__
     routingValue = value['routing']
     instance.routing = __MailboxRoutingSerDer__().parse(routingValue)
     dataLocationValue = value['dataLocation']
     instance.dataLocation = serder.STRING.parse(dataLocationValue)
     quotaValue = value['quota']
     instance.quota = serder.INT.parse(quotaValue)
     propertiesValue = value['properties']
     instance.properties = serder.MapSerDer(
         serder.STRING).parse(propertiesValue)
     return instance
Exemplo n.º 11
0
    def encodeInternal(self, value, instance):
        __DirBaseValueSerDer__().encodeInternal(value, instance)

        loginValue = value.login
        instance["login"] = serder.STRING.encode(loginValue)
        passwordValue = value.password
        instance["password"] = serder.STRING.encode(passwordValue)
        from netbluemind.addressbook.api.VCard import VCard
        from netbluemind.addressbook.api.VCard import __VCardSerDer__
        contactInfosValue = value.contactInfos
        instance["contactInfos"] = __VCardSerDer__().encode(contactInfosValue)
        from netbluemind.mailbox.api.MailboxRouting import MailboxRouting
        from netbluemind.mailbox.api.MailboxRouting import __MailboxRoutingSerDer__
        routingValue = value.routing
        instance["routing"] = __MailboxRoutingSerDer__().encode(routingValue)
        dataLocationValue = value.dataLocation
        instance["dataLocation"] = serder.STRING.encode(dataLocationValue)
        quotaValue = value.quota
        instance["quota"] = serder.INT.encode(quotaValue)
        propertiesValue = value.properties
        instance["properties"] = serder.MapSerDer(
            serder.STRING).encode(propertiesValue)
        return instance