Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def link_contact_to_company(self, contact_id: str, company_id: str):
"""Create a new association between a contact and a company."""
return self.create(
from_object=contact_id,
to_object=company_id,
definition=Definitions.CONTACT_TO_COMPANY,
)
def link_owner_to_company(self, owner_id: str, company_id: str):
"""Create a new association between an owner and a company."""
return self.create(
from_object=owner_id,
to_object=company_id,
definition=Definitions.OWNER_TO_COMPANY,
)
def get_deal_to_lines_items(self, deal_id: str):
"""Get the lines related to a deal."""
return self.get(object_id=deal_id, definition=Definitions.DEAL_TO_LINE_ITEM)
def get_company_to_deals(self, company_id: str):
"""Get the deals related to a company."""
return self.get(object_id=company_id, definition=Definitions.COMPANY_TO_DEAL)
def link_line_item_to_deal(self, line_item_id: str, deal_id: str):
"""Create a new association between a line item and a deal."""
return self.create(
from_object=line_item_id,
to_object=deal_id,
definition=Definitions.LINE_ITEM_TO_DEAL,
)
def get_company_to_contacts(self, company_id: str):
"""Get the contacts related to a company."""
return self.get(object_id=company_id, definition=Definitions.COMPANY_TO_CONTACT)