Class MessageTemplate

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

public final class MessageTemplate extends Object implements com.azure.json.JsonSerializable<MessageTemplate>
The template object used to create templates.
  • Constructor Details

    • MessageTemplate

      public MessageTemplate(String name, String language)
      Creates an instance of MessageTemplate class.
      Parameters:
      name - the name value to set.
      language - the language value to set.
  • Method Details

    • getName

      public String getName()
      Get the name property: Name of the template.
      Returns:
      the name value.
    • getLanguage

      public String getLanguage()
      Get the language property: The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'.
      Returns:
      the language value.
    • getValues

      public List<MessageTemplateValue> getValues()
      Get the values property: The template values.
      Returns:
      the values value.
    • setValues

      public MessageTemplate setValues(List<MessageTemplateValue> values)
      Set the values property: The template values.
      Parameters:
      values - the values value to set.
      Returns:
      the MessageTemplate object itself.
    • getBindings

      public MessageTemplateBindings getBindings()
      Get the bindings property: The binding object to link values to the template specific locations.
      Returns:
      the bindings value.
    • setBindings

      public MessageTemplate setBindings(MessageTemplateBindings bindings)
      Set the bindings property: The binding object to link values to the template specific locations.
      Parameters:
      bindings - the bindings value to set.
      Returns:
      the MessageTemplate 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<MessageTemplate>
      Throws:
      IOException
    • fromJson

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