Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 8 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@ client = LinqAPIV3(

chat = client.chats.create(
from_="+12052535597",
message={
"parts": [
{
"type": "text",
"value": "Hello! How can I help you today?",
}
]
},
message={},
to=["+12052532136"],
)
print(chat.chat)
Expand Down Expand Up @@ -78,14 +71,7 @@ client = AsyncLinqAPIV3(
async def main() -> None:
chat = await client.chats.create(
from_="+12052535597",
message={
"parts": [
{
"type": "text",
"value": "Hello! How can I help you today?",
}
]
},
message={},
to=["+12052532136"],
)
print(chat.chat)
Expand Down Expand Up @@ -123,14 +109,7 @@ async def main() -> None:
) as client:
chat = await client.chats.create(
from_="+12052535597",
message={
"parts": [
{
"type": "text",
"value": "Hello! How can I help you today?",
}
]
},
message={},
to=["+12052532136"],
)
print(chat.chat)
Expand Down Expand Up @@ -253,14 +232,7 @@ client = LinqAPIV3()
try:
client.chats.create(
from_="+12052535597",
message={
"parts": [
{
"type": "text",
"value": "Hello! How can I help you today?",
}
]
},
message={},
to=["+12052532136"],
)
except linq.APIConnectionError as e:
Expand Down Expand Up @@ -307,14 +279,7 @@ client = LinqAPIV3(
# Or, configure per-request:
client.with_options(max_retries=5).chats.create(
from_="+12052535597",
message={
"parts": [
{
"type": "text",
"value": "Hello! How can I help you today?",
}
]
},
message={},
to=["+12052532136"],
)
```
Expand All @@ -341,14 +306,7 @@ client = LinqAPIV3(
# Override per-request:
client.with_options(timeout=5.0).chats.create(
from_="+12052535597",
message={
"parts": [
{
"type": "text",
"value": "Hello! How can I help you today?",
}
]
},
message={},
to=["+12052532136"],
)
```
Expand Down Expand Up @@ -393,12 +351,7 @@ from linq import LinqAPIV3
client = LinqAPIV3()
response = client.chats.with_raw_response.create(
from_="+12052535597",
message={
"parts": [{
"type": "text",
"value": "Hello! How can I help you today?",
}]
},
message={},
to=["+12052532136"],
)
print(response.headers.get('X-My-Header'))
Expand All @@ -420,14 +373,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
```python
with client.chats.with_streaming_response.create(
from_="+12052535597",
message={
"parts": [
{
"type": "text",
"value": "Hello! How can I help you today?",
}
]
},
message={},
to=["+12052532136"],
) as response:
print(response.headers.get("X-My-Header"))
Expand Down
10 changes: 10 additions & 0 deletions src/linq/resources/chats/chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ def create(
separating the "what" (message content) from the "where" (routing fields like
from/to).

A message carries EITHER `parts` — text and attachments, which compose into one
bubble — or a single `action`, which invokes an experience inside Linq's
iMessage app. Never both: an app card is the whole message (Apple's `MSMessage`
cannot coexist with text), so copy and a card are two sends, not one.

to: Array of recipient handles (phone numbers in E.164 format or email addresses).
For individual chats, provide one recipient. For group chats, provide multiple.

Expand Down Expand Up @@ -965,6 +970,11 @@ async def create(
separating the "what" (message content) from the "where" (routing fields like
from/to).

A message carries EITHER `parts` — text and attachments, which compose into one
bubble — or a single `action`, which invokes an experience inside Linq's
iMessage app. Never both: an app card is the whole message (Apple's `MSMessage`
cannot coexist with text), so copy and a card are two sends, not one.

to: Array of recipient handles (phone numbers in E.164 format or email addresses).
For individual chats, provide one recipient. For group chats, provide multiple.

Expand Down
10 changes: 10 additions & 0 deletions src/linq/resources/chats/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ def send(
separating the "what" (message content) from the "where" (routing fields like
from/to).

A message carries EITHER `parts` — text and attachments, which compose into one
bubble — or a single `action`, which invokes an experience inside Linq's
iMessage app. Never both: an app card is the whole message (Apple's `MSMessage`
cannot coexist with text), so copy and a card are two sends, not one.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -428,6 +433,11 @@ async def send(
separating the "what" (message content) from the "where" (routing fields like
from/to).

A message carries EITHER `parts` — text and attachments, which compose into one
bubble — or a single `action`, which invokes an experience inside Linq's
iMessage app. Never both: an app card is the whole message (Apple's `MSMessage`
cannot coexist with text), so copy and a card are two sends, not one.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down
10 changes: 10 additions & 0 deletions src/linq/resources/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ def create(
separating the "what" (message content) from the "where" (routing fields like
from/to).

A message carries EITHER `parts` — text and attachments, which compose into one
bubble — or a single `action`, which invokes an experience inside Linq's
iMessage app. Never both: an app card is the whole message (Apple's `MSMessage`
cannot coexist with text), so copy and a card are two sends, not one.

to: Recipient handles (E.164 phone numbers or email addresses). One handle is a
direct chat; multiple handles a group chat. Order-independent — the set
identifies the chat.
Expand Down Expand Up @@ -706,6 +711,11 @@ async def create(
separating the "what" (message content) from the "where" (routing fields like
from/to).

A message carries EITHER `parts` — text and attachments, which compose into one
bubble — or a single `action`, which invokes an experience inside Linq's
iMessage app. Never both: an app card is the whole message (Apple's `MSMessage`
cannot coexist with text), so copy and a card are two sends, not one.

to: Recipient handles (E.164 phone numbers or email addresses). One handle is a
direct chat; multiple handles a group chat. Order-independent — the set
identifies the chat.
Expand Down
5 changes: 5 additions & 0 deletions src/linq/types/chat_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class ChatCreateParams(TypedDict, total=False):

Groups all message-related fields together, separating the "what" (message
content) from the "where" (routing fields like from/to).

A message carries EITHER `parts` — text and attachments, which compose into one
bubble — or a single `action`, which invokes an experience inside Linq's
iMessage app. Never both: an app card is the whole message (Apple's `MSMessage`
cannot coexist with text), so copy and a card are two sends, not one.
"""

to: Required[SequenceNotStr[str]]
Expand Down
5 changes: 5 additions & 0 deletions src/linq/types/chats/message_send_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ class MessageSendParams(TypedDict, total=False):

Groups all message-related fields together, separating the "what" (message
content) from the "where" (routing fields like from/to).

A message carries EITHER `parts` — text and attachments, which compose into one
bubble — or a single `action`, which invokes an experience inside Linq's
iMessage app. Never both: an app card is the whole message (Apple's `MSMessage`
cannot coexist with text), so copy and a card are two sends, not one.
"""
26 changes: 16 additions & 10 deletions src/linq/types/message_content_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,24 @@ class MessageContentParam(TypedDict, total=False):

Groups all message-related fields together,
separating the "what" (message content) from the "where" (routing fields like from/to).

A message carries EITHER `parts` — text and attachments, which compose
into one bubble — or a single `action`, which invokes an experience
inside Linq's iMessage app. Never both: an app card is the whole message
(Apple's `MSMessage` cannot coexist with text), so copy and a card are
two sends, not one.
"""

effect: MessageEffectParam
"""iMessage effect to apply to this message (screen or bubble effect)"""

idempotency_key: str
"""
Optional idempotency key for this message. Use this to prevent duplicate sends
of the same message.
"""

parts: Required[Iterable[Part]]
parts: Iterable[Part]
"""Array of message parts.

Each part can be text, media, or link. Parts are displayed in order. Text and
Expand Down Expand Up @@ -198,15 +213,6 @@ class MessageContentParam(TypedDict, total=False):
`POST /v3/attachments` and reference by `attachment_id` or `download_url`.
"""

effect: MessageEffectParam
"""iMessage effect to apply to this message (screen or bubble effect)"""

idempotency_key: str
"""
Optional idempotency key for this message. Use this to prevent duplicate sends
of the same message.
"""

preferred_service: ServiceType
"""Messaging service type"""

Expand Down
5 changes: 5 additions & 0 deletions src/linq/types/message_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class MessageCreateParams(TypedDict, total=False):

Groups all message-related fields together, separating the "what" (message
content) from the "where" (routing fields like from/to).

A message carries EITHER `parts` — text and attachments, which compose into one
bubble — or a single `action`, which invokes an experience inside Linq's
iMessage app. Never both: an app card is the whole message (Apple's `MSMessage`
cannot coexist with text), so copy and a card are two sends, not one.
"""

to: Required[SequenceNotStr[str]]
Expand Down
Loading
Loading