1
- from typing import Any , Dict , List , Optional , Union
1
+ from datetime import datetime
2
+ from typing import Any , Dict , List , Optional
2
3
3
- from aleph_message .models import AlephMessage , BaseMessage , ChainRef , ItemHash
4
+ from aleph_message .models import AlephMessage , ItemHash
4
5
from pydantic import BaseModel , Field
5
6
6
7
@@ -18,29 +19,28 @@ class MessagesResponse(PaginationResponse):
18
19
pagination_item = "messages"
19
20
20
21
21
- class Post (BaseMessage ):
22
+ class Post (BaseModel ):
22
23
"""
23
24
A post is a type of message that can be updated. Over the get_posts API
24
25
we get the latest version of a post.
25
26
"""
26
27
27
- hash : ItemHash = Field (description = "Hash of the content (sha256 by default)" )
28
+ item_hash : ItemHash = Field (description = "Hash of the content (sha256 by default)" )
29
+ content : Dict [str , Any ] = Field (
30
+ description = "The content.content of the POST message"
31
+ )
28
32
original_item_hash : ItemHash = Field (
29
33
description = "Hash of the original content (sha256 by default)"
30
34
)
31
- original_signature : Optional [str ] = Field (
32
- description = "Cryptographic signature of the original message by the sender"
33
- )
34
35
original_type : str = Field (
35
36
description = "The original, user-generated 'content-type' of the POST message"
36
37
)
37
- content : Dict [str , Any ] = Field (
38
- description = "The content.content of the POST message"
39
- )
40
- type : str = Field (description = "The content.type of the POST message" )
41
38
address : str = Field (description = "The address of the sender of the POST message" )
42
- ref : Optional [Union [str , ChainRef ]] = Field (
43
- description = "Other message referenced by this one"
39
+ ref : Optional [str ] = Field (description = "Other message referenced by this one" )
40
+ channel : str = Field (description = "The channel where the POST message was published" )
41
+ created : datetime = Field (description = "The time when the POST message was created" )
42
+ last_updated : datetime = Field (
43
+ description = "The time when the POST message was last updated"
44
44
)
45
45
46
46
0 commit comments