projectal.entities.contact API documentation

# projectal.entities.contact

View Source

    from projectal.entity import Entity
    from projectal import api
    from projectal.linkers import *

    class Contact(Entity, CompanyLinker, CustomerLinker, NoteLinker):
        """
        Implementation of the [Contact](https://projectal.com/docs/latest/#tag/Contact) API.
        """
        _path = 'contact'
        _name = 'contact'
        _links = [NoteLinker]
        _links_reverse = [CompanyLinker, CustomerLinker]

        @classmethod
        def create(cls, holder, entity):
            """Create a Contact

            `holder`: `uuId` of the owner

            `entity`: The fields of the entity to be created
            """
            holder = holder['uuId'] if isinstance(holder, dict) else holder
            params = "?holder=" + holder
            return super().create(entity, params)

        @classmethod
        def clone(cls, uuId, holder, entity):
            url = '/api/contact/clone?holder={}&reference={}'.format(holder, uuId)
            response = api.post(url, entity)
            return response['jobClue']['uuId']

class Contact(projectal.entity.Entity, projectal.linkers.CompanyLinker, projectal.linkers.CustomerLinker, projectal.linkers.NoteLinker):
View Source

    class Contact(Entity, CompanyLinker, CustomerLinker, NoteLinker):
        """
        Implementation of the [Contact](https://projectal.com/docs/latest/#tag/Contact) API.
        """
        _path = 'contact'
        _name = 'contact'
        _links = [NoteLinker]
        _links_reverse = [CompanyLinker, CustomerLinker]

        @classmethod
        def create(cls, holder, entity):
            """Create a Contact

            `holder`: `uuId` of the owner

            `entity`: The fields of the entity to be created
            """
            holder = holder['uuId'] if isinstance(holder, dict) else holder
            params = "?holder=" + holder
            return super().create(entity, params)

        @classmethod
        def clone(cls, uuId, holder, entity):
            url = '/api/contact/clone?holder={}&reference={}'.format(holder, uuId)
            response = api.post(url, entity)
            return response['jobClue']['uuId']

Implementation of the Contact API.

@classmethod
def create(cls, holder, entity):
View Source

        @classmethod
        def create(cls, holder, entity):
            """Create a Contact

            `holder`: `uuId` of the owner

            `entity`: The fields of the entity to be created
            """
            holder = holder['uuId'] if isinstance(holder, dict) else holder
            params = "?holder=" + holder
            return super().create(entity, params)

Create a Contact

`holder`: `uuId` of the owner

`entity`: The fields of the entity to be created

@classmethod
def clone(cls, uuId, holder, entity):
View Source

        @classmethod
        def clone(cls, uuId, holder, entity):
            url = '/api/contact/clone?holder={}&reference={}'.format(holder, uuId)
            response = api.post(url, entity)
            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.

##### Inherited Members

projectal.entity.Entity
  Entity
  get
  update
  delete
  history
  save
  list
  match
  match_startswith
  match_endswith
  match_one
  match_startswith_one
  match_endswith_one
  search
  query
  profile_get
  profile_set
  changes
  set_readonly
  entity_name
projectal.linkers.CompanyLinker
  link_company
  unlink_company
projectal.linkers.CustomerLinker
  link_customer
  unlink_customer
builtins.dict
  setdefault
  pop
  popitem
  keys
  items
  values
  fromkeys
  clear
  copy