Class MessageTemplateText

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

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

    • MessageTemplateText

      public MessageTemplateText(String refValue, String text)
      Creates an instance of MessageTemplateText class.
      Parameters:
      refValue - the refValue value to set.
      text - the text 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.
    • getText

      public String getText()
      Get the text property: The text value.
      Returns:
      the text value.
    • 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 MessageTemplateText fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of MessageTemplateText from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of MessageTemplateText 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 MessageTemplateText.