(self, endpoint: str, params: Any = None)
| 210 | return response.status_code, response.reason |
| 211 | |
| 212 | def delete(self, endpoint: str, params: Any = None) -> tuple[int, str]: |
| 213 | headers = { |
| 214 | "Authorization": f"Bearer {self.foundation_client.get_access_token()}", |
| 215 | "Content-type": "application/json", |
| 216 | } |
| 217 | |
| 218 | try: |
| 219 | response = requests.delete(f"{self.baseurl}{endpoint}", headers=headers, params=params or None) |
| 220 | |
| 221 | if response.status_code != 200: |
| 222 | response.raise_for_status() |
| 223 | return response.status_code, response.text |
| 224 | except requests.exceptions.HTTPError as errh: |
| 225 | print(f"message: {response.reason}' '{response.status_code}, {errh}") |
| 226 | return response.status_code, response.reason |
| 227 | |
| 228 | def get_projects(self) -> list[Any]: |
| 229 | return self.get("/projects") |
no test coverage detected