syntax = "proto3";

package twitchcategoryindexer;


option go_package = "code.justin.tv/amzn/TwitchCategoryIndexerTwirp";

message SyncIGDBCategoryRequest {
  // ID of the IGDB game
  string igdb_id = 1;
}

message SyncIGDBCategoryResponse {
  // ID of created/updated Twitch category
  int32 categoryID = 1;
}

message DeleteIGDBCategoryRequest {
  // ID of the IGDB game
  string igdb_id = 1;
  // The reason to be deleted for a given category
  Reason reason = 2;
  // Deleter of the category. Can either be LDAP ID or "indexer"
  string deleted_by = 3;
}

message DeleteIGDBCategoryResponse {
  // ID of deleted Twitch category
  int32 categoryID = 1;
}

service TwitchCategoryIndexer {
  // SyncIGDBCategory creates/updates a Twitch CategoryDB for the given IGDB game ID.
  // SLO@1000ms
  rpc SyncIGDBCategory(SyncIGDBCategoryRequest) returns (SyncIGDBCategoryResponse);
  // DeleteIGDBCategory deletes a Twitch CategoryDB for the given IGDB game ID.
  // SLO@1000ms
  rpc DeleteIGDBCategory(DeleteIGDBCategoryRequest) returns (DeleteIGDBCategoryResponse);
}

enum Reason {
  // Default - unspecified reason
  REASON_UNSET = 0;

  // Explicit category
  EXPLICIT = 1;

  // Duplicate category
  DUPLICATE = 2;

  // Hateful category
  HATEFUL = 3;

  // Deleted category from IGDB
  DELETED = 4;

  // Other reason not captured above
  OTHER = 5;
}