/*
 * Created by jonathan.jesperson@pluto.tv on 10/21/2020.
 * Copyright (c) PlutoTV Inc 2020.
 */

syntax = "proto3";

package placeholderpackage;

option go_package = "github.com/Pluto-tv/service-dal/golang_client";
option java_package = "tv.pluto.ip.dal.placeholder";

service PlaceholderManager {
  // GetPlaceholderSets (Unary)
  //
  rpc GetPlaceholderSets(GetPlaceholdersRequest) returns (GetPlaceholderSetsResponse) {}

  // GetBumperSets (Unary)
  //
  rpc GetBumperSets(GetBumperRequest) returns (GetBumperSetsResponse) {}

  // GetComplexBumperSets (Unary)
  //
  rpc GetComplexBumperSets(GetComplexBumperRequest) returns (GetComplexBumperSetsResponse) {}
}

message GetPlaceholdersRequest {
  bool return_filler_clips = 1; // return fillers
  bool return_error_clip = 2; // return errors
  string channel_i_d = 3; // can be provided for linear
  string timeline_i_d = 4; // can be provided for linear
  string episode_i_d = 5; // can be provided for VOD
  string device_model = 6;
  string device_type = 7;
  string device_make = 8;
  string marketing_region = 9;
}

message GetPlaceholderSetsResponse {
  map<string, Placeholders> placeholders = 1;
}

message Placeholders {
  repeated Clip fillers = 1;
  Clip error = 2;
}

message GetBumperRequest {
  int32 duration = 1;
  repeated string tags = 2;
}

message GetBumperSetsResponse {
  map<string, BumperSet> bumper_sets = 1;
}

message GetComplexBumperRequest {}

message GetComplexBumperSetsResponse {
  map<string, Country> countries = 1;
}

message Country {
  map<string, BumperSets> bumper_sets = 1;
}

message BumperSets {
  repeated Clip pre_bumpers = 1;
  repeated Clip post_bumpers = 2;
}

message BumperSet {
  Clip pre_bumper = 1;
  Clip post_bumper = 2;
}

message Clip {
  string id = 1;
  int32 duration = 2;
  string name = 3;
  string url = 4;
  string content_status = 5;
  string provider = 6;
  repeated string tags = 7;
  string url_origin = 8;
  repeated Source sources = 9;
}

message Source {
  string file = 1;
  string id = 2;
  string type = 3;
  string encryption = 4;
}
