projectal.entities.contact
1from projectal.entity import Entity 2from projectal import api 3from projectal.linkers import * 4 5 6class Contact(Entity, CompanyLinker, CustomerLinker, NoteLinker, TagLinker): 7 """ 8 Implementation of the [Contact](https://projectal.com/docs/latest/#tag/Contact) API. 9 """ 10 11 _path = "contact" 12 _name = "contact" 13 _links = [NoteLinker, TagLinker] 14 _links_reverse = [CompanyLinker, CustomerLinker] 15 16 @classmethod 17 def create( 18 cls, 19 holder, 20 entity, 21 batch_linking=True, 22 disable_system_features=True, 23 enable_system_features_on_exit=True, 24 ): 25 """Create a Contact 26 27 `holder`: `uuId` of the owner 28 29 `entity`: The fields of the entity to be created 30 """ 31 holder = holder["uuId"] if isinstance(holder, dict) else holder 32 params = "?holder=" + holder 33 return super().create( 34 entity, 35 params, 36 batch_linking, 37 disable_system_features, 38 enable_system_features_on_exit, 39 ) 40 41 @classmethod 42 def clone(cls, uuId, holder, entity): 43 url = "/api/contact/clone?holder={}&reference={}".format(holder, uuId) 44 response = api.post(url, entity) 45 return response["jobClue"]["uuId"]
class
Contact(projectal.entity.Entity, projectal.linkers.CompanyLinker, projectal.linkers.CustomerLinker, projectal.linkers.NoteLinker, projectal.linkers.TagLinker):
7class Contact(Entity, CompanyLinker, CustomerLinker, NoteLinker, TagLinker): 8 """ 9 Implementation of the [Contact](https://projectal.com/docs/latest/#tag/Contact) API. 10 """ 11 12 _path = "contact" 13 _name = "contact" 14 _links = [NoteLinker, TagLinker] 15 _links_reverse = [CompanyLinker, CustomerLinker] 16 17 @classmethod 18 def create( 19 cls, 20 holder, 21 entity, 22 batch_linking=True, 23 disable_system_features=True, 24 enable_system_features_on_exit=True, 25 ): 26 """Create a Contact 27 28 `holder`: `uuId` of the owner 29 30 `entity`: The fields of the entity to be created 31 """ 32 holder = holder["uuId"] if isinstance(holder, dict) else holder 33 params = "?holder=" + holder 34 return super().create( 35 entity, 36 params, 37 batch_linking, 38 disable_system_features, 39 enable_system_features_on_exit, 40 ) 41 42 @classmethod 43 def clone(cls, uuId, holder, entity): 44 url = "/api/contact/clone?holder={}&reference={}".format(holder, uuId) 45 response = api.post(url, entity) 46 return response["jobClue"]["uuId"]
Implementation of the Contact API.
@classmethod
def
create( cls, holder, entity, batch_linking=True, disable_system_features=True, enable_system_features_on_exit=True):
17 @classmethod 18 def create( 19 cls, 20 holder, 21 entity, 22 batch_linking=True, 23 disable_system_features=True, 24 enable_system_features_on_exit=True, 25 ): 26 """Create a Contact 27 28 `holder`: `uuId` of the owner 29 30 `entity`: The fields of the entity to be created 31 """ 32 holder = holder["uuId"] if isinstance(holder, dict) else holder 33 params = "?holder=" + holder 34 return super().create( 35 entity, 36 params, 37 batch_linking, 38 disable_system_features, 39 enable_system_features_on_exit, 40 )
Create a Contact
holder
: uuId
of the owner
entity
: The fields of the entity to be created
@classmethod
def
clone(cls, uuId, holder, entity):
42 @classmethod 43 def clone(cls, uuId, holder, entity): 44 url = "/api/contact/clone?holder={}&reference={}".format(holder, uuId) 45 response = api.post(url, entity) 46 return response["jobClue"]["uuId"]
Clones an entity and returns its uuId
.
Each entity has its own set of required values when cloning. Check the API documentation of that entity for details.