pyvikunja 0.7__tar.gz → 0.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyvikunja-0.7/pyvikunja.egg-info → pyvikunja-0.8}/PKG-INFO +1 -1
- {pyvikunja-0.7 → pyvikunja-0.8}/pyproject.toml +1 -1
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja/api.py +16 -0
- {pyvikunja-0.7 → pyvikunja-0.8/pyvikunja.egg-info}/PKG-INFO +1 -1
- {pyvikunja-0.7 → pyvikunja-0.8}/LICENSE +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/README.md +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja/__init__.py +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja/models/enum/repeat_mode.py +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja/models/enum/task_priority.py +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja/models/label.py +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja/models/models.py +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja/models/project.py +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja/models/task.py +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja/models/team.py +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja/models/user.py +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja.egg-info/SOURCES.txt +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja.egg-info/dependency_links.txt +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja.egg-info/requires.txt +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/pyvikunja.egg-info/top_level.txt +0 -0
- {pyvikunja-0.7 → pyvikunja-0.8}/setup.cfg +0 -0
@@ -74,6 +74,22 @@ class VikunjaAPI:
|
|
74
74
|
logger.error(f"Unexpected error occurred: {e} | URL: {url}")
|
75
75
|
return None
|
76
76
|
|
77
|
+
async def ping(self) -> bool:
|
78
|
+
"""Tests if the API key is valid by calling the /projects endpoint."""
|
79
|
+
"""Not chosen the /user endpoint here because it was always returning 401 with an API Token"""
|
80
|
+
url = f"{self.api_base_url}/projects"
|
81
|
+
|
82
|
+
try:
|
83
|
+
response = await self.client.get(url, headers=self.headers, timeout=10)
|
84
|
+
response.raise_for_status()
|
85
|
+
|
86
|
+
if response.status_code == 200:
|
87
|
+
return True
|
88
|
+
else:
|
89
|
+
raise httpx.HTTPError(f"Non-200 Response from server {response.status_code}")
|
90
|
+
except httpx.HTTPError as e:
|
91
|
+
raise e
|
92
|
+
|
77
93
|
# Projects
|
78
94
|
async def get_projects(self, page: int = 1, per_page: int = 20) -> List[Project]:
|
79
95
|
response = await self._request("GET", "/projects", params={"page": page, "per_page": per_page})
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|