cloud_speech_adaptation.proto 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. // Copyright 2021 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.
  113. // Format:
  114. // {api_version}/projects/{project}/locations/{location}/phraseSets
  115. string parent = 1 [
  116. (google.api.field_behavior) = REQUIRED,
  117. (google.api.resource_reference) = {
  118. child_type: "speech.googleapis.com/PhraseSet"
  119. }
  120. ];
  121. // Required. The ID to use for the phrase set, which will become the final
  122. // component of the phrase set's resource name.
  123. //
  124. // This value should be 4-63 characters, and valid characters
  125. // are /[a-z][0-9]-/.
  126. string phrase_set_id = 2 [(google.api.field_behavior) = REQUIRED];
  127. // Required. The phrase set to create.
  128. PhraseSet phrase_set = 3 [(google.api.field_behavior) = REQUIRED];
  129. }
  130. // Message sent by the client for the `UpdatePhraseSet` method.
  131. message UpdatePhraseSetRequest {
  132. // Required. The phrase set to update.
  133. //
  134. // The phrase set's `name` field is used to identify the set to be
  135. // updated. Format:
  136. // {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
  137. PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED];
  138. // The list of fields to be updated.
  139. google.protobuf.FieldMask update_mask = 2;
  140. }
  141. // Message sent by the client for the `GetPhraseSet` method.
  142. message GetPhraseSetRequest {
  143. // Required. The name of the phrase set to retrieve.
  144. // Format:
  145. // {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
  146. string name = 1 [
  147. (google.api.field_behavior) = REQUIRED,
  148. (google.api.resource_reference) = {
  149. type: "speech.googleapis.com/PhraseSet"
  150. }
  151. ];
  152. }
  153. // Message sent by the client for the `ListPhraseSet` method.
  154. message ListPhraseSetRequest {
  155. // Required. The parent, which owns this collection of phrase set.
  156. // Format:
  157. // projects/{project}/locations/{location}
  158. string parent = 1 [
  159. (google.api.field_behavior) = REQUIRED,
  160. (google.api.resource_reference) = {
  161. child_type: "speech.googleapis.com/PhraseSet"
  162. }
  163. ];
  164. // The maximum number of phrase sets to return. The service may return
  165. // fewer than this value. If unspecified, at most 50 phrase sets will be
  166. // returned. The maximum value is 1000; values above 1000 will be coerced to
  167. // 1000.
  168. int32 page_size = 2;
  169. // A page token, received from a previous `ListPhraseSet` call.
  170. // Provide this to retrieve the subsequent page.
  171. //
  172. // When paginating, all other parameters provided to `ListPhraseSet` must
  173. // match the call that provided the page token.
  174. string page_token = 3;
  175. }
  176. // Message returned to the client by the `ListPhraseSet` method.
  177. message ListPhraseSetResponse {
  178. // The phrase set.
  179. repeated PhraseSet phrase_sets = 1;
  180. // A token, which can be sent as `page_token` to retrieve the next page.
  181. // If this field is omitted, there are no subsequent pages.
  182. string next_page_token = 2;
  183. }
  184. // Message sent by the client for the `DeletePhraseSet` method.
  185. message DeletePhraseSetRequest {
  186. // Required. The name of the phrase set to delete.
  187. // Format:
  188. // {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
  189. string name = 1 [
  190. (google.api.field_behavior) = REQUIRED,
  191. (google.api.resource_reference) = {
  192. type: "speech.googleapis.com/PhraseSet"
  193. }
  194. ];
  195. }
  196. // Message sent by the client for the `CreateCustomClass` method.
  197. message CreateCustomClassRequest {
  198. // Required. The parent resource where this custom class will be created.
  199. // Format:
  200. // {api_version}/projects/{project}/locations/{location}/customClasses
  201. string parent = 1 [
  202. (google.api.field_behavior) = REQUIRED,
  203. (google.api.resource_reference) = {
  204. child_type: "speech.googleapis.com/CustomClass"
  205. }
  206. ];
  207. // Required. The ID to use for the custom class, which will become the final
  208. // component of the custom class' resource name.
  209. //
  210. // This value should be 4-63 characters, and valid characters
  211. // are /[a-z][0-9]-/.
  212. string custom_class_id = 2 [(google.api.field_behavior) = REQUIRED];
  213. // Required. The custom class to create.
  214. CustomClass custom_class = 3 [(google.api.field_behavior) = REQUIRED];
  215. }
  216. // Message sent by the client for the `UpdateCustomClass` method.
  217. message UpdateCustomClassRequest {
  218. // Required. The custom class to update.
  219. //
  220. // The custom class's `name` field is used to identify the custom class to be
  221. // updated. Format:
  222. // {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
  223. CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED];
  224. // The list of fields to be updated.
  225. google.protobuf.FieldMask update_mask = 2;
  226. }
  227. // Message sent by the client for the `GetCustomClass` method.
  228. message GetCustomClassRequest {
  229. // Required. The name of the custom class to retrieve.
  230. // Format:
  231. // {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
  232. string name = 1 [
  233. (google.api.field_behavior) = REQUIRED,
  234. (google.api.resource_reference) = {
  235. type: "speech.googleapis.com/CustomClass"
  236. }
  237. ];
  238. }
  239. // Message sent by the client for the `ListCustomClasses` method.
  240. message ListCustomClassesRequest {
  241. // Required. The parent, which owns this collection of custom classes.
  242. // Format:
  243. // {api_version}/projects/{project}/locations/{location}/customClasses
  244. string parent = 1 [
  245. (google.api.field_behavior) = REQUIRED,
  246. (google.api.resource_reference) = {
  247. child_type: "speech.googleapis.com/CustomClass"
  248. }
  249. ];
  250. // The maximum number of custom classes to return. The service may return
  251. // fewer than this value. If unspecified, at most 50 custom classes will be
  252. // returned. The maximum value is 1000; values above 1000 will be coerced to
  253. // 1000.
  254. int32 page_size = 2;
  255. // A page token, received from a previous `ListCustomClass` call.
  256. // Provide this to retrieve the subsequent page.
  257. //
  258. // When paginating, all other parameters provided to `ListCustomClass` must
  259. // match the call that provided the page token.
  260. string page_token = 3;
  261. }
  262. // Message returned to the client by the `ListCustomClasses` method.
  263. message ListCustomClassesResponse {
  264. // The custom classes.
  265. repeated CustomClass custom_classes = 1;
  266. // A token, which can be sent as `page_token` to retrieve the next page.
  267. // If this field is omitted, there are no subsequent pages.
  268. string next_page_token = 2;
  269. }
  270. // Message sent by the client for the `DeleteCustomClass` method.
  271. message DeleteCustomClassRequest {
  272. // Required. The name of the custom class to delete.
  273. // Format:
  274. // {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
  275. string name = 1 [
  276. (google.api.field_behavior) = REQUIRED,
  277. (google.api.resource_reference) = {
  278. type: "speech.googleapis.com/CustomClass"
  279. }
  280. ];
  281. }