timechimp.api.expenses package

Module contents

timechimp.api.expenses.change_status_external(registration_ids: List[int], approval_status: timechimp.enum.ApprovalStatus, message: str, name: str, version: str = '1', to_json: bool = False) Union[requests.models.Response, dict]

Change the external submitted registration ids approval status

Parameters
  • registration_ids – the list of registration ids

  • approval_status – ApprovalStatus.APPROVED or ApprovalStatus.REJECTED

  • message – the message the current submission

  • name – the name of the reviewer

  • version – the version of the endpoint to use

  • to_json – convert the request response to a json object

Returns

TimeChimp expense requests response object

timechimp.api.expenses.change_status_internal(registration_ids: List[int], approval_status: timechimp.enum.ApprovalStatus, message: str, version: str = '1', to_json: bool = False) Union[requests.models.Response, dict]

Change the internal submitted registration ids approval status

Parameters
  • registration_ids – the list of registration ids

  • approval_status – ApprovalStatus.APPROVED or ApprovalStatus.REJECTED

  • message – the message the current submission

  • version – the version of the endpoint to use

  • to_json – convert the request response to a json object

Returns

TimeChimp expense requests response object

timechimp.api.expenses.create(expense: dict, version: str = '1', to_json: bool = False) Union[requests.models.Response, dict]

Create a new expense entry

Parameters
  • expense – the JSON representation of the expense entry to create

  • version – the version of the endpoint to use

  • to_json – convert the request response to a json object

Returns

TimeChimp expense requests response object

timechimp.api.expenses.delete(expense_id: int, version: str = '1', to_json: bool = False) Union[requests.models.Response, dict]

Delete a expense entry by id

Parameters
  • expense_id – the JSON representation of the expense entry to create

  • version – the version of the endpoint to use

  • to_json – convert the request response to a json object

Returns

TimeChimp expense requests response object

timechimp.api.expenses.get_all(version: str = '1', params: Optional[dict] = None, to_json: bool = False) Union[requests.models.Response, List[dict]]

Get all the expense entries

Parameters
  • version – the version of the endpoint to use

  • params – the query string parameters

  • to_json – convert the request response to a json object

Returns

TimeChimp expense requests response object

timechimp.api.expenses.get_by_date_range(date_from: str, date_to: str, version: str = '1', to_json: bool = False) Union[requests.models.Response, List[dict]]

Get expense entries by date range

Parameters
  • date_from – inclusive date as YYYY-MM-DD

  • date_to – inclusive date as YYYY-MM-DD

  • version – the version of the endpoint to use

  • to_json – convert the request response to a json object

Returns

TimeChimp expense requests response object

timechimp.api.expenses.get_by_id(expense_id: int, version: str = '1', to_json: bool = False) Union[requests.models.Response, dict]

Get a expense entry by id

Parameters
  • expense_id – the unique id of the expense entry

  • version – the version of the endpoint to use

  • to_json – convert the request response to a json object

Returns

TimeChimp expense requests response object

timechimp.api.expenses.get_by_project(project_id: int, version: str = '1', to_json: bool = False) Union[requests.models.Response, List[dict]]

Get a expense entry by project

Parameters
  • project_id – the unique id of the project

  • version – the version of the endpoint to use

  • to_json – convert the request response to a json object

Returns

TimeChimp expense requests response object

timechimp.api.expenses.submit_for_approval_external(registration_ids: List[int], contact_person_emails: List[str], message: str, version: str = '1', to_json: bool = False) Union[requests.models.Response, dict]

Submit registration ids for internal approval

Parameters
  • registration_ids – the list of registration ids

  • contact_person_emails – a list of contact emails

  • message – the message the current submission

  • version – the version of the endpoint to use

  • to_json – convert the request response to a json object

Returns

TimeChimp expense requests response object

timechimp.api.expenses.submit_for_approval_internal(registration_ids: List[int], message: str, version: str = '1', to_json: bool = False) Union[requests.models.Response, List[dict]]

Submit registration ids for internal approval

Parameters
  • registration_ids – the list of registration ids

  • message – the message the current submission

  • version – the version of the endpoint to use

  • to_json – convert the request response to a json object

Returns

TimeChimp expense requests response object

timechimp.api.expenses.update(expense: dict, version: str = '1', to_json: bool = False) Union[requests.models.Response, dict]

Update a expense entry

Parameters
  • expense – the JSON representation of the expense entry to update

  • version – the version of the endpoint to use

  • to_json – convert the request response to a json object

Returns

TimeChimp expense requests response object