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
8 changes: 0 additions & 8 deletions CHANGELOG.md

This file was deleted.

4 changes: 2 additions & 2 deletions src/linq/resources/capability.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def check_i_message(
"address": address,
"from_": from_,
},
capability_check_i_message_params.CapabilityCheckiMessageParams,
capability_check_i_message_params.CapabilityCheckIMessageParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
Expand Down Expand Up @@ -196,7 +196,7 @@ async def check_i_message(
"address": address,
"from_": from_,
},
capability_check_i_message_params.CapabilityCheckiMessageParams,
capability_check_i_message_params.CapabilityCheckIMessageParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
Expand Down
2 changes: 1 addition & 1 deletion src/linq/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
from .reaction_removed_webhook_event import ReactionRemovedWebhookEvent as ReactionRemovedWebhookEvent
from .message_delivered_webhook_event import MessageDeliveredWebhookEvent as MessageDeliveredWebhookEvent
from .participant_added_webhook_event import ParticipantAddedWebhookEvent as ParticipantAddedWebhookEvent
from .capability_check_i_message_params import CapabilityCheckiMessageParams as CapabilityCheckiMessageParams
from .capability_check_i_message_params import CapabilityCheckIMessageParams as CapabilityCheckIMessageParams
from .participant_removed_webhook_event import ParticipantRemovedWebhookEvent as ParticipantRemovedWebhookEvent
from .webhook_subscription_create_params import WebhookSubscriptionCreateParams as WebhookSubscriptionCreateParams
from .webhook_subscription_list_response import WebhookSubscriptionListResponse as WebhookSubscriptionListResponse
Expand Down
4 changes: 2 additions & 2 deletions src/linq/types/capability_check_i_message_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

from .._utils import PropertyInfo

__all__ = ["CapabilityCheckiMessageParams"]
__all__ = ["CapabilityCheckIMessageParams"]


class CapabilityCheckiMessageParams(TypedDict, total=False):
class CapabilityCheckIMessageParams(TypedDict, total=False):
address: Required[str]
"""The recipient phone number or email address to check"""

Expand Down
96 changes: 94 additions & 2 deletions src/linq/types/chats/sent_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,107 @@
from ..._models import BaseModel
from ..reply_to import ReplyTo
from ..message_effect import MessageEffect
from ..shared.reaction import Reaction
from ..shared.chat_handle import ChatHandle
from ..shared.service_type import ServiceType
from ..shared.link_part_response import LinkPartResponse
from ..shared.text_part_response import TextPartResponse
from ..shared.media_part_response import MediaPartResponse

__all__ = ["SentMessage", "Part"]
__all__ = [
"SentMessage",
"Part",
"PartIMessageAppPartResponse",
"PartIMessageAppPartResponseApp",
"PartIMessageAppPartResponseLayout",
]

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

class PartIMessageAppPartResponseApp(BaseModel):
"""Identifies the iMessage app (Messages app extension) that backs the card."""

bundle_id: str
"""Bundle identifier of the Messages app extension. Must not contain `:`."""

name: str
"""Display name of the app, shown by Messages' fallback UI."""

team_id: str
"""The app's 10-character uppercase alphanumeric team identifier."""

app_store_id: Optional[int] = None
"""The owning app's App Store id (optional).

When set, recipients without the iMessage app installed see a "Get the app"
affordance.
"""


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: 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."""

trailing_caption: Optional[str] = None
"""Label shown top-right."""

trailing_subcaption: Optional[str] = None
"""Label shown below `trailing_caption`, on the right."""


class PartIMessageAppPartResponse(BaseModel):
"""An iMessage app card part."""

app: PartIMessageAppPartResponseApp
"""Identifies the iMessage app (Messages app extension) that backs the card."""

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.
"""

reactions: Optional[List[Reaction]] = None
"""Reactions on this message part"""

type: Literal["imessage_app"]
"""Indicates this is an iMessage app card part."""

url: str
"""The URL delivered to the iMessage app on tap."""

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]


class SentMessage(BaseModel):
Expand Down
96 changes: 94 additions & 2 deletions src/linq/types/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,107 @@
from .._models import BaseModel
from .reply_to import ReplyTo
from .message_effect import MessageEffect
from .shared.reaction import Reaction
from .shared.chat_handle import ChatHandle
from .shared.service_type import ServiceType
from .shared.link_part_response import LinkPartResponse
from .shared.text_part_response import TextPartResponse
from .shared.media_part_response import MediaPartResponse

__all__ = ["Message", "Part"]
__all__ = [
"Message",
"Part",
"PartIMessageAppPartResponse",
"PartIMessageAppPartResponseApp",
"PartIMessageAppPartResponseLayout",
]

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

class PartIMessageAppPartResponseApp(BaseModel):
"""Identifies the iMessage app (Messages app extension) that backs the card."""

bundle_id: str
"""Bundle identifier of the Messages app extension. Must not contain `:`."""

name: str
"""Display name of the app, shown by Messages' fallback UI."""

team_id: str
"""The app's 10-character uppercase alphanumeric team identifier."""

app_store_id: Optional[int] = None
"""The owning app's App Store id (optional).

When set, recipients without the iMessage app installed see a "Get the app"
affordance.
"""


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: 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."""

trailing_caption: Optional[str] = None
"""Label shown top-right."""

trailing_subcaption: Optional[str] = None
"""Label shown below `trailing_caption`, on the right."""


class PartIMessageAppPartResponse(BaseModel):
"""An iMessage app card part."""

app: PartIMessageAppPartResponseApp
"""Identifies the iMessage app (Messages app extension) that backs the card."""

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.
"""

reactions: Optional[List[Reaction]] = None
"""Reactions on this message part"""

type: Literal["imessage_app"]
"""Indicates this is an iMessage app card part."""

url: str
"""The URL delivered to the iMessage app on tap."""

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]


class Message(BaseModel):
Expand Down
103 changes: 100 additions & 3 deletions src/linq/types/message_content_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

from typing import Union, Iterable
from typing_extensions import Required, TypeAlias, TypedDict
from typing_extensions import Literal, Required, TypeAlias, TypedDict

from .reply_to_param import ReplyToParam
from .link_part_param import LinkPartParam
Expand All @@ -12,9 +12,106 @@
from .shared.service_type import ServiceType
from .message_effect_param import MessageEffectParam

__all__ = ["MessageContentParam", "Part"]
__all__ = ["MessageContentParam", "Part", "PartIMessageAppPart", "PartIMessageAppPartApp", "PartIMessageAppPartLayout"]

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

class PartIMessageAppPartApp(TypedDict, total=False):
"""Identifies the iMessage app (Messages app extension) that backs the card."""

bundle_id: Required[str]
"""Bundle identifier of the Messages app extension. Must not contain `:`."""

name: Required[str]
"""Display name of the app, shown by Messages' fallback UI."""

team_id: Required[str]
"""The app's 10-character uppercase alphanumeric team identifier."""

app_store_id: int
"""The owning app's App Store id (optional).

When set, recipients without the iMessage app installed see a "Get the app"
affordance.
"""


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: 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."""

trailing_caption: str
"""Label shown top-right."""

trailing_subcaption: str
"""Label shown below `trailing_caption`, on the right."""


class PartIMessageAppPart(TypedDict, total=False):
"""An iMessage app card, backed by a Messages app extension.

iMessage only —
an `imessage_app` part must be the **only** part in the message and is never delivered over
SMS/RCS. See the IMessageAppServiceUnsupported (2018) and RecipientUnsupportedMessageType
(4005) error codes.
"""

app: Required[PartIMessageAppPartApp]
"""Identifies the iMessage app (Messages app extension) that backs the card."""

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.
"""

type: Required[Literal["imessage_app"]]
"""Indicates this is an iMessage app card part."""

url: Required[str]
"""
Absolute HTTPS URL delivered to the recipient's installed iMessage app when they
tap the card. Opaque to Messages.
"""

fallback_text: str
"""Text shown on surfaces that cannot render the card (notifications, lock screen).

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]


class MessageContentParam(TypedDict, total=False):
Expand Down
Loading
Loading