Compare commits
2 Commits
25d32d83a9
...
a33c483165
| Author | SHA1 | Date | |
|---|---|---|---|
| a33c483165 | |||
| f8ab5abac4 |
@@ -2,33 +2,17 @@ class ClockifyConfig:
|
|||||||
def __init__(self, workspace_id: str, user_id: str):
|
def __init__(self, workspace_id: str, user_id: str):
|
||||||
self.workspace_id = workspace_id
|
self.workspace_id = workspace_id
|
||||||
self.user_id = user_id
|
self.user_id = user_id
|
||||||
|
self.datetime_format = "%Y-%m-%dT%H:%M:%SZ"
|
||||||
@property
|
self.base_url = "https://api.clockify.me/api/v1"
|
||||||
def base_url(self):
|
self.workspace_url = f"/workspaces/{self.workspace_id}"
|
||||||
return "https://api.clockify.me/api/v1"
|
self.tags_url = f"{self.workspace_url}/tags"
|
||||||
|
self.time_entries_url = f"/{self.workspace_url}/user/{self.user_id}/time-entries"
|
||||||
@property
|
self.user_url = "/user"
|
||||||
def tags_url(self):
|
self.projects_url = f"{self.workspace_url}/projects"
|
||||||
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):
|
def update_time_entry(self, activity_id):
|
||||||
return f"/workspaces/{self.workspace_id}/time-entries/{activity_id}"
|
return f"{self.workspace_url}/time-entries/{activity_id}"
|
||||||
|
|
||||||
@property
|
|
||||||
def projects_url(self):
|
|
||||||
return f"/workspaces/{self.workspace_id}/projects"
|
|
||||||
|
|
||||||
def tasks_url(self, project_id: str):
|
def tasks_url(self, project_id: str):
|
||||||
return f"{self.projects_url}/{project_id}/tasks"
|
return f"{self.projects_url}/{project_id}/tasks"
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,7 @@
|
|||||||
class RedmineConfig:
|
class RedmineConfig:
|
||||||
@property
|
def __init__(self):
|
||||||
def base_url(self):
|
self.base_url = "https://redmine.sbps.ru"
|
||||||
return "https://redmine.sbps.ru"
|
self.time_entries_url = "/time_entries.json"
|
||||||
|
self.my_account_url = "/my/account.json"
|
||||||
@property
|
self.datetime_format = "%Y-%m-%d"
|
||||||
def time_entries_url(self):
|
self.time_entry_activities = "/enumerations/time_entry_activities.json"
|
||||||
return "/time_entries.json"
|
|
||||||
|
|
||||||
@property
|
|
||||||
def my_account_url(self):
|
|
||||||
return "/my/account.json"
|
|
||||||
|
|
||||||
@property
|
|
||||||
def datetime_format(self):
|
|
||||||
return "%Y-%m-%d"
|
|
||||||
|
|
||||||
@property
|
|
||||||
def time_entry_activities(self):
|
|
||||||
return "/enumerations/time_entry_activities.json"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user