import avesterra as av
[docs]
def set_company_facts(company_entity: av.AvEntity, name: str, address: str, employee: str, auth: av.AvAuthorization):
    """
    This function shows how to add a few Facts to an existing company entity. It's
    probably obvious that a company can have one or more facts.
    :param employee: Company employee
    :param company_entity: The entity ID of the company entity to add the facts.
    :param name: Company Name
    :param address: Company Address
    :param auth: The Orchestra server authorization that allows entity operations.
    """
    av.set_fact(
        entity=company_entity,
        attribute=av.AvAttribute.NAME,
        value=av.AvValue.encode_string(name),
        authorization=auth,
    )
    av.set_fact(
        entity=company_entity,
        attribute=av.AvAttribute.ADDRESS,
        value=av.AvValue.encode_string(address),
        authorization=auth,
    )
    av.set_fact(
        entity=company_entity,
        attribute=av.AvAttribute.COMPANY,
        value=av.AvValue.encode_string(name),
        authorization=auth,
    )
    av.set_fact(
        entity=company_entity,
        attribute=av.AvAttribute.EMPLOYEE,
        value=av.AvValue.encode_string(employee),
        authorization=auth,
    )