syntax = "proto3";

package devvit.plugin.notifications;

import "google/protobuf/duration.proto";
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 in the games drawer for a given app, linking to a given post
message ShowGamesDrawerBadgeRequest {
  // The fullname of a post (e.g., "t3_abc123")
  string post = 1;

  oneof expiration {
    // The duration in seconds until the badge expires
    google.protobuf.Duration expires_in = 2;
    // The expiration time of the badge
    google.protobuf.Timestamp expires_at = 3;
  }
}

// Response from setting a games drawer badge
message ShowGamesDrawerBadgeResponse {
  // Whether the games drawer badge was successfully set
  bool success = 1;

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

// Request to dismiss all active games drawer badges
message DismissGamesDrawerBadgeRequest {}

// Response from dismissing active games drawer badges
message DismissGamesDrawerBadgeResponse {
  // Whether all active games drawer badges were successfully dismissed
  bool success = 1;
}

// Request to get the status of active games drawer badges for an app
message GetGamesDrawerBadgeStatusRequest {}

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

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