cloud_speech_adaptation.proto 14 KB

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