-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathcomment_payload.py
More file actions
100 lines (89 loc) · 3.7 KB
/
Copy pathcomment_payload.py
File metadata and controls
100 lines (89 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# This file was auto-generated by Fern from our API Definition.
import typing
import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .comment_payload_author import CommentPayloadAuthor
from .comment_payload_mentioned_users_item import CommentPayloadMentionedUsersItem
class CommentPayload(UniversalBaseModel):
"""
The comment webhook payload contains data for the thread and for replies. Check the type to determine if the payload is for a thread or a reply. The webhook payload may be delayed by up to 5 minutes.
"""
thread_id: typing_extensions.Annotated[
typing.Optional[str],
FieldMetadata(alias="threadId"),
pydantic.Field(alias="threadId", description="Unique identifier for the comment thread"),
] = None
comment_id: typing_extensions.Annotated[
typing.Optional[str],
FieldMetadata(alias="commentId"),
pydantic.Field(alias="commentId", description="Unique identifier for the comment reply"),
] = None
type: typing.Optional[str] = pydantic.Field(default=None)
"""
The type of comment payload
"""
site_id: typing_extensions.Annotated[
typing.Optional[str],
FieldMetadata(alias="siteId"),
pydantic.Field(alias="siteId", description="The site unique identifier"),
] = None
page_id: typing_extensions.Annotated[
typing.Optional[str],
FieldMetadata(alias="pageId"),
pydantic.Field(alias="pageId", description="The page unique identifier"),
] = None
locale_id: typing_extensions.Annotated[
typing.Optional[str],
FieldMetadata(alias="localeId"),
pydantic.Field(alias="localeId", description="The locale unique identifier"),
] = None
item_id: typing_extensions.Annotated[
typing.Optional[str],
FieldMetadata(alias="itemId"),
pydantic.Field(alias="itemId", description="The item unique identifier"),
] = None
breakpoint: typing.Optional[str] = pydantic.Field(default=None)
"""
The breakpoint the comment was left on
"""
url: typing.Optional[str] = pydantic.Field(default=None)
"""
The URL of the page the comment was left on
"""
content: str = pydantic.Field()
"""
The content of the comment reply
"""
is_resolved: typing_extensions.Annotated[
bool,
FieldMetadata(alias="isResolved"),
pydantic.Field(alias="isResolved", description="Boolean determining if the comment thread is resolved"),
]
author: CommentPayloadAuthor
mentioned_users: typing_extensions.Annotated[
typing.List[CommentPayloadMentionedUsersItem],
FieldMetadata(alias="mentionedUsers"),
pydantic.Field(
alias="mentionedUsers",
description="List of mentioned users. This is an empty array until email notifications are sent, which can take up to 5 minutes after the comment is created.",
),
]
created_on: typing_extensions.Annotated[
typing.Optional[str],
FieldMetadata(alias="createdOn"),
pydantic.Field(alias="createdOn", description="The date the item was created"),
] = None
last_updated: typing_extensions.Annotated[
typing.Optional[str],
FieldMetadata(alias="lastUpdated"),
pydantic.Field(alias="lastUpdated", description="The date the item was last updated"),
] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow