syntax = "proto3";

package stream;

option go_package = "stream";

import "eventbus/change.proto";
import "eventbus/owner.proto";

// StreamUpdate is triggered when a stream's metadata attribute changes.
message StreamUpdate {
  option (eventbus.owner.ldap_group) = "team-vx-live-infra";
  // Stream ID.
  string id = 1;
  // Channel ID of the broadcaster.
  string user_id = 2;
  // ID of the game being broadcast.
  eventbus.change.StringChange game_id = 3;
  // Broadcaster's selected language locale.
  eventbus.change.StringChange broadcaster_language = 4;
  // Stream title.
  eventbus.change.StringChange title = 5;
  // Stream type.
  StreamTypeChange stream_type = 13;
  // Tags applied to the stream.
  eventbus.change.StringArrayChange tag_ids = 6;
  // League of Legends: Broadcaster's current champion ID.
  eventbus.change.StringChange league_of_legends_champion_id = 7;
  // PUBG: Number of players alive.
  eventbus.change.Int64Change pubg_player_alive_count = 8;
  // Hearthstone: Broadcaster's current hero class.
  eventbus.change.StringChange hearthstone_broadcaster_hero_class = 9;
  // Hearthstone: Current game mode.
  eventbus.change.StringChange hearthstone_game_mode = 10;
  // CS:GO: Current map.
  eventbus.change.StringChange csgo_map = 11;
  // Overwatch: Broadcaster's current character.
  eventbus.change.StringChange overwatch_broadcaster_character = 12;
}

// StreamType is the enumerated types that a stream is normally.
enum StreamType {
  // Default case is an invalid stream type
  STREAM_TYPE_INVALID = 0;
  // Playlist
  STREAM_TYPE_PLAYLIST = 1;
  // Watch party
  STREAM_TYPE_WATCH_PARTY = 2;
  // Premiere
  STREAM_TYPE_PREMIERE = 3;
  // Re-run
  STREAM_TYPE_RERUN = 4;
  // Live
  STREAM_TYPE_LIVE = 5;
}

// An object representing the stream type change.
message StreamTypeChange {
  bool updated = 1;
  StreamType value = 2;
  bool has_old_value = 3;
  StreamType old_value = 4;
}
