OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis_beta.speech.v1beta1; | 3 library googleapis_beta.speech.v1beta1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
(...skipping 25 matching lines...) Expand all Loading... |
36 OperationsResourceApi(commons.ApiRequester client) : | 36 OperationsResourceApi(commons.ApiRequester client) : |
37 _requester = client; | 37 _requester = client; |
38 | 38 |
39 /** | 39 /** |
40 * Starts asynchronous cancellation on a long-running operation. The server | 40 * Starts asynchronous cancellation on a long-running operation. The server |
41 * makes a best effort to cancel the operation, but success is not | 41 * makes a best effort to cancel the operation, but success is not |
42 * guaranteed. If the server doesn't support this method, it returns | 42 * guaranteed. If the server doesn't support this method, it returns |
43 * `google.rpc.Code.UNIMPLEMENTED`. Clients can use | 43 * `google.rpc.Code.UNIMPLEMENTED`. Clients can use |
44 * Operations.GetOperation or | 44 * Operations.GetOperation or |
45 * other methods to check whether the cancellation succeeded or whether the | 45 * other methods to check whether the cancellation succeeded or whether the |
46 * operation completed despite cancellation. | 46 * operation completed despite cancellation. On successful cancellation, |
| 47 * the operation is not deleted; instead, it becomes an operation with |
| 48 * an Operation.error value with a google.rpc.Status.code of 1, |
| 49 * corresponding to `Code.CANCELLED`. |
47 * | 50 * |
48 * [request] - The metadata request object. | 51 * [request] - The metadata request object. |
49 * | 52 * |
50 * Request parameters: | 53 * Request parameters: |
51 * | 54 * |
52 * [name] - The name of the operation resource to be cancelled. | 55 * [name] - The name of the operation resource to be cancelled. |
53 * Value must have pattern "^[^/]*$". | 56 * Value must have pattern "^[^/]+$". |
54 * | 57 * |
55 * Completes with a [Empty]. | 58 * Completes with a [Empty]. |
56 * | 59 * |
57 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 60 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
58 * error. | 61 * error. |
59 * | 62 * |
60 * If the used [http.Client] completes with an error when making a REST call, | 63 * If the used [http.Client] completes with an error when making a REST call, |
61 * this method will complete with the same error. | 64 * this method will complete with the same error. |
62 */ | 65 */ |
63 async.Future<Empty> cancel(CancelOperationRequest request, core.String name) { | 66 async.Future<Empty> cancel(CancelOperationRequest request, core.String name) { |
(...skipping 25 matching lines...) Expand all Loading... |
89 | 92 |
90 /** | 93 /** |
91 * Deletes a long-running operation. This method indicates that the client is | 94 * Deletes a long-running operation. This method indicates that the client is |
92 * no longer interested in the operation result. It does not cancel the | 95 * no longer interested in the operation result. It does not cancel the |
93 * operation. If the server doesn't support this method, it returns | 96 * operation. If the server doesn't support this method, it returns |
94 * `google.rpc.Code.UNIMPLEMENTED`. | 97 * `google.rpc.Code.UNIMPLEMENTED`. |
95 * | 98 * |
96 * Request parameters: | 99 * Request parameters: |
97 * | 100 * |
98 * [name] - The name of the operation resource to be deleted. | 101 * [name] - The name of the operation resource to be deleted. |
99 * Value must have pattern "^[^/]*$". | 102 * Value must have pattern "^[^/]+$". |
100 * | 103 * |
101 * Completes with a [Empty]. | 104 * Completes with a [Empty]. |
102 * | 105 * |
103 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 106 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
104 * error. | 107 * error. |
105 * | 108 * |
106 * If the used [http.Client] completes with an error when making a REST call, | 109 * If the used [http.Client] completes with an error when making a REST call, |
107 * this method will complete with the same error. | 110 * this method will complete with the same error. |
108 */ | 111 */ |
109 async.Future<Empty> delete(core.String name) { | 112 async.Future<Empty> delete(core.String name) { |
(...skipping 21 matching lines...) Expand all Loading... |
131 } | 134 } |
132 | 135 |
133 /** | 136 /** |
134 * Gets the latest state of a long-running operation. Clients can use this | 137 * Gets the latest state of a long-running operation. Clients can use this |
135 * method to poll the operation result at intervals as recommended by the API | 138 * method to poll the operation result at intervals as recommended by the API |
136 * service. | 139 * service. |
137 * | 140 * |
138 * Request parameters: | 141 * Request parameters: |
139 * | 142 * |
140 * [name] - The name of the operation resource. | 143 * [name] - The name of the operation resource. |
141 * Value must have pattern "^[^/]*$". | 144 * Value must have pattern "^[^/]+$". |
142 * | 145 * |
143 * Completes with a [Operation]. | 146 * Completes with a [Operation]. |
144 * | 147 * |
145 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 148 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
146 * error. | 149 * error. |
147 * | 150 * |
148 * If the used [http.Client] completes with an error when making a REST call, | 151 * If the used [http.Client] completes with an error when making a REST call, |
149 * this method will complete with the same error. | 152 * this method will complete with the same error. |
150 */ | 153 */ |
151 async.Future<Operation> get(core.String name) { | 154 async.Future<Operation> get(core.String name) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 236 } |
234 | 237 |
235 | 238 |
236 class SpeechResourceApi { | 239 class SpeechResourceApi { |
237 final commons.ApiRequester _requester; | 240 final commons.ApiRequester _requester; |
238 | 241 |
239 SpeechResourceApi(commons.ApiRequester client) : | 242 SpeechResourceApi(commons.ApiRequester client) : |
240 _requester = client; | 243 _requester = client; |
241 | 244 |
242 /** | 245 /** |
243 * Perform asynchronous speech-recognition: receive results via the | 246 * Performs asynchronous speech recognition: receive results via the |
244 * google.longrunning.Operations interface. Returns either an | 247 * google.longrunning.Operations interface. Returns either an |
245 * `Operation.error` or an `Operation.response` which contains | 248 * `Operation.error` or an `Operation.response` which contains |
246 * an `AsyncRecognizeResponse` message. | 249 * an `AsyncRecognizeResponse` message. |
247 * | 250 * |
248 * [request] - The metadata request object. | 251 * [request] - The metadata request object. |
249 * | 252 * |
250 * Request parameters: | 253 * Request parameters: |
251 * | 254 * |
252 * Completes with a [Operation]. | 255 * Completes with a [Operation]. |
253 * | 256 * |
(...skipping 21 matching lines...) Expand all Loading... |
275 "POST", | 278 "POST", |
276 body: _body, | 279 body: _body, |
277 queryParams: _queryParams, | 280 queryParams: _queryParams, |
278 uploadOptions: _uploadOptions, | 281 uploadOptions: _uploadOptions, |
279 uploadMedia: _uploadMedia, | 282 uploadMedia: _uploadMedia, |
280 downloadOptions: _downloadOptions); | 283 downloadOptions: _downloadOptions); |
281 return _response.then((data) => new Operation.fromJson(data)); | 284 return _response.then((data) => new Operation.fromJson(data)); |
282 } | 285 } |
283 | 286 |
284 /** | 287 /** |
285 * Perform synchronous speech-recognition: receive results after all audio | 288 * Performs synchronous speech recognition: receive results after all audio |
286 * has been sent and processed. | 289 * has been sent and processed. |
287 * | 290 * |
288 * [request] - The metadata request object. | 291 * [request] - The metadata request object. |
289 * | 292 * |
290 * Request parameters: | 293 * Request parameters: |
291 * | 294 * |
292 * Completes with a [SyncRecognizeResponse]. | 295 * Completes with a [SyncRecognizeResponse]. |
293 * | 296 * |
294 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 297 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
295 * error. | 298 * error. |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 * This resource represents a long-running operation that is the result of a | 436 * This resource represents a long-running operation that is the result of a |
434 * network API call. | 437 * network API call. |
435 */ | 438 */ |
436 class Operation { | 439 class Operation { |
437 /** | 440 /** |
438 * If the value is `false`, it means the operation is still in progress. | 441 * If the value is `false`, it means the operation is still in progress. |
439 * If true, the operation is completed, and either `error` or `response` is | 442 * If true, the operation is completed, and either `error` or `response` is |
440 * available. | 443 * available. |
441 */ | 444 */ |
442 core.bool done; | 445 core.bool done; |
443 /** The error result of the operation in case of failure. */ | 446 /** The error result of the operation in case of failure or cancellation. */ |
444 Status error; | 447 Status error; |
445 /** | 448 /** |
446 * Service-specific metadata associated with the operation. It typically | 449 * Service-specific metadata associated with the operation. It typically |
447 * contains progress information and common metadata such as create time. | 450 * contains progress information and common metadata such as create time. |
448 * Some services might not provide such metadata. Any method that returns a | 451 * Some services might not provide such metadata. Any method that returns a |
449 * long-running operation should document the metadata type, if any. | 452 * long-running operation should document the metadata type, if any. |
450 * | 453 * |
451 * The values for Object must be JSON objects. It can consist of `num`, | 454 * The values for Object must be JSON objects. It can consist of `num`, |
452 * `String`, `bool` and `null` as well as `Map` and `List` values. | 455 * `String`, `bool` and `null` as well as `Map` and `List` values. |
453 */ | 456 */ |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 /** | 573 /** |
571 * The `RecognitionConfig` message provides information to the recognizer | 574 * The `RecognitionConfig` message provides information to the recognizer |
572 * that specifies how to process the request. | 575 * that specifies how to process the request. |
573 */ | 576 */ |
574 class RecognitionConfig { | 577 class RecognitionConfig { |
575 /** | 578 /** |
576 * [Required] Encoding of audio data sent in all `RecognitionAudio` messages. | 579 * [Required] Encoding of audio data sent in all `RecognitionAudio` messages. |
577 * Possible string values are: | 580 * Possible string values are: |
578 * - "ENCODING_UNSPECIFIED" : Not specified. Will return result | 581 * - "ENCODING_UNSPECIFIED" : Not specified. Will return result |
579 * google.rpc.Code.INVALID_ARGUMENT. | 582 * google.rpc.Code.INVALID_ARGUMENT. |
580 * - "LINEAR16" : Uncompressed 16-bit signed little-endian samples. | 583 * - "LINEAR16" : Uncompressed 16-bit signed little-endian samples (Linear |
| 584 * PCM). |
581 * This is the only encoding that may be used by `AsyncRecognize`. | 585 * This is the only encoding that may be used by `AsyncRecognize`. |
582 * - "FLAC" : This is the recommended encoding for `SyncRecognize` and | 586 * - "FLAC" : This is the recommended encoding for `SyncRecognize` and |
583 * `StreamingRecognize` because it uses lossless compression; therefore | 587 * `StreamingRecognize` because it uses lossless compression; therefore |
584 * recognition accuracy is not compromised by a lossy codec. | 588 * recognition accuracy is not compromised by a lossy codec. |
585 * | 589 * |
586 * The stream FLAC (Free Lossless Audio Codec) encoding is specified at: | 590 * The stream FLAC (Free Lossless Audio Codec) encoding is specified at: |
587 * http://flac.sourceforge.net/documentation.html. | 591 * http://flac.sourceforge.net/documentation.html. |
588 * Only 16-bit samples are supported. | 592 * 16-bit and 24-bit samples are supported. |
589 * Not all fields in STREAMINFO are supported. | 593 * Not all fields in STREAMINFO are supported. |
590 * - "MULAW" : 8-bit samples that compand 14-bit audio samples using G.711 | 594 * - "MULAW" : 8-bit samples that compand 14-bit audio samples using G.711 |
591 * PCMU/mu-law. | 595 * PCMU/mu-law. |
592 * - "AMR" : Adaptive Multi-Rate Narrowband codec. `sample_rate` must be 8000 | 596 * - "AMR" : Adaptive Multi-Rate Narrowband codec. `sample_rate` must be 8000 |
593 * Hz. | 597 * Hz. |
594 * - "AMR_WB" : Adaptive Multi-Rate Wideband codec. `sample_rate` must be | 598 * - "AMR_WB" : Adaptive Multi-Rate Wideband codec. `sample_rate` must be |
595 * 16000 Hz. | 599 * 16000 Hz. |
596 */ | 600 */ |
597 core.String encoding; | 601 core.String encoding; |
598 /** | 602 /** |
599 * [Optional] The language of the supplied audio as a BCP-47 language tag. | 603 * [Optional] The language of the supplied audio as a BCP-47 language tag. |
600 * Example: "en-GB" https://www.rfc-editor.org/rfc/bcp/bcp47.txt | 604 * Example: "en-GB" https://www.rfc-editor.org/rfc/bcp/bcp47.txt |
601 * If omitted, defaults to "en-US". See | 605 * If omitted, defaults to "en-US". See |
602 * [Language | 606 * [Language Support](https://cloud.google.com/speech/docs/languages) |
603 * Support](https://cloud.google.com/speech/docs/best-practices#language_suppo
rt) | |
604 * for a list of the currently supported language codes. | 607 * for a list of the currently supported language codes. |
605 */ | 608 */ |
606 core.String languageCode; | 609 core.String languageCode; |
607 /** | 610 /** |
608 * [Optional] Maximum number of recognition hypotheses to be returned. | 611 * [Optional] Maximum number of recognition hypotheses to be returned. |
609 * Specifically, the maximum number of `SpeechRecognitionAlternative` messages | 612 * Specifically, the maximum number of `SpeechRecognitionAlternative` messages |
610 * within each `SpeechRecognitionResult`. | 613 * within each `SpeechRecognitionResult`. |
611 * The server may return fewer than `max_alternatives`. | 614 * The server may return fewer than `max_alternatives`. |
612 * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of | 615 * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of |
613 * `1`. If omitted, defaults to `1`. | 616 * `1`. If omitted, defaults to `1`. |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 } | 938 } |
936 | 939 |
937 core.Map toJson() { | 940 core.Map toJson() { |
938 var _json = new core.Map(); | 941 var _json = new core.Map(); |
939 if (results != null) { | 942 if (results != null) { |
940 _json["results"] = results.map((value) => (value).toJson()).toList(); | 943 _json["results"] = results.map((value) => (value).toJson()).toList(); |
941 } | 944 } |
942 return _json; | 945 return _json; |
943 } | 946 } |
944 } | 947 } |
OLD | NEW |