21 lines
813 B
Python
21 lines
813 B
Python
class ClockifyConfig:
|
|
def __init__(self, workspace_id: str, user_id: str):
|
|
self.workspace_id = workspace_id
|
|
self.user_id = user_id
|
|
self.datetime_format = "%Y-%m-%dT%H:%M:%SZ"
|
|
self.base_url = "https://api.clockify.me/api/v1"
|
|
self.workspace_url = f"/workspaces/{self.workspace_id}"
|
|
self.tags_url = f"{self.workspace_url}/tags"
|
|
self.time_entries_url = f"/{self.workspace_url}/user/{self.user_id}/time-entries"
|
|
self.user_url = "/user"
|
|
self.projects_url = f"{self.workspace_url}/projects"
|
|
|
|
self.tags_count = 100
|
|
|
|
def update_time_entry(self, activity_id):
|
|
return f"{self.workspace_url}/time-entries/{activity_id}"
|
|
|
|
def tasks_url(self, project_id: str):
|
|
return f"{self.projects_url}/{project_id}/tasks"
|
|
|