Interface TemplatesService


public interface TemplatesService
Templates Service
  • Method Details

    • copyVersion

      VersionDetails copyVersion(String domainName, String templateName, String versionName, String newVersionName) throws ApiException
      Copy a version (using default parameters)

      Copies an existing version into a new version with the provided name.

      Parameters:
      domainName - Domain name the template is associated with. (required)
      templateName - template name the version is stored under. (required)
      versionName - Tag of the version to copy. (required)
      newVersionName - The name for the new version. If the version name already exists, it will be overridden. (required)
      Returns:
      VersionDetails
      Throws:
      ApiException - if fails to make API call
    • copyVersion

      VersionDetails copyVersion(String domainName, String templateName, String versionName, String newVersionName, CopyVersionQueryParameters queryParameter) throws ApiException
      Copy a version

      Copies an existing version into a new version with the provided name.

      Parameters:
      domainName - Domain name the template is associated with. (required)
      templateName - template name the version is stored under. (required)
      versionName - Tag of the version to copy. (required)
      newVersionName - The name for the new version. If the version name already exists, it will be overridden. (required)
      queryParameter - (optional)
      Returns:
      VersionDetails
      Throws:
      ApiException - if fails to make API call
    • create

      Template create(String domainName, CreateTemplateRequest requestParameters) throws ApiException
      Create a template

      Store a new template, including its name, description and (optionally) the template content. If the template content is provided, a new version is automatically created and becomes the active version.

      Parameters:
      domainName - Domain name the template is associated with. (required)
      requestParameters - Request parameters
      Returns:
      Template
      Throws:
      ApiException - if fails to make API call
    • createWithActiveVersion

      Pair<Template,VersionDetails> createWithActiveVersion(String domainName, CreateTemplateRequest templateRequestParameters, CreateVersionRequest versionRequestParameters) throws ApiException
      Create a template

      Store a new template, including its name, description and the template content. A new version is automatically created and becomes the active version.

      Parameters:
      domainName - Domain name the template is associated with. (required)
      templateRequestParameters - Template parameters for creation
      versionRequestParameters - Version parameters for creation. The active field will be ignored and created version will become active
      Returns:
      Information about created Template and Version
      Throws:
      ApiException - if fails to make API call
    • createVersion

      VersionDetails createVersion(String domainName, String templateName, CreateVersionRequest requestParameters) throws ApiException
      Create a template version

      Adds a new template version. If the template doesn’t contain any other versions, the first version becomes active. A template can store up to 40 versions.

      Parameters:
      domainName - Domain name the template is associated with. (required)
      templateName - template name to create the new version for. (required)
      requestParameters - Request parameters
      Returns:
      VersionDetails
      Throws:
      ApiException - if fails to make API call
    • delete

      void delete(String domainName, String templateName) throws ApiException
      Delete a template

      Delete the template specified in the url. NOTE: This method deletes all versions of the specified template.

      Parameters:
      domainName - Domain name the template is associated with. (required)
      templateName - template name to be deleted. (required)
      Throws:
      ApiException - if fails to make API call
    • deleteAll

      void deleteAll(String domainName) throws ApiException
      Delete all templates

      Delete all templates and their versions for the domain.

      Parameters:
      domainName - Domain name the template is associated with. (required)
      Throws:
      ApiException - if fails to make API call
    • deleteVersion

      void deleteVersion(String domainName, String templateName, String versionName) throws ApiException
      Delete a version

      Delete a specific template version.

      Parameters:
      domainName - Domain name the template is associated with. (required)
      templateName - template name the version is stored under. (required)
      versionName - Tag of the version of the template to be deleted. (required)
      Throws:
      ApiException - if fails to make API call
    • get

      Template get(String domainName, String templateName) throws ApiException
      Get template (using default parameters)

      Returns metadata information about the stored template specified in the url. If the active flag is provided, the content of the active version of the template is returned.

      Parameters:
      domainName - Domain name the template is stored under. (required)
      templateName - Template name to fetch. (required)
      Returns:
      Template
      Throws:
      ApiException - if fails to make API call
    • getActiveVersion

      VersionDetails getActiveVersion(String domainName, String templateName) throws ApiException
      Get Template's active version
      Parameters:
      domainName - Domain name the template is stored under. (required)
      templateName - Template name to fetch. (required)
      Returns:
      VersionDetails
      Throws:
      ApiException - if fails to make API call
    • getVersion

      VersionDetails getVersion(String domainName, String templateName, String versionName) throws ApiException
      Get a version

      Retrieve the information and content of the specified version of a template.

      Parameters:
      domainName - Domain name the template is stored under. (required)
      templateName - template name the version is for. (required)
      versionName - Tag of the version of the template to fetch. (required)
      Returns:
      VersionDetails
      Throws:
      ApiException - if fails to make API call
    • list

      ListTemplatesResponse list(String domainName) throws ApiException
      Get templates (using default parameters)

      Returns a list of templates for the domain.

      Parameters:
      domainName - Domain name to fetch the templates for. (required)
      Returns:
      ListTemplatesResponse
      Throws:
      ApiException - if fails to make API call
    • list

      ListTemplatesResponse list(String domainName, ListTemplatesQueryParameters queryParameter) throws ApiException
      Get templates

      Returns a list of templates for the domain.

      Parameters:
      domainName - Domain name to fetch the templates for. (required)
      queryParameter - (optional)
      Returns:
      ListTemplatesResponse
      Throws:
      ApiException - if fails to make API call
    • listVersions

      ListVersionsResponse listVersions(String domainName, String templateName) throws ApiException
      Get all template versions (using default parameters)

      Returns a paginated list of template versions.

      Parameters:
      domainName - Domain name to fetch the templates for. (required)
      templateName - template name to fetch the versions for. (required)
      Returns:
      ListVersionsResponse
      Throws:
      ApiException - if fails to make API call
    • listVersions

      ListVersionsResponse listVersions(String domainName, String templateName, ListVersionsQueryParameters queryParameter) throws ApiException
      Get all template versions

      Returns a paginated list of template versions.

      Parameters:
      domainName - Domain name to fetch the templates for. (required)
      templateName - template name to fetch the versions for. (required)
      queryParameter - (optional)
      Returns:
      ListVersionsResponse
      Throws:
      ApiException - if fails to make API call
    • update

      void update(String domainName, String templateName, UpdateTemplateRequest requestParameters) throws ApiException
      Update template

      Update the description of a template.

      Parameters:
      domainName - Domain name the template is associated with. (required)
      templateName - The template name. (required)
      requestParameters - Request parameters
      Throws:
      ApiException - if fails to make API call
    • updateVersion

      void updateVersion(String domainName, String templateName, String versionName, UpdateVersionRequest requestParameters) throws ApiException
      Update a version

      Update information or content of the specific template version. Existing fields not included in the request will not be changed

      Parameters:
      domainName - Domain name the template is associated with. (required)
      templateName - template name the version is stored under. (required)
      versionName - Tag of the version of the template to be updated (required)
      requestParameters - Request parameters
      Throws:
      ApiException - if fails to make API call