// 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 "input/input.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 InputService { // Lists inputs. rpc ListInputs(ListInputsRequest) returns (ListInputsResponse) { option (google.api.http) = { get: "/v1/{parent=teams/*}/inputs" additional_bindings { get: "/v1/{parent=users/*}/inputs" } }; } // Gets an input. rpc GetInput(GetInputRequest) returns (Input) { option (google.api.http) = { get: "/v1/{parent=teams/*}/inputs/{input_id}" additional_bindings { get: "/v1/{parent=users/*}/inputs/{input_id}" } }; } // Creates an input. rpc CreateInput(CreateInputRequest) returns (Input) { option (google.api.http) = { post: "/v1/{parent=teams/*}/inputs" body: "input" additional_bindings { post: "/v1/{parent=users/*}/inputs" body: "input" } }; } // Updates an input. rpc UpdateInput(UpdateInputRequest) returns (Input) { option (google.api.http) = { patch: "/v1/{input.parent=teams/*}/inputs/{input.id}" body: "input" additional_bindings { patch: "/v1/{input.parent=users/*}/inputs/{input.id}" body: "input" } }; } // Deletes an input. rpc DeleteInput(DeleteInputRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{parent=teams/*}/inputs/{input_id}" additional_bindings { delete: "/v1/{parent=users/*}/inputs/{input_id}" } }; } // --- rpc GetInputEndpoint(GetInputEndpointRequest) returns (GetInputEndpointResponse) { option (google.api.http) = { post: "/v1/{parent=teams/*}/inputs/{input_id}:getEndpoint" body: "*" additional_bindings { post: "/v1/{parent=users/*}/inputs/{input_id}:getEndpoint" body: "*" } }; } // -- // Assign an input to a production. rpc AssignInputToProduction (AssignInputToProductionRequest) returns (AssignInputToProductionResponse) { option (google.api.http) = { post: "/v1/{parent=teams/*}/inputs/{input_id}:assignToProduction" body: "*" additional_bindings { post: "/v1/{parent=users/*}/inputs/{input_id}:assignToProduction" body: "*" } }; } // Withdraw an input from a production. rpc WithdrawInputFromProduction (WithdrawInputFromProductionRequest) returns (WithdrawInputFromProductionResponse) { option (google.api.http) = { post: "/v1/{parent=teams/*}/inputs/{input_id}:withdrawFromProduction" body: "*" additional_bindings { post: "/v1/{parent=users/*}/inputs/{input_id}:withdrawFromProduction" body: "*" } }; } // Selects the mode for the input. rpc SetInputMode(SetInputModeRequest) returns (google.protobuf.Empty) { option (google.api.http) = { post: "/v1/{parent=teams/*}/inputs/{input_id}:setInputMode" body: "*" }; } } // Request message for [ListInputs][tv.make.api.InputService.ListInputs]. message ListInputsRequest { // The name of the parent. // // Usually 'team/{uuid}' or 'user/{uuid}'. string parent = 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 [ListInputs][tv.make.api.InputService.ListInputs]. message ListInputsResponse { // The list of inputs. repeated Input inputs = 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 [GetInput][tv.make.api.InputService.GetInput]. message GetInputRequest { // The unique identifier of the input. string input_id = 1; // The name of the parent. // // Usually 'team/{uuid}' or 'user/{uuid}'. string parent = 2; } // Request message for [CreateInput][tv.make.api.InputService.CreateInput]. message CreateInputRequest { // The name of the parent. // // Usually 'team/{uuid}' or 'user/{uuid}'. string parent = 1; // The input to create. Input input = 2; } // Request message for [UpdateInput][tv.make.api.InputService.UpdateInput]. message UpdateInputRequest { // The input resource which replaces the resource on the server. Input input = 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 = 2; } // Request message for [DeleteInput][tv.make.api.InputService.DeleteInput]. message DeleteInputRequest { // The unique identifier of the input. string input_id = 1; // The name of the parent. // // Usually 'team/{uuid}' or 'user/{uuid}'. string parent = 2; } message GetInputEndpointRequest { enum EndpointKind { // The endpoint kind is unspecified. ENDPOINT_KIND_UNSPECIFIED = 0; // RTMP is the desired protocol. RTMP = 1; // WebRTC is the desired protocol. WEBRTC = 2; // SRT is the desired protocol SRT = 3; } // The unique identifier of the input. string input_id = 1; // The name of the parent. // // Usually 'team/{uuid}' or 'user/{uuid}'. string parent = 2; // The kind of the endpoint to obtain. EndpointKind kind = 3; } message GetInputEndpointResponse { message RtmpEndpoint { string url =1; } message WebRtcEndpoint { // Token to use with signaling server. // // Tokens can be used for a limited time after creation. // They may be re-used during re-connects. string signaling_token = 1; // URL of the signaling server. string signaling_url = 2; } message SrtEndpoint { string url = 1; } oneof endpoint_type { RtmpEndpoint rtmp = 1; WebRtcEndpoint webrtc = 2; SrtEndpoint srt= 3; } } message AssignInputToProductionRequest { // The name of the parent. // // Usually 'team/{uuid}' or 'user/{uuid}'. string parent = 1; // The unique identifier of the input. string input_id = 2; // The unique identifier of the production. string production_id = 3; } message AssignInputToProductionResponse {} message WithdrawInputFromProductionRequest { // The name of the parent. // // Usually 'team/{uuid}' or 'user/{uuid}'. string parent = 1; // The unique identifier of the input. string input_id = 2; // The unique identifier of the production. string production_id = 3; } message WithdrawInputFromProductionResponse {} message SetInputModeRequest { // The input selects the source. message AutoSelection { } // The selected source will be used - no matter what. message ManualSelection { string source_id = 1; } // The name of the parent. // // Usually 'team/{uuid}'. string parent = 1; // The unique identifier of the input. string input_id = 2; oneof mode { AutoSelection auto = 3; ManualSelection manual = 4; } }