Package com.vonage.client.verify2
Class TemplateFragment
java.lang.Object
com.vonage.client.JsonableBaseObject
com.vonage.client.verify2.TemplateFragment
- All Implemented Interfaces:
Jsonable
Represents a custom template fragment.
- Since:
- 8.13.0
-
Constructor Summary
ConstructorsConstructorDescriptionTemplateFragment(FragmentChannel channel, String locale, String text) Create a new template fragment. -
Method Summary
Modifier and TypeMethodDescriptionChannel type for the template.Timestamp of when the template fragment was created.Timestamp of when the template fragment was last updated.Unique fragment identifier.Template Locale in IETF BCP 47 format.Unique identifier of the template this fragment belongs to.getText()Text content of the template.voidupdateFromJson(String json) Updates this class's fields from the JSON payload.Methods inherited from class com.vonage.client.JsonableBaseObject
createJsonObjectMapper, equals, hashCode, toString
-
Constructor Details
-
TemplateFragment
Create a new template fragment. All parameters are required.- Parameters:
channel- Channel type for the template.locale- BCP-47 locale for the template.text- Text content of the template. There are 4 reserved variables available to use:${code},${brand},${time-limit}and${time-limit-unit}.
-
-
Method Details
-
getText
Text content of the template.- Returns:
- The template fragment text.
-
getLocale
Template Locale in IETF BCP 47 format.- Returns:
- The locale as an object, or
nullif this is an update request.
-
getChannel
Channel type for the template.- Returns:
- The channel as an enum, or
nullif this is an update request.
-
getFragmentId
Unique fragment identifier.- Returns:
- The template fragment ID, or
nullif this is a request object.
-
getTemplateId
Unique identifier of the template this fragment belongs to.- Returns:
- The parent template's ID, or
nullif unknown.
-
getDateCreated
Timestamp of when the template fragment was created.- Returns:
- The creation date-time in ISO-8601 format, or
nullif this is a request object.
-
getDateUpdated
Timestamp of when the template fragment was last updated.- Returns:
- The latest update time in ISO-8601 format, or
nullif this is a request object.
-
updateFromJson
Description copied from interface:JsonableUpdates this class's fields from the JSON payload.- Parameters:
json- The JSON string.
-