Show all users for this company.

    CLI Example:

        salt myminion bamboohr.list_users

    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_users order_by=id
        salt myminion bamboohr.list_users order_by=email

def list_users(order_by='id'):
    '''
    Show all users for this company.

    CLI Example:

        salt myminion bamboohr.list_users

    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_users order_by=id
        salt myminion bamboohr.list_users order_by=email
    '''
    ret = {}
    status, result = _query(action='meta', command='users')
    root = ET.fromstring(result)
    users = root.getchildren()
    for user in users:
        user_id = None
        user_ret = {}
        for item in user.items():
            user_ret[item[0]] = item[1]
            if item[0] == 'id':
                user_id = item[1]
        for item in user.getchildren():
            user_ret[item.tag] = item.text
        ret[user_ret[order_by]] = user_ret
    return ret