timechimp.api.mileage package
Module contents
- timechimp.api.mileage.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 mileage requests response object
- timechimp.api.mileage.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 mileage requests response object
- timechimp.api.mileage.create(mileage: dict, version: str = '1', to_json: bool = False) Union[requests.models.Response, dict]
Create a new mileage entry
- Parameters
mileage – the JSON representation of the mileage entry to create
version – the version of the endpoint to use
to_json – convert the request response to a json object
- Returns
TimeChimp mileage requests response object
- timechimp.api.mileage.delete(mileage_id: int, version: str = '1', to_json: bool = False) Union[requests.models.Response, dict]
Delete a mileage entry by id
- Parameters
mileage_id – the JSON representation of the mileage entry to create
version – the version of the endpoint to use
to_json – convert the request response to a json object
- Returns
TimeChimp mileage requests response object
- timechimp.api.mileage.get_all(version: str = '1', params: Optional[dict] = None, to_json: bool = False) Union[requests.models.Response, List[dict]]
Get all the mileage 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 mileage requests response object
- timechimp.api.mileage.get_by_date_range(date_from: str, date_to: str, version: str = '1', to_json: bool = False) Union[requests.models.Response, List[dict]]
Get mileage 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 mileage requests response object
- Raises
ValueError, date_from cannot occur later than date_to –
- timechimp.api.mileage.get_by_id(mileage_id: int, version: str = '1', to_json: bool = False) Union[requests.models.Response, dict]
Get a mileage entry by id
- Parameters
mileage_id – the unique id of the mileage entry
version – the version of the endpoint to use
to_json – convert the request response to a json object
- Returns
TimeChimp mileage requests response object
- timechimp.api.mileage.get_by_project(project_id: int, version: str = '1', to_json: bool = False) Union[requests.models.Response, List[dict]]
Get a mileage 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 mileage requests response object
- timechimp.api.mileage.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 mileage requests response object
- timechimp.api.mileage.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 mileage requests response object
- timechimp.api.mileage.update(mileage: dict, version: str = '1', to_json: bool = False) Union[requests.models.Response, dict]
Update a mileage entry
- Parameters
mileage – the JSON representation of the mileage entry to update
version – the version of the endpoint to use
to_json – convert the request response to a json object
- Returns
TimeChimp mileage requests response object