Class TextNotificationContent

java.lang.Object
com.azure.communication.messages.models.NotificationContent
com.azure.communication.messages.models.TextNotificationContent
All Implemented Interfaces:
com.azure.json.JsonSerializable<NotificationContent>

public final class TextNotificationContent extends NotificationContent
A request to send a text notification.
  • Constructor Details

    • TextNotificationContent

      public TextNotificationContent(String channelRegistrationId, List<String> to, String content)
      Creates an instance of TextNotificationContent class.
      Parameters:
      channelRegistrationId - the channelRegistrationId value to set.
      to - the to value to set.
      content - the content value to set.
  • Method Details

    • getKind

      public CommunicationMessageKind getKind()
      Get the kind property: The type discriminator describing a notification type.
      Overrides:
      getKind in class NotificationContent
      Returns:
      the kind value.
    • getContent

      public String getContent()
      Get the content property: Message content.
      Returns:
      the content value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<NotificationContent>
      Overrides:
      toJson in class NotificationContent
      Throws:
      IOException
    • fromJson

      public static TextNotificationContent fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of TextNotificationContent from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of TextNotificationContent if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the TextNotificationContent.