1
1
from typing import Any , Dict , List , Optional , Union
2
2
3
- from aleph_message .models import AlephMessage , ItemHash , ChainRef , ItemType , Chain , MessageConfirmation
3
+ from aleph_message .models import (
4
+ AlephMessage ,
5
+ Chain ,
6
+ ItemHash ,
7
+ ItemType ,
8
+ MessageConfirmation ,
9
+ )
4
10
from pydantic import BaseModel , Field
5
11
6
12
@@ -23,24 +29,37 @@ class Post(BaseModel):
23
29
A post is a type of message that can be updated. Over the get_posts API
24
30
we get the latest version of a post.
25
31
"""
32
+
26
33
chain : Chain = Field (description = "Blockchain this post is associated with" )
27
34
item_hash : ItemHash = Field (description = "Unique hash for this post" )
28
35
sender : str = Field (description = "Address of the sender" )
29
36
type : str = Field (description = "Type of the POST message" )
30
37
channel : Optional [str ] = Field (description = "Channel this post is associated with" )
31
38
confirmed : bool = Field (description = "Whether the post is confirmed or not" )
32
39
content : Dict [str , Any ] = Field (description = "The content of the POST message" )
33
- item_content : Optional [str ] = Field (description = "The POSTs content field as serialized JSON, if of type inline" )
34
- item_type : ItemType = Field (description = "Type of the item content, usually 'inline' or 'storage' for POSTs" )
35
- signature : Optional [str ] = Field (description = "Cryptographic signature of the message by the sender" )
40
+ item_content : Optional [str ] = Field (
41
+ description = "The POSTs content field as serialized JSON, if of type inline"
42
+ )
43
+ item_type : ItemType = Field (
44
+ description = "Type of the item content, usually 'inline' or 'storage' for POSTs"
45
+ )
46
+ signature : Optional [str ] = Field (
47
+ description = "Cryptographic signature of the message by the sender"
48
+ )
36
49
size : int = Field (description = "Size of the post" )
37
50
time : float = Field (description = "Timestamp of the post" )
38
- confirmations : List [MessageConfirmation ] = Field (description = "Number of confirmations" )
51
+ confirmations : List [MessageConfirmation ] = Field (
52
+ description = "Number of confirmations"
53
+ )
39
54
original_item_hash : ItemHash = Field (description = "Hash of the original content" )
40
- original_signature : Optional [str ] = Field (description = "Cryptographic signature of the original message" )
55
+ original_signature : Optional [str ] = Field (
56
+ description = "Cryptographic signature of the original message"
57
+ )
41
58
original_type : str = Field (description = "The original type of the message" )
42
59
hash : ItemHash = Field (description = "Hash of the original item" )
43
- ref : Optional [Union [str , Any ]] = Field (description = "Other message referenced by this one" )
60
+ ref : Optional [Union [str , Any ]] = Field (
61
+ description = "Other message referenced by this one"
62
+ )
44
63
45
64
46
65
class PostsResponse (PaginationResponse ):
0 commit comments