Class MessageTemplateDocument

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

public final class MessageTemplateDocument extends MessageTemplateValue
The message template's document value information.
  • Constructor Details

    • MessageTemplateDocument

      public MessageTemplateDocument(String refValue, String url)
      Creates an instance of MessageTemplateDocument class.
      Parameters:
      refValue - the refValue value to set.
      url - the url value to set.
  • Method Details

    • getKind

      public MessageTemplateValueKind getKind()
      Get the kind property: The type discriminator describing a template parameter type.
      Overrides:
      getKind in class MessageTemplateValue
      Returns:
      the kind value.
    • getUrl

      public String getUrl()
      Get the url property: The (public) URL of the media.
      Returns:
      the url value.
    • getCaption

      public String getCaption()
      Get the caption property: The [optional] caption of the media object.
      Returns:
      the caption value.
    • setCaption

      public MessageTemplateDocument setCaption(String caption)
      Set the caption property: The [optional] caption of the media object.
      Parameters:
      caption - the caption value to set.
      Returns:
      the MessageTemplateDocument object itself.
    • getFileName

      public String getFileName()
      Get the fileName property: The [optional] filename of the media file.
      Returns:
      the fileName value.
    • setFileName

      public MessageTemplateDocument setFileName(String fileName)
      Set the fileName property: The [optional] filename of the media file.
      Parameters:
      fileName - the fileName value to set.
      Returns:
      the MessageTemplateDocument object itself.
    • toJson

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

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