| 285 | return self.delete(f"/projects/{project_id}/topics/{topic_id}") |
| 286 | |
| 287 | def get_snippet(self, project_id: str = "", topic_id: str = "") -> tuple[int, str]: |
| 288 | headers = { |
| 289 | "Authorization": f"Bearer {self.foundation_client.get_access_token()}", |
| 290 | "Content-type": "application/octet-stream", |
| 291 | } |
| 292 | |
| 293 | response = requests.get(f"{self.baseurl}/projects/{project_id}/topics/{topic_id}/snippet", headers=headers) |
| 294 | content = response.content.decode("utf-8") |
| 295 | with open(os.path.join(self.filepath, f"{project_id}_{topic_id}_snippet.txt"), "w") as f: |
| 296 | f.write(content) |
| 297 | return response.status_code, content |
| 298 | |
| 299 | def update_snippet(self, project_id: str = "", topic_id: str = "", files: Any = None, data: Any = None) -> int: |
| 300 | headers = { |