1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.video.transcoder.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/video/transcoder/v1/resources.proto"; 24import "google/protobuf/empty.proto"; 25 26option csharp_namespace = "Google.Cloud.Video.Transcoder.V1"; 27option go_package = "cloud.google.com/go/video/transcoder/apiv1/transcoderpb;transcoderpb"; 28option java_multiple_files = true; 29option java_outer_classname = "ServicesProto"; 30option java_package = "com.google.cloud.video.transcoder.v1"; 31option php_namespace = "Google\\Cloud\\Video\\Transcoder\\V1"; 32option ruby_package = "Google::Cloud::Video::Transcoder::V1"; 33 34// Using the Transcoder API, you can queue asynchronous jobs for transcoding 35// media into various output formats. Output formats may include different 36// streaming standards such as HTTP Live Streaming (HLS) and Dynamic Adaptive 37// Streaming over HTTP (DASH). You can also customize jobs using advanced 38// features such as Digital Rights Management (DRM), audio equalization, content 39// concatenation, and digital ad-stitch ready content generation. 40service TranscoderService { 41 option (google.api.default_host) = "transcoder.googleapis.com"; 42 option (google.api.oauth_scopes) = 43 "https://www.googleapis.com/auth/cloud-platform"; 44 45 // Creates a job in the specified region. 46 rpc CreateJob(CreateJobRequest) returns (Job) { 47 option (google.api.http) = { 48 post: "/v1/{parent=projects/*/locations/*}/jobs" 49 body: "job" 50 }; 51 option (google.api.method_signature) = "parent,job"; 52 } 53 54 // Lists jobs in the specified region. 55 rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { 56 option (google.api.http) = { 57 get: "/v1/{parent=projects/*/locations/*}/jobs" 58 }; 59 option (google.api.method_signature) = "parent"; 60 } 61 62 // Returns the job data. 63 rpc GetJob(GetJobRequest) returns (Job) { 64 option (google.api.http) = { 65 get: "/v1/{name=projects/*/locations/*/jobs/*}" 66 }; 67 option (google.api.method_signature) = "name"; 68 } 69 70 // Deletes a job. 71 rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) { 72 option (google.api.http) = { 73 delete: "/v1/{name=projects/*/locations/*/jobs/*}" 74 }; 75 option (google.api.method_signature) = "name"; 76 } 77 78 // Creates a job template in the specified region. 79 rpc CreateJobTemplate(CreateJobTemplateRequest) returns (JobTemplate) { 80 option (google.api.http) = { 81 post: "/v1/{parent=projects/*/locations/*}/jobTemplates" 82 body: "job_template" 83 }; 84 option (google.api.method_signature) = 85 "parent,job_template,job_template_id"; 86 } 87 88 // Lists job templates in the specified region. 89 rpc ListJobTemplates(ListJobTemplatesRequest) 90 returns (ListJobTemplatesResponse) { 91 option (google.api.http) = { 92 get: "/v1/{parent=projects/*/locations/*}/jobTemplates" 93 }; 94 option (google.api.method_signature) = "parent"; 95 } 96 97 // Returns the job template data. 98 rpc GetJobTemplate(GetJobTemplateRequest) returns (JobTemplate) { 99 option (google.api.http) = { 100 get: "/v1/{name=projects/*/locations/*/jobTemplates/*}" 101 }; 102 option (google.api.method_signature) = "name"; 103 } 104 105 // Deletes a job template. 106 rpc DeleteJobTemplate(DeleteJobTemplateRequest) 107 returns (google.protobuf.Empty) { 108 option (google.api.http) = { 109 delete: "/v1/{name=projects/*/locations/*/jobTemplates/*}" 110 }; 111 option (google.api.method_signature) = "name"; 112 } 113} 114 115// Request message for `TranscoderService.CreateJob`. 116message CreateJobRequest { 117 // Required. The parent location to create and process this job. 118 // Format: `projects/{project}/locations/{location}` 119 string parent = 1 [ 120 (google.api.field_behavior) = REQUIRED, 121 (google.api.resource_reference) = { 122 type: "locations.googleapis.com/Location" 123 } 124 ]; 125 126 // Required. Parameters for creating transcoding job. 127 Job job = 2 [(google.api.field_behavior) = REQUIRED]; 128} 129 130// Request message for `TranscoderService.ListJobs`. 131// The parent location from which to retrieve the collection of jobs. 132message ListJobsRequest { 133 // Required. Format: `projects/{project}/locations/{location}` 134 string parent = 1 [ 135 (google.api.field_behavior) = REQUIRED, 136 (google.api.resource_reference) = { 137 type: "locations.googleapis.com/Location" 138 } 139 ]; 140 141 // The maximum number of items to return. 142 int32 page_size = 2; 143 144 // The `next_page_token` value returned from a previous List request, if 145 // any. 146 string page_token = 3; 147 148 // The filter expression, following the syntax outlined in 149 // https://google.aip.dev/160. 150 string filter = 4; 151 152 // One or more fields to compare and use to sort the output. 153 // See https://google.aip.dev/132#ordering. 154 string order_by = 5; 155} 156 157// Request message for `TranscoderService.GetJob`. 158message GetJobRequest { 159 // Required. The name of the job to retrieve. 160 // Format: `projects/{project}/locations/{location}/jobs/{job}` 161 string name = 1 [ 162 (google.api.field_behavior) = REQUIRED, 163 (google.api.resource_reference) = { type: "transcoder.googleapis.com/Job" } 164 ]; 165} 166 167// Request message for `TranscoderService.DeleteJob`. 168message DeleteJobRequest { 169 // Required. The name of the job to delete. 170 // Format: `projects/{project}/locations/{location}/jobs/{job}` 171 string name = 1 [ 172 (google.api.field_behavior) = REQUIRED, 173 (google.api.resource_reference) = { type: "transcoder.googleapis.com/Job" } 174 ]; 175 176 // If set to true, and the job is not found, the request will succeed but no 177 // action will be taken on the server. 178 bool allow_missing = 2; 179} 180 181// Response message for `TranscoderService.ListJobs`. 182message ListJobsResponse { 183 // List of jobs in the specified region. 184 repeated Job jobs = 1; 185 186 // The pagination token. 187 string next_page_token = 2; 188 189 // List of regions that could not be reached. 190 repeated string unreachable = 3; 191} 192 193// Request message for `TranscoderService.CreateJobTemplate`. 194message CreateJobTemplateRequest { 195 // Required. The parent location to create this job template. 196 // Format: `projects/{project}/locations/{location}` 197 string parent = 1 [ 198 (google.api.field_behavior) = REQUIRED, 199 (google.api.resource_reference) = { 200 type: "locations.googleapis.com/Location" 201 } 202 ]; 203 204 // Required. Parameters for creating job template. 205 JobTemplate job_template = 2 [(google.api.field_behavior) = REQUIRED]; 206 207 // Required. The ID to use for the job template, which will become the final 208 // component of the job template's resource name. 209 // 210 // This value should be 4-63 characters, and valid characters must match the 211 // regular expression `[a-zA-Z][a-zA-Z0-9_-]*`. 212 string job_template_id = 3 [(google.api.field_behavior) = REQUIRED]; 213} 214 215// Request message for `TranscoderService.ListJobTemplates`. 216message ListJobTemplatesRequest { 217 // Required. The parent location from which to retrieve the collection of job 218 // templates. Format: `projects/{project}/locations/{location}` 219 string parent = 1 [ 220 (google.api.field_behavior) = REQUIRED, 221 (google.api.resource_reference) = { 222 type: "locations.googleapis.com/Location" 223 } 224 ]; 225 226 // The maximum number of items to return. 227 int32 page_size = 2; 228 229 // The `next_page_token` value returned from a previous List request, if 230 // any. 231 string page_token = 3; 232 233 // The filter expression, following the syntax outlined in 234 // https://google.aip.dev/160. 235 string filter = 4; 236 237 // One or more fields to compare and use to sort the output. 238 // See https://google.aip.dev/132#ordering. 239 string order_by = 5; 240} 241 242// Request message for `TranscoderService.GetJobTemplate`. 243message GetJobTemplateRequest { 244 // Required. The name of the job template to retrieve. 245 // Format: 246 // `projects/{project}/locations/{location}/jobTemplates/{job_template}` 247 string name = 1 [ 248 (google.api.field_behavior) = REQUIRED, 249 (google.api.resource_reference) = { 250 type: "transcoder.googleapis.com/JobTemplate" 251 } 252 ]; 253} 254 255// Request message for `TranscoderService.DeleteJobTemplate`. 256message DeleteJobTemplateRequest { 257 // Required. The name of the job template to delete. 258 // `projects/{project}/locations/{location}/jobTemplates/{job_template}` 259 string name = 1 [ 260 (google.api.field_behavior) = REQUIRED, 261 (google.api.resource_reference) = { 262 type: "transcoder.googleapis.com/JobTemplate" 263 } 264 ]; 265 266 // If set to true, and the job template is not found, the request will succeed 267 // but no action will be taken on the server. 268 bool allow_missing = 2; 269} 270 271// Response message for `TranscoderService.ListJobTemplates`. 272message ListJobTemplatesResponse { 273 // List of job templates in the specified region. 274 repeated JobTemplate job_templates = 1; 275 276 // The pagination token. 277 string next_page_token = 2; 278 279 // List of regions that could not be reached. 280 repeated string unreachable = 3; 281} 282