From 8a0e4fbac82a824759b563d3b241e513e85c53d3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 21:37:42 +0000 Subject: [PATCH 1/3] feat: [PoC] sync risk lookup on message.received via NATS req/reply --- .stats.yml | 2 +- src/linq/types/chat.py | 12 ++++++++++-- src/linq/types/chat_create_response.py | 12 ++++++++++-- src/linq/types/message_event_v2.py | 23 ++++++++++++++++++++++- 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 601b377..dfcb4c9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 34 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/linq%2Flinq-api-v3-37a94929911f4b5944524a51b722bb0eea0b0b167fd79814181f58ed877aa341.yml -openapi_spec_hash: 795bd7e48e4d2affc5943c57ee111d52 +openapi_spec_hash: a09450056d3af8a47cfe77d483f80d34 config_hash: 3ab31decde29ec61e02db7dcb5313f82 diff --git a/src/linq/types/chat.py b/src/linq/types/chat.py index 242ffe3..43aaeba 100644 --- a/src/linq/types/chat.py +++ b/src/linq/types/chat.py @@ -11,7 +11,11 @@ class HealthScore(BaseModel): - """**[BETA]** Health assessment for a chat. Higher `score` means a healthier chat.""" + """**[BETA]** Health assessment for a chat. + + Higher `score` is healthier. + `null` when a score isn't available yet. Scoring may change during beta. + """ reason: str """Short summary of what's affecting the score. Empty when the score is 100.""" @@ -51,7 +55,11 @@ class Chat(BaseModel): """When the chat was last updated""" health_score: Optional[HealthScore] = None - """**[BETA]** Health assessment for a chat. Higher `score` means a healthier chat.""" + """**[BETA]** Health assessment for a chat. + + Higher `score` is healthier. `null` when a score isn't available yet. Scoring + may change during beta. + """ service: Optional[ServiceType] = None """Messaging service type""" diff --git a/src/linq/types/chat_create_response.py b/src/linq/types/chat_create_response.py index 9efb755..50c26d0 100644 --- a/src/linq/types/chat_create_response.py +++ b/src/linq/types/chat_create_response.py @@ -11,7 +11,11 @@ class ChatHealthScore(BaseModel): - """**[BETA]** Health assessment for a chat. Higher `score` means a healthier chat.""" + """**[BETA]** Health assessment for a chat. + + Higher `score` is healthier. + `null` when a score isn't available yet. Scoring may change during beta. + """ reason: str """Short summary of what's affecting the score. Empty when the score is 100.""" @@ -48,7 +52,11 @@ class Chat(BaseModel): """Messaging service type""" health_score: Optional[ChatHealthScore] = None - """**[BETA]** Health assessment for a chat. Higher `score` means a healthier chat.""" + """**[BETA]** Health assessment for a chat. + + Higher `score` is healthier. `null` when a score isn't available yet. Scoring + may change during beta. + """ class ChatCreateResponse(BaseModel): diff --git a/src/linq/types/message_event_v2.py b/src/linq/types/message_event_v2.py index 269796b..64a65db 100644 --- a/src/linq/types/message_event_v2.py +++ b/src/linq/types/message_event_v2.py @@ -12,7 +12,7 @@ from .schemas_text_part_response import SchemasTextPartResponse from .schemas_media_part_response import SchemasMediaPartResponse -__all__ = ["MessageEventV2", "Chat", "Part", "PartSchemasLinkPartResponse", "ReplyTo"] +__all__ = ["MessageEventV2", "Chat", "Part", "PartSchemasLinkPartResponse", "HealthScore", "ReplyTo"] class Chat(BaseModel): @@ -44,6 +44,20 @@ class PartSchemasLinkPartResponse(BaseModel): ] +class HealthScore(BaseModel): + """**[BETA]** Health assessment for a chat. + + Higher `score` is healthier. + `null` when a score isn't available yet. Scoring may change during beta. + """ + + reason: str + """Short summary of what's affecting the score. Empty when the score is 100.""" + + score: int + """Health score from 0 to 100. Higher is healthier.""" + + class ReplyTo(BaseModel): """Reference to the message this is replying to (for threaded replies)""" @@ -97,6 +111,13 @@ class MessageEventV2(BaseModel): effect: Optional[SchemasMessageEffect] = None """iMessage effect applied to a message (screen or bubble animation)""" + health_score: Optional[HealthScore] = None + """**[BETA]** Health assessment for a chat. + + Higher `score` is healthier. `null` when a score isn't available yet. Scoring + may change during beta. + """ + idempotency_key: Optional[str] = None """Idempotency key for deduplication of outbound messages.""" From 59ab16c54abb0cb25e68aed20acf9198611eaf48 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 02:46:55 +0000 Subject: [PATCH 2/3] feat(webhooks): nest health_score under chat (PLT-540) + remove standalone opt_out/opt_in webhooks --- .stats.yml | 2 +- src/linq/types/message_event_v2.py | 44 +++++++++---------- ...one_number_status_updated_webhook_event.py | 2 - src/linq/types/webhook_event_type.py | 2 - 4 files changed, 23 insertions(+), 27 deletions(-) diff --git a/.stats.yml b/.stats.yml index dfcb4c9..02e38ed 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 34 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/linq%2Flinq-api-v3-37a94929911f4b5944524a51b722bb0eea0b0b167fd79814181f58ed877aa341.yml -openapi_spec_hash: a09450056d3af8a47cfe77d483f80d34 +openapi_spec_hash: a3d001964480c894a5b6cb9ffa4fa47b config_hash: 3ab31decde29ec61e02db7dcb5313f82 diff --git a/src/linq/types/message_event_v2.py b/src/linq/types/message_event_v2.py index 64a65db..06360ab 100644 --- a/src/linq/types/message_event_v2.py +++ b/src/linq/types/message_event_v2.py @@ -12,7 +12,21 @@ from .schemas_text_part_response import SchemasTextPartResponse from .schemas_media_part_response import SchemasMediaPartResponse -__all__ = ["MessageEventV2", "Chat", "Part", "PartSchemasLinkPartResponse", "HealthScore", "ReplyTo"] +__all__ = ["MessageEventV2", "Chat", "ChatHealthScore", "Part", "PartSchemasLinkPartResponse", "ReplyTo"] + + +class ChatHealthScore(BaseModel): + """**[BETA]** Health assessment for a chat. + + Higher `score` is healthier. + `null` when a score isn't available yet. Scoring may change during beta. + """ + + reason: str + """Short summary of what's affecting the score. Empty when the score is 100.""" + + score: int + """Health score from 0 to 100. Higher is healthier.""" class Chat(BaseModel): @@ -21,6 +35,13 @@ class Chat(BaseModel): id: str """Chat identifier""" + health_score: Optional[ChatHealthScore] = None + """**[BETA]** Health assessment for a chat. + + Higher `score` is healthier. `null` when a score isn't available yet. Scoring + may change during beta. + """ + is_group: Optional[bool] = None """Whether this is a group chat""" @@ -44,20 +65,6 @@ class PartSchemasLinkPartResponse(BaseModel): ] -class HealthScore(BaseModel): - """**[BETA]** Health assessment for a chat. - - Higher `score` is healthier. - `null` when a score isn't available yet. Scoring may change during beta. - """ - - reason: str - """Short summary of what's affecting the score. Empty when the score is 100.""" - - score: int - """Health score from 0 to 100. Higher is healthier.""" - - class ReplyTo(BaseModel): """Reference to the message this is replying to (for threaded replies)""" @@ -111,13 +118,6 @@ class MessageEventV2(BaseModel): effect: Optional[SchemasMessageEffect] = None """iMessage effect applied to a message (screen or bubble animation)""" - health_score: Optional[HealthScore] = None - """**[BETA]** Health assessment for a chat. - - Higher `score` is healthier. `null` when a score isn't available yet. Scoring - may change during beta. - """ - idempotency_key: Optional[str] = None """Idempotency key for deduplication of outbound messages.""" 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 43ab4a8..3c11845 100644 --- a/src/linq/types/phone_number_status_updated_webhook_event.py +++ b/src/linq/types/phone_number_status_updated_webhook_event.py @@ -46,8 +46,6 @@ class PhoneNumberStatusUpdatedWebhookEvent(BaseModel): "message.delivered", "message.failed", "message.edited", - "message.opt_out", - "message.opt_in", "reaction.added", "reaction.removed", "participant.added", diff --git a/src/linq/types/webhook_event_type.py b/src/linq/types/webhook_event_type.py index 1594a37..270f117 100644 --- a/src/linq/types/webhook_event_type.py +++ b/src/linq/types/webhook_event_type.py @@ -11,8 +11,6 @@ "message.delivered", "message.failed", "message.edited", - "message.opt_out", - "message.opt_in", "reaction.added", "reaction.removed", "participant.added", From f7aab92264ce0b513105f3deb91be76e2035f4a7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 02:54:08 +0000 Subject: [PATCH 3/3] release: 0.7.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ pyproject.toml | 2 +- src/linq/_version.py | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4208b5c..1b77f50 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.6.0" + ".": "0.7.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ca07fb9..c1b99d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.7.0 (2026-04-30) + +Full Changelog: [v0.6.0...v0.7.0](https://github.com/linq-team/linq-python/compare/v0.6.0...v0.7.0) + +### Features + +* [PoC] sync risk lookup on message.received via NATS req/reply ([8a0e4fb](https://github.com/linq-team/linq-python/commit/8a0e4fbac82a824759b563d3b241e513e85c53d3)) +* **webhooks:** nest health_score under chat (PLT-540) + remove standalone opt_out/opt_in webhooks ([59ab16c](https://github.com/linq-team/linq-python/commit/59ab16c54abb0cb25e68aed20acf9198611eaf48)) + ## 0.6.0 (2026-04-28) Full Changelog: [v0.5.0...v0.6.0](https://github.com/linq-team/linq-python/compare/v0.5.0...v0.6.0) diff --git a/pyproject.toml b/pyproject.toml index c9e0630..4893044 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "linq-python" -version = "0.6.0" +version = "0.7.0" description = "The official Python library for the linq-api-v3 API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/linq/_version.py b/src/linq/_version.py index 0586a24..38bd5ac 100644 --- a/src/linq/_version.py +++ b/src/linq/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "linq" -__version__ = "0.6.0" # x-release-please-version +__version__ = "0.7.0" # x-release-please-version