1// Copyright 2022 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.speech.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/speech/v1/resource.proto"; 24import "google/protobuf/empty.proto"; 25import "google/protobuf/field_mask.proto"; 26 27option cc_enable_arenas = true; 28option go_package = "cloud.google.com/go/speech/apiv1/speechpb;speechpb"; 29option java_multiple_files = true; 30option java_outer_classname = "SpeechAdaptationProto"; 31option java_package = "com.google.cloud.speech.v1"; 32option objc_class_prefix = "GCS"; 33 34// Service that implements Google Cloud Speech Adaptation API. 35service Adaptation { 36 option (google.api.default_host) = "speech.googleapis.com"; 37 option (google.api.oauth_scopes) = 38 "https://www.googleapis.com/auth/cloud-platform"; 39 40 // Create a set of phrase hints. Each item in the set can be a single word or 41 // a multi-word phrase. The items in the PhraseSet are favored by the 42 // recognition model when you send a call that includes the PhraseSet. 43 rpc CreatePhraseSet(CreatePhraseSetRequest) returns (PhraseSet) { 44 option (google.api.http) = { 45 post: "/v1/{parent=projects/*/locations/*}/phraseSets" 46 body: "*" 47 }; 48 option (google.api.method_signature) = "parent,phrase_set,phrase_set_id"; 49 } 50 51 // Get a phrase set. 52 rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) { 53 option (google.api.http) = { 54 get: "/v1/{name=projects/*/locations/*/phraseSets/*}" 55 }; 56 option (google.api.method_signature) = "name"; 57 } 58 59 // List phrase sets. 60 rpc ListPhraseSet(ListPhraseSetRequest) returns (ListPhraseSetResponse) { 61 option (google.api.http) = { 62 get: "/v1/{parent=projects/*/locations/*}/phraseSets" 63 }; 64 option (google.api.method_signature) = "parent"; 65 } 66 67 // Update a phrase set. 68 rpc UpdatePhraseSet(UpdatePhraseSetRequest) returns (PhraseSet) { 69 option (google.api.http) = { 70 patch: "/v1/{phrase_set.name=projects/*/locations/*/phraseSets/*}" 71 body: "phrase_set" 72 }; 73 option (google.api.method_signature) = "phrase_set,update_mask"; 74 } 75 76 // Delete a phrase set. 77 rpc DeletePhraseSet(DeletePhraseSetRequest) returns (google.protobuf.Empty) { 78 option (google.api.http) = { 79 delete: "/v1/{name=projects/*/locations/*/phraseSets/*}" 80 }; 81 option (google.api.method_signature) = "name"; 82 } 83 84 // Create a custom class. 85 rpc CreateCustomClass(CreateCustomClassRequest) returns (CustomClass) { 86 option (google.api.http) = { 87 post: "/v1/{parent=projects/*/locations/*}/customClasses" 88 body: "*" 89 }; 90 option (google.api.method_signature) = 91 "parent,custom_class,custom_class_id"; 92 } 93 94 // Get a custom class. 95 rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) { 96 option (google.api.http) = { 97 get: "/v1/{name=projects/*/locations/*/customClasses/*}" 98 }; 99 option (google.api.method_signature) = "name"; 100 } 101 102 // List custom classes. 103 rpc ListCustomClasses(ListCustomClassesRequest) 104 returns (ListCustomClassesResponse) { 105 option (google.api.http) = { 106 get: "/v1/{parent=projects/*/locations/*}/customClasses" 107 }; 108 option (google.api.method_signature) = "parent"; 109 } 110 111 // Update a custom class. 112 rpc UpdateCustomClass(UpdateCustomClassRequest) returns (CustomClass) { 113 option (google.api.http) = { 114 patch: "/v1/{custom_class.name=projects/*/locations/*/customClasses/*}" 115 body: "custom_class" 116 }; 117 option (google.api.method_signature) = "custom_class,update_mask"; 118 } 119 120 // Delete a custom class. 121 rpc DeleteCustomClass(DeleteCustomClassRequest) 122 returns (google.protobuf.Empty) { 123 option (google.api.http) = { 124 delete: "/v1/{name=projects/*/locations/*/customClasses/*}" 125 }; 126 option (google.api.method_signature) = "name"; 127 } 128} 129 130// Message sent by the client for the `CreatePhraseSet` method. 131message CreatePhraseSetRequest { 132 // Required. The parent resource where this phrase set will be created. 133 // Format: 134 // 135 // `projects/{project}/locations/{location}` 136 // 137 // Speech-to-Text supports three locations: `global`, `us` (US North America), 138 // and `eu` (Europe). If you are calling the `speech.googleapis.com` 139 // endpoint, use the `global` location. To specify a region, use a 140 // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) 141 // with matching `us` or `eu` location value. 142 string parent = 1 [ 143 (google.api.field_behavior) = REQUIRED, 144 (google.api.resource_reference) = { 145 child_type: "speech.googleapis.com/PhraseSet" 146 } 147 ]; 148 149 // Required. The ID to use for the phrase set, which will become the final 150 // component of the phrase set's resource name. 151 // 152 // This value should restrict to letters, numbers, and hyphens, with the first 153 // character a letter, the last a letter or a number, and be 4-63 characters. 154 string phrase_set_id = 2 [(google.api.field_behavior) = REQUIRED]; 155 156 // Required. The phrase set to create. 157 PhraseSet phrase_set = 3 [(google.api.field_behavior) = REQUIRED]; 158} 159 160// Message sent by the client for the `UpdatePhraseSet` method. 161message UpdatePhraseSetRequest { 162 // Required. The phrase set to update. 163 // 164 // The phrase set's `name` field is used to identify the set to be 165 // updated. Format: 166 // 167 // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` 168 // 169 // Speech-to-Text supports three locations: `global`, `us` (US North America), 170 // and `eu` (Europe). If you are calling the `speech.googleapis.com` 171 // endpoint, use the `global` location. To specify a region, use a 172 // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) 173 // with matching `us` or `eu` location value. 174 PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; 175 176 // The list of fields to be updated. 177 google.protobuf.FieldMask update_mask = 2; 178} 179 180// Message sent by the client for the `GetPhraseSet` method. 181message GetPhraseSetRequest { 182 // Required. The name of the phrase set to retrieve. Format: 183 // 184 // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` 185 // 186 // Speech-to-Text supports three locations: `global`, `us` (US North America), 187 // and `eu` (Europe). If you are calling the `speech.googleapis.com` 188 // endpoint, use the `global` location. To specify a region, use a 189 // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) 190 // with matching `us` or `eu` location value. 191 string name = 1 [ 192 (google.api.field_behavior) = REQUIRED, 193 (google.api.resource_reference) = { 194 type: "speech.googleapis.com/PhraseSet" 195 } 196 ]; 197} 198 199// Message sent by the client for the `ListPhraseSet` method. 200message ListPhraseSetRequest { 201 // Required. The parent, which owns this collection of phrase set. Format: 202 // 203 // `projects/{project}/locations/{location}` 204 // 205 // Speech-to-Text supports three locations: `global`, `us` (US North America), 206 // and `eu` (Europe). If you are calling the `speech.googleapis.com` 207 // endpoint, use the `global` location. To specify a region, use a 208 // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) 209 // with matching `us` or `eu` location value. 210 string parent = 1 [ 211 (google.api.field_behavior) = REQUIRED, 212 (google.api.resource_reference) = { 213 child_type: "speech.googleapis.com/PhraseSet" 214 } 215 ]; 216 217 // The maximum number of phrase sets to return. The service may return 218 // fewer than this value. If unspecified, at most 50 phrase sets will be 219 // returned. The maximum value is 1000; values above 1000 will be coerced to 220 // 1000. 221 int32 page_size = 2; 222 223 // A page token, received from a previous `ListPhraseSet` call. 224 // Provide this to retrieve the subsequent page. 225 // 226 // When paginating, all other parameters provided to `ListPhraseSet` must 227 // match the call that provided the page token. 228 string page_token = 3; 229} 230 231// Message returned to the client by the `ListPhraseSet` method. 232message ListPhraseSetResponse { 233 // The phrase set. 234 repeated PhraseSet phrase_sets = 1; 235 236 // A token, which can be sent as `page_token` to retrieve the next page. 237 // If this field is omitted, there are no subsequent pages. 238 string next_page_token = 2; 239} 240 241// Message sent by the client for the `DeletePhraseSet` method. 242message DeletePhraseSetRequest { 243 // Required. The name of the phrase set to delete. Format: 244 // 245 // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` 246 string name = 1 [ 247 (google.api.field_behavior) = REQUIRED, 248 (google.api.resource_reference) = { 249 type: "speech.googleapis.com/PhraseSet" 250 } 251 ]; 252} 253 254// Message sent by the client for the `CreateCustomClass` method. 255message CreateCustomClassRequest { 256 // Required. The parent resource where this custom class will be created. 257 // Format: 258 // 259 // `projects/{project}/locations/{location}/customClasses` 260 // 261 // Speech-to-Text supports three locations: `global`, `us` (US North America), 262 // and `eu` (Europe). If you are calling the `speech.googleapis.com` 263 // endpoint, use the `global` location. To specify a region, use a 264 // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) 265 // with matching `us` or `eu` location value. 266 string parent = 1 [ 267 (google.api.field_behavior) = REQUIRED, 268 (google.api.resource_reference) = { 269 child_type: "speech.googleapis.com/CustomClass" 270 } 271 ]; 272 273 // Required. The ID to use for the custom class, which will become the final 274 // component of the custom class' resource name. 275 // 276 // This value should restrict to letters, numbers, and hyphens, with the first 277 // character a letter, the last a letter or a number, and be 4-63 characters. 278 string custom_class_id = 2 [(google.api.field_behavior) = REQUIRED]; 279 280 // Required. The custom class to create. 281 CustomClass custom_class = 3 [(google.api.field_behavior) = REQUIRED]; 282} 283 284// Message sent by the client for the `UpdateCustomClass` method. 285message UpdateCustomClassRequest { 286 // Required. The custom class to update. 287 // 288 // The custom class's `name` field is used to identify the custom class to be 289 // updated. Format: 290 // 291 // `projects/{project}/locations/{location}/customClasses/{custom_class}` 292 // 293 // Speech-to-Text supports three locations: `global`, `us` (US North America), 294 // and `eu` (Europe). If you are calling the `speech.googleapis.com` 295 // endpoint, use the `global` location. To specify a region, use a 296 // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) 297 // with matching `us` or `eu` location value. 298 CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; 299 300 // The list of fields to be updated. 301 google.protobuf.FieldMask update_mask = 2; 302} 303 304// Message sent by the client for the `GetCustomClass` method. 305message GetCustomClassRequest { 306 // Required. The name of the custom class to retrieve. Format: 307 // 308 // `projects/{project}/locations/{location}/customClasses/{custom_class}` 309 string name = 1 [ 310 (google.api.field_behavior) = REQUIRED, 311 (google.api.resource_reference) = { 312 type: "speech.googleapis.com/CustomClass" 313 } 314 ]; 315} 316 317// Message sent by the client for the `ListCustomClasses` method. 318message ListCustomClassesRequest { 319 // Required. The parent, which owns this collection of custom classes. Format: 320 // 321 // `projects/{project}/locations/{location}/customClasses` 322 // 323 // Speech-to-Text supports three locations: `global`, `us` (US North America), 324 // and `eu` (Europe). If you are calling the `speech.googleapis.com` 325 // endpoint, use the `global` location. To specify a region, use a 326 // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) 327 // with matching `us` or `eu` location value. 328 string parent = 1 [ 329 (google.api.field_behavior) = REQUIRED, 330 (google.api.resource_reference) = { 331 child_type: "speech.googleapis.com/CustomClass" 332 } 333 ]; 334 335 // The maximum number of custom classes to return. The service may return 336 // fewer than this value. If unspecified, at most 50 custom classes will be 337 // returned. The maximum value is 1000; values above 1000 will be coerced to 338 // 1000. 339 int32 page_size = 2; 340 341 // A page token, received from a previous `ListCustomClass` call. 342 // Provide this to retrieve the subsequent page. 343 // 344 // When paginating, all other parameters provided to `ListCustomClass` must 345 // match the call that provided the page token. 346 string page_token = 3; 347} 348 349// Message returned to the client by the `ListCustomClasses` method. 350message ListCustomClassesResponse { 351 // The custom classes. 352 repeated CustomClass custom_classes = 1; 353 354 // A token, which can be sent as `page_token` to retrieve the next page. 355 // If this field is omitted, there are no subsequent pages. 356 string next_page_token = 2; 357} 358 359// Message sent by the client for the `DeleteCustomClass` method. 360message DeleteCustomClassRequest { 361 // Required. The name of the custom class to delete. Format: 362 // 363 // `projects/{project}/locations/{location}/customClasses/{custom_class}` 364 // 365 // Speech-to-Text supports three locations: `global`, `us` (US North America), 366 // and `eu` (Europe). If you are calling the `speech.googleapis.com` 367 // endpoint, use the `global` location. To specify a region, use a 368 // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) 369 // with matching `us` or `eu` location value. 370 string name = 1 [ 371 (google.api.field_behavior) = REQUIRED, 372 (google.api.resource_reference) = { 373 type: "speech.googleapis.com/CustomClass" 374 } 375 ]; 376} 377