@@ -44,7 +44,7 @@ class File:
4444 """Represents a single file within a mystb.in paste.
4545
4646 Attributes
47- -----------
47+ ----------
4848 filename: :class:`str`
4949 The file's name.
5050 content: :class:`str`
@@ -74,7 +74,7 @@ def lines_of_code(self) -> int:
7474 """The total lines of code this file has.
7575
7676 Returns
77- --------
77+ -------
7878 :class:`int`
7979 """
8080 return self ._lines_of_code
@@ -84,7 +84,7 @@ def character_count(self) -> int:
8484 """The total character count of this file.
8585
8686 Returns
87- --------
87+ -------
8888 :class:`int`
8989 """
9090 return self ._character_count
@@ -94,7 +94,7 @@ def annotation(self) -> str:
9494 """The files annotation.
9595
9696 Returns
97- --------
97+ -------
9898 :class:`str`
9999 """
100100 return self ._annotation
@@ -104,13 +104,19 @@ def parent_id(self) -> str:
104104 """The files parent paste ID.
105105
106106 Returns
107- --------
107+ -------
108108 :class:`str`
109109 """
110110 return self ._parent_id
111111
112112 @classmethod
113113 def from_data (cls , payload : FileResponse , / ) -> Self :
114+ """Method to create a File from an api response.
115+
116+ Returns
117+ -------
118+ :class:`~mystbin.File`
119+ """
114120 self = cls (
115121 content = payload ["content" ],
116122 filename = payload ["filename" ],
@@ -123,14 +129,20 @@ def from_data(cls, payload: FileResponse, /) -> Self:
123129 return self
124130
125131 def to_dict (self ) -> dict [str , Any ]:
132+ """Method to dump the File data to a serialized api payload.
133+
134+ Returns
135+ -------
136+ :class:`dict[:class:`str`, Any]`
137+ """
126138 return {"content" : self .content , "filename" : self .filename }
127139
128140
129141class Paste :
130142 """Represents a Paste object from mystbin instances.
131143
132144 Attributes
133- -----------
145+ ----------
134146 id: :class:`str`
135147 The ID of this paste.
136148 created_at: :class:`datetime.datetime`
@@ -171,7 +183,7 @@ def url(self) -> str:
171183 """The paste URL.
172184
173185 Returns
174- --------
186+ -------
175187 :class:`str`
176188 """
177189 return f"{ self ._http .root_url } { self .id } "
@@ -181,7 +193,7 @@ def expires(self) -> datetime.datetime | None:
181193 """When the paste expires, if at all.
182194
183195 Returns
184- --------
196+ -------
185197 Optional[:class:`datetime.datetime`]
186198 """
187199 return self ._expires
@@ -191,7 +203,7 @@ def views(self) -> int | None:
191203 """The pastes view count, if any.
192204
193205 Returns
194- --------
206+ -------
195207 Optional[:class:`int`]
196208 """
197209 return self ._views
@@ -201,13 +213,19 @@ def security_token(self) -> str | None:
201213 """The pastes security token, if any.
202214
203215 Returns
204- --------
216+ -------
205217 Optional[:class:`str`]
206218 """
207219 return self ._security
208220
209221 @classmethod
210222 def from_get (cls , payload : GetPasteResponse , / , * , http : HTTPClient ) -> Self :
223+ """Method to create a Paste from the api fetch response.
224+
225+ Returns
226+ -------
227+ :class:`~mystbin.Paste`
228+ """
211229 files = [File .from_data (data ) for data in payload ["files" ]]
212230 self = cls (
213231 http = http ,
@@ -229,6 +247,12 @@ def from_get(cls, payload: GetPasteResponse, /, *, http: HTTPClient) -> Self:
229247
230248 @classmethod
231249 def from_create (cls , payload : CreatePasteResponse , files : Sequence [File ], * , http : HTTPClient ) -> Self :
250+ """Method to create a Paste from the api response.
251+
252+ Returns
253+ -------
254+ :class:`~mystbin.Paste`
255+ """
232256 self = cls (
233257 http = http ,
234258 paste_id = payload ["id" ],
@@ -253,7 +277,7 @@ async def delete(self) -> None:
253277 This method will delete this paste from the mystbin instance.
254278
255279 Raises
256- -------
280+ ------
257281 ValueError
258282 The paste requires the security token to be present.
259283 """
0 commit comments