syntax = "proto3";

package devvit.plugin.notifications;

import "google/protobuf/timestamp.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";

// Request to show a badge for a given app, linking to a given post
message ShowGameBadgeRequest {
  // The fullname of a post (e.g., "t3_abc123")
  string post = 1;

  // The expiration time of the badge
  optional google.protobuf.Timestamp expires_at = 2;
}

// Response from setting a game badge
message ShowGameBadgeResponse {
  // Whether the game badge was successfully set
  bool success = 1;

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

// Request to dismiss all active game badges
message DismissGameBadgeRequest {}

// Response from dismissing active game badges
message DismissGameBadgeResponse {
  // Whether all active game badges were successfully dismissed
  bool success = 1;
}

// Request to get the status of active game badges for an app
message GetGameBadgeStatusRequest {}

// Response from getting the status of an active game badge for an app
message GetGameBadgeStatusResponse {
  // Whether an active game badge for an app is set
  bool has_active_badge = 1;

  // The expiration time of the active game badge, if set
  optional google.protobuf.Timestamp expires_at = 2;

  // The fullname of a post (e.g., "t3_abc123")
  optional string post = 3;
}

// Request to get the game badge status for a specific app by installation ID
message GetGameBadgeStatusForInstallationsRequest {
  // The installation IDs to inspect
  repeated string installation_ids = 1;
}

// Response from getting the status of an active game badge for an installation
message GetGameBadgeStatusForInstallationsResponse {
  // Map of installation ID to badge status
  map<string, GetGameBadgeStatusResponse> statuses = 1;
}
