// Copyright 2022 LTN Global Communications, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package tv.make.api; import "production/production.proto"; import "longrunning/operations.proto"; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; option go_package = "git.ltnglobal.com/make.tv/genproto/api;api"; service ProductionService { // Lists productions in a team. rpc ListProductions(ListProductionsRequest) returns (ListProductionsResponse) { option (google.api.http) = { get: "/v1/teams/{team_id}/productions" }; } // Gets a production. Returns NOT_FOUND if no such production exists. rpc GetProduction(GetProductionRequest) returns (Production) { option (google.api.http) = { get: "/v1/teams/{team_id}/productions/{production_id}" }; } // Creates a production. rpc CreateProduction(CreateProductionRequest) returns (Production) { option (google.api.http) = { post: "/v1/teams/{production.team_id}/productions" body: "production" }; } // Updates a production. rpc UpdateProduction(UpdateProductionRequest) returns (Production) { option (google.api.http) = { patch: "/v1/teams/{production.team_id}/productions/{production.id}" body: "production" }; } // Deletes a production. rpc DeleteProduction(DeleteProductionRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/teams/{team_id}/productions/{production_id}" }; } // --- // Gets a batch of productions. rpc BatchGetProductions(BatchGetProductionsRequest) returns (BatchGetProductionsResponse) { option (google.api.http) = { get: "/v1/teams/-/productions:batchGet" }; } // Watch a single production for updates. rpc WatchProduction(WatchProductionRequest) returns (stream WatchProductionResponse) { option (google.api.http) = { post: "/v1/teams/{team_id}/productions/{production_id}:watch" }; } // Defragments the inputs of a production. rpc DefragmentProduction (DefragmentProductionRequest) returns (DefragmentProductionResponse) { option (google.api.http) = { post: "/v1/teams/{team_id}/productions/{production_id}:defragment" }; } // Starts a production. // // This operation can not be deleted but it can be canceled. rpc StartProduction (StartProductionRequest) returns (tv.make.api.LongRunningOperation) { option (google.api.http) = { post: "/v1/teams/{team_id}/productions/{production_id}:start" body: "*" }; } // Stop a production. // // This operation can not be deleted and not be canceled. rpc StopProduction (StopProductionRequest) returns (tv.make.api.LongRunningOperation) { option (google.api.http) = { post: "/v1/teams/{team_id}/productions/{production_id}:stop" body: "*" }; } // Lists all streams from a production rpc ListStreams (ListProductionStreamsRequest) returns (ListProductionStreamsResponse) { option (google.api.http) = { post: "/v1/teams/{team_id}/productions/{production_id}:listStreams" }; } } // Request message for [ListProductions][tv.make.api.ProductionService.ListProductions]. message ListProductionsRequest { // The unique identifier of the team owning the productions. string team_id = 1; // The maximum number of items to return. int32 page_size = 2; // The next_page_token value returned from a previous List request, if any. string page_token = 3; } // Response message for [ListProductions][tv.make.api.ProductionService.ListProductions]. message ListProductionsResponse { // The list of productions. repeated Production productions = 1; // Token to retrieve the next page of results, or empty if there are no // more results in the list. string next_page_token = 3; } // Request message for [GetProduction][tv.make.api.ProductionService.GetProduction]. message GetProductionRequest { // The unique identifier of the production. string production_id = 1; // The unique identifier of the team owning the production. string team_id = 2; } message CreateProductionRequest { // The production to create. Production production = 1; } message UpdateProductionRequest { // The production resource which replaces the resource on the server. Production production = 1; // The update mask applies to the resource. For the `FieldMask` definition, // see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask google.protobuf.FieldMask update_mask = 3; } // Request message for [DeleteProduction][tv.make.api.ProductionService.DeleteProduction]. message DeleteProductionRequest { // The unique identifier of the production. string production_id = 1; // The unique identifier of the team owning the production. string team_id = 2; } // Request message for [BatchGetProductions][tv.make.api.ProductionService.BatchGetProductions]. message BatchGetProductionsRequest { // The unique identifier of the productions to retrieve. repeated string production_ids = 1; // The unique identifier of the teams owning the productions. repeated string team_ids = 2; } // Response message for [BatchGetProductions][tv.make.api.ProductionService.BatchGetProductions]. message BatchGetProductionsResponse { // The list of productions. repeated Production productions = 1; } // -- // Request message for [DefragmentProduction][tv.make.api.ProductionService.DefragmentProduction]. message DefragmentProductionRequest { // The unique identifier of the production. string production_id = 1; // The unique identifier of the team owning the production. string team_id = 2; } // Response message for [DefragmentProduction][tv.make.api.ProductionService.DefragmentProduction]. message DefragmentProductionResponse { // The production. Production production = 1; } // Request message for [StartProduction][tv.make.api.ProductionService.StartProduction]. message StartProductionRequest { // The unique identifier of the production. string production_id = 1; // The unique identifier of the team owning the production. string team_id = 2; // The unique identifier of the request. // // If present, the start request will be ignored for subsequent // retries with the same id. // // [optional] string request_id = 3; } // Request message for [StopProduction][tv.make.api.ProductionService.StopProduction]. message StopProductionRequest { // The unique identifier of the production. string production_id = 1; // The unique identifier of the team owning the production. string team_id = 2; // The unique identifier of the request. // // If present, the start request will be ignored for subsequent // retries with the same id. // // [optional] string request_id = 3; } // Request message for [WatchProduction][tv.make.api.ProductionService.WatchProduction]. message WatchProductionRequest { // The unique identifier of the team owning the production. string team_id = 1; // The unique identifier of the production. string production_id = 2; } // Response message for [WatchProduction][tv.make.api.ProductionService.WatchProduction]. message WatchProductionResponse { enum EventKind { // The production has been turned ON and is about to start. STARTING = 0; // The production has started and is ready to acquire and/or distribute video material. STARTED = 1; // The production has been updated. UPDATED = 2; // The production has been turned OFF and is about to stop. STOPPING = 3; // The production has stopped. STOPPED = 4; // The production encountered an error. ERROR = 5; // The production has been created (TODO) CREATED = 6; // The production has been deleted DELETED = 7; } // The uniqie id of the production. string production_id = 1; // The kind of the event. EventKind event_kind = 2; } // Request message for [ListStreams][tv.make.api.ProductionService.ListStreams]. message ListProductionStreamsRequest { // The unique identifier of the team owning the productions. string team_id = 1; // The unique identifier of the production. string production_id = 2; } // Response message for [ListStreams][tv.make.api.ProductionService.ListStreams]. message ListProductionStreamsResponse { // The stream_ids. // // The key is the index for referencing the multiview/thumbnail position. It contains all // streams currently incoming to the production and there can be potentially more then animated // tiles. map stream_ids = 1; }