Skip to content

Commit 50a5c53

Browse files
committed
Finish helix docs for sphinx
1 parent cd44165 commit 50a5c53

File tree

16 files changed

+360
-157
lines changed

16 files changed

+360
-157
lines changed

docs/references/models.rst

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,5 +203,189 @@ Models
203203
:members:
204204

205205

206+
.. attributetable:: twitchio.Clip
207+
208+
.. autoclass:: twitchio.Clip
209+
:members:
210+
211+
212+
.. attributetable:: twitchio.Entitlement
213+
214+
.. autoclass:: twitchio.Entitlement
215+
:members:
216+
217+
218+
.. attributetable:: twitchio.EntitlementStatus
219+
220+
.. autoclass:: twitchio.EntitlementStatus
221+
:members:
222+
223+
.. attributetable:: twitchio.Game
224+
225+
.. autoclass:: twitchio.Game
226+
:members:
227+
228+
.. attributetable:: twitchio.Goal
229+
230+
.. autoclass:: twitchio.Goal
231+
:members:
232+
233+
.. attributetable:: twitchio.HypeTrainEvent
234+
235+
.. autoclass:: twitchio.HypeTrainEvent
236+
:members:
237+
238+
.. attributetable:: twitchio.HypeTrainContribution
239+
240+
.. autoclass:: twitchio.HypeTrainContribution
241+
:members:
242+
243+
.. attributetable:: twitchio.AutoModStatus
244+
245+
.. autoclass:: twitchio.AutoModStatus
246+
:members:
247+
248+
.. attributetable:: twitchio.AutomodCheckMessage
249+
250+
.. autoclass:: twitchio.AutomodCheckMessage
251+
:members:
252+
253+
.. attributetable:: twitchio.AutomodSettings
254+
255+
.. autoclass:: twitchio.AutomodSettings
256+
:members:
257+
258+
.. attributetable:: twitchio.BannedUser
259+
260+
.. autoclass:: twitchio.BannedUser
261+
:members:
262+
263+
.. attributetable:: twitchio.Ban
264+
265+
.. autoclass:: twitchio.Ban
266+
:members:
267+
268+
.. attributetable:: twitchio.Timeout
269+
270+
.. autoclass:: twitchio.Timeout
271+
:members:
272+
273+
.. attributetable:: twitchio.UnbanRequest
274+
275+
.. autoclass:: twitchio.UnbanRequest
276+
:members:
277+
278+
.. attributetable:: twitchio.BlockedTerm
279+
280+
.. autoclass:: twitchio.BlockedTerm
281+
:members:
282+
283+
.. attributetable:: twitchio.ShieldModeStatus
284+
285+
.. autoclass:: twitchio.ShieldModeStatus
286+
:members:
287+
288+
.. attributetable:: twitchio.Warning
289+
290+
.. autoclass:: twitchio.Warning
291+
:members:
292+
293+
.. attributetable:: twitchio.Poll
294+
295+
.. autoclass:: twitchio.Poll
296+
:members:
297+
298+
.. attributetable:: twitchio.PollChoice
299+
300+
.. autoclass:: twitchio.PollChoice
301+
:members:
302+
303+
.. attributetable:: twitchio.Prediction
304+
305+
.. autoclass:: twitchio.Prediction
306+
:members:
307+
308+
.. attributetable:: twitchio.PredictionOutcome
309+
310+
.. autoclass:: twitchio.PredictionOutcome
311+
:members:
312+
313+
.. attributetable:: twitchio.Predictor
314+
315+
.. autoclass:: twitchio.Predictor
316+
:members:
317+
318+
319+
.. attributetable:: twitchio.Raid
320+
321+
.. autoclass:: twitchio.Raid
322+
:members:
323+
324+
.. attributetable:: twitchio.Schedule
325+
326+
.. autoclass:: twitchio.Schedule
327+
:members:
328+
329+
.. attributetable:: twitchio.ScheduleSegment
330+
331+
.. autoclass:: twitchio.ScheduleSegment
332+
:members:
333+
334+
.. attributetable:: twitchio.ScheduleCategory
335+
336+
.. autoclass:: twitchio.ScheduleCategory
337+
:members:
338+
339+
.. attributetable:: twitchio.ScheduleVacation
340+
341+
.. autoclass:: twitchio.ScheduleVacation
342+
:members:
343+
344+
.. attributetable:: twitchio.SearchChannel
345+
346+
.. autoclass:: twitchio.SearchChannel
347+
:members:
348+
349+
.. attributetable:: twitchio.Stream
350+
351+
.. autoclass:: twitchio.Stream
352+
:members:
353+
354+
.. attributetable:: twitchio.StreamMarker
355+
356+
.. autoclass:: twitchio.StreamMarker
357+
:members:
358+
359+
.. attributetable:: twitchio.VideoMarkers
360+
361+
.. autoclass:: twitchio.VideoMarkers
362+
:members:
363+
364+
.. attributetable:: twitchio.UserSubscription
365+
366+
.. autoclass:: twitchio.UserSubscription
367+
:members:
368+
369+
.. attributetable:: twitchio.BroadcasterSubscription
370+
371+
.. autoclass:: twitchio.BroadcasterSubscription
372+
:members:
373+
374+
.. attributetable:: twitchio.BroadcasterSubscriptions
375+
376+
.. autoclass:: twitchio.BroadcasterSubscriptions
377+
:members:
378+
379+
.. attributetable:: twitchio.Team
380+
381+
.. autoclass:: twitchio.Team
382+
:members:
383+
384+
.. attributetable:: twitchio.ChannelTeam
385+
386+
.. autoclass:: twitchio.ChannelTeam
387+
:members:
388+
389+
206390

207391

twitchio/models/chat.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,10 +524,14 @@ class ChatSettings:
524524
non_moderator_chat_delay: bool
525525
A Boolean value that determines whether the broadcaster adds a short delay before chat messages appear in the chat room.
526526
This gives chat moderators and bots a chance to remove them before viewers can see the message.
527-
See the non_moderator_chat_delay_duration field for the length of the delay. Is True if the broadcaster applies a delay; otherwise, False.
527+
See the ``non_moderator_chat_delay_duration`` field for the length of the delay.
528+
529+
Is True if the broadcaster applies a delay; otherwise, False.
530+
528531
The response includes this field only if the request specifies a user access token that includes the ``moderator:read:chat_settings`` scope and the user in the moderator_id query parameter is one of the broadcaster's moderators.
529532
non_moderator_chat_delay_duration: int | None
530533
The amount of time, in seconds, that messages are delayed before appearing in chat. Is None if non_moderator_chat_delay is False.
534+
531535
The response includes this field only if the request specifies a user access token that includes the ``moderator:read:chat_settings scope`` and the user in the moderator_id query parameter is one of the broadcaster's moderators.
532536
"""
533537

twitchio/models/clips.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@
5050

5151

5252
class Clip:
53-
"""
54-
Represents a Twitch Clip
53+
"""Represents a Twitch Clip
5554
5655
Attributes
5756
-----------
@@ -78,7 +77,7 @@ class Clip:
7877
created_at: datetime.datetime
7978
When the clip was created.
8079
thumbnail: twitchio.Asset
81-
The [`Asset`][twitchio.assets.Asset] that can be used to read or save the thumbnail associated with this Clip.
80+
The :class:`~twitchio.Asset` that can be used to read or save the thumbnail associated with this Clip.
8281
is_featured: bool
8382
Indicates if the clip is featured or not.
8483
"""
@@ -123,22 +122,22 @@ def __str__(self) -> str:
123122
return self.id
124123

125124
async def fetch_game(self) -> Game:
126-
"""Fetches the [`Game`][twitchio.Game] associated with this Clip.
125+
"""Fetches the :class:`~twitchio.Game` associated with this Clip.
127126
128127
Returns
129128
-------
130-
twitchio.Game
129+
Game
131130
The game associated with this Clip.
132131
"""
133132
payload: GamesResponse = await self._http.get_games(ids=[self.game_id])
134133
return Game(payload["data"][0], http=self._http)
135134

136135
async def fetch_video(self) -> Video | None:
137-
"""Fetches the [`Video`][twitchio.Video] associated with this clip, if it can be found.
136+
"""Fetches the :class:`~twitchio.Video` associated with this clip, if it can be found.
138137
139138
Returns
140139
-------
141-
twitchio.Video
140+
Video
142141
The video associated with this Clip.
143142
None
144143
The video was not found.

twitchio/models/entitlements.py

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646

4747

4848
class Entitlement:
49-
"""
50-
Represents a drops entitlement.
49+
"""Represents a drops entitlement.
5150
5251
Attributes
5352
-----------
@@ -57,7 +56,7 @@ class Entitlement:
5756
An ID that identifies the benefit (reward).
5857
timestamp: datetime.datetime
5958
Datetime of when the entitlement was granted.
60-
user: twitchio.PartialUser
59+
user: PartialUser
6160
PartialUser of who was granted the entitlement.
6261
game_id: str
6362
An ID that identifies the game the user was playing when the reward was entitled.
@@ -95,19 +94,44 @@ def __str__(self) -> str:
9594
return self.id
9695

9796
async def fetch_game(self) -> Game:
98-
"""
99-
Fetches the [`Game`][twitchio.Game] associated with this drop entitlement.
97+
"""Fetches the :class:`~twitchio.Game` associated with this drop entitlement.
10098
10199
Returns
102100
-------
103-
twitchio.Game
101+
Game
104102
The game associated with this drop entitlement.
105103
"""
106104
payload: GamesResponse = await self._http.get_games(ids=[self.game_id])
107105
return Game(payload["data"][0], http=self._http)
108106

109107

110108
class EntitlementStatus:
109+
"""The status of entitlements after an update.
110+
111+
Attributes
112+
-----------
113+
status: Literal["INVALID_ID", "NOT_FOUND", "SUCCESS", "UNAUTHORIZED", "UPDATE_FAILED"]
114+
Indicates whether the status of the entitlements in the ids field were successfully updated.
115+
116+
+----------------+----------------------------------------------------------------------------------------------------+
117+
| Status | Description |
118+
+================+====================================================================================================+
119+
| INVALID_ID | The entitlement IDs in the ids field are not valid. |
120+
+----------------+----------------------------------------------------------------------------------------------------+
121+
| NOT_FOUND | The entitlement IDs in the ids field were not found. |
122+
+----------------+----------------------------------------------------------------------------------------------------+
123+
| SUCCESS | The status of the entitlements in the ids field were successfully updated. |
124+
+----------------+----------------------------------------------------------------------------------------------------+
125+
| UNAUTHORIZED | The user or organization identified by the user access token is not authorized to update the |
126+
| | entitlements. |
127+
+----------------+----------------------------------------------------------------------------------------------------+
128+
| UPDATE_FAILED | The update failed. These are considered transient errors and the request should be retried later. |
129+
+----------------+----------------------------------------------------------------------------------------------------+
130+
131+
ids: list[str]
132+
The list of entitlement ids that the status in the status field applies to.
133+
"""
134+
111135
def __init__(self, data: UpdateDropsEntitlementsResponseData) -> None:
112136
self.status: Literal["INVALID_ID", "NOT_FOUND", "SUCCESS", "UNAUTHORIZED", "UPDATE_FAILED"] = data["status"]
113137
self.ids: list[str] = data["ids"]

twitchio/models/games.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,25 @@
3838

3939

4040
class Game:
41-
"""
42-
Represents a Game on Twitch.
41+
"""Represents a Game on Twitch.
4342
44-
You can retrieve a game by its ID, name or IGDB ID using the [`Client.fetch_game`][twitchio.Client.fetch_game]
45-
method or the various `.fetch_game()` methods of other models.
43+
You can retrieve a game by its ID, name or IGDB ID using the :meth:`~twitchio.Client.fetch_games`
44+
method or the various ``.fetch_game()`` methods of other models.
4645
47-
To fetch a list of games, see: [`Client.fetch_games`][twitchio.Client.fetch_games]
46+
To fetch a list of games, see: :meth:`~twitchio.Client.fetch_games`
4847
4948
Supported Operations
5049
--------------------
5150
52-
| Operation | Usage(s) | Description |
53-
|----------- |------------------------------------------|----------------------------------------------------|
54-
| `__str__` | `str(game)`, `f"{game}"` | Returns the games name. |
55-
| `__repr__` | `repr(game)`, `f"{game!r}"` | Returns the games official representation. |
56-
| `__eq__` | `game == game2`, `game != game2` | Checks if two games are equal. |
51+
+-------------+----------------------------------+----------------------------------------------------+
52+
| Operation | Usage(s) | Description |
53+
+=============+==================================+====================================================+
54+
| __str__ | str(game), f"{game}" | Returns the games name. |
55+
+-------------+----------------------------------+----------------------------------------------------+
56+
| __repr__ | repr(game), f"{game!r}" | Returns the games official representation. |
57+
+-------------+----------------------------------+----------------------------------------------------+
58+
| __eq__ | game == game2, game != game2 | Checks if two games are equal. |
59+
+-------------+----------------------------------+----------------------------------------------------+
5760
5861
5962
Attributes
@@ -63,9 +66,9 @@ class Game:
6366
name: str
6467
The name of the game.
6568
box_art: Asset
66-
The box art of the game as an [`Asset`][twitchio.Asset].
69+
The box art of the game as an :class:`~twitchio.Assets`.
6770
igdb_id: str | None
68-
The IGDB ID of the game. If this is not available to Twitch it will be `None`.
71+
The IGDB ID of the game. If this is not available to Twitch it will be ``None``.
6972
"""
7073

7174
__slots__ = ("id", "name", "box_art", "igdb_id")

0 commit comments

Comments
 (0)