linq-python 0.1.0__py3-none-any.whl

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 (139) hide show
  1. linq/__init__.py +102 -0
  2. linq/_base_client.py +2149 -0
  3. linq/_client.py +2479 -0
  4. linq/_compat.py +226 -0
  5. linq/_constants.py +14 -0
  6. linq/_exceptions.py +108 -0
  7. linq/_files.py +123 -0
  8. linq/_models.py +878 -0
  9. linq/_qs.py +153 -0
  10. linq/_resource.py +43 -0
  11. linq/_response.py +833 -0
  12. linq/_streaming.py +338 -0
  13. linq/_types.py +271 -0
  14. linq/_utils/__init__.py +65 -0
  15. linq/_utils/_compat.py +45 -0
  16. linq/_utils/_datetime_parse.py +136 -0
  17. linq/_utils/_json.py +35 -0
  18. linq/_utils/_logs.py +25 -0
  19. linq/_utils/_path.py +127 -0
  20. linq/_utils/_proxy.py +65 -0
  21. linq/_utils/_reflection.py +42 -0
  22. linq/_utils/_resources_proxy.py +24 -0
  23. linq/_utils/_streams.py +12 -0
  24. linq/_utils/_sync.py +58 -0
  25. linq/_utils/_transform.py +457 -0
  26. linq/_utils/_typing.py +156 -0
  27. linq/_utils/_utils.py +421 -0
  28. linq/_version.py +4 -0
  29. linq/lib/.keep +4 -0
  30. linq/pagination.py +95 -0
  31. linq/py.typed +0 -0
  32. linq/resources/__init__.py +134 -0
  33. linq/resources/attachments.py +589 -0
  34. linq/resources/capability.py +297 -0
  35. linq/resources/chats/__init__.py +61 -0
  36. linq/resources/chats/chats.py +1492 -0
  37. linq/resources/chats/messages.py +416 -0
  38. linq/resources/chats/participants.py +322 -0
  39. linq/resources/chats/typing.py +299 -0
  40. linq/resources/contact_card.py +472 -0
  41. linq/resources/messages.py +686 -0
  42. linq/resources/phone_numbers.py +163 -0
  43. linq/resources/phonenumbers.py +165 -0
  44. linq/resources/webhook_events.py +319 -0
  45. linq/resources/webhook_subscriptions.py +776 -0
  46. linq/resources/webhooks.py +34 -0
  47. linq/types/__init__.py +90 -0
  48. linq/types/attachment_create_params.py +42 -0
  49. linq/types/attachment_create_response.py +44 -0
  50. linq/types/attachment_retrieve_response.py +55 -0
  51. linq/types/capability_check_RCS_params.py +20 -0
  52. linq/types/capability_check_i_message_params.py +20 -0
  53. linq/types/chat.py +44 -0
  54. linq/types/chat_create_params.py +33 -0
  55. linq/types/chat_create_response.py +44 -0
  56. linq/types/chat_created_webhook_event.py +87 -0
  57. linq/types/chat_group_icon_update_failed_webhook_event.py +65 -0
  58. linq/types/chat_group_icon_updated_webhook_event.py +66 -0
  59. linq/types/chat_group_name_update_failed_webhook_event.py +65 -0
  60. linq/types/chat_group_name_updated_webhook_event.py +66 -0
  61. linq/types/chat_leave_chat_response.py +15 -0
  62. linq/types/chat_list_chats_params.py +36 -0
  63. linq/types/chat_send_voicememo_params.py +23 -0
  64. linq/types/chat_send_voicememo_response.py +79 -0
  65. linq/types/chat_typing_indicator_started_webhook_event.py +52 -0
  66. linq/types/chat_typing_indicator_stopped_webhook_event.py +52 -0
  67. linq/types/chat_update_params.py +15 -0
  68. linq/types/chat_update_response.py +13 -0
  69. linq/types/chats/__init__.py +12 -0
  70. linq/types/chats/message_list_params.py +15 -0
  71. linq/types/chats/message_send_params.py +18 -0
  72. linq/types/chats/message_send_response.py +16 -0
  73. linq/types/chats/participant_add_params.py +12 -0
  74. linq/types/chats/participant_add_response.py +15 -0
  75. linq/types/chats/participant_remove_params.py +12 -0
  76. linq/types/chats/participant_remove_response.py +15 -0
  77. linq/types/chats/sent_message.py +69 -0
  78. linq/types/contact_card_create_params.py +24 -0
  79. linq/types/contact_card_retrieve_params.py +15 -0
  80. linq/types/contact_card_retrieve_response.py +23 -0
  81. linq/types/contact_card_update_params.py +21 -0
  82. linq/types/events_webhook_event.py +50 -0
  83. linq/types/handle_check_response.py +13 -0
  84. linq/types/link_part_param.py +22 -0
  85. linq/types/media_part_param.py +54 -0
  86. linq/types/message.py +87 -0
  87. linq/types/message_add_reaction_params.py +32 -0
  88. linq/types/message_add_reaction_response.py +15 -0
  89. linq/types/message_content_param.py +82 -0
  90. linq/types/message_delivered_webhook_event.py +65 -0
  91. linq/types/message_edited_webhook_event.py +100 -0
  92. linq/types/message_effect.py +23 -0
  93. linq/types/message_effect_param.py +22 -0
  94. linq/types/message_event_v2.py +116 -0
  95. linq/types/message_failed_webhook_event.py +72 -0
  96. linq/types/message_list_messages_thread_params.py +18 -0
  97. linq/types/message_read_webhook_event.py +65 -0
  98. linq/types/message_received_webhook_event.py +65 -0
  99. linq/types/message_sent_webhook_event.py +65 -0
  100. linq/types/message_update_params.py +15 -0
  101. linq/types/participant_added_webhook_event.py +66 -0
  102. linq/types/participant_removed_webhook_event.py +66 -0
  103. linq/types/phone_number_list_response.py +20 -0
  104. linq/types/phone_number_status_updated_webhook_event.py +82 -0
  105. linq/types/phonenumber_list_response.py +39 -0
  106. linq/types/reaction_added_webhook_event.py +46 -0
  107. linq/types/reaction_event_base.py +85 -0
  108. linq/types/reaction_removed_webhook_event.py +46 -0
  109. linq/types/reply_to.py +21 -0
  110. linq/types/reply_to_param.py +21 -0
  111. linq/types/schemas_media_part_response.py +29 -0
  112. linq/types/schemas_message_effect.py +18 -0
  113. linq/types/schemas_text_part_response.py +22 -0
  114. linq/types/set_contact_card.py +24 -0
  115. linq/types/shared/__init__.py +9 -0
  116. linq/types/shared/chat_handle.py +33 -0
  117. linq/types/shared/media_part_response.py +34 -0
  118. linq/types/shared/reaction.py +56 -0
  119. linq/types/shared/reaction_type.py +7 -0
  120. linq/types/shared/service_type.py +7 -0
  121. linq/types/shared/text_decoration.py +23 -0
  122. linq/types/shared/text_part_response.py +26 -0
  123. linq/types/shared_params/__init__.py +5 -0
  124. linq/types/shared_params/reaction_type.py +9 -0
  125. linq/types/shared_params/service_type.py +9 -0
  126. linq/types/shared_params/text_decoration.py +23 -0
  127. linq/types/supported_content_type.py +60 -0
  128. linq/types/text_part_param.py +44 -0
  129. linq/types/webhook_event_list_response.py +17 -0
  130. linq/types/webhook_event_type.py +33 -0
  131. linq/types/webhook_subscription.py +35 -0
  132. linq/types/webhook_subscription_create_params.py +27 -0
  133. linq/types/webhook_subscription_create_response.py +46 -0
  134. linq/types/webhook_subscription_list_response.py +13 -0
  135. linq/types/webhook_subscription_update_params.py +30 -0
  136. linq_python-0.1.0.dist-info/METADATA +572 -0
  137. linq_python-0.1.0.dist-info/RECORD +139 -0
  138. linq_python-0.1.0.dist-info/WHEEL +4 -0
  139. linq_python-0.1.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,65 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from datetime import datetime
4
+
5
+ from .._models import BaseModel
6
+ from .webhook_event_type import WebhookEventType
7
+
8
+ __all__ = ["ChatGroupNameUpdateFailedWebhookEvent", "Data"]
9
+
10
+
11
+ class Data(BaseModel):
12
+ """
13
+ Error details for chat.group_name_update_failed webhook events.
14
+ See [WebhookErrorCode](#/components/schemas/WebhookErrorCode) for the full error code reference.
15
+ """
16
+
17
+ chat_id: str
18
+ """Chat identifier (UUID) of the group chat"""
19
+
20
+ error_code: int
21
+ """Error codes in webhook failure events (3007, 4001)."""
22
+
23
+ failed_at: datetime
24
+ """When the failure was detected"""
25
+
26
+
27
+ class ChatGroupNameUpdateFailedWebhookEvent(BaseModel):
28
+ """Complete webhook payload for chat.group_name_update_failed events"""
29
+
30
+ api_version: str
31
+ """API version for the webhook payload format"""
32
+
33
+ created_at: datetime
34
+ """When the event was created"""
35
+
36
+ data: Data
37
+ """
38
+ Error details for chat.group_name_update_failed webhook events. See
39
+ [WebhookErrorCode](#/components/schemas/WebhookErrorCode) for the full error
40
+ code reference.
41
+ """
42
+
43
+ event_id: str
44
+ """Unique identifier for this event (for deduplication)"""
45
+
46
+ event_type: WebhookEventType
47
+ """Valid webhook event types that can be subscribed to.
48
+
49
+ **Note:** `message.edited` is only delivered to subscriptions using
50
+ `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
51
+ subscription will not produce any deliveries.
52
+ """
53
+
54
+ partner_id: str
55
+ """Partner identifier. Present on all webhooks for cross-referencing."""
56
+
57
+ trace_id: str
58
+ """Trace ID for debugging and correlation across systems."""
59
+
60
+ webhook_version: str
61
+ """
62
+ Date-based webhook payload version. Determined by the `?version=` query
63
+ parameter in your webhook subscription URL. If no version parameter is
64
+ specified, defaults based on subscription creation date.
65
+ """
@@ -0,0 +1,66 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from datetime import datetime
5
+
6
+ from .._models import BaseModel
7
+ from .shared.chat_handle import ChatHandle
8
+ from .webhook_event_type import WebhookEventType
9
+
10
+ __all__ = ["ChatGroupNameUpdatedWebhookEvent", "Data"]
11
+
12
+
13
+ class Data(BaseModel):
14
+ """Payload for chat.group_name_updated webhook events"""
15
+
16
+ chat_id: str
17
+ """Chat identifier (UUID) of the group chat"""
18
+
19
+ updated_at: datetime
20
+ """When the update occurred"""
21
+
22
+ changed_by_handle: Optional[ChatHandle] = None
23
+ """The handle who made the change."""
24
+
25
+ new_value: Optional[str] = None
26
+ """New group name (null if the name was removed)"""
27
+
28
+ old_value: Optional[str] = None
29
+ """Previous group name (null if no previous name)"""
30
+
31
+
32
+ class ChatGroupNameUpdatedWebhookEvent(BaseModel):
33
+ """Complete webhook payload for chat.group_name_updated events"""
34
+
35
+ api_version: str
36
+ """API version for the webhook payload format"""
37
+
38
+ created_at: datetime
39
+ """When the event was created"""
40
+
41
+ data: Data
42
+ """Payload for chat.group_name_updated webhook events"""
43
+
44
+ event_id: str
45
+ """Unique identifier for this event (for deduplication)"""
46
+
47
+ event_type: WebhookEventType
48
+ """Valid webhook event types that can be subscribed to.
49
+
50
+ **Note:** `message.edited` is only delivered to subscriptions using
51
+ `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
52
+ subscription will not produce any deliveries.
53
+ """
54
+
55
+ partner_id: str
56
+ """Partner identifier. Present on all webhooks for cross-referencing."""
57
+
58
+ trace_id: str
59
+ """Trace ID for debugging and correlation across systems."""
60
+
61
+ webhook_version: str
62
+ """
63
+ Date-based webhook payload version. Determined by the `?version=` query
64
+ parameter in your webhook subscription URL. If no version parameter is
65
+ specified, defaults based on subscription creation date.
66
+ """
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["ChatLeaveChatResponse"]
8
+
9
+
10
+ class ChatLeaveChatResponse(BaseModel):
11
+ message: Optional[str] = None
12
+
13
+ status: Optional[str] = None
14
+
15
+ trace_id: Optional[str] = None
@@ -0,0 +1,36 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Annotated, TypedDict
6
+
7
+ from .._utils import PropertyInfo
8
+
9
+ __all__ = ["ChatListChatsParams"]
10
+
11
+
12
+ class ChatListChatsParams(TypedDict, total=False):
13
+ cursor: str
14
+ """
15
+ Pagination cursor from the previous response's `next_cursor` field. Omit this
16
+ parameter for the first page of results.
17
+ """
18
+
19
+ from_: Annotated[str, PropertyInfo(alias="from")]
20
+ """Phone number to filter chats by.
21
+
22
+ Returns chats made from this phone number. Must be in E.164 format (e.g.,
23
+ `+13343284472`). The `+` is automatically URL-encoded by HTTP clients. If
24
+ omitted, returns chats across all phone numbers owned by the partner.
25
+ """
26
+
27
+ limit: int
28
+ """Maximum number of chats to return per page"""
29
+
30
+ to: str
31
+ """Filter chats by a participant handle.
32
+
33
+ Only returns chats where this handle is a participant. Can be an E.164 phone
34
+ number (e.g., `+13343284472`) or an email address (e.g., `user@example.com`).
35
+ For phone numbers, the `+` is automatically URL-encoded by HTTP clients.
36
+ """
@@ -0,0 +1,23 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ __all__ = ["ChatSendVoicememoParams"]
8
+
9
+
10
+ class ChatSendVoicememoParams(TypedDict, total=False):
11
+ attachment_id: str
12
+ """
13
+ Reference to a voice memo file pre-uploaded via `POST /v3/attachments`. The file
14
+ is already stored, so sends using this ID skip the download step.
15
+
16
+ Either `voice_memo_url` or `attachment_id` must be provided, but not both.
17
+ """
18
+
19
+ voice_memo_url: str
20
+ """URL of the voice memo audio file. Must be a publicly accessible HTTPS URL.
21
+
22
+ Either `voice_memo_url` or `attachment_id` must be provided, but not both.
23
+ """
@@ -0,0 +1,79 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from datetime import datetime
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from .._models import BaseModel
9
+ from .shared.chat_handle import ChatHandle
10
+ from .shared.service_type import ServiceType
11
+
12
+ __all__ = ["ChatSendVoicememoResponse", "VoiceMemo", "VoiceMemoChat", "VoiceMemoVoiceMemo"]
13
+
14
+
15
+ class VoiceMemoChat(BaseModel):
16
+ id: str
17
+ """Chat identifier"""
18
+
19
+ handles: List[ChatHandle]
20
+ """Chat participants"""
21
+
22
+ is_active: bool
23
+ """Whether the chat is active"""
24
+
25
+ is_group: bool
26
+ """Whether this is a group chat"""
27
+
28
+ service: ServiceType
29
+ """Messaging service type"""
30
+
31
+
32
+ class VoiceMemoVoiceMemo(BaseModel):
33
+ id: str
34
+ """Attachment identifier"""
35
+
36
+ filename: str
37
+ """Original filename"""
38
+
39
+ mime_type: str
40
+ """Audio MIME type"""
41
+
42
+ size_bytes: int
43
+ """File size in bytes"""
44
+
45
+ url: str
46
+ """CDN URL for downloading the voice memo"""
47
+
48
+ duration_ms: Optional[int] = None
49
+ """Duration in milliseconds"""
50
+
51
+
52
+ class VoiceMemo(BaseModel):
53
+ id: str
54
+ """Message identifier"""
55
+
56
+ chat: VoiceMemoChat
57
+
58
+ created_at: datetime
59
+ """When the voice memo was created"""
60
+
61
+ from_: str = FieldInfo(alias="from")
62
+ """Sender phone number"""
63
+
64
+ status: str
65
+ """Current delivery status"""
66
+
67
+ to: List[str]
68
+ """Recipient handles (phone numbers or email addresses)"""
69
+
70
+ voice_memo: VoiceMemoVoiceMemo
71
+
72
+ service: Optional[ServiceType] = None
73
+ """Messaging service type"""
74
+
75
+
76
+ class ChatSendVoicememoResponse(BaseModel):
77
+ """Response for sending a voice memo to a chat"""
78
+
79
+ voice_memo: VoiceMemo
@@ -0,0 +1,52 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from datetime import datetime
4
+
5
+ from .._models import BaseModel
6
+ from .webhook_event_type import WebhookEventType
7
+
8
+ __all__ = ["ChatTypingIndicatorStartedWebhookEvent", "Data"]
9
+
10
+
11
+ class Data(BaseModel):
12
+ """Payload for chat.typing_indicator.started webhook events"""
13
+
14
+ chat_id: str
15
+ """Chat identifier"""
16
+
17
+
18
+ class ChatTypingIndicatorStartedWebhookEvent(BaseModel):
19
+ """Complete webhook payload for chat.typing_indicator.started events"""
20
+
21
+ api_version: str
22
+ """API version for the webhook payload format"""
23
+
24
+ created_at: datetime
25
+ """When the event was created"""
26
+
27
+ data: Data
28
+ """Payload for chat.typing_indicator.started webhook events"""
29
+
30
+ event_id: str
31
+ """Unique identifier for this event (for deduplication)"""
32
+
33
+ event_type: WebhookEventType
34
+ """Valid webhook event types that can be subscribed to.
35
+
36
+ **Note:** `message.edited` is only delivered to subscriptions using
37
+ `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
38
+ subscription will not produce any deliveries.
39
+ """
40
+
41
+ partner_id: str
42
+ """Partner identifier. Present on all webhooks for cross-referencing."""
43
+
44
+ trace_id: str
45
+ """Trace ID for debugging and correlation across systems."""
46
+
47
+ webhook_version: str
48
+ """
49
+ Date-based webhook payload version. Determined by the `?version=` query
50
+ parameter in your webhook subscription URL. If no version parameter is
51
+ specified, defaults based on subscription creation date.
52
+ """
@@ -0,0 +1,52 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from datetime import datetime
4
+
5
+ from .._models import BaseModel
6
+ from .webhook_event_type import WebhookEventType
7
+
8
+ __all__ = ["ChatTypingIndicatorStoppedWebhookEvent", "Data"]
9
+
10
+
11
+ class Data(BaseModel):
12
+ """Payload for chat.typing_indicator.stopped webhook events"""
13
+
14
+ chat_id: str
15
+ """Chat identifier"""
16
+
17
+
18
+ class ChatTypingIndicatorStoppedWebhookEvent(BaseModel):
19
+ """Complete webhook payload for chat.typing_indicator.stopped events"""
20
+
21
+ api_version: str
22
+ """API version for the webhook payload format"""
23
+
24
+ created_at: datetime
25
+ """When the event was created"""
26
+
27
+ data: Data
28
+ """Payload for chat.typing_indicator.stopped webhook events"""
29
+
30
+ event_id: str
31
+ """Unique identifier for this event (for deduplication)"""
32
+
33
+ event_type: WebhookEventType
34
+ """Valid webhook event types that can be subscribed to.
35
+
36
+ **Note:** `message.edited` is only delivered to subscriptions using
37
+ `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
38
+ subscription will not produce any deliveries.
39
+ """
40
+
41
+ partner_id: str
42
+ """Partner identifier. Present on all webhooks for cross-referencing."""
43
+
44
+ trace_id: str
45
+ """Trace ID for debugging and correlation across systems."""
46
+
47
+ webhook_version: str
48
+ """
49
+ Date-based webhook payload version. Determined by the `?version=` query
50
+ parameter in your webhook subscription URL. If no version parameter is
51
+ specified, defaults based on subscription creation date.
52
+ """
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ __all__ = ["ChatUpdateParams"]
8
+
9
+
10
+ class ChatUpdateParams(TypedDict, total=False):
11
+ display_name: str
12
+ """New display name for the chat (group chats only)"""
13
+
14
+ group_chat_icon: str
15
+ """URL of an image to set as the group chat icon (group chats only)"""
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["ChatUpdateResponse"]
8
+
9
+
10
+ class ChatUpdateResponse(BaseModel):
11
+ chat_id: Optional[str] = None
12
+
13
+ status: Optional[str] = None
@@ -0,0 +1,12 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .sent_message import SentMessage as SentMessage
6
+ from .message_list_params import MessageListParams as MessageListParams
7
+ from .message_send_params import MessageSendParams as MessageSendParams
8
+ from .message_send_response import MessageSendResponse as MessageSendResponse
9
+ from .participant_add_params import ParticipantAddParams as ParticipantAddParams
10
+ from .participant_add_response import ParticipantAddResponse as ParticipantAddResponse
11
+ from .participant_remove_params import ParticipantRemoveParams as ParticipantRemoveParams
12
+ from .participant_remove_response import ParticipantRemoveResponse as ParticipantRemoveResponse
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ __all__ = ["MessageListParams"]
8
+
9
+
10
+ class MessageListParams(TypedDict, total=False):
11
+ cursor: str
12
+ """Pagination cursor from previous next_cursor response"""
13
+
14
+ limit: int
15
+ """Maximum number of messages to return"""
@@ -0,0 +1,18 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, TypedDict
6
+
7
+ from ..message_content_param import MessageContentParam
8
+
9
+ __all__ = ["MessageSendParams"]
10
+
11
+
12
+ class MessageSendParams(TypedDict, total=False):
13
+ message: Required[MessageContentParam]
14
+ """Message content container.
15
+
16
+ Groups all message-related fields together, separating the "what" (message
17
+ content) from the "where" (routing fields like from/to).
18
+ """
@@ -0,0 +1,16 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ..._models import BaseModel
4
+ from .sent_message import SentMessage
5
+
6
+ __all__ = ["MessageSendResponse"]
7
+
8
+
9
+ class MessageSendResponse(BaseModel):
10
+ """Response for sending a message to a chat"""
11
+
12
+ chat_id: str
13
+ """Unique identifier of the chat this message was sent to"""
14
+
15
+ message: SentMessage
16
+ """A message that was sent (used in CreateChat and SendMessage responses)"""
@@ -0,0 +1,12 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, TypedDict
6
+
7
+ __all__ = ["ParticipantAddParams"]
8
+
9
+
10
+ class ParticipantAddParams(TypedDict, total=False):
11
+ handle: Required[str]
12
+ """Phone number (E.164 format) or email address of the participant to add"""
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from ..._models import BaseModel
6
+
7
+ __all__ = ["ParticipantAddResponse"]
8
+
9
+
10
+ class ParticipantAddResponse(BaseModel):
11
+ message: Optional[str] = None
12
+
13
+ status: Optional[str] = None
14
+
15
+ trace_id: Optional[str] = None
@@ -0,0 +1,12 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, TypedDict
6
+
7
+ __all__ = ["ParticipantRemoveParams"]
8
+
9
+
10
+ class ParticipantRemoveParams(TypedDict, total=False):
11
+ handle: Required[str]
12
+ """Phone number (E.164 format) or email address of the participant to remove"""
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from ..._models import BaseModel
6
+
7
+ __all__ = ["ParticipantRemoveResponse"]
8
+
9
+
10
+ class ParticipantRemoveResponse(BaseModel):
11
+ message: Optional[str] = None
12
+
13
+ status: Optional[str] = None
14
+
15
+ trace_id: Optional[str] = None
@@ -0,0 +1,69 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Union, Optional
4
+ from datetime import datetime
5
+ from typing_extensions import Literal, TypeAlias
6
+
7
+ from ..._models import BaseModel
8
+ from ..reply_to import ReplyTo
9
+ from ..message_effect import MessageEffect
10
+ from ..shared.reaction import Reaction
11
+ from ..shared.chat_handle import ChatHandle
12
+ from ..shared.service_type import ServiceType
13
+ from ..shared.text_part_response import TextPartResponse
14
+ from ..shared.media_part_response import MediaPartResponse
15
+
16
+ __all__ = ["SentMessage", "Part", "PartLinkPartResponse"]
17
+
18
+
19
+ class PartLinkPartResponse(BaseModel):
20
+ """A rich link preview part"""
21
+
22
+ reactions: Optional[List[Reaction]] = None
23
+ """Reactions on this message part"""
24
+
25
+ type: Literal["link"]
26
+ """Indicates this is a rich link preview part"""
27
+
28
+ value: str
29
+ """The URL"""
30
+
31
+
32
+ Part: TypeAlias = Union[TextPartResponse, MediaPartResponse, PartLinkPartResponse]
33
+
34
+
35
+ class SentMessage(BaseModel):
36
+ """A message that was sent (used in CreateChat and SendMessage responses)"""
37
+
38
+ id: str
39
+ """Message identifier (UUID)"""
40
+
41
+ delivery_status: Literal["pending", "queued", "sent", "delivered", "failed"]
42
+ """Current delivery status of a message"""
43
+
44
+ is_read: bool
45
+ """Whether the message has been read"""
46
+
47
+ parts: List[Part]
48
+ """Message parts in order (text, media, and link)"""
49
+
50
+ sent_at: datetime
51
+ """When the message was sent"""
52
+
53
+ delivered_at: Optional[datetime] = None
54
+ """When the message was delivered"""
55
+
56
+ effect: Optional[MessageEffect] = None
57
+ """iMessage effect applied to a message (screen or bubble effect)"""
58
+
59
+ from_handle: Optional[ChatHandle] = None
60
+ """The sender of this message as a full handle object"""
61
+
62
+ preferred_service: Optional[ServiceType] = None
63
+ """Messaging service type"""
64
+
65
+ reply_to: Optional[ReplyTo] = None
66
+ """Indicates this message is a threaded reply to another message"""
67
+
68
+ service: Optional[ServiceType] = None
69
+ """Messaging service type"""
@@ -0,0 +1,24 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, TypedDict
6
+
7
+ __all__ = ["ContactCardCreateParams"]
8
+
9
+
10
+ class ContactCardCreateParams(TypedDict, total=False):
11
+ first_name: Required[str]
12
+ """First name for the contact card. Required."""
13
+
14
+ phone_number: Required[str]
15
+ """E.164 phone number to associate the contact card with"""
16
+
17
+ image_url: str
18
+ """URL of the profile image to rehost on the CDN.
19
+
20
+ Only re-uploaded when a new value is provided.
21
+ """
22
+
23
+ last_name: str
24
+ """Last name for the contact card. Optional."""
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ __all__ = ["ContactCardRetrieveParams"]
8
+
9
+
10
+ class ContactCardRetrieveParams(TypedDict, total=False):
11
+ phone_number: str
12
+ """E.164 phone number to filter by.
13
+
14
+ If omitted, all my cards for the partner are returned.
15
+ """