Class TemplateFragment

java.lang.Object
com.vonage.client.JsonableBaseObject
com.vonage.client.verify2.TemplateFragment
All Implemented Interfaces:
Jsonable

public final class TemplateFragment extends JsonableBaseObject
Represents a custom template fragment.
Since:
8.13.0
  • Constructor Details

    • TemplateFragment

      public TemplateFragment(FragmentChannel channel, String locale, String text)
      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

      public String getText()
      Text content of the template.
      Returns:
      The template fragment text.
    • getLocale

      public Locale getLocale()
      Template Locale in IETF BCP 47 format.
      Returns:
      The locale as an object, or null if this is an update request.
    • getChannel

      Channel type for the template.
      Returns:
      The channel as an enum, or null if this is an update request.
    • getFragmentId

      public UUID getFragmentId()
      Unique fragment identifier.
      Returns:
      The template fragment ID, or null if this is a request object.
    • getTemplateId

      public UUID getTemplateId()
      Unique identifier of the template this fragment belongs to.
      Returns:
      The parent template's ID, or null if unknown.
    • getDateCreated

      Timestamp of when the template fragment was created.
      Returns:
      The creation date-time in ISO-8601 format, or null if 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 null if this is a request object.
    • updateFromJson

      public void updateFromJson(String json)
      Description copied from interface: Jsonable
      Updates this class's fields from the JSON payload.
      Parameters:
      json - The JSON string.