diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.api.server.notification.template.common/pom.xml b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.api.server.notification.template.common/pom.xml
new file mode 100644
index 0000000000..3d5c2f73d1
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.api.server.notification.template.common/pom.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+ org.wso2.carbon.identity.server.api
+ org.wso2.carbon.identity.api.server.notification.template
+ 1.2.241-SNAPSHOT
+ ../pom.xml
+
+
+ 4.0.0
+ org.wso2.carbon.identity.api.server.notification.template.common
+ jar
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ 1.8
+
+
+
+
+
+
+
+ javax.ws.rs
+ javax.ws.rs-api
+ provided
+
+
+ org.wso2.carbon.identity.event.handler.notification
+ org.wso2.carbon.email.mgt
+
+
+ org.springframework
+ spring-web
+ provided
+
+
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.api.server.notification.template.common/src/main/java/org/wso2/carbon/identity/api/server/notification/template/common/Constants.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.api.server.notification.template.common/src/main/java/org/wso2/carbon/identity/api/server/notification/template/common/Constants.java
new file mode 100644
index 0000000000..33b18b13e2
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.api.server.notification.template.common/src/main/java/org/wso2/carbon/identity/api/server/notification/template/common/Constants.java
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.api.server.notification.template.common;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.ws.rs.core.Response.Status;
+
+import static org.wso2.carbon.email.mgt.constants.TemplateMgtConstants.ErrorCodes.ERROR_ADDING_TEMPLATE;
+import static org.wso2.carbon.email.mgt.constants.TemplateMgtConstants.ErrorCodes.ERROR_RESOLVING_MAIN_APPLICATION;
+import static org.wso2.carbon.email.mgt.constants.TemplateMgtConstants.ErrorCodes
+ .ERROR_SYSTEM_RESOURCE_DELETION_NOT_ALLOWED;
+import static org.wso2.carbon.email.mgt.constants.TemplateMgtConstants.ErrorCodes.TEMPLATE_ALREADY_EXISTS;
+import static org.wso2.carbon.email.mgt.constants.TemplateMgtConstants.ErrorCodes.TEMPLATE_NOT_FOUND;
+import static org.wso2.carbon.email.mgt.constants.TemplateMgtConstants.ErrorCodes.TEMPLATE_TYPE_ALREADY_EXISTS;
+import static org.wso2.carbon.email.mgt.constants.TemplateMgtConstants.ErrorCodes.TEMPLATE_TYPE_NOT_FOUND;
+
+/**
+ * Constants related to notification templates.
+ */
+public class Constants {
+
+ public static final String NOTIFICATION_TEMPLATES_ERROR_CODE_PREFIX = "NTM-";
+ public static final String NOTIFICATION_TEMPLATES_API_BASE_PATH_EMAIL = "/email";
+ public static final String NOTIFICATION_TEMPLATES_API_BASE_PATH_SMS = "/sms";
+ public static final String NOTIFICATION_TEMPLATES_API_PATH = "/notification";
+ public static final String TEMPLATE_TYPES_PATH = "/template-types";
+ public static final String APP_TEMPLATES_PATH = "/app-templates";
+ public static final String ORG_TEMPLATES_PATH = "/org-templates";
+ public static final String SYSTEM_TEMPLATES_PATH = "/system-templates";
+ public static final String PATH_SEPARATOR = "/";
+ public static final String NOTIFICATION_CHANNEL_EMAIL = "EMAIL";
+ public static final String NOTIFICATION_CHANNEL_SMS = "SMS";
+ public static final String NOTIFICATION_TEMPLATE_OWNER_APP = "APP";
+ public static final String NOTIFICATION_TEMPLATE_OWNER_ORG = "ORG";
+ public static final String NOTIFICATION_TEMPLATE_OWNER_SYSTEM = "SYSTEM";
+
+ // ERROR MESSAGES
+ private static final Map NTM_ERROR_CODE_MAP = new HashMap<>();
+
+ /**
+ * Enum for error messages.
+ */
+ public enum ErrorMessage {
+
+ ERROR_TEMPLATE_TYPE_ALREADY_EXISTS("65001", Status.CONFLICT,
+ "Template Type already exists in the system.",
+ "A template type for the provided template display name already exists " +
+ "in the system."),
+ ERROR_TEMPLATE_TYPE_NOT_FOUND("65002", Status.NOT_FOUND,
+ "Template Type does not exist.",
+ "Specified template type does not exist in the system."),
+ ERROR_TEMPLATE_ALREADY_EXISTS("65003", Status.CONFLICT,
+ "Template already exists in the system.",
+ "A template for the provided template id already exists in the system."),
+ ERROR_TEMPLATE_NOT_FOUND("65004", Status.NOT_FOUND,
+ "Template does not exist.",
+ "Specified template does not exist in the system."),
+ ERROR_ERROR_RETRIEVING_TEMPLATE_TYPES("60002", Status.INTERNAL_SERVER_ERROR,
+ "Unable to retrieve template types.",
+ "Server encountered an error while retrieving template types."),
+ ERROR_ERROR_RETRIEVING_TEMPLATE_TYPE("60003", Status.INTERNAL_SERVER_ERROR,
+ "Unable to retrieve the template type.",
+ "Server encountered an error while retrieving the template " +
+ "type identified by the given template-type-id."),
+ ERROR_ERROR_ADDING_TEMPLATE_TYPE("60004", Status.INTERNAL_SERVER_ERROR,
+ "Unable to add the template type.",
+ "Server encountered an error while adding template type."),
+ ERROR_ERROR_DELETING_TEMPLATE_TYPE("60005", Status.INTERNAL_SERVER_ERROR,
+ "Unable to delete the template type.",
+ "Server encountered an error while deleting the template type."),
+ ERROR_ERROR_ADDING_TEMPLATE("60006", Status.INTERNAL_SERVER_ERROR,
+ "Unable to add the template.",
+ "Server encountered an error while adding the template to the system."),
+ ERROR_ERROR_UPDATING_TEMPLATE("60007", Status.INTERNAL_SERVER_ERROR,
+ "Unable to update the template.",
+ "Server encountered an error while updating the template."),
+ ERROR_ERROR_RETRIEVING_TEMPLATE("60008", Status.INTERNAL_SERVER_ERROR,
+ "Unable to retrieve the template.",
+ "Server encountered an error while retrieving the template " +
+ "identified by the given template-type-id and the template-id."),
+ ERROR_ERROR_DELETING_EMAIL_TEMPLATE("60009", Status.INTERNAL_SERVER_ERROR,
+ "Unable to delete the email template.",
+ "Server encountered an error while deleting the email template."),
+ ERROR_ERROR_DELETING_SMS_TEMPLATE("60010", Status.INTERNAL_SERVER_ERROR,
+ "Unable to delete the SMS template.",
+ "Server encountered an error while deleting the SMS template."),
+ ERROR_ERROR_RETRIEVING_TEMPLATES("60012", Status.INTERNAL_SERVER_ERROR,
+ "Unable to retrieve templates.",
+ "Server encountered an error while retrieving templates."),
+ ERROR_ERROR_RESETTING_TEMPLATE_TYPE("60013", Status.INTERNAL_SERVER_ERROR,
+ "Unable to reset the template type.",
+ "Server encountered an error while deleting the templates of the template type."),
+ ERROR_ERROR_RESOLVING_MAIN_APPLICATION("60014", Status.INTERNAL_SERVER_ERROR,
+ "Unable to resolve the main application.",
+ "Server encountered an error while resolving the main application."),
+ ERROR_ERROR_INVALID_NOTIFICATION_CHANNEL("60015", Status.BAD_REQUEST,
+ "Invalid notification channel.",
+ "Notification channel can only be either 'EMAIL' or 'SMS'."),
+ ERROR_ERROR_SYSTEM_RESOURCE_DELETION_NOT_ALLOWED("60016", Status.FORBIDDEN,
+ "System resource deletion not allowed.",
+ "System resources cannot be deleted.");
+
+ private final String message;
+ private final Status httpStatus;
+ private final String code;
+ private final String description;
+
+ ErrorMessage(String code, Status httpStatus, String message, String description) {
+
+ this.code = code;
+ this.httpStatus = httpStatus;
+ this.message = message;
+ this.description = description;
+ }
+
+ public String getCode() {
+
+ return NOTIFICATION_TEMPLATES_ERROR_CODE_PREFIX + code;
+ }
+
+ public String getMessage() {
+
+ return message;
+ }
+
+ public String getDescription() {
+
+ return description;
+ }
+
+ public Status getHttpStatus() {
+
+ return httpStatus;
+ }
+
+ @Override
+ public String toString() {
+
+ return code + " | " + message;
+ }
+ }
+
+ static {
+ NTM_ERROR_CODE_MAP.put(TEMPLATE_TYPE_ALREADY_EXISTS, ErrorMessage.ERROR_TEMPLATE_TYPE_ALREADY_EXISTS);
+ NTM_ERROR_CODE_MAP.put(TEMPLATE_TYPE_NOT_FOUND, ErrorMessage.ERROR_TEMPLATE_TYPE_NOT_FOUND);
+ NTM_ERROR_CODE_MAP.put(TEMPLATE_ALREADY_EXISTS, ErrorMessage.ERROR_TEMPLATE_ALREADY_EXISTS);
+ NTM_ERROR_CODE_MAP.put(TEMPLATE_NOT_FOUND, ErrorMessage.ERROR_TEMPLATE_NOT_FOUND);
+ NTM_ERROR_CODE_MAP.put(ERROR_ADDING_TEMPLATE, ErrorMessage.ERROR_ERROR_ADDING_TEMPLATE);
+ NTM_ERROR_CODE_MAP.put(ERROR_RESOLVING_MAIN_APPLICATION, ErrorMessage.ERROR_ERROR_RESOLVING_MAIN_APPLICATION);
+ NTM_ERROR_CODE_MAP.put(ERROR_SYSTEM_RESOURCE_DELETION_NOT_ALLOWED,
+ ErrorMessage.ERROR_ERROR_SYSTEM_RESOURCE_DELETION_NOT_ALLOWED);
+ }
+
+ public static ErrorMessage getNTMMappedErrorMessage(String errorCode) {
+
+ return NTM_ERROR_CODE_MAP.get(errorCode);
+ }
+}
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.api.server.notification.template.common/src/main/java/org/wso2/carbon/identity/api/server/notification/template/common/TemplatesServiceHolder.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.api.server.notification.template.common/src/main/java/org/wso2/carbon/identity/api/server/notification/template/common/TemplatesServiceHolder.java
new file mode 100644
index 0000000000..257949be90
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.api.server.notification.template.common/src/main/java/org/wso2/carbon/identity/api/server/notification/template/common/TemplatesServiceHolder.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.api.server.notification.template.common;
+
+
+import org.wso2.carbon.identity.governance.service.notification.NotificationTemplateManager;
+
+/**
+ * This class is used to hold the TemplateManager service.
+ */
+public class TemplatesServiceHolder {
+
+ private static NotificationTemplateManager notificationTemplateManager;
+
+ /**
+ * Get TemplateManager osgi service.
+ * @return TemplateManager
+ */
+ public static NotificationTemplateManager getNotificationTemplateManager() {
+
+ return notificationTemplateManager;
+ }
+
+ /**
+ * Set TemplateManager osgi service.
+ * @param notificationTemplateManager TemplateManager
+ */
+ public static void setNotificationTemplateManager(NotificationTemplateManager notificationTemplateManager) {
+
+ TemplatesServiceHolder.notificationTemplateManager = notificationTemplateManager;
+ }
+}
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.api.server.notification.template.common/src/main/java/org/wso2/carbon/identity/api/server/notification/template/common/factory/OSGIServiceFactory.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.api.server.notification.template.common/src/main/java/org/wso2/carbon/identity/api/server/notification/template/common/factory/OSGIServiceFactory.java
new file mode 100644
index 0000000000..72d43c991e
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.api.server.notification.template.common/src/main/java/org/wso2/carbon/identity/api/server/notification/template/common/factory/OSGIServiceFactory.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.api.server.notification.template.common.factory;
+
+import org.springframework.beans.factory.config.AbstractFactoryBean;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
+import org.wso2.carbon.email.mgt.constants.I18nMgtConstants;
+import org.wso2.carbon.identity.governance.service.notification.NotificationTemplateManager;
+
+import java.util.Hashtable;
+
+/**
+ * Factory Beans serves as a factory for creating other beans within the IOC container. This factory bean is used to
+ * instantiate the NotificationTemplateManager type of object inside the container.
+ */
+public class OSGIServiceFactory extends AbstractFactoryBean {
+
+ private NotificationTemplateManager notificationTemplateManager;
+
+ @Override
+ public Class> getObjectType() {
+ return Object.class;
+ }
+
+ @Override
+ protected NotificationTemplateManager createInstance() throws Exception {
+
+ if (this.notificationTemplateManager == null) {
+ Hashtable serviceProperties = new Hashtable<>();
+ serviceProperties.put(I18nMgtConstants.SERVICE_PROPERTY_KEY_SERVICE_NAME,
+ I18nMgtConstants.SERVICE_PROPERTY_VAL_NOTIFICATION_TEMPLATE_MANAGER);
+ NotificationTemplateManager taskOperationService = (NotificationTemplateManager) PrivilegedCarbonContext.
+ getThreadLocalCarbonContext().getOSGiService(NotificationTemplateManager.class, serviceProperties);
+ if (taskOperationService != null) {
+ this.notificationTemplateManager = taskOperationService;
+ } else {
+ throw new Exception("Unable to retrieve NotificationTemplateManager service.");
+ }
+ }
+ return this.notificationTemplateManager;
+ }
+}
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/pom.xml
new file mode 100644
index 0000000000..65b93eb30c
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/pom.xml
@@ -0,0 +1,180 @@
+
+
+
+
+
+ org.wso2.carbon.identity.server.api
+ org.wso2.carbon.identity.api.server.notification.template
+ 1.2.241-SNAPSHOT
+
+
+ 4.0.0
+ org.wso2.carbon.identity.rest.api.server.notification.template.v1
+ jar
+
+ WSO2 Identity Server - Notification Templates Rest API v1
+ WSO2 Identity Server - Notification Templates Rest API v1
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ 1.8
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 1.8
+
+
+ add-source
+ generate-sources
+
+ add-source
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.apache.cxf
+ cxf-rt-frontend-jaxrs
+ provided
+
+
+ org.apache.cxf
+ cxf-rt-rs-service-description
+ provided
+
+
+ org.springframework
+ spring-web
+ provided
+
+
+ javax.ws.rs
+ javax.ws.rs-api
+ provided
+
+
+ io.swagger
+ swagger-jaxrs
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+
+
+ javax.ws.rs
+ jsr311-api
+
+
+ com.google.guava
+ guava
+
+
+
+
+ com.fasterxml.jackson.jaxrs
+ jackson-jaxrs-json-provider
+ provided
+
+
+ org.wso2.carbon.identity.event.handler.notification
+ org.wso2.carbon.email.mgt
+ provided
+
+
+ org.wso2.carbon.identity.server.api
+ org.wso2.carbon.identity.api.server.notification.template.common
+
+
+ org.wso2.carbon.identity.governance
+ org.wso2.carbon.identity.recovery
+ provided
+
+
+ javax.ws.rs
+ jsr311-api
+
+
+
+
+ org.wso2.carbon.identity.server.api
+ org.wso2.carbon.identity.api.server.common
+
+
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/NotificationApi.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/NotificationApi.java
new file mode 100644
index 0000000000..59c6729372
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/NotificationApi.java
@@ -0,0 +1,846 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.apache.cxf.jaxrs.ext.multipart.Attachment;
+import org.apache.cxf.jaxrs.ext.multipart.Multipart;
+import java.io.InputStream;
+import java.util.List;
+
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.EmailTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.EmailTemplateWithID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.Error;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SMSTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SMSTemplateWithID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SimpleTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SimpleTemplateTypeID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.TemplateTypeOverview;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.TemplateTypeWithID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.NotificationApiService;
+
+import javax.validation.Valid;
+import javax.ws.rs.*;
+import javax.ws.rs.core.Response;
+import io.swagger.annotations.*;
+
+import javax.validation.constraints.*;
+
+@Path("/notification")
+@Api(description = "The notification API")
+
+public class NotificationApi {
+
+ @Autowired
+ private NotificationApiService delegate;
+
+ @Valid
+ @POST
+ @Path("/email/template-types/{template-type-id}/app-templates/{app-uuid}")
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Adds a new application email template to an existing email template type.", notes = "Another application email template with the same locale should not already exist in the respective email template type.
Scope required:
* internal_email_mgt_create / internal_template_mgt_update ", response = SimpleTemplate.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Application Email Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 201, message = "Item Created", response = SimpleTemplate.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 409, message = "Item Already Exists.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response addAppEmailTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "Application UUID.",required=true) @PathParam("app-uuid") String appUuid, @ApiParam(value = "Email template to be added." ) @Valid EmailTemplateWithID emailTemplateWithID) {
+
+ return delegate.addAppEmailTemplate(templateTypeId, appUuid, emailTemplateWithID );
+ }
+
+ @Valid
+ @POST
+ @Path("/sms/template-types/{template-type-id}/app-templates/{app-uuid}")
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Adds a new application SMS template to an existing SMS template type.", notes = "Another application SMS template with the same locale should not already exist in the respective SMS template type.
Scope required:
* internal_template_mgt_create ", response = SimpleTemplate.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Application SMS Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 201, message = "Item Created", response = SimpleTemplate.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 409, message = "Item Already Exists.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response addAppSMSTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "Application UUID.",required=true) @PathParam("app-uuid") String appUuid, @ApiParam(value = "SMS template to be added." ) @Valid SMSTemplateWithID smSTemplateWithID) {
+
+ return delegate.addAppSMSTemplate(templateTypeId, appUuid, smSTemplateWithID );
+ }
+
+ @Valid
+ @POST
+ @Path("/email/template-types")
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Adds a new email template type.", notes = "Adds a new email template type to the system. An email template type can have any number of organization or application email templates.
* Attribute _**displayName**_ of the template type should be unique.
Scope required:
* internal_email_mgt_create / internal_template_mgt_update ", response = TemplateTypeWithID.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Email Template Types", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 201, message = "Item Created", response = TemplateTypeWithID.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 409, message = "Item Already Exists.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response addEmailTemplateType(@ApiParam(value = "Email template type to be added." ) @Valid TemplateTypeOverview templateTypeOverview) {
+
+ return delegate.addEmailTemplateType(templateTypeOverview );
+ }
+
+ @Valid
+ @POST
+ @Path("/email/template-types/{template-type-id}/org-templates")
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Adds a new organization email template to an existing email template type.", notes = "Another organization email template with the same locale should not already exist in the respective email template type.
Scope required:
* internal_email_mgt_create / internal_template_mgt_update ", response = SimpleTemplate.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Email Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 201, message = "Item Created", response = SimpleTemplate.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 409, message = "Item Already Exists.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response addOrgEmailTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "Email template to be added." ) @Valid EmailTemplateWithID emailTemplateWithID) {
+
+ return delegate.addOrgEmailTemplate(templateTypeId, emailTemplateWithID );
+ }
+
+ @Valid
+ @POST
+ @Path("/sms/template-types/{template-type-id}/org-templates")
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Adds a new organization SMS template to an existing SMS template type.", notes = "Another organization SMS template with the same locale should not already exist in the respective SMS template type.
Scope required:
* internal_template_mgt_create ", response = SimpleTemplate.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "SMS Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 201, message = "Item Created", response = SimpleTemplate.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 409, message = "Item Already Exists.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response addOrgSMSTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "SMS template to be added." ) @Valid SMSTemplateWithID smSTemplateWithID) {
+
+ return delegate.addOrgSMSTemplate(templateTypeId, smSTemplateWithID );
+ }
+
+ @Valid
+ @POST
+ @Path("/sms/template-types")
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Adds a new SMS template type.", notes = "Adds a new SMS template type to the system. A SMS template type can have any number of organization or application SMS templates.
* Attribute _**displayName**_ of the template type should be unique.
Scope required:
* internal_template_mgt_create ", response = TemplateTypeWithID.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "SMS Template Types", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 201, message = "Item Created", response = TemplateTypeWithID.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 409, message = "Item Already Exists.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response addSMSTemplateType(@ApiParam(value = "SMS template type to be added." ) @Valid TemplateTypeOverview templateTypeOverview) {
+
+ return delegate.addSMSTemplateType(templateTypeOverview );
+ }
+
+ @Valid
+ @DELETE
+ @Path("/email/template-types/{template-type-id}/app-templates/{app-uuid}/{locale}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Removes an application email template.", notes = "Removes an application email template identified by the template-type-id and the locale.
Scope required:
* internal_email_mgt_delete / internal_template_mgt_delete ", response = Void.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Application Email Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 204, message = "Item/s Deleted.", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response deleteAppEmailTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "Application UUID.",required=true) @PathParam("app-uuid") String appUuid, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale) {
+
+ return delegate.deleteAppEmailTemplate(templateTypeId, appUuid, locale );
+ }
+
+ @Valid
+ @DELETE
+ @Path("/sms/template-types/{template-type-id}/app-templates/{app-uuid}/{locale}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Removes a SMS template.", notes = "Removes a SMS template identified by the template-type-id and the locale.
Scope required:
* internal_template_mgt_delete ", response = Void.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Application SMS Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 204, message = "Item/s Deleted.", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response deleteAppSMSTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "Application UUID.",required=true) @PathParam("app-uuid") String appUuid, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale) {
+
+ return delegate.deleteAppSMSTemplate(templateTypeId, appUuid, locale );
+ }
+
+ @Valid
+ @DELETE
+ @Path("/email/template-types/{template-type-id}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Removes an email template type.", notes = "Removes an existing email template type with all its email templates from the system.
**Note : System resources are not eligible for deletion.**
Attempt to delete a system resource will result in a 403 Forbidden error.
Scope required:
* internal_email_mgt_delete / internal_template_mgt_delete ", response = Void.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Email Template Types", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 204, message = "Item/s Deleted.", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response deleteEmailTemplateType(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId) {
+
+ return delegate.deleteEmailTemplateType(templateTypeId );
+ }
+
+ @Valid
+ @DELETE
+ @Path("/email/template-types/{template-type-id}/org-templates/{locale}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Removes an organization email template.", notes = "Removes an organization email template identified by the template-type-id and the locale.
Scope required:
* internal_email_mgt_delete / internal_template_mgt_delete ", response = Void.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Email Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 204, message = "Item/s Deleted.", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response deleteOrgEmailTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale) {
+
+ return delegate.deleteOrgEmailTemplate(templateTypeId, locale );
+ }
+
+ @Valid
+ @DELETE
+ @Path("/sms/template-types/{template-type-id}/org-templates/{locale}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Removes an organization SMS template.", notes = "Removes an organization SMS template identified by the template-type-id and the locale.
Scope required:
* internal_template_mgt_delete ", response = Void.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "SMS Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 204, message = "Item/s Deleted.", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response deleteOrgSMSTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale) {
+
+ return delegate.deleteOrgSMSTemplate(templateTypeId, locale );
+ }
+
+ @Valid
+ @DELETE
+ @Path("/sms/template-types/{template-type-id}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Removes a SMS template type.", notes = "Removes an existing SMS template type with all its SMS templates from the system.
**Note : System resources are not eligible for deletion.**
Attempt to delete a system resource will result in a 403 Forbidden error.
Scope required:
* internal_template_mgt_delete ", response = Void.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "SMS Template Types", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 204, message = "Item/s Deleted.", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response deleteSMSTemplateType(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId) {
+
+ return delegate.deleteSMSTemplateType(templateTypeId );
+ }
+
+ @Valid
+ @GET
+ @Path("/email/template-types/{template-type-id}/app-templates/{app-uuid}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves the list of application email templates under the provided template type.", notes = "Retrieves the list of application email templates under the provided template type.
Scope required:
* internal_email_mgt_view / internal_template_mgt_view
", response = SimpleTemplate.class, responseContainer = "List", authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Application Email Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = SimpleTemplate.class, responseContainer = "List"),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getAllAppTemplatesOfEmailTemplateType(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "Application UUID.",required=true) @PathParam("app-uuid") String appUuid) {
+
+ return delegate.getAllAppTemplatesOfEmailTemplateType(templateTypeId, appUuid );
+ }
+
+ @Valid
+ @GET
+ @Path("/sms/template-types/{template-type-id}/app-templates/{app-uuid}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves the list of application SMS templates under the provided template type.", notes = "Retrieves the list of application SMS templates under the provided template type.
Scope required:
* internal_template_mgt_view
", response = SimpleTemplate.class, responseContainer = "List", authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Application SMS Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = SimpleTemplate.class, responseContainer = "List"),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getAllAppTemplatesOfSMSTemplateType(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "Application UUID.",required=true) @PathParam("app-uuid") String appUuid) {
+
+ return delegate.getAllAppTemplatesOfSMSTemplateType(templateTypeId, appUuid );
+ }
+
+ @Valid
+ @GET
+ @Path("/email/template-types")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves all the email template types.", notes = "Retrieves all the email template types in the system.
Scope required:
* internal_email_mgt_view / internal_template_mgt_view ", response = TemplateTypeWithID.class, responseContainer = "List", authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Email Template Types", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = TemplateTypeWithID.class, responseContainer = "List"),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getAllEmailTemplateTypes() {
+
+ return delegate.getAllEmailTemplateTypes();
+ }
+
+ @Valid
+ @GET
+ @Path("/email/template-types/{template-type-id}/org-templates")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves the list of organization email templates under the provided template type.", notes = "Retrieves the list of organization email templates under the provided template type.
Scope required:
* internal_email_mgt_view / internal_template_mgt_view
", response = SimpleTemplate.class, responseContainer = "List", authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Email Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = SimpleTemplate.class, responseContainer = "List"),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getAllOrgTemplatesOfEmailTemplateType(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId) {
+
+ return delegate.getAllOrgTemplatesOfEmailTemplateType(templateTypeId );
+ }
+
+ @Valid
+ @GET
+ @Path("/sms/template-types/{template-type-id}/org-templates")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves the list of organization SMS templates under the provided template type.", notes = "Retrieves the list of organization SMS templates under the provided templalte type.
Scope required:
* internal_template_mgt_view
", response = SimpleTemplate.class, responseContainer = "List", authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "SMS Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = SimpleTemplate.class, responseContainer = "List"),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getAllOrgTemplatesOfSMSTemplateType(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId) {
+
+ return delegate.getAllOrgTemplatesOfSMSTemplateType(templateTypeId );
+ }
+
+ @Valid
+ @GET
+ @Path("/sms/template-types")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves all the SMS template types.", notes = "Retrieves all the SMS template types in the system.
Scope required:
* internal_template_mgt_view ", response = TemplateTypeWithID.class, responseContainer = "List", authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "SMS Template Types", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = TemplateTypeWithID.class, responseContainer = "List"),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getAllSMSTemplateTypes() {
+
+ return delegate.getAllSMSTemplateTypes();
+ }
+
+ @Valid
+ @GET
+ @Path("/email/template-types/{template-type-id}/system-templates")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves the system email templates of template type.", notes = "Retrieves the list of system default email templates under the provided template type.
Scope required:
* internal_email_mgt_view / internal_template_mgt_view
", response = SimpleTemplate.class, responseContainer = "List", authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "System Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = SimpleTemplate.class, responseContainer = "List"),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getAllSystemTemplatesOfEmailTemplateType(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId) {
+
+ return delegate.getAllSystemTemplatesOfEmailTemplateType(templateTypeId );
+ }
+
+ @Valid
+ @GET
+ @Path("/sms/template-types/{template-type-id}/system-templates")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves the list of system SMS templates with the template type id.", notes = "Retrieves the list of system default SMS templates under the provided template type.
Scope required:
* internal_template_mgt_view
", response = SimpleTemplate.class, responseContainer = "List", authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "System Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = SimpleTemplate.class, responseContainer = "List"),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getAllSystemTemplatesOfSMSTemplateType(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId) {
+
+ return delegate.getAllSystemTemplatesOfSMSTemplateType(templateTypeId );
+ }
+
+ @Valid
+ @GET
+ @Path("/email/template-types/{template-type-id}/app-templates/{app-uuid}/{locale}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves a single email template of application.", notes = "Retrieves the application email template that matches to the template-type-id and the locale.
Scope required:
* internal_email_mgt_view / internal_template_mgt_view ", response = EmailTemplateWithID.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Application Email Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = EmailTemplateWithID.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getAppEmailTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "Application UUID.",required=true) @PathParam("app-uuid") String appUuid, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale) {
+
+ return delegate.getAppEmailTemplate(templateTypeId, appUuid, locale );
+ }
+
+ @Valid
+ @GET
+ @Path("/sms/template-types/{template-type-id}/app-templates/{app-uuid}/{locale}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves a single SMS template of application.", notes = "Retrieves the application SMS template that matches to the template-type-id and the locale.
Scope required:
* internal_template_mgt_view ", response = SMSTemplateWithID.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Application SMS Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = SMSTemplateWithID.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getAppSMSTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "Application UUID.",required=true) @PathParam("app-uuid") String appUuid, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale) {
+
+ return delegate.getAppSMSTemplate(templateTypeId, appUuid, locale );
+ }
+
+ @Valid
+ @GET
+ @Path("/email/template-types/{template-type-id}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves the email template type corresponding to the template type id.", notes = "Retrieves the email template type in the system identified by the template-type-id.
Scope required:
* internal_email_mgt_view / internal_template_mgt_view
", response = TemplateTypeWithID.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Email Template Types", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = TemplateTypeWithID.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getEmailTemplateType(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId) {
+
+ return delegate.getEmailTemplateType(templateTypeId );
+ }
+
+ @Valid
+ @GET
+ @Path("/email/template-types/{template-type-id}/org-templates/{locale}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves a single organization email template.", notes = "Retrieves the organization email template that matches to the template-type-id and the locale.
Scope required:
* internal_email_mgt_view / internal_template_mgt_view ", response = EmailTemplateWithID.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Email Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = EmailTemplateWithID.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getOrgEmailTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale) {
+
+ return delegate.getOrgEmailTemplate(templateTypeId, locale );
+ }
+
+ @Valid
+ @GET
+ @Path("/sms/template-types/{template-type-id}/org-templates/{locale}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves a single organization SMS template.", notes = "Retrieves the organization SMS template that matches to the template-type-id and the locale.
Scope required:
* internal_template_mgt_view ", response = SMSTemplateWithID.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "SMS Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = SMSTemplateWithID.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getOrgSMSTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale) {
+
+ return delegate.getOrgSMSTemplate(templateTypeId, locale );
+ }
+
+ @Valid
+ @GET
+ @Path("/sms/template-types/{template-type-id}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves the SMS template type corresponding to the template type id.", notes = "Retrieves the SMS template type in the system identified by the template-type-id.
Scope required:
* internal_template_mgt_view
", response = TemplateTypeWithID.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "SMS Template Types", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = TemplateTypeWithID.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getSMSTemplateType(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId) {
+
+ return delegate.getSMSTemplateType(templateTypeId );
+ }
+
+ @Valid
+ @GET
+ @Path("/email/template-types/{template-type-id}/system-templates/{locale}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves the default email template for given type and locale.", notes = "Retrieves the system default email template that matches the template-type-id and the locale.
Scope required:
* internal_email_mgt_view / internal_template_mgt_view ", response = EmailTemplateWithID.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "System Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = EmailTemplateWithID.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getSystemEmailTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale) {
+
+ return delegate.getSystemEmailTemplate(templateTypeId, locale );
+ }
+
+ @Valid
+ @GET
+ @Path("/sms/template-types/{template-type-id}/system-templates/{locale}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Retrieves the default organization SMS template.", notes = "Retrieves the system default SMS template that matches to the template-type-id and the locale.
Scope required:
* internal_template_mgt_view ", response = SMSTemplateWithID.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "System Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Search results matching the given criteria.", response = SMSTemplateWithID.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response getSystemSMSTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale) {
+
+ return delegate.getSystemSMSTemplate(templateTypeId, locale );
+ }
+
+ @Valid
+ @POST
+ @Path("/reset-template-type")
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Resets an template type.", notes = "Resets an existing template type by deleting all its **user defined** templates from the system.
Scope required:
* internal_template_mgt_delete ", response = Void.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Functions", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 204, message = "Item/s Deleted.", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response resetTemplateType(@ApiParam(value = "" ) @Valid SimpleTemplateTypeID simpleTemplateTypeID) {
+
+ return delegate.resetTemplateType(simpleTemplateTypeID );
+ }
+
+ @Valid
+ @PUT
+ @Path("/email/template-types/{template-type-id}/app-templates/{app-uuid}/{locale}")
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Replaces an existing application email template.", notes = "Replaces the application email template identified by the template-type-id and the locale.
Scope required:
* internal_email_mgt_update / internal_template_mgt_update ", response = Void.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Application Email Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Item Updated.", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response updateAppEmailTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "Application UUID.",required=true) @PathParam("app-uuid") String appUuid, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale, @ApiParam(value = "Email templates for the template type." ) @Valid EmailTemplate emailTemplate) {
+
+ return delegate.updateAppEmailTemplate(templateTypeId, appUuid, locale, emailTemplate );
+ }
+
+ @Valid
+ @PUT
+ @Path("/sms/template-types/{template-type-id}/app-templates/{app-uuid}/{locale}")
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Replaces an existing application SMS template.", notes = "Replaces the application SMS template identified by the template-type-id and the locale.
Scope required:
* internal_template_mgt_update ", response = Void.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Application SMS Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Item Updated.", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response updateAppSMSTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "Application UUID.",required=true) @PathParam("app-uuid") String appUuid, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale, @ApiParam(value = "Application SMS template for the template type and locale." ) @Valid SMSTemplate smSTemplate) {
+
+ return delegate.updateAppSMSTemplate(templateTypeId, appUuid, locale, smSTemplate );
+ }
+
+ @Valid
+ @PUT
+ @Path("/email/template-types/{template-type-id}/org-templates/{locale}")
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Replaces an existing organization email template.", notes = "Replaces the organization email template identified by the template-type-id and the locale.
Scope required:
* internal_email_mgt_update / internal_template_mgt_update ", response = Void.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "Email Templates", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Item Updated.", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response updateOrgEmailTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale, @ApiParam(value = "Updated email template for the template type." ) @Valid EmailTemplate emailTemplate) {
+
+ return delegate.updateOrgEmailTemplate(templateTypeId, locale, emailTemplate );
+ }
+
+ @Valid
+ @PUT
+ @Path("/sms/template-types/{template-type-id}/org-templates/{locale}")
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Replaces an existing organization SMS template.", notes = "Replaces the organization SMS template identified by the template-type-id and the locale.
Scope required:
* internal_template_mgt_update ", response = Void.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "SMS Templates" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Item Updated.", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid input request.", response = Error.class),
+ @ApiResponse(code = 401, message = "Unauthorized.", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden.", response = Void.class),
+ @ApiResponse(code = 404, message = "The specified resource is not found.", response = Error.class),
+ @ApiResponse(code = 500, message = "Internal Server Error.", response = Error.class)
+ })
+ public Response updateOrgSMSTemplate(@ApiParam(value = "Template Type ID.",required=true) @PathParam("template-type-id") String templateTypeId, @ApiParam(value = "This should be a valid locale.",required=true) @PathParam("locale") String locale, @ApiParam(value = "Updated SMS template for the template type." ) @Valid SMSTemplate smSTemplate) {
+
+ return delegate.updateOrgSMSTemplate(templateTypeId, locale, smSTemplate );
+ }
+
+}
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/NotificationApiService.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/NotificationApiService.java
new file mode 100644
index 0000000000..feb3334c4d
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/NotificationApiService.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1;
+
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.*;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.*;
+import org.apache.cxf.jaxrs.ext.multipart.Attachment;
+import org.apache.cxf.jaxrs.ext.multipart.Multipart;
+import java.io.InputStream;
+import java.util.List;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.EmailTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.EmailTemplateWithID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.Error;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SMSTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SMSTemplateWithID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SimpleTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SimpleTemplateTypeID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.TemplateTypeOverview;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.TemplateTypeWithID;
+import javax.ws.rs.core.Response;
+
+
+public interface NotificationApiService {
+
+ public Response addAppEmailTemplate(String templateTypeId, String appUuid, EmailTemplateWithID emailTemplateWithID);
+
+ public Response addAppSMSTemplate(String templateTypeId, String appUuid, SMSTemplateWithID smSTemplateWithID);
+
+ public Response addEmailTemplateType(TemplateTypeOverview templateTypeOverview);
+
+ public Response addOrgEmailTemplate(String templateTypeId, EmailTemplateWithID emailTemplateWithID);
+
+ public Response addOrgSMSTemplate(String templateTypeId, SMSTemplateWithID smSTemplateWithID);
+
+ public Response addSMSTemplateType(TemplateTypeOverview templateTypeOverview);
+
+ public Response deleteAppEmailTemplate(String templateTypeId, String appUuid, String locale);
+
+ public Response deleteAppSMSTemplate(String templateTypeId, String appUuid, String locale);
+
+ public Response deleteEmailTemplateType(String templateTypeId);
+
+ public Response deleteOrgEmailTemplate(String templateTypeId, String locale);
+
+ public Response deleteOrgSMSTemplate(String templateTypeId, String locale);
+
+ public Response deleteSMSTemplateType(String templateTypeId);
+
+ public Response getAllAppTemplatesOfEmailTemplateType(String templateTypeId, String appUuid);
+
+ public Response getAllAppTemplatesOfSMSTemplateType(String templateTypeId, String appUuid);
+
+ public Response getAllEmailTemplateTypes();
+
+ public Response getAllOrgTemplatesOfEmailTemplateType(String templateTypeId);
+
+ public Response getAllOrgTemplatesOfSMSTemplateType(String templateTypeId);
+
+ public Response getAllSMSTemplateTypes();
+
+ public Response getAllSystemTemplatesOfEmailTemplateType(String templateTypeId);
+
+ public Response getAllSystemTemplatesOfSMSTemplateType(String templateTypeId);
+
+ public Response getAppEmailTemplate(String templateTypeId, String appUuid, String locale);
+
+ public Response getAppSMSTemplate(String templateTypeId, String appUuid, String locale);
+
+ public Response getEmailTemplateType(String templateTypeId);
+
+ public Response getOrgEmailTemplate(String templateTypeId, String locale);
+
+ public Response getOrgSMSTemplate(String templateTypeId, String locale);
+
+ public Response getSMSTemplateType(String templateTypeId);
+
+ public Response getSystemEmailTemplate(String templateTypeId, String locale);
+
+ public Response getSystemSMSTemplate(String templateTypeId, String locale);
+
+ public Response resetTemplateType(SimpleTemplateTypeID simpleTemplateTypeID);
+
+ public Response updateAppEmailTemplate(String templateTypeId, String appUuid, String locale, EmailTemplate emailTemplate);
+
+ public Response updateAppSMSTemplate(String templateTypeId, String appUuid, String locale, SMSTemplate smSTemplate);
+
+ public Response updateOrgEmailTemplate(String templateTypeId, String locale, EmailTemplate emailTemplate);
+
+ public Response updateOrgSMSTemplate(String templateTypeId, String locale, SMSTemplate smSTemplate);
+}
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/factories/NotificationApiServiceFactory.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/factories/NotificationApiServiceFactory.java
new file mode 100644
index 0000000000..8e708a033b
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/factories/NotificationApiServiceFactory.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.factories;
+
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.NotificationApiService;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.impl.NotificationApiServiceImpl;
+
+public class NotificationApiServiceFactory {
+
+ private final static NotificationApiService service = new NotificationApiServiceImpl();
+
+ public static NotificationApiService getNotificationApi()
+ {
+ return service;
+ }
+}
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/EmailTemplate.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/EmailTemplate.java
new file mode 100644
index 0000000000..9f0c5e716b
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/EmailTemplate.java
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class EmailTemplate {
+
+ private String contentType;
+ private String subject;
+ private String body;
+ private String footer;
+
+ /**
+ * Content type of the email template.
+ **/
+ public EmailTemplate contentType(String contentType) {
+
+ this.contentType = contentType;
+ return this;
+ }
+
+ @ApiModelProperty(example = "text/html", required = true, value = "Content type of the email template.")
+ @JsonProperty("contentType")
+ @Valid
+ @NotNull(message = "Property contentType cannot be null.")
+
+ public String getContentType() {
+ return contentType;
+ }
+ public void setContentType(String contentType) {
+ this.contentType = contentType;
+ }
+
+ /**
+ * The subject of the email.
+ **/
+ public EmailTemplate subject(String subject) {
+
+ this.subject = subject;
+ return this;
+ }
+
+ @ApiModelProperty(example = "WSO2 - Account Confirmation", required = true, value = "The subject of the email.")
+ @JsonProperty("subject")
+ @Valid
+ @NotNull(message = "Property subject cannot be null.")
+
+ public String getSubject() {
+ return subject;
+ }
+ public void setSubject(String subject) {
+ this.subject = subject;
+ }
+
+ /**
+ * The body of the email.
+ **/
+ public EmailTemplate body(String body) {
+
+ this.body = body;
+ return this;
+ }
+
+ @ApiModelProperty(example = "HTML Body", required = true, value = "The body of the email.")
+ @JsonProperty("body")
+ @Valid
+ @NotNull(message = "Property body cannot be null.")
+
+ public String getBody() {
+ return body;
+ }
+ public void setBody(String body) {
+ this.body = body;
+ }
+
+ /**
+ * The footer of the email.
+ **/
+ public EmailTemplate footer(String footer) {
+
+ this.footer = footer;
+ return this;
+ }
+
+ @ApiModelProperty(example = "WSO2 Identity Server Team", value = "The footer of the email.")
+ @JsonProperty("footer")
+ @Valid
+ public String getFooter() {
+ return footer;
+ }
+ public void setFooter(String footer) {
+ this.footer = footer;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ EmailTemplate emailTemplate = (EmailTemplate) o;
+ return Objects.equals(this.contentType, emailTemplate.contentType) &&
+ Objects.equals(this.subject, emailTemplate.subject) &&
+ Objects.equals(this.body, emailTemplate.body) &&
+ Objects.equals(this.footer, emailTemplate.footer);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(contentType, subject, body, footer);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class EmailTemplate {\n");
+
+ sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n");
+ sb.append(" subject: ").append(toIndentedString(subject)).append("\n");
+ sb.append(" body: ").append(toIndentedString(body)).append("\n");
+ sb.append(" footer: ").append(toIndentedString(footer)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n");
+ }
+}
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/EmailTemplateWithID.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/EmailTemplateWithID.java
new file mode 100644
index 0000000000..758785ca4b
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/EmailTemplateWithID.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.EmailTemplate;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class EmailTemplateWithID extends EmailTemplate {
+
+ private String locale;
+
+ /**
+ * Locale of the email template.
+ **/
+ public EmailTemplateWithID locale(String locale) {
+
+ this.locale = locale;
+ return this;
+ }
+
+ @ApiModelProperty(example = "en_US", required = true, value = "Locale of the email template.")
+ @JsonProperty("locale")
+ @Valid
+ @NotNull(message = "Property locale cannot be null.")
+
+ public String getLocale() {
+ return locale;
+ }
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ if (!super.equals(o)) {
+ return false;
+ }
+
+ EmailTemplateWithID emailTemplateWithID = (EmailTemplateWithID) o;
+ return Objects.equals(this.locale, emailTemplateWithID.locale);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(locale);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class EmailTemplateWithID {\n");
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ sb.append(" locale: ").append(toIndentedString(locale)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n");
+ }
+}
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/Error.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/Error.java
new file mode 100644
index 0000000000..2ae19eb2ca
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/Error.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class Error {
+
+ private String code;
+ private String message;
+ private String description;
+ private String traceId;
+
+ /**
+ **/
+ public Error code(String code) {
+
+ this.code = code;
+ return this;
+ }
+
+ @ApiModelProperty(example = "NTM-50000", required = true, value = "")
+ @JsonProperty("code")
+ @Valid
+ @NotNull(message = "Property code cannot be null.")
+
+ public String getCode() {
+ return code;
+ }
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ /**
+ **/
+ public Error message(String message) {
+
+ this.message = message;
+ return this;
+ }
+
+ @ApiModelProperty(example = "Some Error Message", required = true, value = "")
+ @JsonProperty("message")
+ @Valid
+ @NotNull(message = "Property message cannot be null.")
+
+ public String getMessage() {
+ return message;
+ }
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ /**
+ **/
+ public Error description(String description) {
+
+ this.description = description;
+ return this;
+ }
+
+ @ApiModelProperty(example = "Some Error Description", value = "")
+ @JsonProperty("description")
+ @Valid
+ public String getDescription() {
+ return description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ **/
+ public Error traceId(String traceId) {
+
+ this.traceId = traceId;
+ return this;
+ }
+
+ @ApiModelProperty(example = "TR0001", value = "")
+ @JsonProperty("traceId")
+ @Valid
+ public String getTraceId() {
+ return traceId;
+ }
+ public void setTraceId(String traceId) {
+ this.traceId = traceId;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Error error = (Error) o;
+ return Objects.equals(this.code, error.code) &&
+ Objects.equals(this.message, error.message) &&
+ Objects.equals(this.description, error.description) &&
+ Objects.equals(this.traceId, error.traceId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(code, message, description, traceId);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Error {\n");
+
+ sb.append(" code: ").append(toIndentedString(code)).append("\n");
+ sb.append(" message: ").append(toIndentedString(message)).append("\n");
+ sb.append(" description: ").append(toIndentedString(description)).append("\n");
+ sb.append(" traceId: ").append(toIndentedString(traceId)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n");
+ }
+}
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/SMSTemplate.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/SMSTemplate.java
new file mode 100644
index 0000000000..788fce7c25
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/SMSTemplate.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class SMSTemplate {
+
+ private String body;
+
+ /**
+ * The body of the SMS.
+ **/
+ public SMSTemplate body(String body) {
+
+ this.body = body;
+ return this;
+ }
+
+ @ApiModelProperty(example = "SMS Body", required = true, value = "The body of the SMS.")
+ @JsonProperty("body")
+ @Valid
+ @NotNull(message = "Property body cannot be null.")
+
+ public String getBody() {
+ return body;
+ }
+ public void setBody(String body) {
+ this.body = body;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ SMSTemplate smSTemplate = (SMSTemplate) o;
+ return Objects.equals(this.body, smSTemplate.body);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(body);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class SMSTemplate {\n");
+
+ sb.append(" body: ").append(toIndentedString(body)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n");
+ }
+}
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/SMSTemplateWithID.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/SMSTemplateWithID.java
new file mode 100644
index 0000000000..406165c35e
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/SMSTemplateWithID.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SMSTemplate;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class SMSTemplateWithID extends SMSTemplate {
+
+ private String locale;
+
+ /**
+ * Locale of the SMS template.
+ **/
+ public SMSTemplateWithID locale(String locale) {
+
+ this.locale = locale;
+ return this;
+ }
+
+ @ApiModelProperty(example = "en_US", required = true, value = "Locale of the SMS template.")
+ @JsonProperty("locale")
+ @Valid
+ @NotNull(message = "Property locale cannot be null.")
+
+ public String getLocale() {
+ return locale;
+ }
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ if (!super.equals(o)) {
+ return false;
+ }
+
+ SMSTemplateWithID smSTemplateWithID = (SMSTemplateWithID) o;
+ return Objects.equals(this.locale, smSTemplateWithID.locale);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(locale);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class SMSTemplateWithID {\n");
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ sb.append(" locale: ").append(toIndentedString(locale)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n");
+ }
+}
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/SimpleTemplate.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/SimpleTemplate.java
new file mode 100644
index 0000000000..eb735186b1
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/SimpleTemplate.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class SimpleTemplate {
+
+ private String locale;
+ private String self;
+
+ /**
+ * Locale of the template.
+ **/
+ public SimpleTemplate locale(String locale) {
+
+ this.locale = locale;
+ return this;
+ }
+
+ @ApiModelProperty(example = "en_US", required = true, value = "Locale of the template.")
+ @JsonProperty("locale")
+ @Valid
+ @NotNull(message = "Property locale cannot be null.")
+
+ public String getLocale() {
+ return locale;
+ }
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
+ /**
+ * Location of the created/updated resource. resource.
+ **/
+ public SimpleTemplate self(String self) {
+
+ this.self = self;
+ return this;
+ }
+
+ @ApiModelProperty(example = "/t/{tenant-domain}/api/server/v1/notification/{{email|sms}}/template-types/YWNjb3VudGNvbmZpcm1hdGlvbg/{{org|app|system}}templates/en_US", required = true, value = "Location of the created/updated resource. resource.")
+ @JsonProperty("self")
+ @Valid
+ @NotNull(message = "Property self cannot be null.")
+
+ public String getSelf() {
+ return self;
+ }
+ public void setSelf(String self) {
+ this.self = self;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ SimpleTemplate simpleTemplate = (SimpleTemplate) o;
+ return Objects.equals(this.locale, simpleTemplate.locale) &&
+ Objects.equals(this.self, simpleTemplate.self);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(locale, self);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class SimpleTemplate {\n");
+
+ sb.append(" locale: ").append(toIndentedString(locale)).append("\n");
+ sb.append(" self: ").append(toIndentedString(self)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n");
+ }
+}
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/SimpleTemplateTypeID.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/SimpleTemplateTypeID.java
new file mode 100644
index 0000000000..20503f763a
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/SimpleTemplateTypeID.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class SimpleTemplateTypeID {
+
+ private String templateTypeId;
+ private String channel;
+
+ /**
+ * Unique ID of the template type.
+ **/
+ public SimpleTemplateTypeID templateTypeId(String templateTypeId) {
+
+ this.templateTypeId = templateTypeId;
+ return this;
+ }
+
+ @ApiModelProperty(example = "YWNjb3VudGNvbmZpcm1hdGlvbg", required = true, value = "Unique ID of the template type.")
+ @JsonProperty("templateTypeId")
+ @Valid
+ @NotNull(message = "Property templateTypeId cannot be null.")
+
+ public String getTemplateTypeId() {
+ return templateTypeId;
+ }
+ public void setTemplateTypeId(String templateTypeId) {
+ this.templateTypeId = templateTypeId;
+ }
+
+ /**
+ * Notification channel of the template type (SMS or EMAIL).
+ **/
+ public SimpleTemplateTypeID channel(String channel) {
+
+ this.channel = channel;
+ return this;
+ }
+
+ @ApiModelProperty(example = "EMAIL", required = true, value = "Notification channel of the template type (SMS or EMAIL).")
+ @JsonProperty("channel")
+ @Valid
+ @NotNull(message = "Property channel cannot be null.")
+
+ public String getChannel() {
+ return channel;
+ }
+ public void setChannel(String channel) {
+ this.channel = channel;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ SimpleTemplateTypeID simpleTemplateTypeID = (SimpleTemplateTypeID) o;
+ return Objects.equals(this.templateTypeId, simpleTemplateTypeID.templateTypeId) &&
+ Objects.equals(this.channel, simpleTemplateTypeID.channel);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(templateTypeId, channel);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class SimpleTemplateTypeID {\n");
+
+ sb.append(" templateTypeId: ").append(toIndentedString(templateTypeId)).append("\n");
+ sb.append(" channel: ").append(toIndentedString(channel)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n");
+ }
+}
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/TemplateType.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/TemplateType.java
new file mode 100644
index 0000000000..17aa11ab4a
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/TemplateType.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class TemplateType {
+
+ private String displayName;
+ private String self;
+
+ /**
+ * Display name of the template type.
+ **/
+ public TemplateType displayName(String displayName) {
+
+ this.displayName = displayName;
+ return this;
+ }
+
+ @ApiModelProperty(example = "Account Confirmation", required = true, value = "Display name of the template type.")
+ @JsonProperty("displayName")
+ @Valid
+ @NotNull(message = "Property displayName cannot be null.")
+
+ public String getDisplayName() {
+ return displayName;
+ }
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ /**
+ * Location of the created/updated resource.
+ **/
+ public TemplateType self(String self) {
+
+ this.self = self;
+ return this;
+ }
+
+ @ApiModelProperty(example = "/t/{tenant-domain}/api/server/v1/notification/{{email|sms}}/template-types/YWNjb3VudGNvbmZpcm1hdGlvbg", required = true, value = "Location of the created/updated resource.")
+ @JsonProperty("self")
+ @Valid
+ @NotNull(message = "Property self cannot be null.")
+
+ public String getSelf() {
+ return self;
+ }
+ public void setSelf(String self) {
+ this.self = self;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ TemplateType templateType = (TemplateType) o;
+ return Objects.equals(this.displayName, templateType.displayName) &&
+ Objects.equals(this.self, templateType.self);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(displayName, self);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class TemplateType {\n");
+
+ sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n");
+ sb.append(" self: ").append(toIndentedString(self)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n");
+ }
+}
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/TemplateTypeOverview.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/TemplateTypeOverview.java
new file mode 100644
index 0000000000..1b60b13fbc
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/TemplateTypeOverview.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class TemplateTypeOverview {
+
+ private String displayName;
+
+ /**
+ * Display name of the template type.
+ **/
+ public TemplateTypeOverview displayName(String displayName) {
+
+ this.displayName = displayName;
+ return this;
+ }
+
+ @ApiModelProperty(example = "Account Confirmation", required = true, value = "Display name of the template type.")
+ @JsonProperty("displayName")
+ @Valid
+ @NotNull(message = "Property displayName cannot be null.")
+
+ public String getDisplayName() {
+ return displayName;
+ }
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ TemplateTypeOverview templateTypeOverview = (TemplateTypeOverview) o;
+ return Objects.equals(this.displayName, templateTypeOverview.displayName);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(displayName);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class TemplateTypeOverview {\n");
+
+ sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n");
+ }
+}
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/TemplateTypeWithID.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/TemplateTypeWithID.java
new file mode 100644
index 0000000000..dccfb2930f
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/gen/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/model/TemplateTypeWithID.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.TemplateType;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class TemplateTypeWithID extends TemplateType {
+
+ private String id;
+
+ /**
+ * Unique ID of the template type.
+ **/
+ public TemplateTypeWithID id(String id) {
+
+ this.id = id;
+ return this;
+ }
+
+ @ApiModelProperty(example = "YWNjb3VudGNvbmZpcm1hdGlvbg", required = true, value = "Unique ID of the template type.")
+ @JsonProperty("id")
+ @Valid
+ @NotNull(message = "Property id cannot be null.")
+
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ if (!super.equals(o)) {
+ return false;
+ }
+
+ TemplateTypeWithID templateTypeWithID = (TemplateTypeWithID) o;
+ return Objects.equals(this.id, templateTypeWithID.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class TemplateTypeWithID {\n");
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(java.lang.Object o) {
+
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n");
+ }
+}
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/core/TemplateTypeService.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/core/TemplateTypeService.java
new file mode 100644
index 0000000000..626192e4d1
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/core/TemplateTypeService.java
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.core;
+
+import org.wso2.carbon.identity.api.server.notification.template.common.Constants;
+import org.wso2.carbon.identity.api.server.notification.template.common.TemplatesServiceHolder;
+import org.wso2.carbon.identity.governance.exceptions.notiification.NotificationTemplateManagerException;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.TemplateTypeOverview;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.TemplateTypeWithID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.util.Util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.wso2.carbon.identity.api.server.common.ContextLoader.getTenantDomainFromContext;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.NOTIFICATION_CHANNEL_EMAIL;
+
+/**
+ * Service class for the template types.
+ */
+public class TemplateTypeService {
+
+ /**
+ * Add a new template type for a given channel.
+ *
+ * @param notificationChannel Notification channel (Eg: sms, email).
+ * @param templateTypeOverview Template type overview.
+ * @return TemplateTypeWithID object.
+ */
+ public TemplateTypeWithID addNotificationTemplateType(String notificationChannel,
+ TemplateTypeOverview templateTypeOverview) {
+
+ String templateTypeDisplayName = templateTypeOverview.getDisplayName();
+ try {
+ TemplatesServiceHolder.getNotificationTemplateManager().addNotificationTemplateType(notificationChannel,
+ templateTypeDisplayName, getTenantDomainFromContext());
+ // Build a response object and send if everything is successful.
+ TemplateTypeWithID response = new TemplateTypeWithID();
+ response.setDisplayName(templateTypeDisplayName);
+ String templateTypeId = Util.resolveTemplateIdFromDisplayName(templateTypeDisplayName);
+ response.setId(templateTypeId);
+ response.setSelf(Util.getTemplateTypeLocation(templateTypeId, notificationChannel));
+ return response;
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_ADDING_TEMPLATE_TYPE);
+ }
+ }
+
+ /**
+ * Get all available notification template types for a notification chanel in the tenant.
+ *
+ * @param notificationChannel Notification channel (Eg: sms, email).
+ * @return List of TemplateTypeWithID objects.
+ */
+ public List getAllNotificationTemplateTypes(String notificationChannel) {
+
+ try {
+ List templateTypes = TemplatesServiceHolder.getNotificationTemplateManager()
+ .getAllNotificationTemplateTypes(notificationChannel, getTenantDomainFromContext());
+ List templateTypeWithIDs = new ArrayList<>();
+ if (templateTypes != null) {
+ for (String emailTemplateType : templateTypes) {
+ TemplateTypeWithID templateTypeWithID = new TemplateTypeWithID();
+ templateTypeWithID.setDisplayName(emailTemplateType);
+ String templateTypeId = Util.resolveTemplateIdFromDisplayName(emailTemplateType);
+ templateTypeWithID.setId(templateTypeId);
+ templateTypeWithID.setSelf(
+ Util.getTemplateTypeLocation(templateTypeId, notificationChannel));
+ templateTypeWithIDs.add(templateTypeWithID);
+ }
+ }
+ return templateTypeWithIDs;
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_RETRIEVING_TEMPLATE_TYPES);
+ }
+ }
+
+ /**
+ * Delete a notification template type from the tenant.
+ *
+ * @param notificationChannel Notification channel (Eg: sms, email).
+ * @param templateTypeId ID of the template type.
+ */
+ public void deleteNotificationTemplateType(String notificationChannel, String templateTypeId) {
+
+ String templateTypeDisplayName;
+ templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ try {
+ boolean isTemplateTypeExists =
+ TemplatesServiceHolder.getNotificationTemplateManager().isNotificationTemplateTypeExists(
+ notificationChannel, templateTypeDisplayName, getTenantDomainFromContext());
+ if (isTemplateTypeExists) {
+ TemplatesServiceHolder.getNotificationTemplateManager().deleteNotificationTemplateType(
+ notificationChannel, templateTypeDisplayName, getTenantDomainFromContext());
+ } else {
+ throw Util.handleError(Constants.ErrorMessage.ERROR_TEMPLATE_TYPE_NOT_FOUND);
+ }
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_DELETING_TEMPLATE_TYPE);
+ }
+ }
+
+ /**
+ * Reset a specific template type. Deletes all org and app templates under the type.
+ *
+ * @param notificationChannel Notification channel (Eg: sms, email).
+ * @param templateTypeId ID of the template type.
+ */
+ public void resetTemplateType(String notificationChannel, String templateTypeId) {
+
+ if (NOTIFICATION_CHANNEL_EMAIL.equalsIgnoreCase(notificationChannel)) {
+ notificationChannel = NOTIFICATION_CHANNEL_EMAIL;
+ } else if (Constants.NOTIFICATION_CHANNEL_SMS.equalsIgnoreCase(notificationChannel)) {
+ notificationChannel = Constants.NOTIFICATION_CHANNEL_SMS;
+ } else {
+ throw Util.handleError(Constants.ErrorMessage.ERROR_ERROR_INVALID_NOTIFICATION_CHANNEL);
+ }
+ String templateTypeDisplayName;
+ templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ try {
+ boolean isTemplateTypeExists =
+ TemplatesServiceHolder.getNotificationTemplateManager().isNotificationTemplateTypeExists(
+ notificationChannel, templateTypeDisplayName, getTenantDomainFromContext());
+ if (isTemplateTypeExists) {
+ TemplatesServiceHolder.getNotificationTemplateManager().resetNotificationTemplateType(
+ notificationChannel, templateTypeDisplayName, getTenantDomainFromContext()
+ );
+ } else {
+ throw Util.handleError(Constants.ErrorMessage.ERROR_TEMPLATE_TYPE_NOT_FOUND);
+ }
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_RESETTING_TEMPLATE_TYPE);
+ }
+ }
+
+ /**
+ * Get a specific notification template type.
+ *
+ * @param notificationChannel Notification channel (Eg: sms, email).
+ * @param templateTypeId ID of the template type.
+ * @return TemplateTypeWithID object.
+ */
+ public TemplateTypeWithID getNotificationTemplateType(String notificationChannel,
+ String templateTypeId) {
+
+ String templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ try {
+ boolean isTemplateTypeExists =
+ TemplatesServiceHolder.getNotificationTemplateManager().isNotificationTemplateTypeExists(
+ notificationChannel, templateTypeDisplayName, getTenantDomainFromContext());
+ if (isTemplateTypeExists) {
+ TemplateTypeWithID templateTypeWithID = new TemplateTypeWithID();
+ templateTypeWithID.setDisplayName(templateTypeDisplayName);
+ templateTypeWithID.setId(templateTypeId);
+ templateTypeWithID.setSelf(Util.getTemplateTypeLocation(templateTypeId, notificationChannel));
+ return templateTypeWithID;
+ } else {
+ throw Util.handleError(Constants.ErrorMessage.ERROR_TEMPLATE_TYPE_NOT_FOUND);
+ }
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_RETRIEVING_TEMPLATE);
+ }
+ }
+
+}
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/core/TemplatesService.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/core/TemplatesService.java
new file mode 100644
index 0000000000..22a5b8d575
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/core/TemplatesService.java
@@ -0,0 +1,473 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.core;
+
+import org.apache.commons.lang.StringUtils;
+import org.wso2.carbon.identity.api.server.notification.template.common.Constants;
+import org.wso2.carbon.identity.api.server.notification.template.common.TemplatesServiceHolder;
+import org.wso2.carbon.identity.governance.exceptions.notiification.NotificationTemplateManagerException;
+import org.wso2.carbon.identity.governance.model.NotificationTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.EmailTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.EmailTemplateWithID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SMSTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SMSTemplateWithID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SimpleTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.util.Util;
+
+import java.util.List;
+
+import static org.wso2.carbon.identity.api.server.common.ContextLoader.getTenantDomainFromContext;
+
+/**
+ * Service class for application email templates.
+ */
+public class TemplatesService {
+
+ /**
+ * Adds a new organization email template to the given template type. Template ID should not exist in the system.
+ *
+ * @param templateTypeId Template type in which the template should be added.
+ * @param emailTemplateWithID New email template.
+ * @return Location of the newly created template if successful, 409 if template already exists, 500 otherwise.
+ */
+ public SimpleTemplate addEmailTemplate(String templateTypeId, EmailTemplateWithID emailTemplateWithID) {
+
+ return addEmailTemplate(templateTypeId, emailTemplateWithID, null);
+ }
+
+ /**
+ * Adds a new application email template to the given template type. Template ID should not exist in the system.
+ *
+ * @param templateTypeId Template type in which the template should be added.
+ * @param emailTemplateWithID New email template.
+ * @param applicationUuid Application UUID.
+ * @return Location of the newly created template if successful, 409 if template already exists, 500 otherwise.
+ */
+ public SimpleTemplate addEmailTemplate(String templateTypeId, EmailTemplateWithID emailTemplateWithID,
+ String applicationUuid) {
+
+ try {
+ NotificationTemplate notificationTemplate = Util.buildNotificationTemplateWithEmailTemplateWithID(
+ templateTypeId, emailTemplateWithID);
+ TemplatesServiceHolder.getNotificationTemplateManager().addNotificationTemplate(notificationTemplate,
+ getTenantDomainFromContext(), applicationUuid);
+
+ String templateOwner = StringUtils.isNotBlank(applicationUuid) ? Constants.NOTIFICATION_TEMPLATE_OWNER_APP :
+ Constants.NOTIFICATION_TEMPLATE_OWNER_ORG;
+ String templateTypeLocation = Util.getTemplateTypeLocation(templateTypeId,
+ Constants.NOTIFICATION_CHANNEL_EMAIL);
+ String templateLocation = Util.getTemplateLocation(templateTypeLocation, applicationUuid,
+ emailTemplateWithID.getLocale(), templateOwner);
+
+ SimpleTemplate simpleEmailTemplate = new SimpleTemplate();
+ simpleEmailTemplate.setSelf(templateLocation);
+ simpleEmailTemplate.setLocale(notificationTemplate.getLocale());
+ return simpleEmailTemplate;
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_ADDING_TEMPLATE);
+ }
+ }
+
+ /**
+ * Adds a new organization SMS template to the given template type. Template ID should not exist in the system.
+ *
+ * @param templateTypeId Template type in which the template should be added.
+ * @param smsTemplateWithID New SMS template.
+ * @return Location of the newly created template if successful, 409 if template already exists, 500 otherwise.
+ */
+ public SimpleTemplate addSMSTemplate(String templateTypeId, SMSTemplateWithID smsTemplateWithID) {
+
+ return addSMSTemplate(templateTypeId, smsTemplateWithID, null);
+ }
+
+ /**
+ * Adds a new application SMS template to the given template type. Template ID should not exist in the system.
+ *
+ * @param templateTypeId Template type in which the template should be added.
+ * @param smsTemplateWithID New SMS template.
+ * @param applicationUuid Application UUID.
+ * @return Location of the newly created template if successful, 409 if template already exists, 500 otherwise.
+ */
+ public SimpleTemplate addSMSTemplate(String templateTypeId, SMSTemplateWithID smsTemplateWithID,
+ String applicationUuid) {
+
+ try {
+ NotificationTemplate notificationTemplate = Util.buildNotificationTemplateWithSMSTemplateWithID(
+ templateTypeId, smsTemplateWithID);
+ TemplatesServiceHolder.getNotificationTemplateManager().addNotificationTemplate(notificationTemplate,
+ getTenantDomainFromContext(), applicationUuid);
+
+ String templateOwner = StringUtils.isNotBlank(applicationUuid) ? Constants.NOTIFICATION_TEMPLATE_OWNER_APP :
+ Constants.NOTIFICATION_TEMPLATE_OWNER_ORG;
+ String templateTypeLocation = Util.getTemplateTypeLocation(templateTypeId,
+ Constants.NOTIFICATION_CHANNEL_SMS);
+ String templateLocation = Util.getTemplateLocation(templateTypeLocation, applicationUuid,
+ smsTemplateWithID.getLocale(), templateOwner);
+
+ SimpleTemplate simpleSMSTemplate = new SimpleTemplate();
+ simpleSMSTemplate.setSelf(templateLocation);
+ simpleSMSTemplate.setLocale(notificationTemplate.getLocale());
+ return simpleSMSTemplate;
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_ADDING_TEMPLATE);
+ }
+ }
+
+ /**
+ * Retrieves the list of organization email templates of the given template type.
+ *
+ * @param templateTypeId Template type ID.
+ * @return List of email templates.
+ */
+ public List getAllTemplatesOfTemplateType(String templateTypeId, String notificationChannel) {
+
+ return getAllTemplatesOfTemplateType(templateTypeId, null, notificationChannel);
+ }
+
+ /**
+ * Retrieves the list of application email templates of the given template type.
+ *
+ * @param templateTypeId Template type ID.
+ * @param applicationUuid Application UUID.
+ * @return List of email templates.
+ */
+ public List getAllTemplatesOfTemplateType(String templateTypeId, String applicationUuid,
+ String notificationChannel) {
+
+ String templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ try {
+ List templates = TemplatesServiceHolder.getNotificationTemplateManager()
+ .getNotificationTemplatesOfType(notificationChannel, templateTypeDisplayName,
+ getTenantDomainFromContext(), applicationUuid);
+ String templateOwner = StringUtils.isNotBlank(applicationUuid) ? Constants.NOTIFICATION_TEMPLATE_OWNER_APP :
+ Constants.NOTIFICATION_TEMPLATE_OWNER_ORG;
+ return Util.buildSimpleTemplateList(templates, applicationUuid, templateOwner, notificationChannel);
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_RETRIEVING_TEMPLATES);
+ }
+ }
+
+ /**
+ * Retrieves the list of application email templates of the given template type.
+ *
+ * @param templateTypeId Template type ID.
+ * @param notificationChannel Notification channel.
+ * @return List of email templates.
+ */
+ public List getAllSystemTemplatesOfTemplateType(String templateTypeId, String notificationChannel) {
+
+ String templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ try {
+ List templates = TemplatesServiceHolder.getNotificationTemplateManager()
+ .getAllSystemNotificationTemplatesOfType(notificationChannel, templateTypeDisplayName);
+ return Util.buildSimpleTemplateList(templates, null,
+ Constants.NOTIFICATION_TEMPLATE_OWNER_SYSTEM, notificationChannel);
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_RETRIEVING_TEMPLATES);
+ }
+ }
+
+ /**
+ * Retrieves the organization email template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param templateId Template ID.
+ * @return Email template.
+ */
+ public EmailTemplateWithID getEmailTemplate(String templateTypeId, String templateId) {
+
+ return getEmailTemplate(templateTypeId, templateId, null);
+ }
+
+ /**
+ * Retrieves the application email template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param templateId Template ID.
+ * @param applicationUuid Application UUID.
+ * @return Email template.
+ */
+ public EmailTemplateWithID getEmailTemplate(String templateTypeId, String templateId, String applicationUuid) {
+
+ try {
+ String templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ NotificationTemplate internalEmailTemplate = TemplatesServiceHolder.getNotificationTemplateManager().
+ getNotificationTemplate(Constants.NOTIFICATION_CHANNEL_EMAIL, templateTypeDisplayName, templateId,
+ getTenantDomainFromContext(), applicationUuid);
+ // NotificationTemplateManager sends the default template if no matching template found.
+ // We need to check for the locale specifically.
+ if (!internalEmailTemplate.getLocale().equals(templateId)) {
+ throw Util.handleError(Constants.ErrorMessage.ERROR_TEMPLATE_NOT_FOUND);
+ } else {
+ return Util.buildEmailTemplateWithID(internalEmailTemplate);
+ }
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_RETRIEVING_TEMPLATE);
+ }
+ }
+
+ /**
+ * Retrieves the organization SMS template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param templateId Template ID.
+ * @return SMS template.
+ */
+ public SMSTemplateWithID getSMSTemplate(String templateTypeId, String templateId) {
+
+ return getSMSTemplate(templateTypeId, templateId, null);
+ }
+
+ /**
+ * Retrieves the application SMS template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param templateId Template ID.
+ * @param applicationUuid Application UUID.
+ * @return SMS template.
+ */
+ public SMSTemplateWithID getSMSTemplate(String templateTypeId, String templateId, String applicationUuid) {
+
+ try {
+ String templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ NotificationTemplate internalEmailTemplate = TemplatesServiceHolder.getNotificationTemplateManager().
+ getNotificationTemplate(Constants.NOTIFICATION_CHANNEL_SMS, templateTypeDisplayName, templateId,
+ getTenantDomainFromContext(), applicationUuid);
+ // NotificationTemplateManager sends the default template if no matching template found.
+ // We need to check for the locale specifically.
+ if (!internalEmailTemplate.getLocale().equals(templateId)) {
+ throw Util.handleError(Constants.ErrorMessage.ERROR_TEMPLATE_NOT_FOUND);
+ } else {
+ return Util.buildSMSTemplateWithID(internalEmailTemplate);
+ }
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_RETRIEVING_TEMPLATE);
+ }
+ }
+
+ /**
+ * Retrieves the default email template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param templateId Template ID.
+ * @return Default email template.
+ */
+ public EmailTemplateWithID getSystemEmailTemplate(String templateTypeId, String templateId) {
+
+ try {
+ String templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ NotificationTemplate internalTemplate = TemplatesServiceHolder.getNotificationTemplateManager().
+ getSystemNotificationTemplate(Constants.NOTIFICATION_CHANNEL_EMAIL,
+ templateTypeDisplayName, templateId);
+ // NotificationTemplateManager sends the default template if no matching template found.
+ // We need to check for the locale specifically.
+ if (!internalTemplate.getLocale().equals(templateId)) {
+ throw Util.handleError(Constants.ErrorMessage.ERROR_TEMPLATE_NOT_FOUND);
+ } else {
+ return Util.buildEmailTemplateWithID(internalTemplate);
+ }
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_RETRIEVING_TEMPLATE);
+ }
+ }
+
+ /**
+ * Retrieves the default SMS template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param templateId Template ID.
+ * @return Default SMS template.
+ */
+ public SMSTemplateWithID getSystemSmsTemplate(String templateTypeId, String templateId) {
+
+ try {
+ String templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ NotificationTemplate internalTemplate = TemplatesServiceHolder.getNotificationTemplateManager().
+ getSystemNotificationTemplate(Constants.NOTIFICATION_CHANNEL_SMS,
+ templateTypeDisplayName, templateId);
+ // NotificationTemplateManager sends the default template if no matching template found.
+ // We need to check for the locale specifically.
+ if (!internalTemplate.getLocale().equals(templateId)) {
+ throw Util.handleError(Constants.ErrorMessage.ERROR_TEMPLATE_NOT_FOUND);
+ } else {
+ return Util.buildSMSTemplateWithID(internalTemplate);
+ }
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_RETRIEVING_TEMPLATE);
+ }
+ }
+
+ /**
+ * Updates the organization email template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param templateId Template ID.
+ * @param emailTemplate Updated email template.
+ */
+ public void updateEmailTemplate(String templateTypeId, String templateId, EmailTemplate emailTemplate) {
+
+ updateEmailTemplate(templateTypeId, templateId, emailTemplate, null);
+ }
+
+ /**
+ * Updates the application email template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param templateId Template ID.
+ * @param emailTemplate Updated email template.
+ * @param applicationUuid Application UUID.
+ */
+ public void updateEmailTemplate(String templateTypeId, String templateId, EmailTemplate emailTemplate,
+ String applicationUuid) {
+
+ EmailTemplateWithID emailTemplateWithID =
+ Util.buildEmailTemplateWithIdUsingEmailTemplate(emailTemplate, templateId);
+ try {
+ NotificationTemplate notificationTemplate = Util.buildNotificationTemplateWithEmailTemplateWithID(
+ templateTypeId, emailTemplateWithID);
+ TemplatesServiceHolder.getNotificationTemplateManager().updateNotificationTemplate(notificationTemplate,
+ getTenantDomainFromContext(), applicationUuid);
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_UPDATING_TEMPLATE);
+ }
+ }
+
+ /**
+ * Updates the organization SMS template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param templateId Template ID.
+ * @param smsTemplate Updated SMS template.
+ */
+ public void updateSMSTemplate(String templateTypeId, String templateId, SMSTemplate smsTemplate) {
+
+ updateSMSTemplate(templateTypeId, templateId, smsTemplate, null);
+ }
+
+ /**
+ * Updates the application SMS template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param templateId Template ID.
+ * @param smsTemplate Updated SMS template.
+ * @param applicationUuid Application UUID.
+ */
+ public void updateSMSTemplate(String templateTypeId, String templateId, SMSTemplate smsTemplate,
+ String applicationUuid) {
+
+ SMSTemplateWithID smsTemplateWithID =
+ Util.buildSMSTemplateWithIdUsingSMSTemplate(smsTemplate, templateId);
+ try {
+ NotificationTemplate notificationTemplate = Util.buildNotificationTemplateWithSMSTemplateWithID(
+ templateTypeId, smsTemplateWithID);
+ TemplatesServiceHolder.getNotificationTemplateManager().updateNotificationTemplate(notificationTemplate,
+ getTenantDomainFromContext(), applicationUuid);
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_UPDATING_TEMPLATE);
+ }
+ }
+
+ /**
+ * Deletes the organization email template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param locale Template locale.
+ */
+ public void deleteEmailTemplate(String templateTypeId, String locale) {
+
+ deleteEmailTemplate(templateTypeId, locale, null);
+ }
+
+ /**
+ * Deletes the application email template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param locale Template locale.
+ * @param applicationUuid Application UUID.
+ */
+ public void deleteEmailTemplate(String templateTypeId, String locale, String applicationUuid) {
+
+ String templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ try {
+ Util.verifyTemplateTypeExists(Constants.NOTIFICATION_CHANNEL_EMAIL, templateTypeDisplayName);
+ boolean notificationTemplateExists = TemplatesServiceHolder.getNotificationTemplateManager()
+ .isNotificationTemplateExists(Constants.NOTIFICATION_CHANNEL_EMAIL, templateTypeDisplayName,
+ locale, getTenantDomainFromContext(), applicationUuid);
+ if (notificationTemplateExists) {
+ TemplatesServiceHolder.getNotificationTemplateManager().deleteNotificationTemplate(
+ Constants.NOTIFICATION_CHANNEL_EMAIL, templateTypeDisplayName, locale,
+ getTenantDomainFromContext(), applicationUuid);
+ } else {
+ throw Util.handleError(Constants.ErrorMessage.ERROR_TEMPLATE_NOT_FOUND);
+ }
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_DELETING_EMAIL_TEMPLATE);
+ }
+ }
+
+ /**
+ * Deletes the organization SMS template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param locale Template ID.
+ */
+ public void deleteSMSTemplate(String templateTypeId, String locale) {
+
+ deleteSMSTemplate(templateTypeId, locale, null);
+ }
+
+ /**
+ * Deletes the application SMS template of the given template type and locale.
+ *
+ * @param templateTypeId Template type ID.
+ * @param locale Template ID.
+ * @param applicationUuid Application UUID.
+ */
+ public void deleteSMSTemplate(String templateTypeId, String locale, String applicationUuid) {
+
+ String templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ try {
+ Util.verifyTemplateTypeExists(Constants.NOTIFICATION_CHANNEL_SMS, templateTypeDisplayName);
+ boolean notificationTemplateExists = TemplatesServiceHolder.getNotificationTemplateManager()
+ .isNotificationTemplateExists(Constants.NOTIFICATION_CHANNEL_SMS, templateTypeDisplayName,
+ locale, getTenantDomainFromContext(), applicationUuid);
+ if (notificationTemplateExists) {
+ TemplatesServiceHolder.getNotificationTemplateManager().deleteNotificationTemplate(
+ Constants.NOTIFICATION_CHANNEL_SMS, templateTypeDisplayName, locale,
+ getTenantDomainFromContext(), applicationUuid);
+ } else {
+ throw Util.handleError(Constants.ErrorMessage.ERROR_TEMPLATE_NOT_FOUND);
+ }
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_DELETING_SMS_TEMPLATE);
+ }
+ }
+}
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/impl/NotificationApiServiceImpl.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/impl/NotificationApiServiceImpl.java
new file mode 100644
index 0000000000..e83134c6a7
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/impl/NotificationApiServiceImpl.java
@@ -0,0 +1,323 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.wso2.carbon.identity.api.server.notification.template.common.Constants;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.NotificationApiService;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.core.TemplateTypeService;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.core.TemplatesService;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.EmailTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.EmailTemplateWithID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SMSTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SMSTemplateWithID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SimpleTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SimpleTemplateTypeID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.TemplateTypeOverview;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.TemplateTypeWithID;
+
+import java.net.URI;
+import javax.ws.rs.core.Response;
+
+import static org.wso2.carbon.identity.api.server.common.Constants.V1_API_PATH_COMPONENT;
+import static org.wso2.carbon.identity.api.server.common.ContextLoader.buildURIForHeader;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.APP_TEMPLATES_PATH;
+import static org.wso2.carbon.identity.api.server.notification.template.common.
+ Constants.NOTIFICATION_TEMPLATES_API_BASE_PATH_EMAIL;
+import static org.wso2.carbon.identity.api.server.notification.template.common.
+ Constants.NOTIFICATION_TEMPLATES_API_BASE_PATH_SMS;
+import static org.wso2.carbon.identity.api.server.notification.template.common.
+ Constants.NOTIFICATION_TEMPLATES_API_PATH;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.ORG_TEMPLATES_PATH;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.PATH_SEPARATOR;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.TEMPLATE_TYPES_PATH;
+
+/**
+ * This is the service implementation class for notification template management related operations.
+ */
+public class NotificationApiServiceImpl implements NotificationApiService {
+
+ @Autowired
+ private TemplatesService templatesService;
+ @Autowired
+ private TemplateTypeService templateTypeService;
+
+ @Override
+ public Response addAppEmailTemplate(String templateTypeId, String appUuid,
+ EmailTemplateWithID emailTemplateWithID) {
+
+ SimpleTemplate simpleEmailTemplate = templatesService.addEmailTemplate(templateTypeId,
+ emailTemplateWithID, appUuid);
+ URI headerLocation = buildURIForHeader(V1_API_PATH_COMPONENT + NOTIFICATION_TEMPLATES_API_PATH
+ + NOTIFICATION_TEMPLATES_API_BASE_PATH_EMAIL + TEMPLATE_TYPES_PATH + PATH_SEPARATOR
+ + templateTypeId + APP_TEMPLATES_PATH + PATH_SEPARATOR + appUuid + PATH_SEPARATOR
+ + simpleEmailTemplate.getLocale());
+ return Response.created(headerLocation).entity(simpleEmailTemplate).build();
+ }
+
+ @Override
+ public Response addAppSMSTemplate(String templateTypeId, String appUuid, SMSTemplateWithID smSTemplateWithID) {
+
+ SimpleTemplate simpleSMSTemplate = templatesService.addSMSTemplate(templateTypeId,
+ smSTemplateWithID, appUuid);
+ URI headerLocation = buildURIForHeader(V1_API_PATH_COMPONENT + NOTIFICATION_TEMPLATES_API_PATH
+ + NOTIFICATION_TEMPLATES_API_BASE_PATH_SMS + TEMPLATE_TYPES_PATH + PATH_SEPARATOR
+ + templateTypeId + APP_TEMPLATES_PATH + PATH_SEPARATOR + appUuid + PATH_SEPARATOR
+ + smSTemplateWithID.getLocale());
+ return Response.created(headerLocation).entity(simpleSMSTemplate).build();
+ }
+
+ @Override
+ public Response addEmailTemplateType(TemplateTypeOverview templateTypeOverview) {
+
+ TemplateTypeWithID templateType = templateTypeService
+ .addNotificationTemplateType(Constants.NOTIFICATION_CHANNEL_EMAIL, templateTypeOverview);
+ URI headerLocation = buildURIForHeader(
+ V1_API_PATH_COMPONENT + NOTIFICATION_TEMPLATES_API_PATH
+ + NOTIFICATION_TEMPLATES_API_BASE_PATH_EMAIL + TEMPLATE_TYPES_PATH
+ + PATH_SEPARATOR + templateType.getId());
+ return Response.created(headerLocation).entity(templateType).build();
+ }
+
+ @Override
+ public Response addOrgEmailTemplate(String templateTypeId, EmailTemplateWithID emailTemplateWithID) {
+
+ SimpleTemplate simpleEmailTemplate = templatesService.addEmailTemplate(templateTypeId,
+ emailTemplateWithID);
+ URI headerLocation = buildURIForHeader(
+ V1_API_PATH_COMPONENT + NOTIFICATION_TEMPLATES_API_PATH
+ + NOTIFICATION_TEMPLATES_API_BASE_PATH_EMAIL + PATH_SEPARATOR + templateTypeId
+ + ORG_TEMPLATES_PATH + PATH_SEPARATOR + simpleEmailTemplate.getLocale());
+ return Response.created(headerLocation).entity(simpleEmailTemplate).build();
+ }
+
+ @Override
+ public Response addOrgSMSTemplate(String templateTypeId, SMSTemplateWithID smSTemplateWithID) {
+
+ SimpleTemplate simpleSMSTemplate = templatesService.addSMSTemplate(templateTypeId,
+ smSTemplateWithID);
+ URI headerLocation = buildURIForHeader(
+ V1_API_PATH_COMPONENT + NOTIFICATION_TEMPLATES_API_PATH
+ + NOTIFICATION_TEMPLATES_API_BASE_PATH_SMS + PATH_SEPARATOR + templateTypeId
+ + ORG_TEMPLATES_PATH + PATH_SEPARATOR + simpleSMSTemplate.getLocale());
+ return Response.created(headerLocation).entity(simpleSMSTemplate).build();
+ }
+
+ @Override
+ public Response addSMSTemplateType(TemplateTypeOverview templateTypeOverview) {
+
+ TemplateTypeWithID templateType = templateTypeService
+ .addNotificationTemplateType(Constants.NOTIFICATION_CHANNEL_SMS, templateTypeOverview);
+ URI headerLocation = buildURIForHeader(
+ V1_API_PATH_COMPONENT + NOTIFICATION_TEMPLATES_API_PATH
+ + NOTIFICATION_TEMPLATES_API_BASE_PATH_SMS + TEMPLATE_TYPES_PATH
+ + PATH_SEPARATOR + templateType.getId());
+ return Response.created(headerLocation).entity(templateType).build();
+ }
+
+ @Override
+ public Response deleteAppEmailTemplate(String templateTypeId, String appUuid, String locale) {
+
+ templatesService.deleteEmailTemplate(templateTypeId, locale, appUuid);
+ return Response.noContent().build();
+ }
+
+ @Override
+ public Response deleteAppSMSTemplate(String templateTypeId, String appUuid, String locale) {
+
+ templatesService.deleteSMSTemplate(templateTypeId, locale, appUuid);
+ return Response.noContent().build();
+ }
+
+ @Override
+ public Response deleteEmailTemplateType(String templateTypeId) {
+
+ templateTypeService.deleteNotificationTemplateType(Constants.NOTIFICATION_CHANNEL_EMAIL, templateTypeId);
+ return Response.noContent().build();
+ }
+
+ @Override
+ public Response deleteOrgEmailTemplate(String templateTypeId, String locale) {
+
+ templatesService.deleteEmailTemplate(templateTypeId, locale);
+ return Response.noContent().build();
+ }
+
+ @Override
+ public Response deleteOrgSMSTemplate(String templateTypeId, String locale) {
+
+ templatesService.deleteSMSTemplate(templateTypeId, locale);
+ return Response.noContent().build();
+ }
+
+ @Override
+ public Response deleteSMSTemplateType(String templateTypeId) {
+
+ templateTypeService.deleteNotificationTemplateType(Constants.NOTIFICATION_CHANNEL_SMS, templateTypeId);
+ return Response.noContent().build();
+ }
+
+ @Override
+ public Response getAllAppTemplatesOfEmailTemplateType(String templateTypeId, String appUuid) {
+
+ return Response.ok().entity(
+ templatesService.getAllTemplatesOfTemplateType(templateTypeId, appUuid,
+ Constants.NOTIFICATION_CHANNEL_EMAIL)).build();
+ }
+
+ @Override
+ public Response getAllAppTemplatesOfSMSTemplateType(String templateTypeId, String appUuid) {
+
+ return Response.ok().entity(
+ templatesService.getAllTemplatesOfTemplateType(templateTypeId, appUuid,
+ Constants.NOTIFICATION_CHANNEL_SMS)).build();
+ }
+
+ @Override
+ public Response getAllEmailTemplateTypes() {
+
+ return Response.ok().entity(templateTypeService
+ .getAllNotificationTemplateTypes(Constants.NOTIFICATION_CHANNEL_EMAIL)).build();
+ }
+
+ @Override
+ public Response getAllOrgTemplatesOfEmailTemplateType(String templateTypeId) {
+
+ return Response.ok().entity(templatesService.getAllTemplatesOfTemplateType(templateTypeId,
+ Constants.NOTIFICATION_CHANNEL_EMAIL)).build();
+ }
+
+ @Override
+ public Response getAllOrgTemplatesOfSMSTemplateType(String templateTypeId) {
+
+ return Response.ok().entity(templatesService.getAllTemplatesOfTemplateType(templateTypeId,
+ Constants.NOTIFICATION_CHANNEL_SMS)).build();
+ }
+
+ @Override
+ public Response getAllSMSTemplateTypes() {
+
+ return Response.ok().entity(templateTypeService
+ .getAllNotificationTemplateTypes(Constants.NOTIFICATION_CHANNEL_SMS)).build();
+ }
+
+ @Override
+ public Response getAllSystemTemplatesOfEmailTemplateType(String templateTypeId) {
+
+ return Response.ok().entity(templatesService
+ .getAllSystemTemplatesOfTemplateType(templateTypeId, Constants.NOTIFICATION_CHANNEL_EMAIL)).build();
+ }
+
+ @Override
+ public Response getAllSystemTemplatesOfSMSTemplateType(String templateTypeId) {
+
+ return Response.ok().entity(templatesService
+ .getAllSystemTemplatesOfTemplateType(templateTypeId, Constants.NOTIFICATION_CHANNEL_SMS)).build();
+ }
+
+ @Override
+ public Response getAppEmailTemplate(String templateTypeId, String appUuid, String locale) {
+
+ return Response.ok().entity(templatesService.getEmailTemplate(templateTypeId, locale, appUuid))
+ .build();
+ }
+
+ @Override
+ public Response getAppSMSTemplate(String templateTypeId, String appUuid, String locale) {
+
+ return Response.ok().entity(templatesService.getSMSTemplate(templateTypeId, locale, appUuid))
+ .build();
+ }
+
+ @Override
+ public Response getEmailTemplateType(String templateTypeId) {
+
+ return Response.ok().entity(templateTypeService.getNotificationTemplateType(
+ Constants.NOTIFICATION_CHANNEL_EMAIL, templateTypeId)).build();
+ }
+
+ @Override
+ public Response getOrgEmailTemplate(String templateTypeId, String locale) {
+
+ return Response.ok().entity(templatesService.getEmailTemplate(templateTypeId, locale)).build();
+ }
+
+ @Override
+ public Response getOrgSMSTemplate(String templateTypeId, String locale) {
+
+ return Response.ok().entity(templatesService.getSMSTemplate(templateTypeId, locale)).build();
+ }
+
+ @Override
+ public Response getSMSTemplateType(String templateTypeId) {
+
+ return Response.ok().entity(templateTypeService.getNotificationTemplateType(Constants.NOTIFICATION_CHANNEL_SMS,
+ templateTypeId)).build();
+ }
+
+ @Override
+ public Response getSystemEmailTemplate(String templateTypeId, String locale) {
+
+ return Response.ok().entity(templatesService.getSystemEmailTemplate(templateTypeId, locale)).build();
+ }
+
+ @Override
+ public Response getSystemSMSTemplate(String templateTypeId, String locale) {
+
+ return Response.ok().entity(templatesService.getSystemSmsTemplate(templateTypeId, locale)).build();
+ }
+
+ @Override
+ public Response resetTemplateType(SimpleTemplateTypeID simpleTemplateTypeID) {
+
+ templateTypeService.resetTemplateType(simpleTemplateTypeID.getChannel(),
+ simpleTemplateTypeID.getTemplateTypeId());
+ return Response.noContent().build();
+ }
+
+ @Override
+ public Response updateAppEmailTemplate(String templateTypeId, String appUuid, String locale,
+ EmailTemplate emailTemplate) {
+
+ templatesService.updateEmailTemplate(templateTypeId, locale, emailTemplate, appUuid);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response updateAppSMSTemplate(String templateTypeId, String appUuid, String locale,
+ SMSTemplate smSTemplate) {
+
+ templatesService.updateSMSTemplate(templateTypeId, locale, smSTemplate, appUuid);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response updateOrgEmailTemplate(String templateTypeId, String locale, EmailTemplate emailTemplate) {
+
+ templatesService.updateEmailTemplate(templateTypeId, locale, emailTemplate);
+ return Response.ok().build();
+ }
+
+ @Override
+ public Response updateOrgSMSTemplate(String templateTypeId, String locale, SMSTemplate smSTemplate) {
+
+ templatesService.updateSMSTemplate(templateTypeId, locale, smSTemplate);
+ return Response.ok().build();
+ }
+}
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/util/Util.java b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/util/Util.java
new file mode 100644
index 0000000000..fe126c04e5
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/java/org/wso2/carbon/identity/rest/api/server/notification/template/v1/util/Util.java
@@ -0,0 +1,349 @@
+/*
+ * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
+ *
+ * WSO2 LLC. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.carbon.identity.rest.api.server.notification.template.v1.util;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.email.mgt.util.I18nEmailUtil;
+import org.wso2.carbon.identity.api.server.common.ContextLoader;
+import org.wso2.carbon.identity.api.server.common.error.APIError;
+import org.wso2.carbon.identity.api.server.common.error.ErrorResponse;
+import org.wso2.carbon.identity.api.server.notification.template.common.Constants;
+import org.wso2.carbon.identity.api.server.notification.template.common.TemplatesServiceHolder;
+import org.wso2.carbon.identity.governance.exceptions.notiification.NotificationTemplateManagerClientException;
+import org.wso2.carbon.identity.governance.exceptions.notiification.NotificationTemplateManagerException;
+import org.wso2.carbon.identity.governance.exceptions.notiification.NotificationTemplateManagerServerException;
+import org.wso2.carbon.identity.governance.model.NotificationTemplate;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.EmailTemplateWithID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SMSTemplateWithID;
+import org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SimpleTemplate;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.ws.rs.core.Response;
+
+import static org.wso2.carbon.identity.api.server.common.Constants.V1_API_PATH_COMPONENT;
+import static org.wso2.carbon.identity.api.server.common.ContextLoader.getTenantDomainFromContext;
+import static org.wso2.carbon.identity.api.server.common.Util.base64URLDecode;
+import static org.wso2.carbon.identity.api.server.common.Util.base64URLEncode;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.APP_TEMPLATES_PATH;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.NOTIFICATION_CHANNEL_EMAIL;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.NOTIFICATION_TEMPLATES_API_BASE_PATH_EMAIL;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.NOTIFICATION_TEMPLATES_API_BASE_PATH_SMS;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.NOTIFICATION_TEMPLATES_API_PATH;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.ORG_TEMPLATES_PATH;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.PATH_SEPARATOR;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.SYSTEM_TEMPLATES_PATH;
+import static org.wso2.carbon.identity.api.server.notification.template.common.Constants.TEMPLATE_TYPES_PATH;
+
+/**
+ * Utility class for notification templates API
+ */
+public class Util {
+
+ private static final Log log = LogFactory.getLog(Util.class);
+
+ private static final String ERROR_CODE_DELIMITER = "-";
+
+ /**
+ * Builds a list of SimpleTemplate objects using the provided NotificationTemplate list.
+ *
+ * @param templates NotificationTemplate list.
+ * @param applicationUuid Application UUID.
+ * @param templateOwner Template owner.
+ * @param notificationChannel Notification channel.
+ * @return List of SimpleTemplate objects.
+ */
+ public static List buildSimpleTemplateList(List templates,
+ String applicationUuid, String templateOwner, String notificationChannel) {
+
+ List simpleTemplates = new ArrayList<>();
+ if (templates != null) {
+ for (NotificationTemplate template : templates) {
+ SimpleTemplate simpleTemplate = new SimpleTemplate();
+ String templateTypeId = base64URLEncode(template.getDisplayName());
+ String templateTypeLocation =
+ getTemplateTypeLocation(templateTypeId, notificationChannel);
+ simpleTemplate.setSelf(getTemplateLocation(templateTypeLocation, applicationUuid,
+ template.getLocale(), templateOwner));
+ simpleTemplate.setLocale(template.getLocale());
+ simpleTemplates.add(simpleTemplate);
+ }
+ }
+ return simpleTemplates;
+ }
+
+ /**
+ * Resolves templateID using the templateTypeDisplayName.
+ *
+ * @param templateTypeDisplayName Display name of the template type.
+ * @return templateID.
+ */
+ public static String resolveTemplateIdFromDisplayName(String templateTypeDisplayName) {
+
+ return base64URLEncode(templateTypeDisplayName);
+ }
+
+ /**
+ * Decodes the template type ID.
+ *
+ * @param encodedTemplateTypeId Encoded template type ID.
+ * @return Decoded template type ID.
+ */
+ public static String decodeTemplateTypeId(String encodedTemplateTypeId) {
+
+ try {
+ return base64URLDecode(encodedTemplateTypeId);
+ } catch (Throwable e) {
+ throw handleError(Constants.ErrorMessage.ERROR_TEMPLATE_TYPE_NOT_FOUND);
+ }
+ }
+
+ /**
+ * Handles the error and returns an APIError object.
+ *
+ * @param error Error message.
+ * @return APIError object.
+ */
+ public static APIError handleError(Constants.ErrorMessage error) {
+
+ return new APIError(error.getHttpStatus(), getErrorBuilder(error).build());
+ }
+
+ /**
+ * Handles the I18nEmailMgtException and returns an APIError object.
+ *
+ * @param exception I18nEmailMgtException.
+ * @param errorEnum Error message.
+ * @return APIError object.
+ */
+ public static APIError handleNotificationTemplateManagerException(NotificationTemplateManagerException exception,
+ Constants.ErrorMessage errorEnum) {
+
+ ErrorResponse errorResponse;
+ Response.Status status;
+ String errorCode = extractErrorCode(exception.getErrorCode());
+ if (exception instanceof NotificationTemplateManagerServerException
+ && Constants.getNTMMappedErrorMessage(errorCode) != null) {
+ // Specific error with code is found.
+ Constants.ErrorMessage errorMessage = Constants.getNTMMappedErrorMessage(errorCode);
+ errorResponse = getErrorBuilder(errorMessage).build(log, exception, errorEnum.getDescription());
+ status = errorMessage.getHttpStatus();
+ } else if (exception instanceof NotificationTemplateManagerClientException) {
+ // Send client error with original exception message.
+ errorResponse = getErrorBuilder(errorEnum).build(log, exception.getMessage());
+ errorResponse.setDescription(exception.getMessage());
+ status = Response.Status.BAD_REQUEST;
+ } else {
+ // Server error
+ errorResponse = getErrorBuilder(errorEnum).build(log, exception, errorEnum.getDescription());
+ status = Response.Status.INTERNAL_SERVER_ERROR;
+ }
+ return new APIError(status, errorResponse);
+ }
+
+ /**
+ * Builds EmailTemplateWithID using NotificationTemplate.
+ *
+ * @param internalTemplate NotificationTemplate object.
+ * @return EmailTemplateWithID object.
+ */
+ public static EmailTemplateWithID buildEmailTemplateWithID(NotificationTemplate internalTemplate) {
+
+ EmailTemplateWithID templateWithID = new EmailTemplateWithID();
+ templateWithID.setLocale(internalTemplate.getLocale());
+ templateWithID.setContentType(internalTemplate.getContentType());
+ templateWithID.setSubject(internalTemplate.getSubject());
+ templateWithID.setBody(internalTemplate.getBody());
+ templateWithID.setFooter(internalTemplate.getFooter());
+ return templateWithID;
+ }
+
+ /**
+ * Builds SMSTemplateWithID using NotificationTemplate.
+ *
+ * @param internalTemplate NotificationTemplate object.
+ * @return SMSTemplateWithID object.
+ */
+ public static SMSTemplateWithID buildSMSTemplateWithID(NotificationTemplate internalTemplate) {
+
+ SMSTemplateWithID templateWithID = new SMSTemplateWithID();
+ templateWithID.setLocale(internalTemplate.getLocale());
+ templateWithID.setBody(internalTemplate.getBody());
+ return templateWithID;
+ }
+
+ /**
+ * Builds NotificationTemplate object using SMSTemplateWithID object.
+ *
+ * @param templateTypeId Template type ID.
+ * @param smsTemplateWithID SMSTemplateWithID Object.
+ * @return NotificationTemplate object built using provided values.
+ */
+ public static NotificationTemplate buildNotificationTemplateWithSMSTemplateWithID(String templateTypeId,
+ SMSTemplateWithID smsTemplateWithID) {
+
+ String templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ NotificationTemplate notificationTemplate = new NotificationTemplate();
+ notificationTemplate.setNotificationChannel(Constants.NOTIFICATION_CHANNEL_SMS);
+ notificationTemplate.setLocale(smsTemplateWithID.getLocale());
+ notificationTemplate.setBody(smsTemplateWithID.getBody());
+ notificationTemplate.setDisplayName(templateTypeDisplayName);
+ notificationTemplate.setLocale(smsTemplateWithID.getLocale());
+ notificationTemplate.setType(I18nEmailUtil.getNormalizedName(templateTypeDisplayName));
+ return notificationTemplate;
+ }
+
+ /**
+ * Builds NotificationTemplate object using EmailTemplateWithID object.
+ *
+ * @param templateTypeId Template type ID.
+ * @param emailTemplateWithID EmailTemplateWithID Object.
+ * @return NotificationTemplate object built using provided values.
+ */
+ public static NotificationTemplate buildNotificationTemplateWithEmailTemplateWithID(String templateTypeId,
+ EmailTemplateWithID emailTemplateWithID) {
+
+ String templateTypeDisplayName = Util.decodeTemplateTypeId(templateTypeId);
+ NotificationTemplate notificationTemplate = new NotificationTemplate();
+ notificationTemplate.setNotificationChannel(Constants.NOTIFICATION_CHANNEL_EMAIL);
+ notificationTemplate.setLocale(emailTemplateWithID.getLocale());
+ notificationTemplate.setBody(emailTemplateWithID.getBody());
+ notificationTemplate.setDisplayName(templateTypeDisplayName);
+ notificationTemplate.setType(I18nEmailUtil.getNormalizedName(templateTypeDisplayName));
+ notificationTemplate.setSubject(emailTemplateWithID.getSubject());
+ notificationTemplate.setFooter(emailTemplateWithID.getFooter());
+ notificationTemplate.setContentType(emailTemplateWithID.getContentType());
+ return notificationTemplate;
+ }
+
+ /**
+ * Verify that the existence of the template type.
+ *
+ * @param notificationChannel Notification channel.
+ * @param templateTypeDisplayName Template type display name.
+ */
+ public static void verifyTemplateTypeExists(String notificationChannel, String templateTypeDisplayName) {
+
+ try {
+ boolean isTemplateTypeExists = TemplatesServiceHolder.getNotificationTemplateManager()
+ .isNotificationTemplateTypeExists(notificationChannel, templateTypeDisplayName,
+ getTenantDomainFromContext());
+ if (!isTemplateTypeExists) {
+ throw Util.handleError(Constants.ErrorMessage.ERROR_TEMPLATE_TYPE_NOT_FOUND);
+ }
+ } catch (NotificationTemplateManagerException e) {
+ throw Util.handleNotificationTemplateManagerException(e,
+ Constants.ErrorMessage.ERROR_ERROR_RETRIEVING_TEMPLATE_TYPE);
+ }
+ }
+
+ /**
+ * Builds the location of the template type.
+ *
+ * @param templateTypeId Template type ID.
+ * @param notificationChannel Notification channel type.
+ * @return Location of the template.
+ */
+ public static String getTemplateTypeLocation(String templateTypeId, String notificationChannel) {
+
+ String templateTypePath;
+ // Only EMAIL and SMS are passed as the type. So, no need to check for other types.
+ if (NOTIFICATION_CHANNEL_EMAIL.equals(notificationChannel)) {
+ templateTypePath = NOTIFICATION_TEMPLATES_API_BASE_PATH_EMAIL;
+ } else {
+ templateTypePath = NOTIFICATION_TEMPLATES_API_BASE_PATH_SMS;
+ }
+ String location = V1_API_PATH_COMPONENT + NOTIFICATION_TEMPLATES_API_PATH + templateTypePath
+ + TEMPLATE_TYPES_PATH + PATH_SEPARATOR + templateTypeId;
+ return ContextLoader.buildURIForBody(location).toString();
+ }
+
+ /**
+ * Generates EmailTemplateWithID using provided values.
+ *
+ * @param emailTemplate EmailTemplate object.
+ * @param locale Locale.
+ * @return EmailTemplateWithID object.
+ */
+ public static EmailTemplateWithID buildEmailTemplateWithIdUsingEmailTemplate(
+ org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.EmailTemplate emailTemplate,
+ String locale) {
+ EmailTemplateWithID emailTemplateWithID = new EmailTemplateWithID();
+ emailTemplateWithID.setLocale(locale);
+ emailTemplateWithID.setContentType(emailTemplate.getContentType());
+ emailTemplateWithID.setSubject(emailTemplate.getSubject());
+ emailTemplateWithID.setBody(emailTemplate.getBody());
+ emailTemplateWithID.setFooter(emailTemplate.getFooter());
+ return emailTemplateWithID;
+ }
+
+ /**
+ * Generates SMSTemplateWithID using provided values.
+ *
+ * @param smsTemplate SMSTemplate object.
+ * @param locale Locale.
+ * @return SMSTemplateWithID object.
+ */
+ public static SMSTemplateWithID buildSMSTemplateWithIdUsingSMSTemplate(
+ org.wso2.carbon.identity.rest.api.server.notification.template.v1.model.SMSTemplate smsTemplate,
+ String locale) {
+
+ SMSTemplateWithID smsTemplateWithID = new SMSTemplateWithID();
+ smsTemplateWithID.setLocale(locale);
+ smsTemplateWithID.setBody(smsTemplate.getBody());
+ return smsTemplateWithID;
+ }
+
+
+ /**
+ * Generates self url for application templates.
+ *
+ * @param templateTypeLocation Template type ID.
+ * @param applicationUuid Application UUID.
+ * @param locale Locale.
+ * @return SimpleTemplate object.
+ */
+ public static String getTemplateLocation(String templateTypeLocation, String applicationUuid, String locale,
+ String templateOwner) {
+
+ switch (templateOwner) {
+ case Constants.NOTIFICATION_TEMPLATE_OWNER_APP:
+ return templateTypeLocation + APP_TEMPLATES_PATH + PATH_SEPARATOR + applicationUuid
+ + PATH_SEPARATOR + locale;
+ case Constants.NOTIFICATION_TEMPLATE_OWNER_ORG:
+ return templateTypeLocation + ORG_TEMPLATES_PATH + PATH_SEPARATOR + locale;
+ case Constants.NOTIFICATION_TEMPLATE_OWNER_SYSTEM:
+ return templateTypeLocation + SYSTEM_TEMPLATES_PATH + PATH_SEPARATOR + locale;
+ default:
+ return null;
+ }
+ }
+
+ private static ErrorResponse.Builder getErrorBuilder(Constants.ErrorMessage errorMsg) {
+
+ return new ErrorResponse.Builder().withCode(errorMsg.getCode()).
+ withMessage(errorMsg.getMessage()).withDescription(errorMsg.getDescription());
+ }
+
+ private static String extractErrorCode(String errorCodeWithScenario) {
+
+ return errorCodeWithScenario.split(ERROR_CODE_DELIMITER)[1];
+ }
+}
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/resources/META-INF/cxf/notification-template-server-v1-cxf.xml b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/resources/META-INF/cxf/notification-template-server-v1-cxf.xml
new file mode 100644
index 0000000000..27e3f3b5be
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/resources/META-INF/cxf/notification-template-server-v1-cxf.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/resources/notification-template.yml b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/resources/notification-template.yml
new file mode 100644
index 0000000000..0e05a947bb
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/org.wso2.carbon.identity.rest.api.server.notification.template.v1/src/main/resources/notification-template.yml
@@ -0,0 +1,1312 @@
+openapi: 3.0.0
+info:
+ title: "WSO2 Identity Server - Notification Template API"
+ version: 1.0.0
+ description: >-
+ This is the RESTful API for managing notification templates in the WSO2 Identity
+ Server. This API allows adding, retrieving, replacing, and removing notification
+ templates and template types.
+tags:
+ - name: Email Template Types
+ description: An email template type can have multiple email templates for different languages.
+ - name: Email Templates
+ description: An email template of a specific type and a language.
+ - name: Application Email Templates
+ description: An application email template of a specific type and a language.
+ - name: SMS Template Types
+ description: A SMS template type can have multiple SMS templates for different languages.
+ - name: SMS Templates
+ description: A SMS template of a specific type and a language.
+ - name: Application SMS Templates
+ description: An application email template of a specific type and a language.
+ - name: System Templates
+ description: A system default template of a specific type and a language.
+security:
+ - OAuth2: []
+ - BasicAuth: []
+paths:
+ /notification/email/template-types:
+ get:
+ tags:
+ - Email Template Types
+ summary: Retrieves all the email template types.
+ operationId: getAllEmailTemplateTypes
+ description: |
+ Retrieves all the email template types in the system.
+
+
+ Scope required:
+
* internal_email_mgt_view / internal_template_mgt_view
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/TemplateTypeWithID'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ post:
+ tags:
+ - Email Template Types
+ summary: Adds a new email template type.
+ operationId: addEmailTemplateType
+ description: |
+ Adds a new email template type to the system. An email template type can have any number of
+ organization or application email templates.
+
+ * Attribute _**displayName**_ of the template type should be unique.
+
+ Scope required:
+
* internal_email_mgt_create / internal_template_mgt_update
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/TemplateTypeOverview'
+ description: Email template type to be added.
+ responses:
+ '201':
+ description: Item Created
+ headers:
+ self:
+ description: Location of the newly created email template type.
+ schema:
+ type: string
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/TemplateTypeWithID'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '409':
+ $ref: '#/components/responses/Conflict'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/email/template-types/{template-type-id}':
+ get:
+ tags:
+ - Email Template Types
+ summary: Retrieves the email template type corresponding to the template type id.
+ operationId: getEmailTemplateType
+ description: |
+ Retrieves the email template type in the system identified by the template-type-id.
+
+ Scope required:
+ * internal_email_mgt_view / internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/TemplateTypeWithID'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ delete:
+ tags:
+ - Email Template Types
+ summary: Removes an email template type.
+ operationId: deleteEmailTemplateType
+ description: |
+ Removes an existing email template type with all its email templates
+ from the system.
+ **Note : System resources are not eligible for deletion.**
+ Attempt to delete a system resource will result in a 403 Forbidden error.
+
+ Scope required:
+ * internal_email_mgt_delete / internal_template_mgt_delete
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ responses:
+ '204':
+ $ref: '#/components/responses/Deleted'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/reset-template-type':
+ post:
+ tags:
+ - Functions
+ summary: Resets an template type.
+ operationId: resetTemplateType
+ description: |
+ Resets an existing template type by deleting all its **user defined** templates
+ from the system.
+
+ Scope required:
+ * internal_template_mgt_delete
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SimpleTemplateTypeID'
+ responses:
+ '204':
+ $ref: '#/components/responses/Deleted'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/email/template-types/{template-type-id}/org-templates':
+ get:
+ tags:
+ - Email Templates
+ summary: Retrieves the list of organization email templates under the provided template type.
+ operationId: getAllOrgTemplatesOfEmailTemplateType
+ description: |
+ Retrieves the list of organization email templates under the provided template type.
+
+ Scope required:
+ * internal_email_mgt_view / internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/SimpleTemplate'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ post:
+ tags:
+ - Email Templates
+ summary: Adds a new organization email template to an existing email template type.
+ operationId: addOrgEmailTemplate
+ description: |
+ Another organization email template with the same locale should not already exist in the
+ respective email template type.
+
+ Scope required:
+ * internal_email_mgt_create / internal_template_mgt_update
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/EmailTemplateWithID'
+ description: Email template to be added.
+ responses:
+ '201':
+ description: Item Created
+ headers:
+ Location:
+ description: Location of the newly created email template.
+ schema:
+ type: string
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SimpleTemplate'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '409':
+ $ref: '#/components/responses/Conflict'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/email/template-types/{template-type-id}/app-templates/{app-uuid}':
+ get:
+ tags:
+ - Application Email Templates
+ summary: Retrieves the list of application email templates under the provided template type.
+ operationId: getAllAppTemplatesOfEmailTemplateType
+ description: |
+ Retrieves the list of application email templates under the provided template type.
+
+ Scope required:
+ * internal_email_mgt_view / internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/appUuidPathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/SimpleTemplate'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ post:
+ tags:
+ - Application Email Templates
+ summary: Adds a new application email template to an existing email template type.
+ operationId: addAppEmailTemplate
+ description: |
+ Another application email template with the same locale should not already exist in the
+ respective email template type.
+
+ Scope required:
+ * internal_email_mgt_create / internal_template_mgt_update
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/appUuidPathParam'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/EmailTemplateWithID'
+ description: Email template to be added.
+ responses:
+ '201':
+ description: Item Created
+ headers:
+ Location:
+ description: Location of the newly created email template.
+ schema:
+ type: string
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SimpleTemplate'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '409':
+ $ref: '#/components/responses/Conflict'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/email/template-types/{template-type-id}/org-templates/{locale}':
+ get:
+ tags:
+ - Email Templates
+ summary: Retrieves a single organization email template.
+ operationId: getOrgEmailTemplate
+ description: |
+ Retrieves the organization email template that matches to the template-type-id and the locale.
+
+ Scope required:
+ * internal_email_mgt_view / internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/EmailTemplateWithID'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ put:
+ tags:
+ - Email Templates
+ summary: Replaces an existing organization email template.
+ operationId: updateOrgEmailTemplate
+ description: |
+ Replaces the organization email template identified by the template-type-id and the locale.
+
+ Scope required:
+ * internal_email_mgt_update / internal_template_mgt_update
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/EmailTemplate'
+ description: Updated email template for the template type.
+ responses:
+ '200':
+ $ref: '#/components/responses/Updated'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ delete:
+ tags:
+ - Email Templates
+ summary: Removes an organization email template.
+ operationId: deleteOrgEmailTemplate
+ description: |
+ Removes an organization email template identified by the template-type-id and the locale.
+
+ Scope required:
+ * internal_email_mgt_delete / internal_template_mgt_delete
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ responses:
+ '204':
+ $ref: '#/components/responses/Deleted'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/email/template-types/{template-type-id}/system-templates':
+ get:
+ tags:
+ - System Templates
+ summary: Retrieves the system email templates of template type.
+ operationId: getAllSystemTemplatesOfEmailTemplateType
+ description: |
+ Retrieves the list of system default email templates under the provided template type.
+
+ Scope required:
+ * internal_email_mgt_view / internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/SimpleTemplate'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/email/template-types/{template-type-id}/system-templates/{locale}':
+ get:
+ tags:
+ - System Templates
+ summary: Retrieves the default email template for given type and locale.
+ operationId: getSystemEmailTemplate
+ description: |
+ Retrieves the system default email template that matches the template-type-id and the locale.
+
+ Scope required:
+ * internal_email_mgt_view / internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/EmailTemplateWithID'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/email/template-types/{template-type-id}/app-templates/{app-uuid}/{locale}':
+ get:
+ tags:
+ - Application Email Templates
+ summary: Retrieves a single email template of application.
+ operationId: getAppEmailTemplate
+ description: |
+ Retrieves the application email template that matches to the template-type-id and the locale.
+
+ Scope required:
+ * internal_email_mgt_view / internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/appUuidPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/EmailTemplateWithID'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ put:
+ tags:
+ - Application Email Templates
+ summary: Replaces an existing application email template.
+ operationId: updateAppEmailTemplate
+ description: |
+ Replaces the application email template identified by the template-type-id and the locale.
+
+ Scope required:
+ * internal_email_mgt_update / internal_template_mgt_update
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/appUuidPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/EmailTemplate'
+ description: Email templates for the template type.
+ responses:
+ '200':
+ $ref: '#/components/responses/Updated'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ delete:
+ tags:
+ - Application Email Templates
+ summary: Removes an application email template.
+ operationId: deleteAppEmailTemplate
+ description: |
+ Removes an application email template identified by the template-type-id and the locale.
+
+ Scope required:
+ * internal_email_mgt_delete / internal_template_mgt_delete
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/appUuidPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ responses:
+ '204':
+ $ref: '#/components/responses/Deleted'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ /notification/sms/template-types:
+ get:
+ tags:
+ - SMS Template Types
+ summary: Retrieves all the SMS template types.
+ operationId: getAllSMSTemplateTypes
+ description: |
+ Retrieves all the SMS template types in the system.
+
+ Scope required:
+ * internal_template_mgt_view
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/TemplateTypeWithID'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ post:
+ tags:
+ - SMS Template Types
+ summary: Adds a new SMS template type.
+ operationId: addSMSTemplateType
+ description: |
+ Adds a new SMS template type to the system. A SMS template type can have any number of
+ organization or application SMS templates.
+
+ * Attribute _**displayName**_ of the template type should be unique.
+
+ Scope required:
+ * internal_template_mgt_create
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/TemplateTypeOverview'
+ description: SMS template type to be added.
+ responses:
+ '201':
+ description: Item Created
+ headers:
+ self:
+ description: Location of the newly created SMS template type.
+ schema:
+ type: string
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/TemplateTypeWithID'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '409':
+ $ref: '#/components/responses/Conflict'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/sms/template-types/{template-type-id}':
+ get:
+ tags:
+ - SMS Template Types
+ summary: Retrieves the SMS template type corresponding to the template type id.
+ operationId: getSMSTemplateType
+ description: |
+ Retrieves the SMS template type in the system identified by the template-type-id.
+
+ Scope required:
+ * internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/TemplateTypeWithID'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ delete:
+ tags:
+ - SMS Template Types
+ summary: Removes a SMS template type.
+ operationId: deleteSMSTemplateType
+ description: |
+ Removes an existing SMS template type with all its SMS templates
+ from the system.
+ **Note : System resources are not eligible for deletion.**
+ Attempt to delete a system resource will result in a 403 Forbidden error.
+
+ Scope required:
+ * internal_template_mgt_delete
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ responses:
+ '204':
+ $ref: '#/components/responses/Deleted'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/sms/template-types/{template-type-id}/app-templates/{app-uuid}':
+ get:
+ tags:
+ - Application SMS Templates
+ summary: Retrieves the list of application SMS templates under the provided template type.
+ operationId: getAllAppTemplatesOfSMSTemplateType
+ description: |
+ Retrieves the list of application SMS templates under the provided template type.
+
+ Scope required:
+ * internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/appUuidPathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/SimpleTemplate'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ post:
+ tags:
+ - Application SMS Templates
+ summary: Adds a new application SMS template to an existing SMS template type.
+ operationId: addAppSMSTemplate
+ description: |
+ Another application SMS template with the same locale should not already exist in the
+ respective SMS template type.
+
+ Scope required:
+ * internal_template_mgt_create
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/appUuidPathParam'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SMSTemplateWithID'
+ description: SMS template to be added.
+ responses:
+ '201':
+ description: Item Created
+ headers:
+ Location:
+ description: Location of the newly created SMS template.
+ schema:
+ type: string
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SimpleTemplate'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '409':
+ $ref: '#/components/responses/Conflict'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/sms/template-types/{template-type-id}/app-templates/{app-uuid}/{locale}':
+ get:
+ tags:
+ - Application SMS Templates
+ summary: Retrieves a single SMS template of application.
+ operationId: getAppSMSTemplate
+ description: |
+ Retrieves the application SMS template that matches to the template-type-id and the locale.
+
+ Scope required:
+ * internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/appUuidPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SMSTemplateWithID'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ put:
+ tags:
+ - Application SMS Templates
+ summary: Replaces an existing application SMS template.
+ operationId: updateAppSMSTemplate
+ description: |
+ Replaces the application SMS template identified by the template-type-id and the locale.
+
+ Scope required:
+ * internal_template_mgt_update
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/appUuidPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SMSTemplate'
+ description: Application SMS template for the template type and locale.
+ responses:
+ '200':
+ $ref: '#/components/responses/Updated'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ delete:
+ tags:
+ - Application SMS Templates
+ summary: Removes a SMS template.
+ operationId: deleteAppSMSTemplate
+ description: |
+ Removes a SMS template identified by the template-type-id and the locale.
+
+ Scope required:
+ * internal_template_mgt_delete
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/appUuidPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ responses:
+ '204':
+ $ref: '#/components/responses/Deleted'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/sms/template-types/{template-type-id}/org-templates':
+ get:
+ tags:
+ - SMS Templates
+ summary: Retrieves the list of organization SMS templates under the provided template type.
+ operationId: getAllOrgTemplatesOfSMSTemplateType
+ description: |
+ Retrieves the list of organization SMS templates under the provided templalte type.
+
+ Scope required:
+ * internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/SimpleTemplate'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ post:
+ tags:
+ - SMS Templates
+ summary: Adds a new organization SMS template to an existing SMS template type.
+ operationId: addOrgSMSTemplate
+ description: |
+ Another organization SMS template with the same locale should not already exist in the
+ respective SMS template type.
+
+ Scope required:
+ * internal_template_mgt_create
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SMSTemplateWithID'
+ description: SMS template to be added.
+ responses:
+ '201':
+ description: Item Created
+ headers:
+ Location:
+ description: Location of the newly created SMS template.
+ schema:
+ type: string
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SimpleTemplate'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '409':
+ $ref: '#/components/responses/Conflict'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/sms/template-types/{template-type-id}/org-templates/{locale}':
+ get:
+ tags:
+ - SMS Templates
+ summary: Retrieves a single organization SMS template.
+ operationId: getOrgSMSTemplate
+ description: |
+ Retrieves the organization SMS template that matches to the template-type-id and the locale.
+
+ Scope required:
+ * internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SMSTemplateWithID'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ put:
+ tags:
+ - SMS Templates
+ summary: Replaces an existing organization SMS template.
+ operationId: updateOrgSMSTemplate
+ description: |
+ Replaces the organization SMS template identified by the template-type-id and the locale.
+
+ Scope required:
+ * internal_template_mgt_update
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SMSTemplate'
+ description: Updated SMS template for the template type.
+ responses:
+ '200':
+ $ref: '#/components/responses/Updated'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ delete:
+ tags:
+ - SMS Templates
+ summary: Removes an organization SMS template.
+ operationId: deleteOrgSMSTemplate
+ description: |
+ Removes an organization SMS template identified by the template-type-id and the locale.
+
+ Scope required:
+ * internal_template_mgt_delete
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ responses:
+ '204':
+ $ref: '#/components/responses/Deleted'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/sms/template-types/{template-type-id}/system-templates':
+ get:
+ tags:
+ - System Templates
+ summary: Retrieves the list of system SMS templates with the template type id.
+ operationId: getAllSystemTemplatesOfSMSTemplateType
+ description: |
+ Retrieves the list of system default SMS templates under the provided template type.
+
+ Scope required:
+ * internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/SimpleTemplate'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+ '/notification/sms/template-types/{template-type-id}/system-templates/{locale}':
+ get:
+ tags:
+ - System Templates
+ summary: Retrieves the default organization SMS template.
+ operationId: getSystemSMSTemplate
+ description: |
+ Retrieves the system default SMS template that matches to the template-type-id and the locale.
+
+ Scope required:
+ * internal_template_mgt_view
+ parameters:
+ - $ref: '#/components/parameters/templateTypeIdPathParam'
+ - $ref: '#/components/parameters/localePathParam'
+ responses:
+ '200':
+ description: Search results matching the given criteria.
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/SMSTemplateWithID'
+ '400':
+ $ref: '#/components/responses/InvalidInput'
+ '401':
+ $ref: '#/components/responses/Unauthorized'
+ '403':
+ $ref: '#/components/responses/Forbidden'
+ '404':
+ $ref: '#/components/responses/NotFound'
+ '500':
+ $ref: '#/components/responses/ServerError'
+
+servers:
+ # Added by API Auto Mocking Plugin
+ - url: 'https://localhost:9443/t/{tenant-domain}/api/server/v1'
+ variables:
+ tenant-domain:
+ default: unknown
+
+components:
+ parameters:
+ templateTypeIdPathParam:
+ in: path
+ name: template-type-id
+ required: true
+ description: Template Type ID.
+ schema:
+ type: string
+ localePathParam:
+ in: path
+ name: locale
+ required: true
+ description: This should be a valid locale.
+ schema:
+ type: string
+ appUuidPathParam:
+ in: path
+ name: app-uuid
+ required: true
+ description: Application UUID.
+ schema:
+ type: string
+ responses:
+ NotFound:
+ description: The specified resource is not found.
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/Error'
+ Unauthorized:
+ description: Unauthorized.
+ Forbidden:
+ description: Forbidden.
+ ServerError:
+ description: Internal Server Error.
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/Error'
+ InvalidInput:
+ description: Invalid input request.
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/Error'
+ Conflict:
+ description: Item Already Exists.
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/Error'
+ Deleted:
+ description: Item/s Deleted.
+ Updated:
+ description: Item Updated.
+ securitySchemes:
+ BasicAuth:
+ type: http
+ scheme: basic
+ OAuth2:
+ type: oauth2
+ flows:
+ authorizationCode:
+ authorizationUrl: 'https://localhost:9443/oauth2/authorize'
+ tokenUrl: 'https://localhost:9443/oauth2/token'
+ scopes: {}
+ schemas:
+ TemplateType:
+ type: object
+ required:
+ - displayName
+ - self
+ properties:
+ displayName:
+ type: string
+ example: Account Confirmation
+ description: Display name of the template type.
+ self:
+ type: string
+ example: /t/{tenant-domain}/api/server/v1/notification/{{email|sms}}/template-types/YWNjb3VudGNvbmZpcm1hdGlvbg
+ description: Location of the created/updated resource.
+ TemplateTypeOverview:
+ type: object
+ required:
+ - displayName
+ properties:
+ displayName:
+ type: string
+ example: Account Confirmation
+ description: Display name of the template type.
+ TemplateTypeWithID:
+ allOf:
+ - $ref: '#/components/schemas/TemplateType'
+ - required:
+ - id
+ properties:
+ id:
+ type: string
+ example: YWNjb3VudGNvbmZpcm1hdGlvbg
+ description: Unique ID of the template type.
+ EmailTemplate:
+ type: object
+ required:
+ - contentType
+ - subject
+ - body
+ properties:
+ contentType:
+ type: string
+ example: text/html
+ description: Content type of the email template.
+ subject:
+ type: string
+ example: WSO2 - Account Confirmation
+ description: The subject of the email.
+ body:
+ type: string
+ example: HTML Body
+ description: The body of the email.
+ footer:
+ type: string
+ example: WSO2 Identity Server Team
+ description: The footer of the email.
+ EmailTemplateWithID:
+ allOf:
+ - $ref: '#/components/schemas/EmailTemplate'
+ - required:
+ - locale
+ properties:
+ locale:
+ type: string
+ example: en_US
+ description: >-
+ Locale of the email template.
+ SMSTemplate:
+ type: object
+ required:
+ - body
+ properties:
+ body:
+ type: string
+ example: SMS Body
+ description: The body of the SMS.
+ SMSTemplateWithID:
+ allOf:
+ - $ref: '#/components/schemas/SMSTemplate'
+ - required:
+ - locale
+ properties:
+ locale:
+ type: string
+ example: en_US
+ description: >-
+ Locale of the SMS template.
+ SimpleTemplate:
+ type: object
+ required:
+ - locale
+ - self
+ properties:
+ locale:
+ type: string
+ example: en_US
+ description: >-
+ Locale of the template.
+ self:
+ type: string
+ example: /t/{tenant-domain}/api/server/v1/notification/{{email|sms}}/template-types/YWNjb3VudGNvbmZpcm1hdGlvbg/{{org|app|system}}templates/en_US
+ description: Location of the created/updated resource. resource.
+ SimpleTemplateTypeID:
+ type: object
+ required:
+ - templateTypeId
+ - channel
+ properties:
+ templateTypeId:
+ type: string
+ example: YWNjb3VudGNvbmZpcm1hdGlvbg
+ description: Unique ID of the template type.
+ channel:
+ type: string
+ example: EMAIL
+ description: Notification channel of the template type (SMS or EMAIL).
+ Error:
+ type: object
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: string
+ example: NTM-50000
+ message:
+ type: string
+ example: Some Error Message
+ description:
+ type: string
+ example: Some Error Description
+ traceId:
+ type: string
+ example: TR0001
diff --git a/components/org.wso2.carbon.identity.api.server.notification.template/pom.xml b/components/org.wso2.carbon.identity.api.server.notification.template/pom.xml
new file mode 100644
index 0000000000..ae78585bef
--- /dev/null
+++ b/components/org.wso2.carbon.identity.api.server.notification.template/pom.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+ org.wso2.carbon.identity.server.api
+ identity-api-server
+ 1.2.241-SNAPSHOT
+ ../../pom.xml
+
+ 4.0.0
+
+ org.wso2.carbon.identity.api.server.notification.template
+ pom
+
+
+ org.wso2.carbon.identity.api.server.notification.template.common
+ org.wso2.carbon.identity.rest.api.server.notification.template.v1
+
+
+
diff --git a/findbugs-exclude-filter.xml b/findbugs-exclude-filter.xml
index 3eadbe5996..0bd7bf4340 100644
--- a/findbugs-exclude-filter.xml
+++ b/findbugs-exclude-filter.xml
@@ -124,7 +124,8 @@
@@ -133,4 +134,11 @@
+
+
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index 3a54be5c99..980e46eea7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -496,6 +496,12 @@
${project.version}
provided
+
+ org.wso2.carbon.identity.server.api
+ org.wso2.carbon.identity.api.server.notification.template.common
+ ${project.version}
+ provided
+
org.wso2.carbon.identity.server.api
org.wso2.carbon.identity.api.server.secret.management.common
@@ -802,12 +808,12 @@
2.3.1.wso2v1
1.4
1.2.4
- 1.10.6
+ 1.11.11
7.5.71
3.0.5
1.12.0
**/gen/**/*
- 1.8.19
+ 1.9.12
7.0.162
5.11.41
1.9.4
@@ -875,6 +881,7 @@
components/org.wso2.carbon.identity.api.server.organization.configs
components/org.wso2.carbon.identity.api.server.organization.selfservice
components/org.wso2.carbon.identity.api.server.action.management
+ components/org.wso2.carbon.identity.api.server.notification.template