google-cloud-speech-v2 0.a → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +151 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/speech/v2/cloud_speech_pb.rb +460 -0
  6. data/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb +98 -0
  7. data/lib/google/cloud/speech/v2/rest.rb +37 -0
  8. data/lib/google/cloud/speech/v2/speech/client.rb +2789 -0
  9. data/lib/google/cloud/speech/v2/speech/credentials.rb +51 -0
  10. data/lib/google/cloud/speech/v2/speech/operations.rb +768 -0
  11. data/lib/google/cloud/speech/v2/speech/paths.rb +168 -0
  12. data/lib/google/cloud/speech/v2/speech/rest/client.rb +2074 -0
  13. data/lib/google/cloud/speech/v2/speech/rest/operations.rb +793 -0
  14. data/lib/google/cloud/speech/v2/speech/rest/service_stub.rb +1358 -0
  15. data/lib/google/cloud/speech/v2/speech/rest.rb +53 -0
  16. data/lib/google/cloud/speech/v2/speech.rb +56 -0
  17. data/lib/google/cloud/speech/v2/version.rb +7 -2
  18. data/lib/google/cloud/speech/v2.rb +45 -0
  19. data/lib/google-cloud-speech-v2.rb +21 -0
  20. data/proto_docs/README.md +4 -0
  21. data/proto_docs/google/api/client.rb +318 -0
  22. data/proto_docs/google/api/field_behavior.rb +71 -0
  23. data/proto_docs/google/api/launch_stage.rb +71 -0
  24. data/proto_docs/google/api/resource.rb +222 -0
  25. data/proto_docs/google/cloud/speech/v2/cloud_speech.rb +1692 -0
  26. data/proto_docs/google/longrunning/operations.rb +164 -0
  27. data/proto_docs/google/protobuf/any.rb +141 -0
  28. data/proto_docs/google/protobuf/duration.rb +98 -0
  29. data/proto_docs/google/protobuf/empty.rb +34 -0
  30. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  31. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  32. data/proto_docs/google/rpc/status.rb +48 -0
  33. metadata +191 -13
@@ -0,0 +1,1692 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Speech
23
+ module V2
24
+ # Request message for the
25
+ # {::Google::Cloud::Speech::V2::Speech::Client#create_recognizer CreateRecognizer} method.
26
+ # @!attribute [rw] recognizer
27
+ # @return [::Google::Cloud::Speech::V2::Recognizer]
28
+ # Required. The Recognizer to create.
29
+ # @!attribute [rw] validate_only
30
+ # @return [::Boolean]
31
+ # If set, validate the request and preview the Recognizer, but do not
32
+ # actually create it.
33
+ # @!attribute [rw] recognizer_id
34
+ # @return [::String]
35
+ # The ID to use for the Recognizer, which will become the final component of
36
+ # the Recognizer's resource name.
37
+ #
38
+ # This value should be 4-63 characters, and valid characters
39
+ # are /[a-z][0-9]-/.
40
+ # @!attribute [rw] parent
41
+ # @return [::String]
42
+ # Required. The project and location where this Recognizer will be created.
43
+ # The expected format is `projects/{project}/locations/{location}`.
44
+ class CreateRecognizerRequest
45
+ include ::Google::Protobuf::MessageExts
46
+ extend ::Google::Protobuf::MessageExts::ClassMethods
47
+ end
48
+
49
+ # Represents the metadata of a long-running operation.
50
+ # @!attribute [rw] create_time
51
+ # @return [::Google::Protobuf::Timestamp]
52
+ # The time the operation was created.
53
+ # @!attribute [rw] update_time
54
+ # @return [::Google::Protobuf::Timestamp]
55
+ # The time the operation was last updated.
56
+ # @!attribute [rw] resource
57
+ # @return [::String]
58
+ # The resource path for the target of the operation.
59
+ # @!attribute [rw] method
60
+ # @return [::String]
61
+ # The method that triggered the operation.
62
+ # @!attribute [rw] kms_key_name
63
+ # @return [::String]
64
+ # The [KMS key
65
+ # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which
66
+ # the content of the Operation is encrypted. The expected format is
67
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
68
+ # @!attribute [rw] kms_key_version_name
69
+ # @return [::String]
70
+ # The [KMS key version
71
+ # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions)
72
+ # with which content of the Operation is encrypted. The expected format is
73
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`.
74
+ # @!attribute [rw] batch_recognize_request
75
+ # @return [::Google::Cloud::Speech::V2::BatchRecognizeRequest]
76
+ # The BatchRecognizeRequest that spawned the Operation.
77
+ # @!attribute [rw] create_recognizer_request
78
+ # @return [::Google::Cloud::Speech::V2::CreateRecognizerRequest]
79
+ # The CreateRecognizerRequest that spawned the Operation.
80
+ # @!attribute [rw] update_recognizer_request
81
+ # @return [::Google::Cloud::Speech::V2::UpdateRecognizerRequest]
82
+ # The UpdateRecognizerRequest that spawned the Operation.
83
+ # @!attribute [rw] delete_recognizer_request
84
+ # @return [::Google::Cloud::Speech::V2::DeleteRecognizerRequest]
85
+ # The DeleteRecognizerRequest that spawned the Operation.
86
+ # @!attribute [rw] undelete_recognizer_request
87
+ # @return [::Google::Cloud::Speech::V2::UndeleteRecognizerRequest]
88
+ # The UndeleteRecognizerRequest that spawned the Operation.
89
+ # @!attribute [rw] create_custom_class_request
90
+ # @return [::Google::Cloud::Speech::V2::CreateCustomClassRequest]
91
+ # The CreateCustomClassRequest that spawned the Operation.
92
+ # @!attribute [rw] update_custom_class_request
93
+ # @return [::Google::Cloud::Speech::V2::UpdateCustomClassRequest]
94
+ # The UpdateCustomClassRequest that spawned the Operation.
95
+ # @!attribute [rw] delete_custom_class_request
96
+ # @return [::Google::Cloud::Speech::V2::DeleteCustomClassRequest]
97
+ # The DeleteCustomClassRequest that spawned the Operation.
98
+ # @!attribute [rw] undelete_custom_class_request
99
+ # @return [::Google::Cloud::Speech::V2::UndeleteCustomClassRequest]
100
+ # The UndeleteCustomClassRequest that spawned the Operation.
101
+ # @!attribute [rw] create_phrase_set_request
102
+ # @return [::Google::Cloud::Speech::V2::CreatePhraseSetRequest]
103
+ # The CreatePhraseSetRequest that spawned the Operation.
104
+ # @!attribute [rw] update_phrase_set_request
105
+ # @return [::Google::Cloud::Speech::V2::UpdatePhraseSetRequest]
106
+ # The UpdatePhraseSetRequest that spawned the Operation.
107
+ # @!attribute [rw] delete_phrase_set_request
108
+ # @return [::Google::Cloud::Speech::V2::DeletePhraseSetRequest]
109
+ # The DeletePhraseSetRequest that spawned the Operation.
110
+ # @!attribute [rw] undelete_phrase_set_request
111
+ # @return [::Google::Cloud::Speech::V2::UndeletePhraseSetRequest]
112
+ # The UndeletePhraseSetRequest that spawned the Operation.
113
+ # @!attribute [rw] update_config_request
114
+ # @return [::Google::Cloud::Speech::V2::UpdateConfigRequest]
115
+ # The UpdateConfigRequest that spawned the Operation.
116
+ # @!attribute [rw] progress_percent
117
+ # @return [::Integer]
118
+ # The percent progress of the Operation. Values can range from 0-100. If the
119
+ # value is 100, then the operation is finished.
120
+ # @!attribute [rw] batch_recognize_metadata
121
+ # @return [::Google::Cloud::Speech::V2::BatchRecognizeMetadata]
122
+ # Metadata specific to the BatchRecognize method.
123
+ class OperationMetadata
124
+ include ::Google::Protobuf::MessageExts
125
+ extend ::Google::Protobuf::MessageExts::ClassMethods
126
+ end
127
+
128
+ # Request message for the
129
+ # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} method.
130
+ # @!attribute [rw] parent
131
+ # @return [::String]
132
+ # Required. The project and location of Recognizers to list. The expected
133
+ # format is `projects/{project}/locations/{location}`.
134
+ # @!attribute [rw] page_size
135
+ # @return [::Integer]
136
+ # The maximum number of Recognizers to return. The service may return fewer
137
+ # than this value. If unspecified, at most 20 Recognizers will be returned.
138
+ # The maximum value is 20; values above 20 will be coerced to 20.
139
+ # @!attribute [rw] page_token
140
+ # @return [::String]
141
+ # A page token, received from a previous
142
+ # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} call.
143
+ # Provide this to retrieve the subsequent page.
144
+ #
145
+ # When paginating, all other parameters provided to
146
+ # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} must match
147
+ # the call that provided the page token.
148
+ # @!attribute [rw] show_deleted
149
+ # @return [::Boolean]
150
+ # Whether, or not, to show resources that have been deleted.
151
+ class ListRecognizersRequest
152
+ include ::Google::Protobuf::MessageExts
153
+ extend ::Google::Protobuf::MessageExts::ClassMethods
154
+ end
155
+
156
+ # Response message for the
157
+ # {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} method.
158
+ # @!attribute [rw] recognizers
159
+ # @return [::Array<::Google::Cloud::Speech::V2::Recognizer>]
160
+ # The list of requested Recognizers.
161
+ # @!attribute [rw] next_page_token
162
+ # @return [::String]
163
+ # A token, which can be sent as
164
+ # {::Google::Cloud::Speech::V2::ListRecognizersRequest#page_token page_token} to
165
+ # retrieve the next page. If this field is omitted, there are no subsequent
166
+ # pages. This token expires after 72 hours.
167
+ class ListRecognizersResponse
168
+ include ::Google::Protobuf::MessageExts
169
+ extend ::Google::Protobuf::MessageExts::ClassMethods
170
+ end
171
+
172
+ # Request message for the
173
+ # {::Google::Cloud::Speech::V2::Speech::Client#get_recognizer GetRecognizer} method.
174
+ # @!attribute [rw] name
175
+ # @return [::String]
176
+ # Required. The name of the Recognizer to retrieve. The expected format is
177
+ # `projects/{project}/locations/{location}/recognizers/{recognizer}`.
178
+ class GetRecognizerRequest
179
+ include ::Google::Protobuf::MessageExts
180
+ extend ::Google::Protobuf::MessageExts::ClassMethods
181
+ end
182
+
183
+ # Request message for the
184
+ # {::Google::Cloud::Speech::V2::Speech::Client#update_recognizer UpdateRecognizer} method.
185
+ # @!attribute [rw] recognizer
186
+ # @return [::Google::Cloud::Speech::V2::Recognizer]
187
+ # Required. The Recognizer to update.
188
+ #
189
+ # The Recognizer's `name` field is used to identify the Recognizer to update.
190
+ # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`.
191
+ # @!attribute [rw] update_mask
192
+ # @return [::Google::Protobuf::FieldMask]
193
+ # The list of fields to update. If empty, all non-default valued fields are
194
+ # considered for update. Use `*` to update the entire Recognizer resource.
195
+ # @!attribute [rw] validate_only
196
+ # @return [::Boolean]
197
+ # If set, validate the request and preview the updated Recognizer, but do not
198
+ # actually update it.
199
+ class UpdateRecognizerRequest
200
+ include ::Google::Protobuf::MessageExts
201
+ extend ::Google::Protobuf::MessageExts::ClassMethods
202
+ end
203
+
204
+ # Request message for the
205
+ # {::Google::Cloud::Speech::V2::Speech::Client#delete_recognizer DeleteRecognizer} method.
206
+ # @!attribute [rw] name
207
+ # @return [::String]
208
+ # Required. The name of the Recognizer to delete.
209
+ # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`
210
+ # @!attribute [rw] validate_only
211
+ # @return [::Boolean]
212
+ # If set, validate the request and preview the deleted Recognizer, but do not
213
+ # actually delete it.
214
+ # @!attribute [rw] allow_missing
215
+ # @return [::Boolean]
216
+ # If set to true, and the Recognizer is not found, the request will succeed
217
+ # and be a no-op (no Operation is recorded in this case).
218
+ # @!attribute [rw] etag
219
+ # @return [::String]
220
+ # This checksum is computed by the server based on the value of other
221
+ # fields. This may be sent on update, undelete, and delete requests to ensure
222
+ # the client has an up-to-date value before proceeding.
223
+ class DeleteRecognizerRequest
224
+ include ::Google::Protobuf::MessageExts
225
+ extend ::Google::Protobuf::MessageExts::ClassMethods
226
+ end
227
+
228
+ # Request message for the
229
+ # {::Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer UndeleteRecognizer}
230
+ # method.
231
+ # @!attribute [rw] name
232
+ # @return [::String]
233
+ # Required. The name of the Recognizer to undelete.
234
+ # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`
235
+ # @!attribute [rw] validate_only
236
+ # @return [::Boolean]
237
+ # If set, validate the request and preview the undeleted Recognizer, but do
238
+ # not actually undelete it.
239
+ # @!attribute [rw] etag
240
+ # @return [::String]
241
+ # This checksum is computed by the server based on the value of other
242
+ # fields. This may be sent on update, undelete, and delete requests to ensure
243
+ # the client has an up-to-date value before proceeding.
244
+ class UndeleteRecognizerRequest
245
+ include ::Google::Protobuf::MessageExts
246
+ extend ::Google::Protobuf::MessageExts::ClassMethods
247
+ end
248
+
249
+ # A Recognizer message. Stores recognition configuration and metadata.
250
+ # @!attribute [r] name
251
+ # @return [::String]
252
+ # Output only. The resource name of the Recognizer.
253
+ # Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`.
254
+ # @!attribute [r] uid
255
+ # @return [::String]
256
+ # Output only. System-assigned unique identifier for the Recognizer.
257
+ # @!attribute [rw] display_name
258
+ # @return [::String]
259
+ # User-settable, human-readable name for the Recognizer. Must be 63
260
+ # characters or less.
261
+ # @!attribute [rw] model
262
+ # @return [::String]
263
+ # Required. Which model to use for recognition requests. Select the model
264
+ # best suited to your domain to get best results.
265
+ #
266
+ # Supported models:
267
+ #
268
+ # - `latest_long`
269
+ #
270
+ # Best for long form content like media or conversation.
271
+ #
272
+ # - `latest_short`
273
+ #
274
+ # Best for short form content like commands or single shot directed speech.
275
+ # When using this model, the service will stop transcribing audio after the
276
+ # first utterance is detected and completed.
277
+ #
278
+ # When using this model,
279
+ # {::Google::Cloud::Speech::V2::RecognitionFeatures::MultiChannelMode::SEPARATE_RECOGNITION_PER_CHANNEL SEPARATE_RECOGNITION_PER_CHANNEL}
280
+ # is not supported; multi-channel audio is accepted, but only the first
281
+ # channel will be processed and transcribed.
282
+ # @!attribute [rw] language_codes
283
+ # @return [::Array<::String>]
284
+ # Required. The language of the supplied audio as a
285
+ # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
286
+ #
287
+ # Supported languages:
288
+ #
289
+ # - `en-US`
290
+ #
291
+ # - `en-GB`
292
+ #
293
+ # - `fr-FR`
294
+ #
295
+ # If additional languages are provided, recognition result will contain
296
+ # recognition in the most likely language detected. The recognition result
297
+ # will include the language tag of the language detected in the audio.
298
+ # When you create or update a Recognizer, these values are
299
+ # stored in normalized BCP-47 form. For example, "en-us" is stored as
300
+ # "en-US".
301
+ # @!attribute [rw] default_recognition_config
302
+ # @return [::Google::Cloud::Speech::V2::RecognitionConfig]
303
+ # Default configuration to use for requests with this Recognizer.
304
+ # This can be overwritten by inline configuration in the
305
+ # {::Google::Cloud::Speech::V2::RecognizeRequest#config RecognizeRequest.config}
306
+ # field.
307
+ # @!attribute [rw] annotations
308
+ # @return [::Google::Protobuf::Map{::String => ::String}]
309
+ # Allows users to store small amounts of arbitrary data.
310
+ # Both the key and the value must be 63 characters or less each.
311
+ # At most 100 annotations.
312
+ # @!attribute [r] state
313
+ # @return [::Google::Cloud::Speech::V2::Recognizer::State]
314
+ # Output only. The Recognizer lifecycle state.
315
+ # @!attribute [r] create_time
316
+ # @return [::Google::Protobuf::Timestamp]
317
+ # Output only. Creation time.
318
+ # @!attribute [r] update_time
319
+ # @return [::Google::Protobuf::Timestamp]
320
+ # Output only. The most recent time this Recognizer was modified.
321
+ # @!attribute [r] delete_time
322
+ # @return [::Google::Protobuf::Timestamp]
323
+ # Output only. The time at which this Recognizer was requested for deletion.
324
+ # @!attribute [r] expire_time
325
+ # @return [::Google::Protobuf::Timestamp]
326
+ # Output only. The time at which this Recognizer will be purged.
327
+ # @!attribute [r] etag
328
+ # @return [::String]
329
+ # Output only. This checksum is computed by the server based on the value of
330
+ # other fields. This may be sent on update, undelete, and delete requests to
331
+ # ensure the client has an up-to-date value before proceeding.
332
+ # @!attribute [r] reconciling
333
+ # @return [::Boolean]
334
+ # Output only. Whether or not this Recognizer is in the process of being
335
+ # updated.
336
+ # @!attribute [r] kms_key_name
337
+ # @return [::String]
338
+ # Output only. The [KMS key
339
+ # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which
340
+ # the Recognizer is encrypted. The expected format is
341
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
342
+ # @!attribute [r] kms_key_version_name
343
+ # @return [::String]
344
+ # Output only. The [KMS key version
345
+ # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions)
346
+ # with which the Recognizer is encrypted. The expected format is
347
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`.
348
+ class Recognizer
349
+ include ::Google::Protobuf::MessageExts
350
+ extend ::Google::Protobuf::MessageExts::ClassMethods
351
+
352
+ # @!attribute [rw] key
353
+ # @return [::String]
354
+ # @!attribute [rw] value
355
+ # @return [::String]
356
+ class AnnotationsEntry
357
+ include ::Google::Protobuf::MessageExts
358
+ extend ::Google::Protobuf::MessageExts::ClassMethods
359
+ end
360
+
361
+ # Set of states that define the lifecycle of a Recognizer.
362
+ module State
363
+ # The default value. This value is used if the state is omitted.
364
+ STATE_UNSPECIFIED = 0
365
+
366
+ # The Recognizer is active and ready for use.
367
+ ACTIVE = 2
368
+
369
+ # This Recognizer has been deleted.
370
+ DELETED = 4
371
+ end
372
+ end
373
+
374
+ # Automatically detected decoding parameters.
375
+ # Supported for the following encodings:
376
+ # * WAV_LINEAR16: 16-bit signed little-endian PCM samples in a WAV container.
377
+ # * WAV_MULAW: 8-bit companded mulaw samples in a WAV container.
378
+ # * WAV_ALAW: 8-bit companded alaw samples in a WAV container.
379
+ # * RFC4867_5_AMR: AMR frames with an rfc4867.5 header.
380
+ # * RFC4867_5_AMRWB: AMR-WB frames with an rfc4867.5 header.
381
+ # * FLAC: FLAC frames in the "native FLAC" container format.
382
+ # * MP3: MPEG audio frames with optional (ignored) ID3 metadata.
383
+ # * OGG_OPUS: Opus audio frames in an Ogg container.
384
+ # * WEBM_OPUS: Opus audio frames in a WebM container.
385
+ class AutoDetectDecodingConfig
386
+ include ::Google::Protobuf::MessageExts
387
+ extend ::Google::Protobuf::MessageExts::ClassMethods
388
+ end
389
+
390
+ # Explicitly specified decoding parameters.
391
+ # @!attribute [rw] encoding
392
+ # @return [::Google::Cloud::Speech::V2::ExplicitDecodingConfig::AudioEncoding]
393
+ # Required. Encoding of the audio data sent for recognition.
394
+ # @!attribute [rw] sample_rate_hertz
395
+ # @return [::Integer]
396
+ # Sample rate in Hertz of the audio data sent for recognition. Valid
397
+ # values are: 8000-48000. 16000 is optimal. For best results, set the
398
+ # sampling rate of the audio source to 16000 Hz. If that's not possible, use
399
+ # the native sample rate of the audio source (instead of re-sampling).
400
+ # Supported for the following encodings:
401
+ # * LINEAR16: Headerless 16-bit signed little-endian PCM samples.
402
+ # * MULAW: Headerless 8-bit companded mulaw samples.
403
+ # * ALAW: Headerless 8-bit companded alaw samples.
404
+ # @!attribute [rw] audio_channel_count
405
+ # @return [::Integer]
406
+ # Number of channels present in the audio data sent for recognition.
407
+ # Supported for the following encodings:
408
+ # * LINEAR16: Headerless 16-bit signed little-endian PCM samples.
409
+ # * MULAW: Headerless 8-bit companded mulaw samples.
410
+ # * ALAW: Headerless 8-bit companded alaw samples.
411
+ class ExplicitDecodingConfig
412
+ include ::Google::Protobuf::MessageExts
413
+ extend ::Google::Protobuf::MessageExts::ClassMethods
414
+
415
+ # Supported audio data encodings.
416
+ module AudioEncoding
417
+ # Default value. This value is unused.
418
+ AUDIO_ENCODING_UNSPECIFIED = 0
419
+
420
+ # Headerless 16-bit signed little-endian PCM samples.
421
+ LINEAR16 = 1
422
+
423
+ # Headerless 8-bit companded mulaw samples.
424
+ MULAW = 2
425
+
426
+ # Headerless 8-bit companded alaw samples.
427
+ ALAW = 3
428
+ end
429
+ end
430
+
431
+ # Configuration to enable speaker diarization.
432
+ # @!attribute [rw] min_speaker_count
433
+ # @return [::Integer]
434
+ # Required. Minimum number of speakers in the conversation. This range gives
435
+ # you more flexibility by allowing the system to automatically determine the
436
+ # correct number of speakers. If not set, the default value is 2.
437
+ #
438
+ # To fix the number of speakers detected in the audio, set
439
+ # `min_speaker_count` = `max_speaker_count`.
440
+ # @!attribute [rw] max_speaker_count
441
+ # @return [::Integer]
442
+ # Required. Maximum number of speakers in the conversation. Valid values are:
443
+ # 1-6. Must be >= `min_speaker_count`. This range gives you more flexibility
444
+ # by allowing the system to automatically determine the correct number of
445
+ # speakers.
446
+ class SpeakerDiarizationConfig
447
+ include ::Google::Protobuf::MessageExts
448
+ extend ::Google::Protobuf::MessageExts::ClassMethods
449
+ end
450
+
451
+ # Available recognition features.
452
+ # @!attribute [rw] profanity_filter
453
+ # @return [::Boolean]
454
+ # If set to `true`, the server will attempt to filter out profanities,
455
+ # replacing all but the initial character in each filtered word with
456
+ # asterisks, for instance, "f***". If set to `false` or omitted, profanities
457
+ # won't be filtered out.
458
+ # @!attribute [rw] enable_word_time_offsets
459
+ # @return [::Boolean]
460
+ # If `true`, the top result includes a list of words and the start and end
461
+ # time offsets (timestamps) for those words. If `false`, no word-level time
462
+ # offset information is returned. The default is `false`.
463
+ # @!attribute [rw] enable_word_confidence
464
+ # @return [::Boolean]
465
+ # If `true`, the top result includes a list of words and the confidence for
466
+ # those words. If `false`, no word-level confidence information is returned.
467
+ # The default is `false`.
468
+ # @!attribute [rw] enable_automatic_punctuation
469
+ # @return [::Boolean]
470
+ # If `true`, adds punctuation to recognition result hypotheses. This feature
471
+ # is only available in select languages. The default `false` value does not
472
+ # add punctuation to result hypotheses.
473
+ # @!attribute [rw] enable_spoken_punctuation
474
+ # @return [::Boolean]
475
+ # The spoken punctuation behavior for the call. If `true`, replaces spoken
476
+ # punctuation with the corresponding symbols in the request. For example,
477
+ # "how are you question mark" becomes "how are you?". See
478
+ # https://cloud.google.com/speech-to-text/docs/spoken-punctuation for
479
+ # support. If `false`, spoken punctuation is not replaced.
480
+ # @!attribute [rw] enable_spoken_emojis
481
+ # @return [::Boolean]
482
+ # The spoken emoji behavior for the call. If `true`, adds spoken emoji
483
+ # formatting for the request. This will replace spoken emojis with the
484
+ # corresponding Unicode symbols in the final transcript. If `false`, spoken
485
+ # emojis are not replaced.
486
+ # @!attribute [rw] multi_channel_mode
487
+ # @return [::Google::Cloud::Speech::V2::RecognitionFeatures::MultiChannelMode]
488
+ # Mode for recognizing multi-channel audio.
489
+ # @!attribute [rw] diarization_config
490
+ # @return [::Google::Cloud::Speech::V2::SpeakerDiarizationConfig]
491
+ # Configuration to enable speaker diarization and set additional
492
+ # parameters to make diarization better suited for your application.
493
+ # When this is enabled, we send all the words from the beginning of the
494
+ # audio for the top alternative in every consecutive STREAMING responses.
495
+ # This is done in order to improve our speaker tags as our models learn to
496
+ # identify the speakers in the conversation over time.
497
+ # For non-streaming requests, the diarization results will be provided only
498
+ # in the top alternative of the FINAL SpeechRecognitionResult.
499
+ # @!attribute [rw] max_alternatives
500
+ # @return [::Integer]
501
+ # Maximum number of recognition hypotheses to be returned.
502
+ # The server may return fewer than `max_alternatives`.
503
+ # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
504
+ # one. If omitted, will return a maximum of one.
505
+ class RecognitionFeatures
506
+ include ::Google::Protobuf::MessageExts
507
+ extend ::Google::Protobuf::MessageExts::ClassMethods
508
+
509
+ # Options for how to recognize multi-channel audio.
510
+ module MultiChannelMode
511
+ # Default value for the multi-channel mode. If the audio contains
512
+ # multiple channels, only the first channel will be transcribed; other
513
+ # channels will be ignored.
514
+ MULTI_CHANNEL_MODE_UNSPECIFIED = 0
515
+
516
+ # If selected, each channel in the provided audio is transcribed
517
+ # independently. This cannot be selected if the selected
518
+ # {::Google::Cloud::Speech::V2::Recognizer#model model} is `latest_short`.
519
+ SEPARATE_RECOGNITION_PER_CHANNEL = 1
520
+ end
521
+ end
522
+
523
+ # Provides "hints" to the speech recognizer to favor specific words and phrases
524
+ # in the results. Phrase sets can be specified as an inline resource, or a
525
+ # reference to an existing phrase set resource.
526
+ # @!attribute [rw] phrase_sets
527
+ # @return [::Array<::Google::Cloud::Speech::V2::SpeechAdaptation::AdaptationPhraseSet>]
528
+ # A list of inline or referenced phrase sets.
529
+ # @!attribute [rw] custom_classes
530
+ # @return [::Array<::Google::Cloud::Speech::V2::CustomClass>]
531
+ # A list of inline custom classes. Existing custom class resources can be
532
+ # referenced directly in a phrase set.
533
+ class SpeechAdaptation
534
+ include ::Google::Protobuf::MessageExts
535
+ extend ::Google::Protobuf::MessageExts::ClassMethods
536
+
537
+ # A biasing phrase set, which can be either a string referencing the name of
538
+ # an existing phrase set resource, or an inline definition of a phrase set.
539
+ # @!attribute [rw] phrase_set
540
+ # @return [::String]
541
+ # The name of an existing phrase set resource. The user must have read
542
+ # access to the resource and it must not be deleted.
543
+ # @!attribute [rw] inline_phrase_set
544
+ # @return [::Google::Cloud::Speech::V2::PhraseSet]
545
+ # An inline defined phrase set.
546
+ class AdaptationPhraseSet
547
+ include ::Google::Protobuf::MessageExts
548
+ extend ::Google::Protobuf::MessageExts::ClassMethods
549
+ end
550
+ end
551
+
552
+ # Provides information to the Recognizer that specifies how to process the
553
+ # recognition request.
554
+ # @!attribute [rw] auto_decoding_config
555
+ # @return [::Google::Cloud::Speech::V2::AutoDetectDecodingConfig]
556
+ # Automatically detect decoding parameters.
557
+ # Preferred for supported formats.
558
+ # @!attribute [rw] explicit_decoding_config
559
+ # @return [::Google::Cloud::Speech::V2::ExplicitDecodingConfig]
560
+ # Explicitly specified decoding parameters.
561
+ # Required if using headerless PCM audio (linear16, mulaw, alaw).
562
+ # @!attribute [rw] features
563
+ # @return [::Google::Cloud::Speech::V2::RecognitionFeatures]
564
+ # Speech recognition features to enable.
565
+ # @!attribute [rw] adaptation
566
+ # @return [::Google::Cloud::Speech::V2::SpeechAdaptation]
567
+ # Speech adaptation context that weights recognizer predictions for specific
568
+ # words and phrases.
569
+ class RecognitionConfig
570
+ include ::Google::Protobuf::MessageExts
571
+ extend ::Google::Protobuf::MessageExts::ClassMethods
572
+ end
573
+
574
+ # Request message for the
575
+ # {::Google::Cloud::Speech::V2::Speech::Client#recognize Recognize} method. Either
576
+ # `content` or `uri` must be supplied. Supplying both or neither returns
577
+ # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See [content
578
+ # limits](https://cloud.google.com/speech-to-text/quotas#content).
579
+ # @!attribute [rw] recognizer
580
+ # @return [::String]
581
+ # Required. The name of the Recognizer to use during recognition. The
582
+ # expected format is
583
+ # `projects/{project}/locations/{location}/recognizers/{recognizer}`.
584
+ # @!attribute [rw] config
585
+ # @return [::Google::Cloud::Speech::V2::RecognitionConfig]
586
+ # Features and audio metadata to use for the Automatic Speech Recognition.
587
+ # This field in combination with the
588
+ # {::Google::Cloud::Speech::V2::RecognizeRequest#config_mask config_mask} field
589
+ # can be used to override parts of the
590
+ # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config}
591
+ # of the Recognizer resource.
592
+ # @!attribute [rw] config_mask
593
+ # @return [::Google::Protobuf::FieldMask]
594
+ # The list of fields in
595
+ # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} that override the
596
+ # values in the
597
+ # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config}
598
+ # of the recognizer during this recognition request. If no mask is provided,
599
+ # all non-default valued fields in
600
+ # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} override the
601
+ # values in the recognizer for this recognition request. If a mask is
602
+ # provided, only the fields listed in the mask override the config in the
603
+ # recognizer for this recognition request. If a wildcard (`*`) is provided,
604
+ # {::Google::Cloud::Speech::V2::RecognizeRequest#config config} completely
605
+ # overrides and replaces the config in the recognizer for this recognition
606
+ # request.
607
+ # @!attribute [rw] content
608
+ # @return [::String]
609
+ # The audio data bytes encoded as specified in
610
+ # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. As
611
+ # with all bytes fields, proto buffers use a pure binary representation,
612
+ # whereas JSON representations use base64.
613
+ # @!attribute [rw] uri
614
+ # @return [::String]
615
+ # URI that points to a file that contains audio data bytes as specified in
616
+ # {::Google::Cloud::Speech::V2::RecognitionConfig RecognitionConfig}. The file
617
+ # must not be compressed (for example, gzip). Currently, only Google Cloud
618
+ # Storage URIs are supported, which must be specified in the following
619
+ # format: `gs://bucket_name/object_name` (other URI formats return
620
+ # [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more
621
+ # information, see [Request
622
+ # URIs](https://cloud.google.com/storage/docs/reference-uris).
623
+ class RecognizeRequest
624
+ include ::Google::Protobuf::MessageExts
625
+ extend ::Google::Protobuf::MessageExts::ClassMethods
626
+ end
627
+
628
+ # Metadata about the recognition request and response.
629
+ # @!attribute [rw] total_billed_duration
630
+ # @return [::Google::Protobuf::Duration]
631
+ # When available, billed audio seconds for the corresponding request.
632
+ class RecognitionResponseMetadata
633
+ include ::Google::Protobuf::MessageExts
634
+ extend ::Google::Protobuf::MessageExts::ClassMethods
635
+ end
636
+
637
+ # Alternative hypotheses (a.k.a. n-best list).
638
+ # @!attribute [rw] transcript
639
+ # @return [::String]
640
+ # Transcript text representing the words that the user spoke.
641
+ # @!attribute [rw] confidence
642
+ # @return [::Float]
643
+ # The confidence estimate between 0.0 and 1.0. A higher number
644
+ # indicates an estimated greater likelihood that the recognized words are
645
+ # correct. This field is set only for the top alternative of a non-streaming
646
+ # result or, of a streaming result where
647
+ # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final} is
648
+ # set to `true`. This field is not guaranteed to be accurate and users should
649
+ # not rely on it to be always provided. The default of 0.0 is a sentinel
650
+ # value indicating `confidence` was not set.
651
+ # @!attribute [rw] words
652
+ # @return [::Array<::Google::Cloud::Speech::V2::WordInfo>]
653
+ # A list of word-specific information for each recognized word.
654
+ # When
655
+ # [enable_speaker_diarization][google.cloud.speech.v2.SpeakerDiarizationConfig.enable_speaker_diarization]
656
+ # is true, you will see all the words from the beginning of the audio.
657
+ class SpeechRecognitionAlternative
658
+ include ::Google::Protobuf::MessageExts
659
+ extend ::Google::Protobuf::MessageExts::ClassMethods
660
+ end
661
+
662
+ # Word-specific information for recognized words.
663
+ # @!attribute [rw] start_offset
664
+ # @return [::Google::Protobuf::Duration]
665
+ # Time offset relative to the beginning of the audio,
666
+ # and corresponding to the start of the spoken word.
667
+ # This field is only set if
668
+ # {::Google::Cloud::Speech::V2::RecognitionFeatures#enable_word_time_offsets enable_word_time_offsets}
669
+ # is `true` and only in the top hypothesis. This is an experimental feature
670
+ # and the accuracy of the time offset can vary.
671
+ # @!attribute [rw] end_offset
672
+ # @return [::Google::Protobuf::Duration]
673
+ # Time offset relative to the beginning of the audio,
674
+ # and corresponding to the end of the spoken word.
675
+ # This field is only set if
676
+ # {::Google::Cloud::Speech::V2::RecognitionFeatures#enable_word_time_offsets enable_word_time_offsets}
677
+ # is `true` and only in the top hypothesis. This is an experimental feature
678
+ # and the accuracy of the time offset can vary.
679
+ # @!attribute [rw] word
680
+ # @return [::String]
681
+ # The word corresponding to this set of information.
682
+ # @!attribute [rw] confidence
683
+ # @return [::Float]
684
+ # The confidence estimate between 0.0 and 1.0. A higher number
685
+ # indicates an estimated greater likelihood that the recognized words are
686
+ # correct. This field is set only for the top alternative of a non-streaming
687
+ # result or, of a streaming result where
688
+ # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final} is
689
+ # set to `true`. This field is not guaranteed to be accurate and users should
690
+ # not rely on it to be always provided. The default of 0.0 is a sentinel
691
+ # value indicating `confidence` was not set.
692
+ # @!attribute [rw] speaker_label
693
+ # @return [::String]
694
+ # A distinct label is assigned for every speaker within the audio. This field
695
+ # specifies which one of those speakers was detected to have spoken this
696
+ # word. `speaker_label` is set if
697
+ # [enable_speaker_diarization][google.cloud.speech.v2.SpeakerDiarizationConfig.enable_speaker_diarization]
698
+ # is `true` and only in the top alternative.
699
+ class WordInfo
700
+ include ::Google::Protobuf::MessageExts
701
+ extend ::Google::Protobuf::MessageExts::ClassMethods
702
+ end
703
+
704
+ # A speech recognition result corresponding to a portion of the audio.
705
+ # @!attribute [rw] alternatives
706
+ # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionAlternative>]
707
+ # May contain one or more recognition hypotheses. These alternatives are
708
+ # ordered in terms of accuracy, with the top (first) alternative being the
709
+ # most probable, as ranked by the recognizer.
710
+ # @!attribute [rw] channel_tag
711
+ # @return [::Integer]
712
+ # For multi-channel audio, this is the channel number corresponding to the
713
+ # recognized result for the audio from that channel.
714
+ # For `audio_channel_count` = `N`, its output values can range from `1` to
715
+ # `N`.
716
+ # @!attribute [rw] result_end_offset
717
+ # @return [::Google::Protobuf::Duration]
718
+ # Time offset of the end of this result relative to the beginning of the
719
+ # audio.
720
+ # @!attribute [r] language_code
721
+ # @return [::String]
722
+ # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
723
+ # language tag of the language in this result. This language code was
724
+ # detected to have the most likelihood of being spoken in the audio.
725
+ class SpeechRecognitionResult
726
+ include ::Google::Protobuf::MessageExts
727
+ extend ::Google::Protobuf::MessageExts::ClassMethods
728
+ end
729
+
730
+ # Response message for the
731
+ # {::Google::Cloud::Speech::V2::Speech::Client#recognize Recognize} method.
732
+ # @!attribute [rw] results
733
+ # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionResult>]
734
+ # Sequential list of transcription results corresponding to sequential
735
+ # portions of audio.
736
+ # @!attribute [rw] metadata
737
+ # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata]
738
+ # Metadata about the recognition.
739
+ class RecognizeResponse
740
+ include ::Google::Protobuf::MessageExts
741
+ extend ::Google::Protobuf::MessageExts::ClassMethods
742
+ end
743
+
744
+ # Available recognition features specific to streaming recognition requests.
745
+ # @!attribute [rw] enable_voice_activity_events
746
+ # @return [::Boolean]
747
+ # If `true`, responses with voice activity speech events will be returned as
748
+ # they are detected.
749
+ # @!attribute [rw] interim_results
750
+ # @return [::Boolean]
751
+ # Whether or not to stream interim results to the client. If set to true,
752
+ # interim results will be streamed to the client. Otherwise, only the final
753
+ # response will be streamed back.
754
+ # @!attribute [rw] voice_activity_timeout
755
+ # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures::VoiceActivityTimeout]
756
+ # If set, the server will automatically close the stream after the specified
757
+ # duration has elapsed after the last VOICE_ACTIVITY speech event has been
758
+ # sent. The field `voice_activity_events` must also be set to true.
759
+ class StreamingRecognitionFeatures
760
+ include ::Google::Protobuf::MessageExts
761
+ extend ::Google::Protobuf::MessageExts::ClassMethods
762
+
763
+ # Events that a timeout can be set on for voice activity.
764
+ # @!attribute [rw] speech_start_timeout
765
+ # @return [::Google::Protobuf::Duration]
766
+ # Duration to timeout the stream if no speech begins. If this is set and
767
+ # no speech is detected in this duration at the start of the stream, the
768
+ # server will close the stream.
769
+ # @!attribute [rw] speech_end_timeout
770
+ # @return [::Google::Protobuf::Duration]
771
+ # Duration to timeout the stream after speech ends. If this is set and no
772
+ # speech is detected in this duration after speech was detected, the server
773
+ # will close the stream.
774
+ class VoiceActivityTimeout
775
+ include ::Google::Protobuf::MessageExts
776
+ extend ::Google::Protobuf::MessageExts::ClassMethods
777
+ end
778
+ end
779
+
780
+ # Provides configuration information for the StreamingRecognize request.
781
+ # @!attribute [rw] config
782
+ # @return [::Google::Cloud::Speech::V2::RecognitionConfig]
783
+ # Required. Features and audio metadata to use for the Automatic Speech
784
+ # Recognition. This field in combination with the
785
+ # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config_mask config_mask}
786
+ # field can be used to override parts of the
787
+ # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config}
788
+ # of the Recognizer resource.
789
+ # @!attribute [rw] config_mask
790
+ # @return [::Google::Protobuf::FieldMask]
791
+ # The list of fields in
792
+ # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} that
793
+ # override the values in the
794
+ # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config}
795
+ # of the recognizer during this recognition request. If no mask is provided,
796
+ # all non-default valued fields in
797
+ # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} override
798
+ # the values in the recognizer for this recognition request. If a mask is
799
+ # provided, only the fields listed in the mask override the config in the
800
+ # recognizer for this recognition request. If a wildcard (`*`) is provided,
801
+ # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config}
802
+ # completely overrides and replaces the config in the recognizer for this
803
+ # recognition request.
804
+ # @!attribute [rw] streaming_features
805
+ # @return [::Google::Cloud::Speech::V2::StreamingRecognitionFeatures]
806
+ # Speech recognition features to enable specific to streaming audio
807
+ # recognition requests.
808
+ class StreamingRecognitionConfig
809
+ include ::Google::Protobuf::MessageExts
810
+ extend ::Google::Protobuf::MessageExts::ClassMethods
811
+ end
812
+
813
+ # Request message for the
814
+ # {::Google::Cloud::Speech::V2::Speech::Client#streaming_recognize StreamingRecognize}
815
+ # method. Multiple
816
+ # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest StreamingRecognizeRequest}
817
+ # messages are sent. The first message must contain a
818
+ # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#recognizer recognizer} and
819
+ # optionally a
820
+ # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#streaming_config streaming_config}
821
+ # message and must not contain
822
+ # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio}. All
823
+ # subsequent messages must contain
824
+ # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#audio audio} and must not
825
+ # contain a
826
+ # {::Google::Cloud::Speech::V2::StreamingRecognizeRequest#streaming_config streaming_config}
827
+ # message.
828
+ # @!attribute [rw] recognizer
829
+ # @return [::String]
830
+ # Required. Streaming recognition should start with an initial request having
831
+ # a `recognizer`. Subsequent requests carry the audio data to be recognized.
832
+ #
833
+ # The initial request with configuration can be omitted if the Recognizer
834
+ # being used has a
835
+ # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config}.
836
+ # @!attribute [rw] streaming_config
837
+ # @return [::Google::Cloud::Speech::V2::StreamingRecognitionConfig]
838
+ # StreamingRecognitionConfig to be used in this recognition attempt.
839
+ # If provided, it will override the default RecognitionConfig stored in the
840
+ # Recognizer.
841
+ # @!attribute [rw] audio
842
+ # @return [::String]
843
+ # Inline audio bytes to be Recognized.
844
+ class StreamingRecognizeRequest
845
+ include ::Google::Protobuf::MessageExts
846
+ extend ::Google::Protobuf::MessageExts::ClassMethods
847
+ end
848
+
849
+ # Request message for the
850
+ # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize}
851
+ # method.
852
+ # @!attribute [rw] recognizer
853
+ # @return [::String]
854
+ # Required. Resource name of the recognizer to be used for ASR.
855
+ # @!attribute [rw] config
856
+ # @return [::Google::Cloud::Speech::V2::RecognitionConfig]
857
+ # Features and audio metadata to use for the Automatic Speech Recognition.
858
+ # This field in combination with the
859
+ # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config_mask config_mask}
860
+ # field can be used to override parts of the
861
+ # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config}
862
+ # of the Recognizer resource.
863
+ # @!attribute [rw] config_mask
864
+ # @return [::Google::Protobuf::FieldMask]
865
+ # The list of fields in
866
+ # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} that override
867
+ # the values in the
868
+ # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config}
869
+ # of the recognizer during this recognition request. If no mask is provided,
870
+ # all given fields in
871
+ # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} override the
872
+ # values in the recognizer for this recognition request. If a mask is
873
+ # provided, only the fields listed in the mask override the config in the
874
+ # recognizer for this recognition request. If a wildcard (`*`) is provided,
875
+ # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} completely
876
+ # overrides and replaces the config in the recognizer for this recognition
877
+ # request.
878
+ # @!attribute [rw] files
879
+ # @return [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata>]
880
+ # Audio files with file metadata for ASR.
881
+ class BatchRecognizeRequest
882
+ include ::Google::Protobuf::MessageExts
883
+ extend ::Google::Protobuf::MessageExts::ClassMethods
884
+ end
885
+
886
+ # Response message for
887
+ # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} that is
888
+ # packaged into a longrunning {::Google::Longrunning::Operation Operation}.
889
+ # @!attribute [rw] results
890
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::BatchRecognizeFileResult}]
891
+ # Map from filename to the final result for that file.
892
+ class BatchRecognizeResponse
893
+ include ::Google::Protobuf::MessageExts
894
+ extend ::Google::Protobuf::MessageExts::ClassMethods
895
+
896
+ # @!attribute [rw] key
897
+ # @return [::String]
898
+ # @!attribute [rw] value
899
+ # @return [::Google::Cloud::Speech::V2::BatchRecognizeFileResult]
900
+ class ResultsEntry
901
+ include ::Google::Protobuf::MessageExts
902
+ extend ::Google::Protobuf::MessageExts::ClassMethods
903
+ end
904
+ end
905
+
906
+ # Final results for a single file.
907
+ # @!attribute [rw] uri
908
+ # @return [::String]
909
+ # The GCS URI to which recognition results were written.
910
+ # @!attribute [rw] error
911
+ # @return [::Google::Rpc::Status]
912
+ # Error if one was encountered.
913
+ class BatchRecognizeFileResult
914
+ include ::Google::Protobuf::MessageExts
915
+ extend ::Google::Protobuf::MessageExts::ClassMethods
916
+ end
917
+
918
+ # Metadata about transcription for a single file (for example, progress
919
+ # percent).
920
+ # @!attribute [rw] progress_percent
921
+ # @return [::Integer]
922
+ # How much of the file has been transcribed so far.
923
+ # @!attribute [rw] error
924
+ # @return [::Google::Rpc::Status]
925
+ # Error if one was encountered.
926
+ # @!attribute [rw] uri
927
+ # @return [::String]
928
+ # The GCS URI to which recognition results will be written.
929
+ class BatchRecognizeTranscriptionMetadata
930
+ include ::Google::Protobuf::MessageExts
931
+ extend ::Google::Protobuf::MessageExts::ClassMethods
932
+ end
933
+
934
+ # Operation metadata for
935
+ # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize}.
936
+ # @!attribute [rw] transcription_metadata
937
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::BatchRecognizeTranscriptionMetadata}]
938
+ # Map from provided filename to the transcription metadata for that file.
939
+ class BatchRecognizeMetadata
940
+ include ::Google::Protobuf::MessageExts
941
+ extend ::Google::Protobuf::MessageExts::ClassMethods
942
+
943
+ # @!attribute [rw] key
944
+ # @return [::String]
945
+ # @!attribute [rw] value
946
+ # @return [::Google::Cloud::Speech::V2::BatchRecognizeTranscriptionMetadata]
947
+ class TranscriptionMetadataEntry
948
+ include ::Google::Protobuf::MessageExts
949
+ extend ::Google::Protobuf::MessageExts::ClassMethods
950
+ end
951
+ end
952
+
953
+ # Metadata about a single file in a batch for BatchRecognize.
954
+ # @!attribute [rw] uri
955
+ # @return [::String]
956
+ # Cloud Storage URI for the audio file.
957
+ # @!attribute [rw] config
958
+ # @return [::Google::Cloud::Speech::V2::RecognitionConfig]
959
+ # Features and audio metadata to use for the Automatic Speech Recognition.
960
+ # This field in combination with the
961
+ # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config_mask config_mask}
962
+ # field can be used to override parts of the
963
+ # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config}
964
+ # of the Recognizer resource as well as the
965
+ # {::Google::Cloud::Speech::V2::BatchRecognizeRequest#config config} at the
966
+ # request level.
967
+ # @!attribute [rw] config_mask
968
+ # @return [::Google::Protobuf::FieldMask]
969
+ # The list of fields in
970
+ # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} that
971
+ # override the values in the
972
+ # {::Google::Cloud::Speech::V2::Recognizer#default_recognition_config default_recognition_config}
973
+ # of the recognizer during this recognition request. If no mask is provided,
974
+ # all non-default valued fields in
975
+ # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config} override
976
+ # the values in the recognizer for this recognition request. If a mask is
977
+ # provided, only the fields listed in the mask override the config in the
978
+ # recognizer for this recognition request. If a wildcard (`*`) is provided,
979
+ # {::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata#config config}
980
+ # completely overrides and replaces the config in the recognizer for this
981
+ # recognition request.
982
+ class BatchRecognizeFileMetadata
983
+ include ::Google::Protobuf::MessageExts
984
+ extend ::Google::Protobuf::MessageExts::ClassMethods
985
+ end
986
+
987
+ # A streaming speech recognition result corresponding to a portion of the audio
988
+ # that is currently being processed.
989
+ # @!attribute [rw] alternatives
990
+ # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionAlternative>]
991
+ # May contain one or more recognition hypotheses. These alternatives are
992
+ # ordered in terms of accuracy, with the top (first) alternative being the
993
+ # most probable, as ranked by the recognizer.
994
+ # @!attribute [rw] is_final
995
+ # @return [::Boolean]
996
+ # If `false`, this
997
+ # {::Google::Cloud::Speech::V2::StreamingRecognitionResult StreamingRecognitionResult}
998
+ # represents an interim result that may change. If `true`, this is the final
999
+ # time the speech service will return this particular
1000
+ # {::Google::Cloud::Speech::V2::StreamingRecognitionResult StreamingRecognitionResult},
1001
+ # the recognizer will not return any further hypotheses for this portion of
1002
+ # the transcript and corresponding audio.
1003
+ # @!attribute [rw] stability
1004
+ # @return [::Float]
1005
+ # An estimate of the likelihood that the recognizer will not change its guess
1006
+ # about this interim result. Values range from 0.0 (completely unstable)
1007
+ # to 1.0 (completely stable). This field is only provided for interim results
1008
+ # ({::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`false`).
1009
+ # The default of 0.0 is a sentinel value indicating `stability` was not set.
1010
+ # @!attribute [rw] result_end_offset
1011
+ # @return [::Google::Protobuf::Duration]
1012
+ # Time offset of the end of this result relative to the beginning of the
1013
+ # audio.
1014
+ # @!attribute [rw] channel_tag
1015
+ # @return [::Integer]
1016
+ # For multi-channel audio, this is the channel number corresponding to the
1017
+ # recognized result for the audio from that channel.
1018
+ # For
1019
+ # `audio_channel_count` = `N`, its output values can range from `1` to `N`.
1020
+ # @!attribute [r] language_code
1021
+ # @return [::String]
1022
+ # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
1023
+ # language tag of the language in this result. This language code was
1024
+ # detected to have the most likelihood of being spoken in the audio.
1025
+ class StreamingRecognitionResult
1026
+ include ::Google::Protobuf::MessageExts
1027
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1028
+ end
1029
+
1030
+ # `StreamingRecognizeResponse` is the only message returned to the client by
1031
+ # `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
1032
+ # messages are streamed back to the client. If there is no recognizable
1033
+ # audio then no messages are streamed back to the client.
1034
+ #
1035
+ # Here are some examples of `StreamingRecognizeResponse`s that might
1036
+ # be returned while processing audio:
1037
+ #
1038
+ # 1. results { alternatives { transcript: "tube" } stability: 0.01 }
1039
+ #
1040
+ # 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
1041
+ #
1042
+ # 3. results { alternatives { transcript: "to be" } stability: 0.9 }
1043
+ # results { alternatives { transcript: " or not to be" } stability: 0.01 }
1044
+ #
1045
+ # 4. results { alternatives { transcript: "to be or not to be"
1046
+ # confidence: 0.92 }
1047
+ # alternatives { transcript: "to bee or not to bee" }
1048
+ # is_final: true }
1049
+ #
1050
+ # 5. results { alternatives { transcript: " that's" } stability: 0.01 }
1051
+ #
1052
+ # 6. results { alternatives { transcript: " that is" } stability: 0.9 }
1053
+ # results { alternatives { transcript: " the question" } stability: 0.01 }
1054
+ #
1055
+ # 7. results { alternatives { transcript: " that is the question"
1056
+ # confidence: 0.98 }
1057
+ # alternatives { transcript: " that was the question" }
1058
+ # is_final: true }
1059
+ #
1060
+ # Notes:
1061
+ #
1062
+ # - Only two of the above responses #4 and #7 contain final results; they are
1063
+ # indicated by `is_final: true`. Concatenating these together generates the
1064
+ # full transcript: "to be or not to be that is the question".
1065
+ #
1066
+ # - The others contain interim `results`. #3 and #6 contain two interim
1067
+ # `results`: the first portion has a high stability and is less likely to
1068
+ # change; the second portion has a low stability and is very likely to
1069
+ # change. A UI designer might choose to show only high stability `results`.
1070
+ #
1071
+ # - The specific `stability` and `confidence` values shown above are only for
1072
+ # illustrative purposes. Actual values may vary.
1073
+ #
1074
+ # - In each response, only one of these fields will be set:
1075
+ # `error`,
1076
+ # `speech_event_type`, or
1077
+ # one or more (repeated) `results`.
1078
+ # @!attribute [rw] results
1079
+ # @return [::Array<::Google::Cloud::Speech::V2::StreamingRecognitionResult>]
1080
+ # This repeated list contains zero or more results that
1081
+ # correspond to consecutive portions of the audio currently being processed.
1082
+ # It contains zero or one
1083
+ # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`true`
1084
+ # result (the newly settled portion), followed by zero or more
1085
+ # {::Google::Cloud::Speech::V2::StreamingRecognitionResult#is_final is_final}=`false`
1086
+ # results (the interim results).
1087
+ # @!attribute [rw] speech_event_type
1088
+ # @return [::Google::Cloud::Speech::V2::StreamingRecognizeResponse::SpeechEventType]
1089
+ # Indicates the type of speech event.
1090
+ # @!attribute [rw] speech_event_offset
1091
+ # @return [::Google::Protobuf::Duration]
1092
+ # Time offset between the beginning of the audio and event emission.
1093
+ # @!attribute [rw] metadata
1094
+ # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata]
1095
+ # Metadata about the recognition.
1096
+ class StreamingRecognizeResponse
1097
+ include ::Google::Protobuf::MessageExts
1098
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1099
+
1100
+ # Indicates the type of speech event.
1101
+ module SpeechEventType
1102
+ # No speech event specified.
1103
+ SPEECH_EVENT_TYPE_UNSPECIFIED = 0
1104
+
1105
+ # This event indicates that the server has detected the end of the user's
1106
+ # speech utterance and expects no additional speech. Therefore, the server
1107
+ # will not process additional audio and will close the gRPC bidirectional
1108
+ # stream. This event is only sent if there was a force cutoff due to
1109
+ # silence being detected early. This event is only available through the
1110
+ # `latest_short` {::Google::Cloud::Speech::V2::Recognizer#model model}.
1111
+ END_OF_SINGLE_UTTERANCE = 1
1112
+
1113
+ # This event indicates that the server has detected the beginning of human
1114
+ # voice activity in the stream. This event can be returned multiple times
1115
+ # if speech starts and stops repeatedly throughout the stream. This event
1116
+ # is only sent if `voice_activity_events` is set to true.
1117
+ SPEECH_ACTIVITY_BEGIN = 2
1118
+
1119
+ # This event indicates that the server has detected the end of human voice
1120
+ # activity in the stream. This event can be returned multiple times if
1121
+ # speech starts and stops repeatedly throughout the stream. This event is
1122
+ # only sent if `voice_activity_events` is set to true.
1123
+ SPEECH_ACTIVITY_END = 3
1124
+ end
1125
+ end
1126
+
1127
+ # Message representing the config for the Speech-to-Text API. This includes an
1128
+ # optional [KMS key](https://cloud.google.com/kms/docs/resource-hierarchy#keys)
1129
+ # with which incoming data will be encrypted.
1130
+ # @!attribute [r] name
1131
+ # @return [::String]
1132
+ # Output only. The name of the config resource. There is exactly one config
1133
+ # resource per project per location. The expected format is
1134
+ # `projects/{project}/locations/{location}/config`.
1135
+ # @!attribute [rw] kms_key_name
1136
+ # @return [::String]
1137
+ # Optional. An optional [KMS key
1138
+ # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) that if
1139
+ # present, will be used to encrypt Speech-to-Text resources at-rest. Updating
1140
+ # this key will not encrypt existing resources using this key; only new
1141
+ # resources will be encrypted using this key. The expected format is
1142
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
1143
+ # @!attribute [r] update_time
1144
+ # @return [::Google::Protobuf::Timestamp]
1145
+ # Output only. The most recent time this resource was modified.
1146
+ class Config
1147
+ include ::Google::Protobuf::MessageExts
1148
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1149
+ end
1150
+
1151
+ # Request message for the
1152
+ # {::Google::Cloud::Speech::V2::Speech::Client#get_config GetConfig} method.
1153
+ # @!attribute [rw] name
1154
+ # @return [::String]
1155
+ # Required. The name of the config to retrieve. There is exactly one config
1156
+ # resource per project per location. The expected format is
1157
+ # `projects/{project}/locations/{location}/config`.
1158
+ class GetConfigRequest
1159
+ include ::Google::Protobuf::MessageExts
1160
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1161
+ end
1162
+
1163
+ # Request message for the
1164
+ # {::Google::Cloud::Speech::V2::Speech::Client#update_config UpdateConfig} method.
1165
+ # @!attribute [rw] config
1166
+ # @return [::Google::Cloud::Speech::V2::Config]
1167
+ # Required. The config to update.
1168
+ #
1169
+ # The config's `name` field is used to identify the config to be updated.
1170
+ # The expected format is `projects/{project}/locations/{location}/config`.
1171
+ # @!attribute [rw] update_mask
1172
+ # @return [::Google::Protobuf::FieldMask]
1173
+ # The list of fields to be updated.
1174
+ class UpdateConfigRequest
1175
+ include ::Google::Protobuf::MessageExts
1176
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1177
+ end
1178
+
1179
+ # CustomClass for biasing in speech recognition. Used to define a set of words
1180
+ # or phrases that represents a common concept or theme likely to appear in your
1181
+ # audio, for example a list of passenger ship names.
1182
+ # @!attribute [r] name
1183
+ # @return [::String]
1184
+ # Output only. The resource name of the CustomClass.
1185
+ # Format:
1186
+ # `projects/{project}/locations/{location}/customClasses/{custom_class}`.
1187
+ # @!attribute [r] uid
1188
+ # @return [::String]
1189
+ # Output only. System-assigned unique identifier for the CustomClass.
1190
+ # @!attribute [rw] display_name
1191
+ # @return [::String]
1192
+ # User-settable, human-readable name for the CustomClass. Must be 63
1193
+ # characters or less.
1194
+ # @!attribute [rw] items
1195
+ # @return [::Array<::Google::Cloud::Speech::V2::CustomClass::ClassItem>]
1196
+ # A collection of class items.
1197
+ # @!attribute [r] state
1198
+ # @return [::Google::Cloud::Speech::V2::CustomClass::State]
1199
+ # Output only. The CustomClass lifecycle state.
1200
+ # @!attribute [r] create_time
1201
+ # @return [::Google::Protobuf::Timestamp]
1202
+ # Output only. Creation time.
1203
+ # @!attribute [r] update_time
1204
+ # @return [::Google::Protobuf::Timestamp]
1205
+ # Output only. The most recent time this resource was modified.
1206
+ # @!attribute [r] delete_time
1207
+ # @return [::Google::Protobuf::Timestamp]
1208
+ # Output only. The time at which this resource was requested for deletion.
1209
+ # @!attribute [r] expire_time
1210
+ # @return [::Google::Protobuf::Timestamp]
1211
+ # Output only. The time at which this resource will be purged.
1212
+ # @!attribute [rw] annotations
1213
+ # @return [::Google::Protobuf::Map{::String => ::String}]
1214
+ # Allows users to store small amounts of arbitrary data.
1215
+ # Both the key and the value must be 63 characters or less each.
1216
+ # At most 100 annotations.
1217
+ # @!attribute [r] etag
1218
+ # @return [::String]
1219
+ # Output only. This checksum is computed by the server based on the value of
1220
+ # other fields. This may be sent on update, undelete, and delete requests to
1221
+ # ensure the client has an up-to-date value before proceeding.
1222
+ # @!attribute [r] reconciling
1223
+ # @return [::Boolean]
1224
+ # Output only. Whether or not this CustomClass is in the process of being
1225
+ # updated.
1226
+ # @!attribute [r] kms_key_name
1227
+ # @return [::String]
1228
+ # Output only. The [KMS key
1229
+ # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which
1230
+ # the CustomClass is encrypted. The expected format is
1231
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
1232
+ # @!attribute [r] kms_key_version_name
1233
+ # @return [::String]
1234
+ # Output only. The [KMS key version
1235
+ # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions)
1236
+ # with which the CustomClass is encrypted. The expected format is
1237
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`.
1238
+ class CustomClass
1239
+ include ::Google::Protobuf::MessageExts
1240
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1241
+
1242
+ # An item of the class.
1243
+ # @!attribute [rw] value
1244
+ # @return [::String]
1245
+ # The class item's value.
1246
+ class ClassItem
1247
+ include ::Google::Protobuf::MessageExts
1248
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1249
+ end
1250
+
1251
+ # @!attribute [rw] key
1252
+ # @return [::String]
1253
+ # @!attribute [rw] value
1254
+ # @return [::String]
1255
+ class AnnotationsEntry
1256
+ include ::Google::Protobuf::MessageExts
1257
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1258
+ end
1259
+
1260
+ # Set of states that define the lifecycle of a CustomClass.
1261
+ module State
1262
+ # Unspecified state. This is only used/useful for distinguishing
1263
+ # unset values.
1264
+ STATE_UNSPECIFIED = 0
1265
+
1266
+ # The normal and active state.
1267
+ ACTIVE = 2
1268
+
1269
+ # This CustomClass has been deleted.
1270
+ DELETED = 4
1271
+ end
1272
+ end
1273
+
1274
+ # PhraseSet for biasing in speech recognition. A PhraseSet is used to provide
1275
+ # "hints" to the speech recognizer to favor specific words and phrases in the
1276
+ # results.
1277
+ # @!attribute [r] name
1278
+ # @return [::String]
1279
+ # Output only. The resource name of the PhraseSet.
1280
+ # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`.
1281
+ # @!attribute [r] uid
1282
+ # @return [::String]
1283
+ # Output only. System-assigned unique identifier for the PhraseSet.
1284
+ # @!attribute [rw] phrases
1285
+ # @return [::Array<::Google::Cloud::Speech::V2::PhraseSet::Phrase>]
1286
+ # A list of word and phrases.
1287
+ # @!attribute [rw] boost
1288
+ # @return [::Float]
1289
+ # Hint Boost. Positive value will increase the probability that a specific
1290
+ # phrase will be recognized over other similar sounding phrases. The higher
1291
+ # the boost, the higher the chance of false positive recognition as well.
1292
+ # Valid `boost` values are between 0 (exclusive) and 20. We recommend using a
1293
+ # binary search approach to finding the optimal value for your use case.
1294
+ # @!attribute [rw] display_name
1295
+ # @return [::String]
1296
+ # User-settable, human-readable name for the PhraseSet. Must be 63
1297
+ # characters or less.
1298
+ # @!attribute [r] state
1299
+ # @return [::Google::Cloud::Speech::V2::PhraseSet::State]
1300
+ # Output only. The PhraseSet lifecycle state.
1301
+ # @!attribute [r] create_time
1302
+ # @return [::Google::Protobuf::Timestamp]
1303
+ # Output only. Creation time.
1304
+ # @!attribute [r] update_time
1305
+ # @return [::Google::Protobuf::Timestamp]
1306
+ # Output only. The most recent time this resource was modified.
1307
+ # @!attribute [r] delete_time
1308
+ # @return [::Google::Protobuf::Timestamp]
1309
+ # Output only. The time at which this resource was requested for deletion.
1310
+ # @!attribute [r] expire_time
1311
+ # @return [::Google::Protobuf::Timestamp]
1312
+ # Output only. The time at which this resource will be purged.
1313
+ # @!attribute [rw] annotations
1314
+ # @return [::Google::Protobuf::Map{::String => ::String}]
1315
+ # Allows users to store small amounts of arbitrary data.
1316
+ # Both the key and the value must be 63 characters or less each.
1317
+ # At most 100 annotations.
1318
+ # @!attribute [r] etag
1319
+ # @return [::String]
1320
+ # Output only. This checksum is computed by the server based on the value of
1321
+ # other fields. This may be sent on update, undelete, and delete requests to
1322
+ # ensure the client has an up-to-date value before proceeding.
1323
+ # @!attribute [r] reconciling
1324
+ # @return [::Boolean]
1325
+ # Output only. Whether or not this PhraseSet is in the process of being
1326
+ # updated.
1327
+ # @!attribute [r] kms_key_name
1328
+ # @return [::String]
1329
+ # Output only. The [KMS key
1330
+ # name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which
1331
+ # the PhraseSet is encrypted. The expected format is
1332
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
1333
+ # @!attribute [r] kms_key_version_name
1334
+ # @return [::String]
1335
+ # Output only. The [KMS key version
1336
+ # name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions)
1337
+ # with which the PhraseSet is encrypted. The expected format is
1338
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`.
1339
+ class PhraseSet
1340
+ include ::Google::Protobuf::MessageExts
1341
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1342
+
1343
+ # A Phrase contains words and phrase "hints" so that the speech recognition
1344
+ # is more likely to recognize them. This can be used to improve the accuracy
1345
+ # for specific words and phrases, for example, if specific commands are
1346
+ # typically spoken by the user. This can also be used to add additional words
1347
+ # to the vocabulary of the recognizer.
1348
+ #
1349
+ # List items can also include CustomClass references containing groups of
1350
+ # words that represent common concepts that occur in natural language.
1351
+ # @!attribute [rw] value
1352
+ # @return [::String]
1353
+ # The phrase itself.
1354
+ # @!attribute [rw] boost
1355
+ # @return [::Float]
1356
+ # Hint Boost. Overrides the boost set at the phrase set level.
1357
+ # Positive value will increase the probability that a specific phrase will
1358
+ # be recognized over other similar sounding phrases. The higher the boost,
1359
+ # the higher the chance of false positive recognition as well. Negative
1360
+ # boost values would correspond to anti-biasing. Anti-biasing is not
1361
+ # enabled, so negative boost will simply be ignored. Though `boost` can
1362
+ # accept a wide range of positive values, most use cases are best served
1363
+ # with values between 0 and 20. We recommend using a binary search approach
1364
+ # to finding the optimal value for your use case. Speech recognition
1365
+ # will skip PhraseSets with a boost value of 0.
1366
+ class Phrase
1367
+ include ::Google::Protobuf::MessageExts
1368
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1369
+ end
1370
+
1371
+ # @!attribute [rw] key
1372
+ # @return [::String]
1373
+ # @!attribute [rw] value
1374
+ # @return [::String]
1375
+ class AnnotationsEntry
1376
+ include ::Google::Protobuf::MessageExts
1377
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1378
+ end
1379
+
1380
+ # Set of states that define the lifecycle of a PhraseSet.
1381
+ module State
1382
+ # Unspecified state. This is only used/useful for distinguishing
1383
+ # unset values.
1384
+ STATE_UNSPECIFIED = 0
1385
+
1386
+ # The normal and active state.
1387
+ ACTIVE = 2
1388
+
1389
+ # This PhraseSet has been deleted.
1390
+ DELETED = 4
1391
+ end
1392
+ end
1393
+
1394
+ # Request message for the
1395
+ # {::Google::Cloud::Speech::V2::Speech::Client#create_custom_class CreateCustomClass} method.
1396
+ # @!attribute [rw] custom_class
1397
+ # @return [::Google::Cloud::Speech::V2::CustomClass]
1398
+ # Required. The CustomClass to create.
1399
+ # @!attribute [rw] validate_only
1400
+ # @return [::Boolean]
1401
+ # If set, validate the request and preview the CustomClass, but do not
1402
+ # actually create it.
1403
+ # @!attribute [rw] custom_class_id
1404
+ # @return [::String]
1405
+ # The ID to use for the CustomClass, which will become the final component of
1406
+ # the CustomClass's resource name.
1407
+ #
1408
+ # This value should be 4-63 characters, and valid characters
1409
+ # are /[a-z][0-9]-/.
1410
+ # @!attribute [rw] parent
1411
+ # @return [::String]
1412
+ # Required. The project and location where this CustomClass will be created.
1413
+ # The expected format is `projects/{project}/locations/{location}`.
1414
+ class CreateCustomClassRequest
1415
+ include ::Google::Protobuf::MessageExts
1416
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1417
+ end
1418
+
1419
+ # Request message for the
1420
+ # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} method.
1421
+ # @!attribute [rw] parent
1422
+ # @return [::String]
1423
+ # Required. The project and location of CustomClass resources to list. The
1424
+ # expected format is `projects/{project}/locations/{location}`.
1425
+ # @!attribute [rw] page_size
1426
+ # @return [::Integer]
1427
+ # Number of results per requests. A valid page_size ranges from 0 to 20
1428
+ # inclusive. If the page_size is zero or unspecified, a page size of 5 will
1429
+ # be chosen. If the page size exceeds 20, it will be coerced down to 20. Note
1430
+ # that a call might return fewer results than the requested page size.
1431
+ # @!attribute [rw] page_token
1432
+ # @return [::String]
1433
+ # A page token, received from a previous
1434
+ # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} call.
1435
+ # Provide this to retrieve the subsequent page.
1436
+ #
1437
+ # When paginating, all other parameters provided to
1438
+ # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} must
1439
+ # match the call that provided the page token.
1440
+ # @!attribute [rw] show_deleted
1441
+ # @return [::Boolean]
1442
+ # Whether, or not, to show resources that have been deleted.
1443
+ class ListCustomClassesRequest
1444
+ include ::Google::Protobuf::MessageExts
1445
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1446
+ end
1447
+
1448
+ # Response message for the
1449
+ # {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} method.
1450
+ # @!attribute [rw] custom_classes
1451
+ # @return [::Array<::Google::Cloud::Speech::V2::CustomClass>]
1452
+ # The list of requested CustomClasses.
1453
+ # @!attribute [rw] next_page_token
1454
+ # @return [::String]
1455
+ # A token, which can be sent as
1456
+ # {::Google::Cloud::Speech::V2::ListCustomClassesRequest#page_token page_token} to
1457
+ # retrieve the next page. If this field is omitted, there are no subsequent
1458
+ # pages. This token expires after 72 hours.
1459
+ class ListCustomClassesResponse
1460
+ include ::Google::Protobuf::MessageExts
1461
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1462
+ end
1463
+
1464
+ # Request message for the
1465
+ # {::Google::Cloud::Speech::V2::Speech::Client#get_custom_class GetCustomClass} method.
1466
+ # @!attribute [rw] name
1467
+ # @return [::String]
1468
+ # Required. The name of the CustomClass to retrieve. The expected format is
1469
+ # `projects/{project}/locations/{location}/customClasses/{custom_class}`.
1470
+ class GetCustomClassRequest
1471
+ include ::Google::Protobuf::MessageExts
1472
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1473
+ end
1474
+
1475
+ # Request message for the
1476
+ # {::Google::Cloud::Speech::V2::Speech::Client#update_custom_class UpdateCustomClass} method.
1477
+ # @!attribute [rw] custom_class
1478
+ # @return [::Google::Cloud::Speech::V2::CustomClass]
1479
+ # Required. The CustomClass to update.
1480
+ #
1481
+ # The CustomClass's `name` field is used to identify the CustomClass to
1482
+ # update. Format:
1483
+ # `projects/{project}/locations/{location}/customClasses/{custom_class}`.
1484
+ # @!attribute [rw] update_mask
1485
+ # @return [::Google::Protobuf::FieldMask]
1486
+ # The list of fields to be updated. If empty, all fields are considered for
1487
+ # update.
1488
+ # @!attribute [rw] validate_only
1489
+ # @return [::Boolean]
1490
+ # If set, validate the request and preview the updated CustomClass, but do
1491
+ # not actually update it.
1492
+ class UpdateCustomClassRequest
1493
+ include ::Google::Protobuf::MessageExts
1494
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1495
+ end
1496
+
1497
+ # Request message for the
1498
+ # {::Google::Cloud::Speech::V2::Speech::Client#delete_custom_class DeleteCustomClass} method.
1499
+ # @!attribute [rw] name
1500
+ # @return [::String]
1501
+ # Required. The name of the CustomClass to delete.
1502
+ # Format:
1503
+ # `projects/{project}/locations/{location}/customClasses/{custom_class}`
1504
+ # @!attribute [rw] validate_only
1505
+ # @return [::Boolean]
1506
+ # If set, validate the request and preview the deleted CustomClass, but do
1507
+ # not actually delete it.
1508
+ # @!attribute [rw] allow_missing
1509
+ # @return [::Boolean]
1510
+ # If set to true, and the CustomClass is not found, the request will succeed
1511
+ # and be a no-op (no Operation is recorded in this case).
1512
+ # @!attribute [rw] etag
1513
+ # @return [::String]
1514
+ # This checksum is computed by the server based on the value of other
1515
+ # fields. This may be sent on update, undelete, and delete requests to ensure
1516
+ # the client has an up-to-date value before proceeding.
1517
+ class DeleteCustomClassRequest
1518
+ include ::Google::Protobuf::MessageExts
1519
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1520
+ end
1521
+
1522
+ # Request message for the
1523
+ # {::Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class UndeleteCustomClass}
1524
+ # method.
1525
+ # @!attribute [rw] name
1526
+ # @return [::String]
1527
+ # Required. The name of the CustomClass to undelete.
1528
+ # Format:
1529
+ # `projects/{project}/locations/{location}/customClasses/{custom_class}`
1530
+ # @!attribute [rw] validate_only
1531
+ # @return [::Boolean]
1532
+ # If set, validate the request and preview the undeleted CustomClass, but do
1533
+ # not actually undelete it.
1534
+ # @!attribute [rw] etag
1535
+ # @return [::String]
1536
+ # This checksum is computed by the server based on the value of other
1537
+ # fields. This may be sent on update, undelete, and delete requests to ensure
1538
+ # the client has an up-to-date value before proceeding.
1539
+ class UndeleteCustomClassRequest
1540
+ include ::Google::Protobuf::MessageExts
1541
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1542
+ end
1543
+
1544
+ # Request message for the
1545
+ # {::Google::Cloud::Speech::V2::Speech::Client#create_phrase_set CreatePhraseSet} method.
1546
+ # @!attribute [rw] phrase_set
1547
+ # @return [::Google::Cloud::Speech::V2::PhraseSet]
1548
+ # Required. The PhraseSet to create.
1549
+ # @!attribute [rw] validate_only
1550
+ # @return [::Boolean]
1551
+ # If set, validate the request and preview the PhraseSet, but do not
1552
+ # actually create it.
1553
+ # @!attribute [rw] phrase_set_id
1554
+ # @return [::String]
1555
+ # The ID to use for the PhraseSet, which will become the final component of
1556
+ # the PhraseSet's resource name.
1557
+ #
1558
+ # This value should be 4-63 characters, and valid characters
1559
+ # are /[a-z][0-9]-/.
1560
+ # @!attribute [rw] parent
1561
+ # @return [::String]
1562
+ # Required. The project and location where this PhraseSet will be created.
1563
+ # The expected format is `projects/{project}/locations/{location}`.
1564
+ class CreatePhraseSetRequest
1565
+ include ::Google::Protobuf::MessageExts
1566
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1567
+ end
1568
+
1569
+ # Request message for the
1570
+ # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} method.
1571
+ # @!attribute [rw] parent
1572
+ # @return [::String]
1573
+ # Required. The project and location of PhraseSet resources to list. The
1574
+ # expected format is `projects/{project}/locations/{location}`.
1575
+ # @!attribute [rw] page_size
1576
+ # @return [::Integer]
1577
+ # The maximum number of PhraseSets to return. The service may return fewer
1578
+ # than this value. If unspecified, at most 20 PhraseSets will be returned.
1579
+ # The maximum value is 20; values above 20 will be coerced to 20.
1580
+ # @!attribute [rw] page_token
1581
+ # @return [::String]
1582
+ # A page token, received from a previous
1583
+ # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} call.
1584
+ # Provide this to retrieve the subsequent page.
1585
+ #
1586
+ # When paginating, all other parameters provided to
1587
+ # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} must match
1588
+ # the call that provided the page token.
1589
+ # @!attribute [rw] show_deleted
1590
+ # @return [::Boolean]
1591
+ # Whether, or not, to show resources that have been deleted.
1592
+ class ListPhraseSetsRequest
1593
+ include ::Google::Protobuf::MessageExts
1594
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1595
+ end
1596
+
1597
+ # Response message for the
1598
+ # {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} method.
1599
+ # @!attribute [rw] phrase_sets
1600
+ # @return [::Array<::Google::Cloud::Speech::V2::PhraseSet>]
1601
+ # The list of requested PhraseSets.
1602
+ # @!attribute [rw] next_page_token
1603
+ # @return [::String]
1604
+ # A token, which can be sent as
1605
+ # {::Google::Cloud::Speech::V2::ListPhraseSetsRequest#page_token page_token} to
1606
+ # retrieve the next page. If this field is omitted, there are no subsequent
1607
+ # pages. This token expires after 72 hours.
1608
+ class ListPhraseSetsResponse
1609
+ include ::Google::Protobuf::MessageExts
1610
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1611
+ end
1612
+
1613
+ # Request message for the
1614
+ # {::Google::Cloud::Speech::V2::Speech::Client#get_phrase_set GetPhraseSet} method.
1615
+ # @!attribute [rw] name
1616
+ # @return [::String]
1617
+ # Required. The name of the PhraseSet to retrieve. The expected format is
1618
+ # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`.
1619
+ class GetPhraseSetRequest
1620
+ include ::Google::Protobuf::MessageExts
1621
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1622
+ end
1623
+
1624
+ # Request message for the
1625
+ # {::Google::Cloud::Speech::V2::Speech::Client#update_phrase_set UpdatePhraseSet} method.
1626
+ # @!attribute [rw] phrase_set
1627
+ # @return [::Google::Cloud::Speech::V2::PhraseSet]
1628
+ # Required. The PhraseSet to update.
1629
+ #
1630
+ # The PhraseSet's `name` field is used to identify the PhraseSet to update.
1631
+ # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`.
1632
+ # @!attribute [rw] update_mask
1633
+ # @return [::Google::Protobuf::FieldMask]
1634
+ # The list of fields to update. If empty, all non-default valued fields are
1635
+ # considered for update. Use `*` to update the entire PhraseSet resource.
1636
+ # @!attribute [rw] validate_only
1637
+ # @return [::Boolean]
1638
+ # If set, validate the request and preview the updated PhraseSet, but do not
1639
+ # actually update it.
1640
+ class UpdatePhraseSetRequest
1641
+ include ::Google::Protobuf::MessageExts
1642
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1643
+ end
1644
+
1645
+ # Request message for the
1646
+ # {::Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set DeletePhraseSet} method.
1647
+ # @!attribute [rw] name
1648
+ # @return [::String]
1649
+ # Required. The name of the PhraseSet to delete.
1650
+ # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
1651
+ # @!attribute [rw] validate_only
1652
+ # @return [::Boolean]
1653
+ # If set, validate the request and preview the deleted PhraseSet, but do not
1654
+ # actually delete it.
1655
+ # @!attribute [rw] allow_missing
1656
+ # @return [::Boolean]
1657
+ # If set to true, and the PhraseSet is not found, the request will succeed
1658
+ # and be a no-op (no Operation is recorded in this case).
1659
+ # @!attribute [rw] etag
1660
+ # @return [::String]
1661
+ # This checksum is computed by the server based on the value of other
1662
+ # fields. This may be sent on update, undelete, and delete requests to ensure
1663
+ # the client has an up-to-date value before proceeding.
1664
+ class DeletePhraseSetRequest
1665
+ include ::Google::Protobuf::MessageExts
1666
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1667
+ end
1668
+
1669
+ # Request message for the
1670
+ # {::Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set UndeletePhraseSet}
1671
+ # method.
1672
+ # @!attribute [rw] name
1673
+ # @return [::String]
1674
+ # Required. The name of the PhraseSet to undelete.
1675
+ # Format: `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
1676
+ # @!attribute [rw] validate_only
1677
+ # @return [::Boolean]
1678
+ # If set, validate the request and preview the undeleted PhraseSet, but do
1679
+ # not actually undelete it.
1680
+ # @!attribute [rw] etag
1681
+ # @return [::String]
1682
+ # This checksum is computed by the server based on the value of other
1683
+ # fields. This may be sent on update, undelete, and delete requests to ensure
1684
+ # the client has an up-to-date value before proceeding.
1685
+ class UndeletePhraseSetRequest
1686
+ include ::Google::Protobuf::MessageExts
1687
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1688
+ end
1689
+ end
1690
+ end
1691
+ end
1692
+ end