syntax = "proto3";

package twitch.video.usher;
option go_package = "code.justin.tv/video/usherapi/rpc/usher";

import "google/protobuf/wrappers.proto";

// The HLSTranscodes service is a control plane for 'Transcodes', which are jobs
// we run to convert ingested streams of video from broadcasters into playable
// streams for viewers.
//
// The "HLS" part of the name refers to the output type: HLS is 'HTTP Live
// Streaming' and is a particular playable format. We used to also have RTMP
// streams for playback; now we only have HLS, but the name has stuck around.
//
// The definitions in this file are based on Gotranscoder's client, found in
// code.justin.tv/video/gotranscoder/pkg/usher, commit
// 7a252957eb80309904dca7eb02ae57f5f38d1aab, retrieved on 2018-02-27:
// https://git-aws.internal.justin.tv/video/gotranscoder/blob/7a252957eb80309904dca7eb02ae57f5f38d1aab/pkg/usher/api.go

message HLSTranscodeShowChannelRequest {
  string channel = 1;
}

message HLSTranscodeShowRequest {
  int64 transcode_id = 1;
}

message HLSTranscodeReadyRequest {
  int64 stream_id = 1;
}

message HLSTranscodeLVSReadyRequest {
  int64 stream_id = 1;
}

message HLSTranscodeKillRequest {
  int64 transcode_id = 1;
}

message HLSTranscodeUpdateRequest {
  int64 transcode_id = 1;
  HLSTranscodeUpdate update = 2;
}

message HLSTranscodeLVSCustomerTranscodesRequest {
  string customer_id = 1;
}

message HLSTranscodeLVSChannelRequest {
  string customer_id = 1;
  string content_id = 2;
}

message ListOf_HLSTranscode {
  repeated HLSTranscode transcodes = 1;
}

message HLSTranscodePayloadKeysRequest {
}

message ListOf_HLSTranscodePayloadKeys {
    repeated google.protobuf.StringValue keys = 1;
}

message HLSTranscodeDeadTranscodesRequest {}

message HLSTranscodeChannelsToRetryRequest {}

message HLSTranscodeChannelsToUpgradeRequest {}

message ListOf_DeadTranscode {
    // channels is a list of the Twitch channel/broadcaster name for the transcode  e.g. "lirik"
    repeated google.protobuf.StringValue channels = 1;
}

message ListOf_ChannelToRetry{
    // channels is a list of the Twitch channel/broadcaster name for the transcode e.g. "lirik"
    repeated google.protobuf.StringValue channels = 1;
}

message ListOf_ChannelToUpgrade {
    repeated ChannelToUpgrade channels = 1;
}

message ChannelToUpgrade {
    // channel is the Twitch channel/broadcaster name for the transcode e.g. "lirik"
    string channel = 1;

    // channel_id is a permanently-fixed unique identifier for the broadcasting channel.
    int64 channel_id = 2;
}

// HLSTranscode represents a single running transcode of video. The transcode is
// associated with a particular channel (aka 'broadcaster', aka 'streamer', aka
// 'user'). Many of its fields describe the configuration of the transcoder
// (like 'formats', 'transcode_profile', and 'renditions') and many of it
// describe the location where the transcoder is running (like 'origin_fqdn' and
// 'uri').
//
// Field types are based on Usher's schema, found in
// https://git-aws.internal.justin.tv/video/usher/blob/c65001d959710109e63a1f2b2c38d9f03ce0133e/py_tests/modules/testdata/usher/schema.sql#L1112-L1134
message HLSTranscode {
  // id is a unique identifier for the HLSTranscode object.
  int64 id = 1 [json_name = "id"];

  // channel is the Twitch user name of the broadcasting channel, like 'lirik'
  // or 'imaqtpie'. Channels can be renamed, albeit rarely; it's better to use
  // channel_id when performing queries.
  string channel = 3 [json_name = "channel"];

  // channel_id is a permanently-fixed unique identifier for the broadcasting
  // channel.
  int32 channel_id = 4 [json_name = "channel_id"];

  // stream_id is a key used in queries for streams.
  int64 stream_id = 5 [json_name = "destination"];

  // start_time_seconds is the start timestamp, in Unix seconds, of the
  // transcode of the broadcast.
  int64 start_time_seconds = 6 [json_name = "started_on"];

  // update_time_seconds is the most recent timestamp, in Unix seconds, that any
  // field of this object was changed.
  int64 update_time_seconds = 7 [json_name = "updated_on"];

  // uri is a URL path that can be used by the replication system to find the
  // actual video data (that is, playlists and segments) for this transcode.
  //
  // For example:
  //   "/new/transcode-x2-e469cc/lirik_27750740112_803091426"
  string uri = 8 [json_name = "uri"];

  // origin_fqdn is the fully-qualified domain name of the host running a
  // transcoder process for this transcode.
  //
  // For example:
  //   "transcode-x2-e469cc.sjc02.justin.tv"
  string origin_fqdn = 9 [json_name = "origin_fqdn"];

  // formats is a comma-separated list of the output rendition names of the
  // transcode.
  //
  // For example:
  //   "audio_only,chunked,720p60,480p30,160p30,720p30,360p30"
  string formats = 10 [json_name = "formats"];

  // transcode_profile is a name for the set of configuration values passed to
  // TwitchTranscoder. This is sometimes called the 'transcode stack' or 'transcoder
  // configuration.'
  //
  // For example:
  //   "2017TranscodeX264_V2"
  string transcode_profile = 11 [json_name = "transcode_profile"];

  // thumbnail_uri is a URL that will serve a "thumbnail" image for a transcode
  // - that is, a snapshot of it as a JPEG.
  //
  // For example:
  //   "http://transcode-x2-e469cc.sjc02.justin.tv:8080/hls/lirik_27750740112_803091426/thumb/thumb.jpg"
  string thumbnail_uri = 12 [json_name = "thumbnail_uri"];

  LVSMetadata lvs_meta = 13 [json_name = "lvs_metadata_obj"];

  // lvs_metadata_raw_string is a container for the raw JSON-encoded
  // lvs_metadata string, because that's how Usher provides it. You should
  // probably use lvs_meta, which is the deserialized contents.
  string lvs_metadata_raw_string = 14 [json_name = "lvs_metadata"];

  repeated RenditionMetadata renditions = 15 [json_name = "rendition_meta_obj"];

  // rendition_meta_raw_string is a container for the raw JSON-encoded
  // rendition_meta string, because that's how Usher provides it. You should
  // probably use renditions, which is the deserialized contents.
  string rendition_meta_raw_string = 16 [json_name = "rendition_meta"];

  // content_id is the LVS content ID. LVS is the Live Video Service, the first
  // API surface area that Twitch exposed to non Twitch teams. The ID value
  // itself is customer provided and is an arbitrary string
  string content_id = 17 [json_name = "content_id"];

  // Mysteries for the ancients!
  //
  // If you know what the meaning is of any of these fields, *please* make a PR
  // to help document them!
  string transcoder_info = 18 [json_name = "transcoder_info"];
  string session_id = 19 [json_name = "session_id"];

  // job_key is used to ensure that only one transcode job is running for any
  // given transcode entry. each time a transcode job is put on the queue, a
  // key unique to that transcode entry is also sent. the transcode with the
  // higest nubmered job key wins.
  int32 job_key = 20 [json_name = "job_key"];

  // status indicates the current transcode's status, typically "pending" before
  // the transcode is ready for playback and "active" once it is ready
  string status = 21 [json_name = "status"];

  // More undocumented fields
  string configuration = 22 [json_name = "configuration"];
  int32 version = 23 [json_name = "version"];
  string pushers_info = 24 [json_name = "pushers_info"];
  int32 vod_id = 25 [json_name = "vod_id"];
  int64 video_id = 26 [json_name = "video_id"];
  bool source_restricted = 27 [json_name = "source_restricted"];
  bool private_video = 28 [json_name = "private_video"];
  bool twitch_content = 29 [json_name = "twitch_content"];
  int64 last_viewed = 30 [json_name = "last_viewed"];

  // customer_id is the LVS customer ID. LVS is the Live Video Service, the first
  // API surface area that Twitch exposed to non Twitch teams. The ID value is
  // unique per LVS customer, although some customers have multiple IDs
  //
  // For Example:
  //    "amazonlive_beta"
  string customer_id = 31 [json_name = "customer_id"];

  // encryption_key_ids is the list of encryption keys used for DRM support
  repeated string encryption_key_ids = 32 [json_name = "encryption_key_ids"];

  // encryption_key_ids_raw is the raw json serialized list of encryption keys,
  // this field will be empty and encryption_key_ids should be used instead
  string encryption_key_ids_raw_string = 33 [json_name = "encryption_meta"];

  int64 channel_count = 34 [json_name = "channel_count"];

  // job_type "primary" for the main job that determines liveness, "secondary" for other jobs
  string job_type = 35 [json_name = "job_type"];

  // encode_type describes the codec used by this transcode stack e.g. "h264", "vp9"
  string encode_type = 36 [json_name = "encode_type"];

  // latency_mode specifies what latency mode the broadcast is running e.g. "normal", "low"
  string latency_mode = 37 [json_name = "latency_mode"];
}

// LVSMetadata is used to assign LVS specific properties which the transcoder
// uses during runtime for things like vod storage and notifications. This
// message is used both for reads and writes.
//
// Field names were retrieved from here:
//  https://git-aws.internal.justin.tv/video/gotranscoder/blob/38d9b8adc778f0ce0166eb1b01eca576030eabd7/cmd/gotranscoder/constants.go#L135
message LVSMetadata {
  string sns_endpoint = 1 [json_name = "sns_endpoint"];
  string s3_vod_url = 2 [json_name = "s3_vod_url"];
  string vod_manifest_url = 3 [json_name = "vod_manifest_url"];
}

// RenditionMetadata is a container for metadata about one 'rendition' being
// emitted by the transcoder. A 'rendition' is one output format for a stream -
// we transcode video into multiple formats to allow playback on different
// devices and for users with different bandwidth requirements. This message is
// used for both reads and writes.
message RenditionMetadata {
  // group_id is a logical name for the rendition.
  //
  // For example:
  //   "chunked"
  //   "audio_only"
  //   "720p60"
  google.protobuf.StringValue group_id = 1 [json_name = "group_id"];

  // display_label is the human-readable name for the rendition, displayed to
  // end users when they select a quality level in the player.
  //
  // For example:
  //   "1080p60 (source)"
  google.protobuf.StringValue display_label = 2 [json_name = "display_label"];

  // mux_rate is the bitrate of the rendition, in units of 50 bytes/s. We are
  // using a google.protobuf.Int64Value to allow for updates when the value is
  // zero.
  //
  // Yes, this unit is pretty bizarre. It's common in MPEG-TS though.
  google.protobuf.Int32Value mux_rate = 3 [json_name = "mux_rate"];

  // video_height_pixels is the height of the output video for this rendition in
  // pixels. We are using a google.protobuf.Int64Value here to allow for updates
  // when the value is zero
  google.protobuf.Int32Value video_height_pixels = 4 [json_name = "video_height"];

  // video_width_pixels is the width of the output video for this rendition in
  // pixels. We are using a google.protobuf.Int64Value here to allow for updates
  // when the value is zero
  google.protobuf.Int32Value video_width_pixels = 5 [json_name = "video_width"];

  // codecs is a comma-separated list of codecs being used in this rendition.
  //
  // For example:
  //   "avc1.77.31,mp4a.40.2"
  //   "mp4a.40.2"
  google.protobuf.StringValue codecs = 6 [json_name = "codecs"];

  // fps is the number of frames per second for this rendition. We are using a
  // google.protobuf.Int32Value here to allow for updates when the value is zero
  google.protobuf.Int32Value fps = 7 [json_name = "fps"];

  // max_idr_interval is the maximum Instantaneous Decoding Refresh (IDR) keyframe
  // interval in milliseconds. When the keyframe interval of the source is too high,
  // source rendition gets dropped. We are using a google.protobuf.Int32Value
  // here to allow for updates when the value is zero.
  google.protobuf.Int32Value max_idr_interval = 8 [json_name = "max_idr_interval"];
}

// TODO [ING-2646] Add more thorough documentation for every input. Also prune unused parameters.
// Request for the Usher API /hls_transcode/create_lvs_transcode/{channel}.json"/
// https://git-aws.internal.justin.tv/video/usher/blob/master/api/hls_transcode.py#L946
message HLSTranscodeCreateLVSTranscodeRequest {

  // channel is the Twitch channel/broadcaster name for the transcode being created e.g. "lirik"
  string channel = 1 [json_name = "channel"];

  // s3_bucket is the S3 bucket used by the broadcast.
  string s3_bucket = 2 [json_name = "s3_bucket"];

  // s3_prefix is the S3 prefix used for this broadcast.
  string s3_prefix = 3 [json_name = "s3_prefix"];

  // sns_endpoint is the SNS ARN to be used to send notifcations about changes to this broadcast's S3 Bucket
  string sns_endpoint = 4 [json_name = "sns_endpoint"];

  // cdn_url is the URL to record static vod manifests.
  string cdn_url = 5 [json_name = "cdn_url"];

  // start_time_seconds is the time at which the broadcast started. Unix time in seconds.
  string start_time_seconds = 6 [json_name = "start_time"];

  // session_id is a unique Session ID for the broadcast.
  string session_id = 7 [json_name = "session_id"];

  // rtmp_endpoint is the location to pull the livestream from but excludes the broadcast name.
  // e.g. rtmp://10.1.228.320:61042/app/
  string rtmp_endpoint = 8 [json_name = "RTMP_endpoint"];

  // rtmp_url is the location to pull the livestream from. This is used by playback and gotranscoder.
  // e.g. rtmp://10.1.228.320:61042/app/lirik
  string rtmp_url = 9 [json_name = "rtmp_url"];

  // TranscodeMode the transcode mode to use e.g. "normal", "low_latency"
  enum TranscodeMode {
    normal = 0;
    low_latency = 1;
  }

  // mode is the transcode mode to use e.g. "normal", "low_latency"
  TranscodeMode mode = 10 [json_name = "mode"];

  // fields 11 through 22 are undefined parameters being passed from Digestion service to
  // Usher. These are being added to the API because currently it is difficult to determine which parameters
  // are still actively used by the Video Platform.
  // ref - https://git-aws.internal.justin.tv/video/digestion/blob/master/pkg/domain/parser.go
  // ref - https://git-aws.internal.justin.tv/video/digestion/blob/master/pkg/parse/params.go

  // broadcaster is read from the broadcast_tag typically, and is used to indicate
  // when special broadcast integrations are in use (rebroadcasts, delay, etc)
  string broadcaster = 11 [json_name = "broadcaster"];

  // os is used by the sdk. Reason unknown.
  string os = 12 [json_name = "os"];
  // client_id is used by the sdk. Reason unknown.
  string client_id = 13 [json_name = "client_id"];
  // sdk_version is used by the sdk. Reason unknown.
  string sdk_version = 14 [json_name = "sdk_version"];
  // video_encoder is used by the sdk. Reason unknown.
  string video_encoder = 15 [json_name = "video_encoder"];

  // no_archive prevents VODs for PS4 pre-releases and rebroadcasts
  bool no_archive = 16 [json_name = "no_archive"];

  // bandwidthtest is used by some broadcasters to test bandwidth. Should not make a channel 'go live'
  bool bandwidthtest = 17 [json_name = "bandwidthtest"];

  // force_channel is used by proxy monitor to become a nonexistent channel
  string force_channel = 18 [json_name = "force_channel"];

  // broadcast_tag is the RTMP query string from the rtmp broadcast for this stream
  string broadcast_tag = 19 [json_name = "broadcast_tag"];

  // rtmp_flag is an unknown flag. Possibly not used.
  string rtmp_flag = 20 [json_name = "rtmp_flag"];

  // recorder is used by hls rebroadcaster to prevent archives (if set to 0)
  string recorder = 21 [json_name = "recorder"];

  // backup is used to designate a backup stream
  string backup = 22 [json_name = "backup"];
}

// TODO [ING-2646] Add more thorough documentation for every input. Also prune unused parameters.
message HLSTranscodeCreateLVSTranscodeResponse {
  // hls_transcode_id is the ID which can be used to query information about a transcode e.g. 489926070
  // Used as an input for the /hls_transcode/show/ Usher API e.g. /hls_transcode/show/489926070.json
  int64 hls_transcode_id = 1 [json_name = "hls_transcode_id"];

  // stream_id is a key used in queries for streams.
  int64 stream_id = 2 [json_name = "stream_id"];

  // channel is the Twitch channel/broadcaster name for the transcode being created e.g. "lirik"
  string channel = 3 [json_name = "channel"];
}

// PreemptiveTranscodeData contains information about the transcode_type and encoder type assigned to the channel preemptively
message PreemptiveTranscodeData {
  // transcode_type can be a transcode profile or any of the supported transcode types from channel properties
  string transcode_type = 1 [json_name = "transcode_type"];
  // encoder type specifies the encoder which is specific to the transcode profile, h264 , vp09 etc
  string encoder_type = 2 [json_name = "encoder_type"];
}

// TODO [ING-2646] Add more thorough documentation for every input. Also prune unused parameters.
// Request for Usher API /hls_transcode/create_by_channel_id/{channel_id}.json
// https://git-aws.internal.justin.tv/video/usher/blob/master/api/hls_transcode.py#L861
message HLSTranscodeCreateByChannelIDRequest {
  // channel_id is a permanently-fixed unique identifier for the broadcasting channel.
  string channel_id = 1 [json_name = "channel_id"];

  // start_time_seconds is the time at which the broadcast started. Unix time in seconds.
  string start_time_seconds = 2 [json_name = "start_time"];

  // session_id is a unique Session ID for the broadcast.
  string session_id = 3 [json_name = "session_id"];

  // rtmp_endpoint is the location to pull the livestream from but excludes the stream name.
  // e.g. rtmp://10.1.228.320:61042/app/
  string rtmp_endpoint = 4 [json_name = "RTMP_endpoint"];

  // rtmp_url is the location to pull the livestream from. This is used by playback and gotranscoder.
  // e.g. rtmp://10.1.228.320:61042/app/lirik
  string rtmp_url = 5 [json_name = "rtmp_url"];

  // fields 6 through 17 are undefined parameters being passed from Digestion service to
  // Usher. These are being added to the API because currently it is difficult to determine which parameters
  // are still actively used by the Video Platform.
  // ref - https://git-aws.internal.justin.tv/video/digestion/blob/master/pkg/domain/parser.go
  // ref - https://git-aws.internal.justin.tv/video/digestion/blob/master/pkg/parse/params.go

  // broadcaster is read from the broadcast_tag typically, and is used to indicate
  // when special broadcast integrations are in use (rebroadcasts, delay, etc)
  string broadcaster = 6 [json_name = "broadcaster"];

  // os is used by the sdk. Reason unknown.
  string os = 7 [json_name = "os"];
  // client_id is used by the sdk. Reason unknown.
  string client_id = 8 [json_name = "client_id"];
  // sdk_version is used by the sdk. Reason unknown.
  string sdk_version = 9 [json_name = "sdk_version"];
  // video_encoder is used by the sdk. Reason unknown.
  string video_encoder = 10 [json_name = "video_encoder"];

  // no_archive prevents VODs for PS4 pre-releases and rebroadcasts
  bool no_archive = 11 [json_name = "no_archive"];

  // bandwidthtest is used by some broadcasters to test bandwidth. Should not make a channel 'go live'
  bool bandwidthtest = 12 [json_name = "bandwidthtest"];

  // force_channel is used by proxy monitor to become a nonexistent channel
  string force_channel = 13 [json_name = "force_channel"];

  // broadcast_tag is the RTMP query string from the rtmp broadcast for this stream
  string broadcast_tag = 14 [json_name = "broadcast_tag"];

  // rtmp_flag is an unknown flag. Possibly not used.
  string rtmp_flag = 15 [json_name = "rtmp_flag"];

  // recorder is used by hls rebroadcaster to prevent archives (if set to 0)
  string recorder = 16 [json_name = "recorder"];

  // backup is used to designate a backup stream
  string backup = 17 [json_name = "backup"];

  // Client IP address.
  string client_ip = 18 [json_name = "client_ip"];

  // preemptive_transcodes contains information about transcode types which are assigned preemptively to the channel
  // This information is stored in channel properties and can be accessed via the admin panel
  repeated PreemptiveTranscodeData preemptive_transcodes = 19 [json_name= "preemptive_transcodes"];
}

// TODO [ING-2646] Add more thorough documentation for every input. Also prune unused parameters.
message HLSTranscodeCreateByChannelIDResponse {
  // hls_transcode_id is the ID which can be used to query information about a transcode e.g. 489926070
  // Used as an input for the /hls_transcode/show/ Usher API e.g. /hls_transcode/show/489926070.json
  int64 hls_transcode_id = 1 [json_name = "hls_transcode_id"];

  // stream_id is a key used in queries for streams.
  int64 stream_id = 2 [json_name = "stream_id"];

  // channel is the Twitch channel/broadcaster name for the transcode being created e.g. "lirik"
  string channel = 3 [json_name = "channel"];
}

// Request for Usher API /hls_transcode/start_by_channel_id/{channel_id}.json
message HLSTranscodeStartByChannelIDRequest {
  // channel_id is a permanently-fixed unique identifier for the broadcasting channel.
  int32 channel_id = 1 [json_name = "channel_id"];

  // s3_bucket is the S3 bucket used by the broadcast.
  string s3_bucket = 2 [json_name = "s3_bucket"];

  // s3_prefix is the S3 prefix used for this broadcast.
  string s3_prefix = 3 [json_name = "s3_prefix"];

  // sns_endpoint is the SNS ARN to be used to send notifcations about changes to this broadcast's S3 Bucket
  string sns_endpoint = 4 [json_name = "sns_endpoint"];

  // cdn_url is the URL to record static vod manifests.
  string cdn_url = 5 [json_name = "cdn_url"];

  // start_time_seconds is the time at which the broadcast started. Unix time in seconds.
  string start_time_seconds = 6 [json_name = "start_time"];

  // session_id is a unique Session ID for the broadcast.
  string session_id = 7 [json_name = "session_id"];

  // rtmp_endpoint is the location to pull the livestream from but excludes the broadcast name.
  // e.g. rtmp://10.1.228.320:61042/app/
  string rtmp_endpoint = 8 [json_name = "RTMP_endpoint"];

  // rtmp_url is the location to pull the livestream from. This is used by playback and gotranscoder.
  // e.g. rtmp://10.1.228.320:61042/app/lirik
  string rtmp_url = 9 [json_name = "rtmp_url"];

  // TranscodeMode the transcode mode to use e.g. "normal", "low_latency"
  enum TranscodeMode {
    normal = 0;
    low_latency = 1;
  }

  // mode is the transcode mode to use e.g. "normal", "low_latency"
  TranscodeMode mode = 10 [json_name = "mode"];

  // fields 11 through 22 are undefined parameters being passed from Digestion service to
  // Usher. These are being added to the API because currently it is difficult to determine which parameters
  // are still actively used by the Video Platform.
  // ref - https://git-aws.internal.justin.tv/video/digestion/blob/master/pkg/domain/parser.go
  // ref - https://git-aws.internal.justin.tv/video/digestion/blob/master/pkg/parse/params.go

  // broadcaster is read from the broadcast_tag typically, and is used to indicate
  // when special broadcast integrations are in use (rebroadcasts, delay, etc)
  string broadcaster = 11 [json_name = "broadcaster"];

  // os is used by the sdk. Reason unknown.
  string os = 12 [json_name = "os"];
  // client_id is used by the sdk. Reason unknown.
  string client_id = 13 [json_name = "client_id"];
  // sdk_version is used by the sdk. Reason unknown.
  string sdk_version = 14 [json_name = "sdk_version"];
  // video_encoder is used by the sdk. Reason unknown.
  string video_encoder = 15 [json_name = "video_encoder"];

  // no_archive prevents VODs for PS4 pre-releases and rebroadcasts
  bool no_archive = 16 [json_name = "no_archive"];

  // bandwidthtest is used by some broadcasters to test bandwidth. Should not make a channel 'go live'
  bool bandwidthtest = 17 [json_name = "bandwidthtest"];

  // force_channel is used by proxy monitor to become a nonexistent channel
  string force_channel = 18 [json_name = "force_channel"];

  // broadcast_tag is the RTMP query string from the rtmp broadcast for this stream
  string broadcast_tag = 19 [json_name = "broadcast_tag"];

  // rtmp_flag is an unknown flag. Possibly not used.
  string rtmp_flag = 20 [json_name = "rtmp_flag"];

  // recorder is used by hls rebroadcaster to prevent archives (if set to 0)
  string recorder = 21 [json_name = "recorder"];

  // backup is used to designate a backup stream
  string backup = 22 [json_name = "backup"];
}

message HLSTranscodeStartByChannelIDResponse {
  // hls_transcode_id is the ID which can be used to query information about a transcode e.g. 489926070
  // Used as an input for the /hls_transcode/show/ Usher API e.g. /hls_transcode/show/489926070.json
  int64 hls_transcode_id = 1 [json_name = "hls_transcode_id"];

  // stream_id is a key used in queries for streams.
  int64 stream_id = 2 [json_name = "stream_id"];

  // channel is the Twitch channel/broadcaster name for the transcode being created e.g. "lirik"
  string channel = 3 [json_name = "channel"];
}

message HLSTranscodeDestroyByChannelIDRequest {
  // channel_id is a permanently-fixed unique identifier for the broadcasting
  // channel.
  int32 channel_id = 1;
}

message HLSTranscodeDestroyByChannelRequest {
  // channel is the Twitch channel/broadcaster name for the transcode being created e.g. "lirik"
  string channel = 3 [json_name = "channel"];
}

message HLSTranscodeDestroyByChannelIDResponse {}

message HLSTranscodeDestroyByChannelResponse {}

// HLSTranscodeUpdate uses google/protobuf/wrappers.proto to allow zero values
// to be set for fields in HLSTranscode. For documentation on individual fields
// see the documentation for HLSTranscode
message HLSTranscodeUpdate {
  google.protobuf.Int64Value  stream_id         = 1 [json_name = "destination"];
  google.protobuf.StringValue uri               = 2 [json_name = "uri"];
  google.protobuf.StringValue origin_fqdn       = 3 [json_name = "origin_fqdn"];
  google.protobuf.StringValue formats           = 4 [json_name = "formats"];
  google.protobuf.StringValue transcode_profile = 5 [json_name = "transcode_profile"];
  google.protobuf.Int32Value  job_key           = 6 [json_name = "job_key"];
  google.protobuf.Int32Value  version           = 7 [json_name = "version"];
  google.protobuf.StringValue transcoder_info   = 8 [json_name = "transcoder_info"];
  google.protobuf.StringValue status            = 9 [json_name = "status"];


  LVSMetadata                 lvs_meta                  = 20 [json_name = "lvs_metadata_obj"];
  google.protobuf.StringValue lvs_metadata_raw_string   = 21 [json_name = "lvs_metadata"];

  repeated RenditionMetadata  renditions                = 22  [json_name = "rendition_meta_obj"];
  google.protobuf.StringValue rendition_meta_raw_string = 23 [json_name = "rendition_meta"];

  repeated string encryption_key_ids = 32 [json_name = "encryption_key_ids"];
  google.protobuf.StringValue encryption_key_ids_raw_string = 33 [json_name = "encryption_meta"];
}

