Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9140da9

Browse files
committed
created method for getting a paste from its uuid
1 parent 55151b3 commit 9140da9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

sdk/sdk/module.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,15 @@ def create_paste(self, content: Union[str, Path], file_extension: Optional[str]
2525
response = requests.post(f"{self.base_url}/web", data=data)
2626

2727
response.raise_for_status()
28-
return response.text.strip()
28+
return response.text.strip()
29+
30+
def get_paste(self, uuid: str) -> str:
31+
"""
32+
Retrieve a paste by its unique identifier.
33+
34+
:param uuid: The unique identifier of the paste
35+
:return: The content of the paste
36+
"""
37+
response = requests.get(f"{self.base_url}/paste/{uuid}")
38+
response.raise_for_status()
39+
return response.text

0 commit comments

Comments
 (0)