Class ChatMessage

java.lang.Object
com.azure.communication.chat.models.ChatMessage

public final class ChatMessage extends Object
The ChatMessage model.
  • Constructor Details

    • ChatMessage

      public ChatMessage()
  • Method Details

    • getId

      public String getId()
      Get the id property: The id of the chat message. This id is server generated.
      Returns:
      the id value.
    • setId

      public ChatMessage setId(String id)
      Set the id property: The id of the chat message.
      Parameters:
      id - the id to set.
      Returns:
      the ChatMessage object itself.
    • getType

      public ChatMessageType getType()
      Get the type property: Type of the chat message.

      Possible values: - Text - ThreadActivity/TopicUpdate - ThreadActivity/AddMember - ThreadActivity/DeleteMember.

      Returns:
      the type value.
    • setType

      public ChatMessage setType(ChatMessageType type)
      Set the type property: Type of the chat message.

      Possible values: - Text - ThreadActivity/TopicUpdate - ThreadActivity/AddMember - ThreadActivity/DeleteMember.

      Parameters:
      type - the type value to set.
      Returns:
      the ChatMessage object itself.
    • getVersion

      public String getVersion()
      Get the version property: Version of the chat message.
      Returns:
      the version value.
    • setVersion

      public ChatMessage setVersion(String version)
      Set the version property: Version of the chat message.
      Parameters:
      version - the version to set.
      Returns:
      the ChatMessage object itself.
    • getContent

      public ChatMessageContent getContent()
      Get the content property: Content of the chat message.
      Returns:
      the content value.
    • setContent

      public ChatMessage setContent(ChatMessageContent content)
      Set the content property: Content of the chat message.
      Parameters:
      content - the content value to set.
      Returns:
      the ChatMessage object itself.
    • getSenderDisplayName

      public String getSenderDisplayName()
      Get the senderDisplayName property: The display name of the chat message sender. This property is used to populate sender name for push notifications.
      Returns:
      the senderDisplayName value.
    • setSenderDisplayName

      public ChatMessage setSenderDisplayName(String senderDisplayName)
      Set the senderDisplayName property: The display name of the chat message sender. This property is used to populate sender name for push notifications.
      Parameters:
      senderDisplayName - the senderDisplayName value to set.
      Returns:
      the ChatMessage object itself.
    • getCreatedOn

      public OffsetDateTime getCreatedOn()
      Get the createdOn property: The timestamp when the chat message arrived at the server. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.
      Returns:
      the createdOn value.
    • setCreatedOn

      public ChatMessage setCreatedOn(OffsetDateTime createdOn)
      Set the createdOn property: The timestamp when the chat message arrived at the server. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.
      Parameters:
      createdOn - the createdOn value to set.
      Returns:
      the ChatMessage object itself.
    • getSender

      public CommunicationIdentifier getSender()
      Get the sender property: Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set.
      Returns:
      the sender value.
    • setSender

      public ChatMessage setSender(CommunicationIdentifier sender)
      Set the sender property: Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set.
      Parameters:
      sender - the sender value to set.
      Returns:
      the ChatMessage object itself.
    • getDeletedOn

      public OffsetDateTime getDeletedOn()
      Get the deletedOn property: The timestamp when the chat message was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.
      Returns:
      the deletedOn value.
    • setDeletedOn

      public ChatMessage setDeletedOn(OffsetDateTime deletedOn)
      Set the deletedOn property: The timestamp when the chat message was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.
      Parameters:
      deletedOn - the deletedOn value to set.
      Returns:
      the ChatMessage object itself.
    • getEditedOn

      public OffsetDateTime getEditedOn()
      Get the editedOn property: The timestamp when the chat message was edited. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.
      Returns:
      the editedOn value.
    • setEditedOn

      public ChatMessage setEditedOn(OffsetDateTime editedOn)
      Set the editedOn property: The timestamp when the chat message was edited. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.
      Parameters:
      editedOn - the editedOn value to set.
      Returns:
      the ChatMessage object itself.
    • getMetadata

      public Map<String,String> getMetadata()
      Get the metadata property: Message metadata.
      Returns:
      the metadata value.
    • setMetadata

      public ChatMessage setMetadata(Map<String,String> metadata)
      Set the metadata property: Message metadata.
      Parameters:
      metadata - the metadata value to set.
      Returns:
      the ChatMessage object itself.