Class MessageTemplateItem

java.lang.Object
com.azure.communication.messages.models.MessageTemplateItem
All Implemented Interfaces:
com.azure.json.JsonSerializable<MessageTemplateItem>
Direct Known Subclasses:
WhatsAppMessageTemplateItem

public abstract class MessageTemplateItem extends Object implements com.azure.json.JsonSerializable<MessageTemplateItem>
The message template as returned from the service.
  • Constructor Details

    • MessageTemplateItem

      protected MessageTemplateItem(String language, MessageTemplateStatus status)
      Creates an instance of MessageTemplateItem class.
      Parameters:
      language - the language value to set.
      status - the status value to set.
  • Method Details

    • getKind

      public CommunicationMessagesChannel getKind()
      Get the kind property: The type discriminator describing a template type.
      Returns:
      the kind value.
    • getName

      public String getName()
      Get the name property: The template's name.
      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.
    • getStatus

      public MessageTemplateStatus getStatus()
      Get the status property: The aggregated template status.
      Returns:
      the status value.
    • toJson

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

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