attenpy 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. {attenpy-0.2.0 → attenpy-0.2.1}/PKG-INFO +1 -1
  2. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/__init__.py +3 -1
  3. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/endpoints/notices.py +1 -1
  4. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/models/__init__.py +2 -1
  5. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/models/attachment.py +10 -4
  6. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/models/notice.py +21 -15
  7. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy.egg-info/PKG-INFO +1 -1
  8. {attenpy-0.2.0 → attenpy-0.2.1}/pyproject.toml +1 -1
  9. {attenpy-0.2.0 → attenpy-0.2.1}/LICENSE +0 -0
  10. {attenpy-0.2.0 → attenpy-0.2.1}/README.md +0 -0
  11. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/client.py +0 -0
  12. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/endpoints/__init__.py +0 -0
  13. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/endpoints/posts.py +0 -0
  14. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/endpoints/users.py +0 -0
  15. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/exceptions.py +0 -0
  16. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/http.py +0 -0
  17. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/models/base.py +0 -0
  18. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/models/post.py +0 -0
  19. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/models/user.py +0 -0
  20. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/pagination.py +0 -0
  21. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/payloads/__init__.py +0 -0
  22. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/payloads/notice.py +0 -0
  23. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/payloads/post.py +0 -0
  24. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/payloads/ws.py +0 -0
  25. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/ref.py +0 -0
  26. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/snowflake.py +0 -0
  27. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/types.py +0 -0
  28. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/utils.py +0 -0
  29. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy/ws.py +0 -0
  30. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy.egg-info/SOURCES.txt +0 -0
  31. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy.egg-info/dependency_links.txt +0 -0
  32. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy.egg-info/requires.txt +0 -0
  33. {attenpy-0.2.0 → attenpy-0.2.1}/attenpy.egg-info/top_level.txt +0 -0
  34. {attenpy-0.2.0 → attenpy-0.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: attenpy
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: SDK for AttenAPI
5
5
  Author: AttenTeam
6
6
  License: MIT
@@ -2,6 +2,7 @@ from .client import Client
2
2
  from .exceptions import AttenpyException, HTTPException, InvalidResponseError
3
3
  from .models import (
4
4
  Attachment,
5
+ AttachmentCategory,
5
6
  Notice,
6
7
  NoticeKind,
7
8
  NoticeTarget,
@@ -20,10 +21,11 @@ from .payloads import (
20
21
  from .ref import UserRef
21
22
  from .snowflake import Snowflake
22
23
 
23
- __version__ = "0.2.0"
24
+ __version__ = "0.2.1"
24
25
  __all__ = [
25
26
  "AttenpyException",
26
27
  "Attachment",
28
+ "AttachmentCategory",
27
29
  "BotReadyPayload",
28
30
  "Client",
29
31
  "HTTPException",
@@ -22,7 +22,7 @@ class NoticeEndpoint:
22
22
  ) -> AsyncIterator[Notice]:
23
23
  params = None
24
24
  if types:
25
- params = {"type": list(dict.fromkeys(types))}
25
+ params = {"type": [i.value for i in set(types)]}
26
26
  async for data in paginate(self.client.http, "/notices", params=params, **kw):
27
27
  yield Notice.model_validate(data)
28
28
 
@@ -1,4 +1,4 @@
1
- from .attachment import Attachment, PartialAttachment
1
+ from .attachment import Attachment, AttachmentCategory, PartialAttachment
2
2
  from .base import CursorPage, ErrorResponse, ListResponse, SuccessResponse
3
3
  from .notice import Notice, NoticeKind, NoticeTarget, NoticeType
4
4
  from .post import PartialPost, Post
@@ -12,6 +12,7 @@ User.model_rebuild()
12
12
 
13
13
  __all__ = [
14
14
  "Attachment",
15
+ "AttachmentCategory",
15
16
  "CursorPage",
16
17
  "ErrorResponse",
17
18
  "PartialAttachment",
@@ -1,11 +1,19 @@
1
1
  from datetime import datetime
2
- from typing import Literal
2
+ from enum import Enum
3
3
 
4
4
  from pydantic import BaseModel
5
5
 
6
6
  from ..snowflake import Snowflake
7
7
 
8
8
 
9
+ class AttachmentCategory(str, Enum):
10
+ ICON = "icon"
11
+ BANNER = "banner"
12
+ POST_ATTACHMENT = "post_attachment"
13
+ GROUP_ICON = "group_icon"
14
+ CHAT_ATTACHMENT = "chat_attachment"
15
+
16
+
9
17
  class PartialAttachment(BaseModel):
10
18
  url: str
11
19
 
@@ -13,9 +21,7 @@ class PartialAttachment(BaseModel):
13
21
  class Attachment(BaseModel):
14
22
  id: int
15
23
  url: str
16
- category: Literal[
17
- "icon", "banner", "post_attachment", "group_icon", "chat_attachment"
18
- ]
24
+ category: AttachmentCategory
19
25
  mime: str
20
26
  deleted: bool
21
27
 
@@ -1,5 +1,6 @@
1
1
  from datetime import datetime
2
- from typing import TYPE_CHECKING, Literal, TypeAlias
2
+ from enum import Enum
3
+ from typing import TYPE_CHECKING
3
4
 
4
5
  from pydantic import BaseModel
5
6
 
@@ -8,20 +9,25 @@ from ..snowflake import Snowflake
8
9
  if TYPE_CHECKING:
9
10
  from .user import PartialUser
10
11
 
11
- NoticeType: TypeAlias = Literal[
12
- "welcome",
13
- "login",
14
- "warn",
15
- "follow",
16
- "mention",
17
- "reply",
18
- "quote",
19
- "repost",
20
- "love",
21
- "invite_chat",
22
- ]
23
-
24
- NoticeKind: TypeAlias = Literal["session", "post", "chat", "warn"]
12
+
13
+ class NoticeType(str, Enum):
14
+ WELCOME = "welcome"
15
+ LOGIN = "login"
16
+ WARN = "warn"
17
+ FOLLOW = "follow"
18
+ MENTION = "mention"
19
+ REPLY = "reply"
20
+ QUOTE = "quote"
21
+ REPOST = "repost"
22
+ LOVE = "love"
23
+ INVITE_CHAT = "invite_chat"
24
+
25
+
26
+ class NoticeKind(str, Enum):
27
+ SESSION = "session"
28
+ POST = "post"
29
+ CHAT = "chat"
30
+ WARN = "warn"
25
31
 
26
32
 
27
33
  class NoticeTarget(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: attenpy
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: SDK for AttenAPI
5
5
  Author: AttenTeam
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "attenpy"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "SDK for AttenAPI"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes