syntax = "proto3";

package reddit.devvit.subreddit.v1;

import "reddit/devvit/common/v1/context_action.proto";
import "reddit/devvit/common/v1/error_message.proto";
import "reddit/devvit/common/v1/installation.proto";

option go_package = "github.snooguts.net/reddit/devplatform-api/go/grpc/devvit/subreddit/v1;devvit_subreddit_manifest";

message DevvitSubredditManifestRequest {
  // t5_ subreddit id, eg 't5_bogzxg'
  string subreddit = 1;
}

message BatchDevvitSubredditManifestRequest {
  // List of t5_ subreddit ids to get the manifest for. eg ['t5_bogzxg', 't5_cpqfxh']
  repeated string subreddit_ids = 1;
}

message DevvitSubredditManifest {
  // List of all context actions available in the Subreddit
  repeated SubredditContextActions context_actions = 1;
  // List of all app installations in the Subreddit
  repeated reddit.devvit.common.v1.Installation installations = 2;
  // Not actually used
  repeated reddit.devvit.common.v1.ErrorMessage errors = 3 [deprecated = true];
  // Error message if an error occurred while fetching the manifest
  reddit.devvit.common.v1.ErrorMessage error = 4;
}

message BatchDevvitSubredditManifestResponse {
  // List of all Subreddit manifests, returned in the same order as the
  // requested subreddit ids
  repeated DevvitSubredditManifest manifests = 1;
}

message SubredditContextActions {
  // The hostname corresponding to the context actions, eg '7c65897c-d3d1-4070-9db3-25402e093d37.sf-local-app.main.devvit-gateway.reddit.com'
  string hostname = 1;
  // Return value from ContextAction.GetActions()
  reddit.devvit.common.v1.ContextActionList actions = 2;
}
