|
1 | 1 | # -*- coding: utf-8 -*- |
2 | 2 | """Interfaces to all of the User objects offered by the Trakt.tv API""" |
3 | 3 | from collections import namedtuple |
| 4 | +from typing import NamedTuple |
| 5 | + |
4 | 6 | from trakt.core import get, post, delete |
5 | 7 | from trakt.movies import Movie |
6 | 8 | from trakt.people import Person |
|
12 | 14 | 'get_user_settings', 'unfollow'] |
13 | 15 |
|
14 | 16 |
|
15 | | -class Request(namedtuple('Request', ['id', 'requested_at', 'user'])): |
16 | | - __slots__ = () |
| 17 | +class Request(NamedTuple): |
| 18 | + id: int |
| 19 | + user: str |
| 20 | + requested_at: str |
17 | 21 |
|
18 | 22 | @post |
19 | 23 | def approve(self): |
@@ -60,12 +64,24 @@ def unfollow(user_name): |
60 | 64 | yield 'users/{username}/follow'.format(username=slugify(user_name)) |
61 | 65 |
|
62 | 66 |
|
63 | | -class UserList(namedtuple('UserList', ['name', 'description', 'privacy', |
64 | | - 'display_numbers', 'allow_comments', |
65 | | - 'sort_by', 'sort_how', 'created_at', |
66 | | - 'updated_at', 'item_count', |
67 | | - 'comment_count', 'likes', 'trakt', |
68 | | - 'slug', 'user', 'creator'])): |
| 67 | +class UserList(NamedTuple): |
| 68 | + name: str |
| 69 | + description: str |
| 70 | + privacy: str |
| 71 | + display_numbers: str |
| 72 | + allow_comments: str |
| 73 | + sort_by: str |
| 74 | + sort_how: str |
| 75 | + created_at: str |
| 76 | + updated_at: str |
| 77 | + item_count: str |
| 78 | + comment_count: str |
| 79 | + likes: str |
| 80 | + trakt: str |
| 81 | + slug: str |
| 82 | + user: str |
| 83 | + creator: str |
| 84 | + |
69 | 85 | """A list created by a Trakt.tv :class:`User`""" |
70 | 86 |
|
71 | 87 | def __init__(self, *args, **kwargs): |
|
0 commit comments