示例#1
0
    def get_whos_out(self, start_date=None, end_date=None):
        start_date = utils.resolve_date_argument(start_date)
        end_date = utils.resolve_date_argument(end_date)

        url = self.base_url + 'time_off/whos_out'
        params = {}
        if start_date:
            params['start'] = start_date
        if end_date:
            params['end'] = end_date
        r = requests.get(url, params=params, headers=self.headers, auth=(self.api_key, 'x'))
        r.raise_for_status()
        return r.json()
示例#2
0
    def get_time_off_requests(self, start_date=None, end_date=None, status=None, type=None, employee_id=None):
        start_date = utils.resolve_date_argument(start_date)
        end_date = utils.resolve_date_argument(end_date)

        params = {}
        if start_date:
            params['start'] = start_date
        if end_date:
            params['end'] = end_date
        if status:
            params['status'] = status
        if type:
            params['type'] = type
        if employee_id:
            params['employeeId'] = employee_id

        r = self._query('time_off/requests', params, raw=True)
        return r.json()