/*
 * Created by jonathan.jesperson@pluto.tv on 11/11/2022.
 * Copyright (c) PlutoTV Inc 2022.
 */

syntax = "proto3";

package gracenotemetadatapackage;

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

service GracenoteMetadataManager {
  // CFeedsSyncDocuments (Server Stream)
  //
  rpc CFeedsSyncDocuments(CFeedsSyncDocumentsRequest) returns (stream GracenoteMetadata) {}

  // CFeedsSyncAllIds (Server Stream)
  //
  rpc CFeedsSyncAllIds(CFeedsSyncAllIdsRequest) returns (stream Id) {}
}

message CFeedsSyncAllIdsRequest {}

message Id {
  string id = 1;
}

message CFeedsSyncDocumentsRequest {
  // Expressed as a valid javascript Date, https://en.wikipedia.org/wiki/ISO_8601
  string last_run_at = 1;
}

message GracenoteMetadata {
  string id = 1;
  string tmsid = 2;
  string connector_id = 3;
  repeated Cast cast = 4;
  repeated Cast crew = 5;
  repeated string description = 6;
  map<string, string> official_u_r_l = 7;
  string orig_air_date = 8;
  string title = 9;
  string update_id = 10;
  repeated Keywords keywords = 11;
  repeated Relations relations = 12;
  repeated Suggestions suggestions = 13;
  repeated Genre genres = 14;
  string root_id = 15;
  repeated Releases releases = 16;
  repeated Rating ratings = 17;
  repeated Asset assets = 18;
  string active_region = 21;
  string created_at = 22;
  string update_date = 23;
}

message Cast {
  string person_id = 1;
  string role = 2;
  string first = 3;
  string last = 4;
}

message Keywords {
  string type = 1;
  string text = 2;
}

message Relations {
  string type = 1;
  string connector_type = 2;
  string value = 3;
}

message Suggestions {
  string root_id = 1;
  string type = 2;
  string association = 3;
}

message Genre {
  string genre_id = 1;
  string title = 2;
}

message Releases {
  string country = 1;
  string type = 2;
  string date = 3;
  string medium = 4;
  string prg_svc_id = 5;
}

message Rating {
  string area = 1;
  string code = 2;
  string description = 3;
  string ratings_body = 4;
}

message Asset {
  string asset_id = 1;
  string last_modified = 2;
  string type = 3;
  string width = 4;
  string height = 5;
  string primary = 6;
  string category = 7;
  string ratio = 8;
  string tier = 9;
  string family_id = 10;
  string family_master = 11;
  string url = 12;
}
