diff --git a/src/linq/types/chat.py b/src/linq/types/chat.py index b697e13..d78b2ee 100644 --- a/src/linq/types/chat.py +++ b/src/linq/types/chat.py @@ -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""" diff --git a/src/linq/types/chats/sent_message.py b/src/linq/types/chats/sent_message.py index c75dcac..4ea7417 100644 --- a/src/linq/types/chats/sent_message.py +++ b/src/linq/types/chats/sent_message.py @@ -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.""" @@ -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 @@ -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] diff --git a/src/linq/types/message.py b/src/linq/types/message.py index a362489..256968b 100644 --- a/src/linq/types/message.py +++ b/src/linq/types/message.py @@ -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.""" @@ -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 @@ -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] diff --git a/src/linq/types/message_content_param.py b/src/linq/types/message_content_param.py index 2cbfb9e..f3eccb4 100644 --- a/src/linq/types/message_content_param.py +++ b/src/linq/types/message_content_param.py @@ -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.""" @@ -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"]] @@ -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] diff --git a/src/linq/types/message_event_v2.py b/src/linq/types/message_event_v2.py index ebc9446..7cf6c6f 100644 --- a/src/linq/types/message_event_v2.py +++ b/src/linq/types/message_event_v2.py @@ -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.""" @@ -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[ diff --git a/src/linq/types/phone_number_list_response.py b/src/linq/types/phone_number_list_response.py index d09d4f7..58822cc 100644 --- a/src/linq/types/phone_number_list_response.py +++ b/src/linq/types/phone_number_list_response.py @@ -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. """ @@ -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 @@ -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. @@ -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] diff --git a/src/linq/types/phone_number_status_updated_webhook_event.py b/src/linq/types/phone_number_status_updated_webhook_event.py index ef9c4df..0d4f745 100644 --- a/src/linq/types/phone_number_status_updated_webhook_event.py +++ b/src/linq/types/phone_number_status_updated_webhook_event.py @@ -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""" @@ -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""" diff --git a/uv.lock b/uv.lock index bae0cc1..b3dcdff 100644 --- a/uv.lock +++ b/uv.lock @@ -530,7 +530,7 @@ wheels = [ [[package]] name = "linq-python" -version = "0.13.0" +version = "0.14.0" source = { editable = "." } dependencies = [ { name = "anyio" },