Class DocumentNotificationContent

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

public final class DocumentNotificationContent extends NotificationContent
A request to send a document notification.
  • Constructor Details

    • DocumentNotificationContent

      public DocumentNotificationContent(String channelRegistrationId, List<String> to, String mediaUrl)
      Creates an instance of DocumentNotificationContent class.
      Parameters:
      channelRegistrationId - the channelRegistrationId value to set.
      to - the to value to set.
      mediaUrl - the mediaUrl 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.
    • getFileName

      public String getFileName()
      Get the fileName property: Optional name for the file.
      Returns:
      the fileName value.
    • setFileName

      public DocumentNotificationContent setFileName(String fileName)
      Set the fileName property: Optional name for the file.
      Parameters:
      fileName - the fileName value to set.
      Returns:
      the DocumentNotificationContent object itself.
    • getMediaUrl

      public String getMediaUrl()
      Get the mediaUrl property: A media url for the file. Required if the type is one of the supported media types, e.g. image.
      Returns:
      the mediaUrl 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 DocumentNotificationContent fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of DocumentNotificationContent from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of DocumentNotificationContent 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 DocumentNotificationContent.
    • getCaption

      public String getCaption()
      Get the caption property: Optional text content.
      Returns:
      the caption value.
    • setCaption

      public DocumentNotificationContent setCaption(String caption)
      Set the caption property: Optional text content.
      Parameters:
      caption - the caption value to set.
      Returns:
      the DocumentNotificationContent object itself.