Class WhatsAppMessageTemplateItem

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

public final class WhatsAppMessageTemplateItem extends MessageTemplateItem
The WhatsApp-specific template response contract.
  • Method Details

    • getKind

      public CommunicationMessagesChannel getKind()
      Get the kind property: The type discriminator describing a template type.
      Overrides:
      getKind in class MessageTemplateItem
      Returns:
      the kind value.
    • getContent

      public com.azure.core.util.BinaryData getContent()
      Get the content property: WhatsApp platform's template content. This is the payload returned from WhatsApp API.
      Returns:
      the content 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>
      Overrides:
      toJson in class MessageTemplateItem
      Throws:
      IOException
    • fromJson

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