Skip to content
Merged
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
6 changes: 6 additions & 0 deletions src/linq/types/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,11 @@ class Chat(BaseModel):
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"""
28 changes: 7 additions & 21 deletions src/linq/types/chats/sent_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,14 @@ class PartIMessageAppPartResponseLayout(BaseModel):
"""Visible layout of the card.

At least one of
`caption`, `subcaption`, `trailing_caption`, `trailing_subcaption`, or `image_url` must be
set, otherwise the card renders as an empty bubble.
`caption`, `subcaption`, `trailing_caption`, or `trailing_subcaption` must be set, otherwise
the card renders as an empty bubble. Any image on the card is drawn by the recipient's
installed app extension; it cannot be supplied here.
"""

caption: Optional[str] = None
"""Primary label, top-left and bold."""

image_subtitle: Optional[str] = None
"""Overlay text shown below `image_title`. Requires `image_url`."""

image_title: Optional[str] = None
"""Overlay text shown above the image. Requires `image_url`."""

image_url: Optional[str] = None
"""Optional HTTPS URL of a preview image.

The server downloads it and embeds it in the card as JPEG (10MB max, same fetch
rules as media parts).
"""

subcaption: Optional[str] = None
"""Secondary label, below `caption` on the left."""

Expand All @@ -86,9 +74,10 @@ class PartIMessageAppPartResponse(BaseModel):
layout: PartIMessageAppPartResponseLayout
"""Visible layout of the card.

At least one of `caption`, `subcaption`, `trailing_caption`,
`trailing_subcaption`, or `image_url` must be set, otherwise the card renders as
an empty bubble.
At least one of `caption`, `subcaption`, `trailing_caption`, or
`trailing_subcaption` must be set, otherwise the card renders as an empty
bubble. Any image on the card is drawn by the recipient's installed app
extension; it cannot be supplied here.
"""

reactions: Optional[List[Reaction]] = None
Expand All @@ -103,9 +92,6 @@ class PartIMessageAppPartResponse(BaseModel):
fallback_text: Optional[str] = None
"""Fallback text for surfaces that cannot render the card."""

session_id: Optional[str] = None
"""Client-supplied session identifier, echoed back when provided."""


Part: TypeAlias = Union[TextPartResponse, MediaPartResponse, LinkPartResponse, PartIMessageAppPartResponse]

Expand Down
28 changes: 7 additions & 21 deletions src/linq/types/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,14 @@ class PartIMessageAppPartResponseLayout(BaseModel):
"""Visible layout of the card.

At least one of
`caption`, `subcaption`, `trailing_caption`, `trailing_subcaption`, or `image_url` must be
set, otherwise the card renders as an empty bubble.
`caption`, `subcaption`, `trailing_caption`, or `trailing_subcaption` must be set, otherwise
the card renders as an empty bubble. Any image on the card is drawn by the recipient's
installed app extension; it cannot be supplied here.
"""

caption: Optional[str] = None
"""Primary label, top-left and bold."""

image_subtitle: Optional[str] = None
"""Overlay text shown below `image_title`. Requires `image_url`."""

image_title: Optional[str] = None
"""Overlay text shown above the image. Requires `image_url`."""

image_url: Optional[str] = None
"""Optional HTTPS URL of a preview image.

The server downloads it and embeds it in the card as JPEG (10MB max, same fetch
rules as media parts).
"""

subcaption: Optional[str] = None
"""Secondary label, below `caption` on the left."""

Expand All @@ -88,9 +76,10 @@ class PartIMessageAppPartResponse(BaseModel):
layout: PartIMessageAppPartResponseLayout
"""Visible layout of the card.

At least one of `caption`, `subcaption`, `trailing_caption`,
`trailing_subcaption`, or `image_url` must be set, otherwise the card renders as
an empty bubble.
At least one of `caption`, `subcaption`, `trailing_caption`, or
`trailing_subcaption` must be set, otherwise the card renders as an empty
bubble. Any image on the card is drawn by the recipient's installed app
extension; it cannot be supplied here.
"""

reactions: Optional[List[Reaction]] = None
Expand All @@ -105,9 +94,6 @@ class PartIMessageAppPartResponse(BaseModel):
fallback_text: Optional[str] = None
"""Fallback text for surfaces that cannot render the card."""

session_id: Optional[str] = None
"""Client-supplied session identifier, echoed back when provided."""


Part: TypeAlias = Union[TextPartResponse, MediaPartResponse, LinkPartResponse, PartIMessageAppPartResponse]

Expand Down
31 changes: 7 additions & 24 deletions src/linq/types/message_content_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,14 @@ class PartIMessageAppPartLayout(TypedDict, total=False):
"""Visible layout of the card.

At least one of
`caption`, `subcaption`, `trailing_caption`, `trailing_subcaption`, or `image_url` must be
set, otherwise the card renders as an empty bubble.
`caption`, `subcaption`, `trailing_caption`, or `trailing_subcaption` must be set, otherwise
the card renders as an empty bubble. Any image on the card is drawn by the recipient's
installed app extension; it cannot be supplied here.
"""

caption: str
"""Primary label, top-left and bold."""

image_subtitle: str
"""Overlay text shown below `image_title`. Requires `image_url`."""

image_title: str
"""Overlay text shown above the image. Requires `image_url`."""

image_url: str
"""Optional HTTPS URL of a preview image.

The server downloads it and embeds it in the card as JPEG (10MB max, same fetch
rules as media parts).
"""

subcaption: str
"""Secondary label, below `caption` on the left."""

Expand All @@ -84,9 +72,10 @@ class PartIMessageAppPart(TypedDict, total=False):
layout: Required[PartIMessageAppPartLayout]
"""Visible layout of the card.

At least one of `caption`, `subcaption`, `trailing_caption`,
`trailing_subcaption`, or `image_url` must be set, otherwise the card renders as
an empty bubble.
At least one of `caption`, `subcaption`, `trailing_caption`, or
`trailing_subcaption` must be set, otherwise the card renders as an empty
bubble. Any image on the card is drawn by the recipient's installed app
extension; it cannot be supplied here.
"""

type: Required[Literal["imessage_app"]]
Expand All @@ -104,12 +93,6 @@ class PartIMessageAppPart(TypedDict, total=False):
Defaults to the caption when omitted.
"""

session_id: str
"""
Optional client-supplied identifier to correlate updatable/collaborative app
sessions (advanced). Not interpreted by Synapse.
"""


Part: TypeAlias = Union[TextPartParam, MediaPartParam, LinkPartParam, PartIMessageAppPart]

Expand Down
12 changes: 0 additions & 12 deletions src/linq/types/message_event_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,6 @@ class PartSchemasIMessageAppPartResponseLayout(BaseModel):
caption: Optional[str] = None
"""Primary label, top-left and bold."""

image_subtitle: Optional[str] = None
"""Overlay text shown below image_title."""

image_title: Optional[str] = None
"""Overlay text shown above the image."""

image_url: Optional[str] = None
"""Presigned URL of the card preview image, when present."""

subcaption: Optional[str] = None
"""Secondary label, below caption on the left."""

Expand Down Expand Up @@ -146,9 +137,6 @@ class PartSchemasIMessageAppPartResponse(BaseModel):
fallback_text: Optional[str] = None
"""Fallback text for surfaces that cannot render the card."""

session_id: Optional[str] = None
"""Client-supplied session identifier, echoed back when provided."""


Part: TypeAlias = Annotated[
Union[
Expand Down
53 changes: 46 additions & 7 deletions src/linq/types/phone_number_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

from .._models import BaseModel

__all__ = ["PhoneNumberListResponse", "PhoneNumber", "PhoneNumberHealthStatus"]
__all__ = ["PhoneNumberListResponse", "PhoneNumber", "PhoneNumberHealthStatus", "PhoneNumberReputation"]


class PhoneNumberHealthStatus(BaseModel):
"""**[BETA]** Current health for a phone line.
"""**[BETA]** Current reputation for a phone line.

Always present — lines start at `HEALTHY` and may shift based on aggregate engagement and delivery signals across all conversations on the line.

Unlike chat health, line health does not include `opted_out` — opt-out applies to individual recipients, not the whole line.
Unlike chat health, line reputation does not include `opted_out` — opt-out applies to individual recipients, not the whole line.

See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each status means and how to react.
"""
Expand All @@ -22,7 +22,33 @@ class PhoneNumberHealthStatus(BaseModel):
"""Deep-link to the relevant section of the Phone Health guide for this status."""

status: Literal["HEALTHY", "AT_RISK", "CRITICAL"]
"""Current health of this phone line as assessed by risk-service.
"""Current reputation of this phone line as assessed by risk-service.

- `HEALTHY` — No elevated risk detected.
- `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
reviewing messaging patterns.
- `CRITICAL` — High risk; further sending may result in line flagging or
restriction.

Defaults to `HEALTHY` for lines that have not yet been scored.
"""


class PhoneNumberReputation(BaseModel):
"""**[BETA]** Current reputation for a phone line.

Always present — lines start at `HEALTHY` and may shift based on aggregate engagement and delivery signals across all conversations on the line.

Unlike chat health, line reputation does not include `opted_out` — opt-out applies to individual recipients, not the whole line.

See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each status means and how to react.
"""

doc_url: str
"""Deep-link to the relevant section of the Phone Health guide for this status."""

status: Literal["HEALTHY", "AT_RISK", "CRITICAL"]
"""Current reputation of this phone line as assessed by risk-service.

- `HEALTHY` — No elevated risk detected.
- `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
Expand All @@ -39,13 +65,13 @@ class PhoneNumber(BaseModel):
"""Unique identifier for the phone number"""

health_status: PhoneNumberHealthStatus
"""**[BETA]** Current health for a phone line.
"""**[BETA]** Current reputation for a phone line.

Always present — lines start at `HEALTHY` and may shift based on aggregate
engagement and delivery signals across all conversations on the line.

Unlike chat health, line health does not include `opted_out` — opt-out applies
to individual recipients, not the whole line.
Unlike chat health, line reputation does not include `opted_out` — opt-out
applies to individual recipients, not the whole line.

See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
status means and how to react.
Expand All @@ -54,6 +80,19 @@ class PhoneNumber(BaseModel):
phone_number: str
"""Phone number in E.164 format"""

reputation: PhoneNumberReputation
"""**[BETA]** Current reputation for a phone line.

Always present — lines start at `HEALTHY` and may shift based on aggregate
engagement and delivery signals across all conversations on the line.

Unlike chat health, line reputation does not include `opted_out` — opt-out
applies to individual recipients, not the whole line.

See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
status means and how to react.
"""


class PhoneNumberListResponse(BaseModel):
phone_numbers: List[PhoneNumber]
Expand Down
28 changes: 26 additions & 2 deletions src/linq/types/phone_number_status_updated_webhook_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@ class Data(BaseModel):
"""When the status change occurred"""

new_health_status: Literal["HEALTHY", "AT_RISK", "CRITICAL"]
"""The new line health status"""
"""Current reputation of this phone line as assessed by risk-service.

- `HEALTHY` — No elevated risk detected.
- `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
reviewing messaging patterns.
- `CRITICAL` — High risk; further sending may result in line flagging or
restriction.

Defaults to `HEALTHY` for lines that have not yet been scored.
"""

new_reputation: Literal["HEALTHY", "AT_RISK", "CRITICAL"]
"""The new line reputation"""

new_status: Literal["ACTIVE", "FLAGGED"]
"""The new service status"""
Expand All @@ -24,7 +36,19 @@ class Data(BaseModel):
"""Phone number in E.164 format"""

previous_health_status: Literal["HEALTHY", "AT_RISK", "CRITICAL"]
"""The previous line health status"""
"""Current reputation of this phone line as assessed by risk-service.

- `HEALTHY` — No elevated risk detected.
- `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
reviewing messaging patterns.
- `CRITICAL` — High risk; further sending may result in line flagging or
restriction.

Defaults to `HEALTHY` for lines that have not yet been scored.
"""

previous_reputation: Literal["HEALTHY", "AT_RISK", "CRITICAL"]
"""The previous line reputation"""

previous_status: Literal["ACTIVE", "FLAGGED"]
"""The previous service status"""
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading