-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.py
More file actions
93 lines (64 loc) · 2.97 KB
/
Copy pathchat.py
File metadata and controls
93 lines (64 loc) · 2.97 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
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Optional
from datetime import datetime
from typing_extensions import Literal
from .._models import BaseModel
from .shared.chat_handle import ChatHandle
from .shared.service_type import ServiceType
__all__ = ["Chat", "HealthStatus"]
class HealthStatus(BaseModel):
"""**[BETA]** Current health for a chat.
Always present — chats start at `HEALTHY` and may shift based on engagement and delivery signals on the conversation. Many `AT_RISK` or `CRITICAL` chats on a single line increase the risk of line flagging.
Switch on `status` to gate sends or surface line health in your UI — the enum is the long-term contract. Each status carries a `doc_url` that deep-links to the relevant section of the Chat Health guide.
See the [Chat Health guide](/guides/chats/chat-health) for what each status means and how to react.
"""
doc_url: str
"""Deep-link to the relevant section of the Chat Health guide for this status."""
status: Literal["HEALTHY", "AT_RISK", "CRITICAL", "OPTED_OUT"]
"""Current health bucket for the chat.
See the [Chat Health guide](/guides/chats/chat-health) for what each value means
and how to react. `doc_url` deep-links to the relevant section.
"""
updated_at: datetime
"""When this status last changed."""
class Chat(BaseModel):
id: str
"""Unique identifier for the chat"""
created_at: datetime
"""When the chat was created"""
display_name: Optional[str] = None
"""Display name for the chat.
Defaults to a comma-separated list of recipient handles. Can be updated for
group chats.
"""
handles: List[ChatHandle]
"""List of chat participants with full handle details.
Always contains at least two handles (your phone number and the other
participant).
"""
health_status: HealthStatus
"""**[BETA]** Current health for a chat.
Always present — chats start at `HEALTHY` and may shift based on engagement and
delivery signals on the conversation. Many `AT_RISK` or `CRITICAL` chats on a
single line increase the risk of line flagging.
Switch on `status` to gate sends or surface line health in your UI — the enum is
the long-term contract. Each status carries a `doc_url` that deep-links to the
relevant section of the Chat Health guide.
See the [Chat Health guide](/guides/chats/chat-health) for what each status
means and how to react.
"""
is_archived: bool
"""
**DEPRECATED:** This field is deprecated and will be removed in a future API
version.
"""
is_group: bool
"""Whether this is a group chat"""
updated_at: datetime
"""When the chat was last updated"""
group_chat_icon: Optional[str] = None
"""URL of the group chat icon.
Only set for group chats that have an icon; `null` otherwise.
"""
service: Optional[ServiceType] = None
"""Messaging service type"""