27 lines
753 B
Python
27 lines
753 B
Python
class ClockifyConfig:
|
|
def __init__(self, workspace_id: str, user_id: str):
|
|
self.workspace_id = workspace_id
|
|
self.user_id = user_id
|
|
|
|
@property
|
|
def base_url(self):
|
|
return "https://api.clockify.me/api/v1"
|
|
|
|
@property
|
|
def tags_url(self):
|
|
return f"/workspaces/{self.workspace_id}/tags"
|
|
|
|
@property
|
|
def time_entries_url(self):
|
|
return f"/workspaces/{self.workspace_id}/user/{self.user_id}/time-entries"
|
|
|
|
@property
|
|
def user_url(self):
|
|
return "/user"
|
|
|
|
@property
|
|
def datetime_format(self):
|
|
return "%Y-%m-%dT%H:%M:%SZ"
|
|
|
|
def update_time_entry(self, activity_id):
|
|
return f"/workspaces/{self.workspace_id}/time-entries/{activity_id}" |