syntax = "proto3";

package devvit.dev_portal.nutrition;

option go_package = "github.snooguts.net/reddit/reddit-devplatform-monorepo/go-common/generated/protos/types/devvit/devportal/nutrition";

message GetNutritionByNameVersionRequest {
  // App slug / ID. Eg, comment-nuke.
  string name = 1;
  // App version. Eg, 1.2.3 or 1.2.3.4. Defaults to latest.
  optional string version = 2;
}

message MultipleNutritionCategories {
  repeated NutritionCategory categories = 1;
}

// Abstract plugin capabilities required by an app. Plugin usage is bucketed
// coarsely by Definition.fullName and may change. This enumeration is to power
// informative permission UI, not make platform security decisions. See the
// nutritionCategoriesFromBundle() implementation for the current behavior.
//
// "Use" and "provides" terminology is loose. An app that _uses_ a scheduler
// callback OR _provides_ the scheduler plugin is still categorized as
// "SCHEDULER".
//
// See ActorType in packages/protos/src/index.ts. Beware: many of these
// Defintions should never be Devvit apps.
enum NutritionCategory {
  // App may use uncategorized permissions.
  UNCATEGORIZED = 0;
  // App may execute when installed or upgraded.
  APP_TRIGGERS = 1;
  // App may present predefined audio-visual media.
  ASSETS = 2;
  // App may read and write _app_ data to Reddit servers.
  DATA = 3;
  // App may read and write _any_ data to and from the internet.
  HTTP = 4;
  // App may read and write data to Reddit moderator logs. Does not imply Reddit
  // API.
  // DEPRECATED: The modlog api has been removed.
  MODLOG = 5;
  // App may read and write _any_ Reddit data. Does not imply HTTP.
  REDDIT_API = 6;
  // App may observe Reddit events such as post creation, comment deletion, and
  // many more. Does not imply REDDIT_API.
  REDDIT_TRIGGERS = 7;
  // App may schedule itself for later execution.
  SCHEDULER = 8;
  // App may appear in subreddit, post, and comment menu entries, and custom posts.
  // Note: CUSTOM_POST is a subset of UI: if CUSTOM_POST is set then UI is set also.
  UI = 9;
  // App may appear and act as a moderator on subreddits where it's installed.
  MODERATOR = 10;
  // App may embed a webview to enable more web functionality in their app.
  WEBVIEW = 11;
  // App may sell digital goods or services.
  PAYMENTS = 12;
  // App can create a custom experience.
  // Note: CUSTOM_POST is a subset of UI: if CUSTOM_POST is set then UI is set also.
  CUSTOM_POST = 13;
  // App may call Reddit APIs on behalf of the User.
  USER_ACTIONS = 14;
}
