syntax = "proto3";

package devvit.plugin.notifications;

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

message OptInCurrentUserResponse {
  // Whether the user successfully opted in
  bool success = 1;

  // Optional message providing additional context about the operation
  string message = 2;
}

message OptOutCurrentUserResponse {
  // Whether the user successfully opted out
  bool success = 1;

  // Optional message providing additional context about the operation
  string message = 2;
}

message ListOptedInUsersRequest {
  // The maximum number of users to return. If this is greater than our max page size, it will be capped.
  optional int64 limit = 1;

  // Cursor to start listing AFTER. Interpreted as a timestamp in milliseconds.
  optional string after = 2;
}

message ListOptedInUsersResponse {
  // List of T2 user IDs who have opted in to receive notifications (e.g. "t2_abc123", "t2_def456")
  repeated string user_ids = 1;

  // Next page cursor. Interpreted as a timestamp in milliseconds, pass back as `after`.
  optional string next = 2;
}

message IsOptedInRequest {
  // The Reddit user ID to check (e.g. "t2_abc123").
  string user_id = 1;
}

message IsOptedInResponse {
  // Whether the user has opted in to receive notifications
  bool opted_in = 1;
}
