Show all employees for this company.

    CLI Example:

        salt myminion bamboohr.list_employees

    By default, the return data will be keyed by ID. However, it can be ordered
    by any other field. Keep in mind that if the field that is chosen contains
    duplicate values (i.e., location is used, for a company which only has one
    location), then each duplicate value will be overwritten by the previous.
    Therefore, it is advisable to only sort by fields that are guaranteed to be
    unique.

    CLI Examples:

        salt myminion bamboohr.list_employees order_by=id
        salt myminion bamboohr.list_employees order_by=displayName
        salt myminion bamboohr.list_employees order_by=workEmail

def list_employees(order_by='id'):
    '''
    Show all employees for this company.

    CLI Example:

        salt myminion bamboohr.list_employees

    By default, the return data will be keyed by ID. However, it can be ordered
    by any other field. Keep in mind that if the field that is chosen contains
    duplicate values (i.e., location is used, for a company which only has one
    location), then each duplicate value will be overwritten by the previous.
    Therefore, it is advisable to only sort by fields that are guaranteed to be
    unique.

    CLI Examples:

        salt myminion bamboohr.list_employees order_by=id
        salt myminion bamboohr.list_employees order_by=displayName
        salt myminion bamboohr.list_employees order_by=workEmail
    '''
    ret = {}
    status, result = _query(action='employees', command='directory')
    root = ET.fromstring(result)
    directory = root.getchildren()
    for cat in directory:
        if cat.tag != 'employees':
            continue
        for item in cat:
            emp_id = item.items()[0][1]
            emp_ret = {'id': emp_id}
            for details in item.getchildren():
                emp_ret[details.items()[0][1]] = details.text
            ret[emp_ret[order_by]] = emp_ret
    return ret