# Shared

## Domain Types

### Chat Handle

- `type ChatHandle struct{…}`

  - `ID string`

    Unique identifier for this handle

  - `Handle string`

    Phone number (E.164) or email address of the participant

  - `JoinedAt Time`

    When this participant joined the chat

  - `Service ServiceType`

    Messaging service type

    - `const ServiceTypeiMessage ServiceType = "iMessage"`

    - `const ServiceTypeSMS ServiceType = "SMS"`

    - `const ServiceTypeRCS ServiceType = "RCS"`

  - `IsMe bool`

    Whether this handle belongs to the sender (your phone number)

  - `LeftAt Time`

    When they left (if applicable)

  - `Status ChatHandleStatus`

    Participant status

    - `const ChatHandleStatusActive ChatHandleStatus = "active"`

    - `const ChatHandleStatusLeft ChatHandleStatus = "left"`

    - `const ChatHandleStatusRemoved ChatHandleStatus = "removed"`

### Link Part Response

- `type LinkPartResponse struct{…}`

  A rich link preview part

  - `Reactions []Reaction`

    Reactions on this message part

    - `Handle ChatHandle`

      - `ID string`

        Unique identifier for this handle

      - `Handle string`

        Phone number (E.164) or email address of the participant

      - `JoinedAt Time`

        When this participant joined the chat

      - `Service ServiceType`

        Messaging service type

        - `const ServiceTypeiMessage ServiceType = "iMessage"`

        - `const ServiceTypeSMS ServiceType = "SMS"`

        - `const ServiceTypeRCS ServiceType = "RCS"`

      - `IsMe bool`

        Whether this handle belongs to the sender (your phone number)

      - `LeftAt Time`

        When they left (if applicable)

      - `Status ChatHandleStatus`

        Participant status

        - `const ChatHandleStatusActive ChatHandleStatus = "active"`

        - `const ChatHandleStatusLeft ChatHandleStatus = "left"`

        - `const ChatHandleStatusRemoved ChatHandleStatus = "removed"`

    - `IsMe bool`

      Whether this reaction is from the current user

    - `Type ReactionType`

      Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh, emphasize, question.
      Custom emoji reactions have type "custom" with the actual emoji in the custom_emoji field.
      Sticker reactions have type "sticker" with sticker attachment details in the sticker field.

      - `const ReactionTypeLove ReactionType = "love"`

      - `const ReactionTypeLike ReactionType = "like"`

      - `const ReactionTypeDislike ReactionType = "dislike"`

      - `const ReactionTypeLaugh ReactionType = "laugh"`

      - `const ReactionTypeEmphasize ReactionType = "emphasize"`

      - `const ReactionTypeQuestion ReactionType = "question"`

      - `const ReactionTypeCustom ReactionType = "custom"`

      - `const ReactionTypeSticker ReactionType = "sticker"`

    - `CustomEmoji string`

      Custom emoji if type is "custom", null otherwise

    - `Sticker ReactionSticker`

      Sticker attachment details when reaction_type is "sticker". Null for non-sticker reactions.

      - `FileName string`

        Filename of the sticker

      - `Height int64`

        Sticker image height in pixels

      - `MimeType string`

        MIME type of the sticker image

      - `URL string`

        Presigned URL for downloading the sticker image (expires in 1 hour).

      - `Width int64`

        Sticker image width in pixels

  - `Type LinkPartResponseType`

    Indicates this is a rich link preview part

    - `const LinkPartResponseTypeLink LinkPartResponseType = "link"`

  - `Value string`

    The URL

### Media Part Response

- `type MediaPartResponse struct{…}`

  A media attachment part

  - `ID string`

    Unique attachment identifier

  - `Filename string`

    Original filename

  - `MimeType string`

    MIME type of the file

  - `Reactions []Reaction`

    Reactions on this message part

    - `Handle ChatHandle`

      - `ID string`

        Unique identifier for this handle

      - `Handle string`

        Phone number (E.164) or email address of the participant

      - `JoinedAt Time`

        When this participant joined the chat

      - `Service ServiceType`

        Messaging service type

        - `const ServiceTypeiMessage ServiceType = "iMessage"`

        - `const ServiceTypeSMS ServiceType = "SMS"`

        - `const ServiceTypeRCS ServiceType = "RCS"`

      - `IsMe bool`

        Whether this handle belongs to the sender (your phone number)

      - `LeftAt Time`

        When they left (if applicable)

      - `Status ChatHandleStatus`

        Participant status

        - `const ChatHandleStatusActive ChatHandleStatus = "active"`

        - `const ChatHandleStatusLeft ChatHandleStatus = "left"`

        - `const ChatHandleStatusRemoved ChatHandleStatus = "removed"`

    - `IsMe bool`

      Whether this reaction is from the current user

    - `Type ReactionType`

      Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh, emphasize, question.
      Custom emoji reactions have type "custom" with the actual emoji in the custom_emoji field.
      Sticker reactions have type "sticker" with sticker attachment details in the sticker field.

      - `const ReactionTypeLove ReactionType = "love"`

      - `const ReactionTypeLike ReactionType = "like"`

      - `const ReactionTypeDislike ReactionType = "dislike"`

      - `const ReactionTypeLaugh ReactionType = "laugh"`

      - `const ReactionTypeEmphasize ReactionType = "emphasize"`

      - `const ReactionTypeQuestion ReactionType = "question"`

      - `const ReactionTypeCustom ReactionType = "custom"`

      - `const ReactionTypeSticker ReactionType = "sticker"`

    - `CustomEmoji string`

      Custom emoji if type is "custom", null otherwise

    - `Sticker ReactionSticker`

      Sticker attachment details when reaction_type is "sticker". Null for non-sticker reactions.

      - `FileName string`

        Filename of the sticker

      - `Height int64`

        Sticker image height in pixels

      - `MimeType string`

        MIME type of the sticker image

      - `URL string`

        Presigned URL for downloading the sticker image (expires in 1 hour).

      - `Width int64`

        Sticker image width in pixels

  - `SizeBytes int64`

    File size in bytes

  - `Type MediaPartResponseType`

    Indicates this is a media attachment part

    - `const MediaPartResponseTypeMedia MediaPartResponseType = "media"`

  - `URL string`

    Presigned URL for downloading the attachment (expires in 1 hour).

### Reaction

- `type Reaction struct{…}`

  - `Handle ChatHandle`

    - `ID string`

      Unique identifier for this handle

    - `Handle string`

      Phone number (E.164) or email address of the participant

    - `JoinedAt Time`

      When this participant joined the chat

    - `Service ServiceType`

      Messaging service type

      - `const ServiceTypeiMessage ServiceType = "iMessage"`

      - `const ServiceTypeSMS ServiceType = "SMS"`

      - `const ServiceTypeRCS ServiceType = "RCS"`

    - `IsMe bool`

      Whether this handle belongs to the sender (your phone number)

    - `LeftAt Time`

      When they left (if applicable)

    - `Status ChatHandleStatus`

      Participant status

      - `const ChatHandleStatusActive ChatHandleStatus = "active"`

      - `const ChatHandleStatusLeft ChatHandleStatus = "left"`

      - `const ChatHandleStatusRemoved ChatHandleStatus = "removed"`

  - `IsMe bool`

    Whether this reaction is from the current user

  - `Type ReactionType`

    Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh, emphasize, question.
    Custom emoji reactions have type "custom" with the actual emoji in the custom_emoji field.
    Sticker reactions have type "sticker" with sticker attachment details in the sticker field.

    - `const ReactionTypeLove ReactionType = "love"`

    - `const ReactionTypeLike ReactionType = "like"`

    - `const ReactionTypeDislike ReactionType = "dislike"`

    - `const ReactionTypeLaugh ReactionType = "laugh"`

    - `const ReactionTypeEmphasize ReactionType = "emphasize"`

    - `const ReactionTypeQuestion ReactionType = "question"`

    - `const ReactionTypeCustom ReactionType = "custom"`

    - `const ReactionTypeSticker ReactionType = "sticker"`

  - `CustomEmoji string`

    Custom emoji if type is "custom", null otherwise

  - `Sticker ReactionSticker`

    Sticker attachment details when reaction_type is "sticker". Null for non-sticker reactions.

    - `FileName string`

      Filename of the sticker

    - `Height int64`

      Sticker image height in pixels

    - `MimeType string`

      MIME type of the sticker image

    - `URL string`

      Presigned URL for downloading the sticker image (expires in 1 hour).

    - `Width int64`

      Sticker image width in pixels

### Reaction Type

- `type ReactionType string`

  Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh, emphasize, question.
  Custom emoji reactions have type "custom" with the actual emoji in the custom_emoji field.
  Sticker reactions have type "sticker" with sticker attachment details in the sticker field.

  - `const ReactionTypeLove ReactionType = "love"`

  - `const ReactionTypeLike ReactionType = "like"`

  - `const ReactionTypeDislike ReactionType = "dislike"`

  - `const ReactionTypeLaugh ReactionType = "laugh"`

  - `const ReactionTypeEmphasize ReactionType = "emphasize"`

  - `const ReactionTypeQuestion ReactionType = "question"`

  - `const ReactionTypeCustom ReactionType = "custom"`

  - `const ReactionTypeSticker ReactionType = "sticker"`

### Service Type

- `type ServiceType string`

  Messaging service type

  - `const ServiceTypeiMessage ServiceType = "iMessage"`

  - `const ServiceTypeSMS ServiceType = "SMS"`

  - `const ServiceTypeRCS ServiceType = "RCS"`

### Text Decoration

- `type TextDecoration struct{…}`

  - `Range []int64`

    Character range `[start, end)` in the `value` string where the decoration applies.
    `start` is inclusive, `end` is exclusive.
    *Characters are measured as UTF-16 code units. Most characters count as 1; some emoji count as 2.*

  - `Animation TextDecorationAnimation`

    Animated text effect to apply. Mutually exclusive with `style`.

    - `const TextDecorationAnimationBig TextDecorationAnimation = "big"`

    - `const TextDecorationAnimationSmall TextDecorationAnimation = "small"`

    - `const TextDecorationAnimationShake TextDecorationAnimation = "shake"`

    - `const TextDecorationAnimationNod TextDecorationAnimation = "nod"`

    - `const TextDecorationAnimationExplode TextDecorationAnimation = "explode"`

    - `const TextDecorationAnimationRipple TextDecorationAnimation = "ripple"`

    - `const TextDecorationAnimationBloom TextDecorationAnimation = "bloom"`

    - `const TextDecorationAnimationJitter TextDecorationAnimation = "jitter"`

  - `Style TextDecorationStyle`

    Text style to apply. Mutually exclusive with `animation`.

    - `const TextDecorationStyleBold TextDecorationStyle = "bold"`

    - `const TextDecorationStyleItalic TextDecorationStyle = "italic"`

    - `const TextDecorationStyleStrikethrough TextDecorationStyle = "strikethrough"`

    - `const TextDecorationStyleUnderline TextDecorationStyle = "underline"`

### Text Part Response

- `type TextPartResponse struct{…}`

  A text message part

  - `Reactions []Reaction`

    Reactions on this message part

    - `Handle ChatHandle`

      - `ID string`

        Unique identifier for this handle

      - `Handle string`

        Phone number (E.164) or email address of the participant

      - `JoinedAt Time`

        When this participant joined the chat

      - `Service ServiceType`

        Messaging service type

        - `const ServiceTypeiMessage ServiceType = "iMessage"`

        - `const ServiceTypeSMS ServiceType = "SMS"`

        - `const ServiceTypeRCS ServiceType = "RCS"`

      - `IsMe bool`

        Whether this handle belongs to the sender (your phone number)

      - `LeftAt Time`

        When they left (if applicable)

      - `Status ChatHandleStatus`

        Participant status

        - `const ChatHandleStatusActive ChatHandleStatus = "active"`

        - `const ChatHandleStatusLeft ChatHandleStatus = "left"`

        - `const ChatHandleStatusRemoved ChatHandleStatus = "removed"`

    - `IsMe bool`

      Whether this reaction is from the current user

    - `Type ReactionType`

      Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh, emphasize, question.
      Custom emoji reactions have type "custom" with the actual emoji in the custom_emoji field.
      Sticker reactions have type "sticker" with sticker attachment details in the sticker field.

      - `const ReactionTypeLove ReactionType = "love"`

      - `const ReactionTypeLike ReactionType = "like"`

      - `const ReactionTypeDislike ReactionType = "dislike"`

      - `const ReactionTypeLaugh ReactionType = "laugh"`

      - `const ReactionTypeEmphasize ReactionType = "emphasize"`

      - `const ReactionTypeQuestion ReactionType = "question"`

      - `const ReactionTypeCustom ReactionType = "custom"`

      - `const ReactionTypeSticker ReactionType = "sticker"`

    - `CustomEmoji string`

      Custom emoji if type is "custom", null otherwise

    - `Sticker ReactionSticker`

      Sticker attachment details when reaction_type is "sticker". Null for non-sticker reactions.

      - `FileName string`

        Filename of the sticker

      - `Height int64`

        Sticker image height in pixels

      - `MimeType string`

        MIME type of the sticker image

      - `URL string`

        Presigned URL for downloading the sticker image (expires in 1 hour).

      - `Width int64`

        Sticker image width in pixels

  - `Type TextPartResponseType`

    Indicates this is a text message part

    - `const TextPartResponseTypeText TextPartResponseType = "text"`

  - `Value string`

    The text content

  - `TextDecorations []TextDecoration`

    Text decorations applied to character ranges in the value

    - `Range []int64`

      Character range `[start, end)` in the `value` string where the decoration applies.
      `start` is inclusive, `end` is exclusive.
      *Characters are measured as UTF-16 code units. Most characters count as 1; some emoji count as 2.*

    - `Animation TextDecorationAnimation`

      Animated text effect to apply. Mutually exclusive with `style`.

      - `const TextDecorationAnimationBig TextDecorationAnimation = "big"`

      - `const TextDecorationAnimationSmall TextDecorationAnimation = "small"`

      - `const TextDecorationAnimationShake TextDecorationAnimation = "shake"`

      - `const TextDecorationAnimationNod TextDecorationAnimation = "nod"`

      - `const TextDecorationAnimationExplode TextDecorationAnimation = "explode"`

      - `const TextDecorationAnimationRipple TextDecorationAnimation = "ripple"`

      - `const TextDecorationAnimationBloom TextDecorationAnimation = "bloom"`

      - `const TextDecorationAnimationJitter TextDecorationAnimation = "jitter"`

    - `Style TextDecorationStyle`

      Text style to apply. Mutually exclusive with `animation`.

      - `const TextDecorationStyleBold TextDecorationStyle = "bold"`

      - `const TextDecorationStyleItalic TextDecorationStyle = "italic"`

      - `const TextDecorationStyleStrikethrough TextDecorationStyle = "strikethrough"`

      - `const TextDecorationStyleUnderline TextDecorationStyle = "underline"`
