// 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 "videoasset/videoasset.proto"; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; option go_package = "git.ltnglobal.com/make.tv/genproto/api;api"; service VideoAssetService { // Lists videoassets. rpc ListVideoAssets(ListVideoAssetsRequest) returns (ListVideoAssetsResponse) { option (google.api.http) = { get: "/v1/teams/{team_id}/videoassets" }; } // Gets a videoasset. rpc GetVideoAsset(GetVideoAssetRequest) returns (VideoAsset) { option (google.api.http) = { get: "/v1/teams/{team_id}/videoassets/{videoasset_id}" }; } // Deletes a videoasset. rpc DeleteVideoAsset(DeleteVideoAssetRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/teams/{team_id}/videoassets/{videoasset_id}" }; } // Gets a batch of videoasset thumbnails. rpc BatchGetVideoAssetThumbnails(BatchGetVideoAssetThumbnailsRequest) returns (stream BatchGetVideoAssetThumbnailsResponse) { option (google.api.http) = { get: "/v1/teams/-/videoassets:batchGetThumbnails" }; } // Add a batch of metadata to a videoasset. rpc BatchAddVideoAssetMetadata(BatchAddVideoAssetMetadataRequest) returns (BatchAddVideoAssetMetadataResponse) { option (google.api.http) = { post: "/v1/teams/{team_id}/videoassets/{videoasset_id}:batchAddMetadata" body: "*" }; } // Download a videoasset. rpc DownloadVideoAsset(DownloadVideoAssetRequest) returns (DownloadVideoAssetResponse) { option (google.api.http) = { post: "/v1/teams/{team_id}/videoassets/{videoasset_id}:download" body: "*" }; } // Search videoassets. rpc SearchVideoAssets(SearchVideoAssetsRequest) returns (SearchVideoAssetsResponse) { option (google.api.http) = { get: "/v1/teams/{team_id}/videoassets:search" }; } } // Request message for [ListVideoAssets][tv.make.api.VideoAssetService.ListVideoAssets]. message ListVideoAssetsRequest { // The unique identifier of the team owning the videoasset. 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; // Specifies the result ordering for List requests. string order_by = 4; } // Response message for [ListVideoAssets][tv.make.api.VideoAssetService.ListVideoAssets]. message ListVideoAssetsResponse { // The list of videoassets. repeated VideoAsset videoassets = 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 [GetVideoAsset][tv.make.api.VideoAssetService.GetVideoAsset]. message GetVideoAssetRequest { // The unique identifier of the videoasset. string videoasset_id = 1; // The unique identifier of the team owning the videoasset. string team_id = 2; } // Request message for [DeleteVideoAsset][tv.make.api.VideoAssetService.DeleteVideoAsset]. message DeleteVideoAssetRequest { // The unique identifier of the videoasset. string videoasset_id = 1; // The unique identifier of the team owning the videoasset. string team_id = 2; } // Request message for VideoAssetService.GetVideoAssetThumbnails. message BatchGetVideoAssetThumbnailsRequest { // URLs of a video asset playlist, for example: https://s3-eu-west-1.amazonaws.com/ingest-recording-live/recordings/95ac51c7-9ef1-497b-b542-07be6458b071/886386d6-acc7-4ca4-a47a-24cdba07b1f1/segments/index.m3u8 repeated string recording_urls = 1; } // Response message for VideoAssetService.GetVideoAssetThumbnails. message BatchGetVideoAssetThumbnailsResponse { string recording_url = 1; // URL of the given video asset recording string thumbnail_url = 2; // URLs of the thumbnail } message BatchAddVideoAssetMetadataRequest { // The unique identifier of the videoasset. string videoasset_id = 1; // The unique identifier of the team owning the videoasset. string team_id = 2; // The metadata to add. repeated VideoAsset.Metadata metadata = 3; } message BatchAddVideoAssetMetadataResponse {} message RemoveVideoAssetMetadataRequest { // The unique identifier of the videoasset. string videoasset_id = 1; // The unique identifier of the team owning the videoasset. string team_id = 2; // The unique identifier of the metadata. string metadata_id = 3; } message RemoveVideoAssetMetadataResponse {} message DownloadVideoAssetRequest { // The unique identifier of the videoasset. string videoasset_id = 1; // The unique identifier of the team owning the videoasset. string team_id = 2; // Start position of a slice to download (optional). double start_seconds = 3; // End position of a slice to download (optional). double end_seconds = 4; } message DownloadVideoAssetResponse { // URL at which the selected slice of the videoasset can be downloaded. // // This URL can be queried exactly once via GET and doesn't require additional authentication. string download_url = 1; // The time when the download_url won't be accessible anymore google.protobuf.Timestamp expire_time = 2; } // Request message for [SearchVideoAssets][tv.make.api.VideoAssetService.SearchVideoAssets]. message SearchVideoAssetsRequest { // The unique identifier of the team owning the videoassets. string team_id = 1; // The query expression. // // Search atoms can be used to match certain specific fields. // // Search atoms: // * `duration_seconds` - (float) The duration in seconds (operators: >=, <=, =) // * `size_bytes` - (int) The size in bytes (operators: >=, <=, =) // * `video_width_pixels` - (int) The width in pixel (operators: >=, <=, =) // * `video_height_pixels` - (int) The height in pixel (operators: >=, <=, =) // * `create_time` - (timestamp) The time of creation (operators: >=, <=, =) // * `update_time` - (timestamp) The time of last modification (operators: >=, <=, =) // * `creator_id` - (uuid) The id of the creator (operators: =) // // Timestamp formats: // * RFC3339, for example "2006-01-02T15:04:05Z07:00" // // It is NOT possible to form a logical disjunction with any of the atoms other than `creator_id`. // Atoms must use the logical conjunction to create complex queries. Current limitations do not // allow mixing some operators. // // Example queries: // * `(creator_id = "7996d1e5-a08b-45c2-ac60-c0a8bb7bd6f4" OR creator_id = "11ffb69d-1260-4ef8-b203-0af57fb2c81e")` - matches // assets created by user `7996d1e5-a08b-45c2-ac60-c0a8bb7bd6f4` or user `11ffb69d-1260-4ef8-b203-0af57fb2c81e` // * `video_width = 1280 AND video_height = 720` - matches assets with exact 720p resolution // * `video_width = 1280 AND video_height >= 720` - matches assets with 1280 width and height greater or equal to 720 // * `video_height >= 720 AND video_width <= 1080` - matches assets that are at least 720p but at max 1080p // * `video_height >= 720 AND video_width <= 1080 AND (creator_id = "7996d1e5-a08b-45c2-ac60-c0a8bb7bd6f4" OR creator_id = "11ffb69d-1260-4ef8-b203-0af57fb2c81e")` - // matches assets that are at least 720p but at max 1080p and created by user `7996d1e5-a08b-45c2-ac60-c0a8bb7bd6f4` or user `11ffb69d-1260-4ef8-b203-0af57fb2c81e` // * `create_time >= 2019-01-01T00:00:00.000Z` - matches assets created since 2019 // string query = 2; // The maximum number of items to return. int32 page_size = 3; // The next_page_token value returned from a previous List request, if any. string page_token = 4; // Specifies the result ordering for List requests. string order_by = 5; } // Response message for [SearchVideoAssets][tv.make.api.VideoAssetService.SearchVideoAssets]. message SearchVideoAssetsResponse { // The list of videoassets. repeated VideoAsset videoassets = 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; }