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 Summary
ConstructorsConstructorDescriptionMessageTemplate
(String name, String language) Creates an instance of MessageTemplate class. -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageTemplate
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of MessageTemplate from the JsonReader.Get the bindings property: The binding object to link values to the template specific locations.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'.getName()
Get the name property: Name of the template.Get the values property: The template values.setBindings
(MessageTemplateBindings bindings) Set the bindings property: The binding object to link values to the template specific locations.setValues
(List<MessageTemplateValue> values) Set the values property: The template values.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
MessageTemplate
Creates an instance of MessageTemplate class.- Parameters:
name
- the name value to set.language
- the language value to set.
-
-
Method Details
-
getName
Get the name property: Name of the template.- Returns:
- the name value.
-
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
Get the values property: The template values.- Returns:
- the values value.
-
setValues
Set the values property: The template values.- Parameters:
values
- the values value to set.- Returns:
- the MessageTemplate object itself.
-
getBindings
Get the bindings property: The binding object to link values to the template specific locations.- Returns:
- the bindings value.
-
setBindings
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
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<MessageTemplate>
- Throws:
IOException
-
fromJson
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.
-