syntax = "proto3";

package devvit.plugin_svc.notifications;

option go_package = "github.snooguts.net/reddit/reddit-devplatform-monorepo/go-common/generated/protos/types/devvit/plugin_svc/notifications";
option java_package = "com.reddit.devvit.plugin_svc.notifications";

message PushNotificationTemplate {
  //The unique identifier for the template
  string template_id = 1;

  //The title of the push notification template (mustache template supported)
  string title_template = 2;

  //The body text of the push notification template (mustache template supported)
  string body_template = 3;
}

//Request to register a template for an app
message RegisterTemplatesRequest {
  //The templates to register
  repeated PushNotificationTemplate templates = 1;
}

message PushNotificationTemplateErrors {
  //The template ID that failed to register
  string template_id = 1;

  //The error message describing why the template failed to register
  string error_message = 2;
}

//Response from registering a template
message RegisterTemplatesResponse {
  //Whether all templates were successfully registered
  bool success = 1;

  //Array of errors for templates that failed to register
  repeated PushNotificationTemplateErrors errors = 2;
}

message GetTemplatesResponse {
  //The registered templates for the app
  repeated PushNotificationTemplate templates = 1;
}
