Class NotificationContent

java.lang.Object
com.azure.communication.messages.models.NotificationContent
All Implemented Interfaces:
com.azure.json.JsonSerializable<NotificationContent>
Direct Known Subclasses:
AudioNotificationContent, DocumentNotificationContent, ImageNotificationContent, MediaNotificationContent, TemplateNotificationContent, TextNotificationContent, VideoNotificationContent

public abstract class NotificationContent extends Object implements com.azure.json.JsonSerializable<NotificationContent>
Details of the message to send.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    NotificationContent(String channelRegistrationId, List<String> to)
    Creates an instance of NotificationContent class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of NotificationContent from the JsonReader.
    Get the channelRegistrationId property: The Channel Registration ID for the Business Identifier.
    Get the kind property: The type discriminator describing a notification type.
    Get the to property: The native external platform user identifiers of the recipient.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • NotificationContent

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

    • getKind

      public CommunicationMessageKind getKind()
      Get the kind property: The type discriminator describing a notification type.
      Returns:
      the kind value.
    • getChannelRegistrationId

      public String getChannelRegistrationId()
      Get the channelRegistrationId property: The Channel Registration ID for the Business Identifier.
      Returns:
      the channelRegistrationId value.
    • getTo

      public List<String> getTo()
      Get the to property: The native external platform user identifiers of the recipient.
      Returns:
      the to 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>
      Throws:
      IOException
    • fromJson

      public static NotificationContent fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of NotificationContent from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of NotificationContent 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 NotificationContent.