syntax = "proto3";

package devvit.plugin.notifications;

import "devvit/plugin/notifications/gamesdrawerbadge_msg.proto";
import "devvit/plugin/notifications/optin_msg.proto";
import "devvit/plugin/notifications/pushnotif_msg.proto";
import "google/protobuf/empty.proto";

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";

//Service for opting into and out of Devvit notifications
service Notifications {
  /* Opt In */
  // This method opts the current authenticated user into receiving notifications.
  rpc OptInCurrentUser(google.protobuf.Empty) returns (OptInCurrentUserResponse);
  // This method opts the current authenticated user out of receiving notifications.
  rpc OptOutCurrentUser(google.protobuf.Empty) returns (OptOutCurrentUserResponse);
  // Lists users who have opted in to receive notifications.
  rpc ListOptedInUsers(ListOptedInUsersRequest) returns (ListOptedInUsersResponse);
  // Checks if a specific user has opted in to receive notifications.
  rpc IsOptedIn(IsOptedInRequest) returns (IsOptedInResponse);

  /* Push Notifications */
  // This method queues a notification for asynchronous delivery. The actual
  // delivery timing and success is not guaranteed by this service.
  rpc Enqueue(EnqueueRequest) returns (EnqueueResponse);

  /* Badging */
  // Show a badge for a given app, linking to a given post
  rpc ShowGameBadge(ShowGameBadgeRequest) returns (ShowGameBadgeResponse);
  // Dismiss all active game badges
  rpc DismissGameBadge(DismissGameBadgeRequest) returns (DismissGameBadgeResponse);
  // Get the status of active game badges for an app
  rpc GetGameBadgeStatus(GetGameBadgeStatusRequest) returns (GetGameBadgeStatusResponse);
}
