google-apis-speech_v1p1beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module SpeechV1p1beta1
18
+ # Version of the google-apis-speech_v1p1beta1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20201207"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,374 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module SpeechV1p1beta1
24
+
25
+ class ClassItem
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class CustomClass
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class ListOperationsResponse
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class LongRunningRecognizeMetadata
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class LongRunningRecognizeRequest
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class LongRunningRecognizeResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class Operation
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class Phrase
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class PhraseSet
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class RecognitionAudio
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class RecognitionConfig
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class RecognitionMetadata
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class RecognizeRequest
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class RecognizeResponse
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class SpeakerDiarizationConfig
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class SpeechAdaptation
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class SpeechContext
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class SpeechRecognitionAlternative
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class SpeechRecognitionResult
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class Status
140
+ class Representation < Google::Apis::Core::JsonRepresentation; end
141
+
142
+ include Google::Apis::Core::JsonObjectSupport
143
+ end
144
+
145
+ class WordInfo
146
+ class Representation < Google::Apis::Core::JsonRepresentation; end
147
+
148
+ include Google::Apis::Core::JsonObjectSupport
149
+ end
150
+
151
+ class ClassItem
152
+ # @private
153
+ class Representation < Google::Apis::Core::JsonRepresentation
154
+ property :value, as: 'value'
155
+ end
156
+ end
157
+
158
+ class CustomClass
159
+ # @private
160
+ class Representation < Google::Apis::Core::JsonRepresentation
161
+ property :custom_class_id, as: 'customClassId'
162
+ collection :items, as: 'items', class: Google::Apis::SpeechV1p1beta1::ClassItem, decorator: Google::Apis::SpeechV1p1beta1::ClassItem::Representation
163
+
164
+ property :name, as: 'name'
165
+ end
166
+ end
167
+
168
+ class ListOperationsResponse
169
+ # @private
170
+ class Representation < Google::Apis::Core::JsonRepresentation
171
+ property :next_page_token, as: 'nextPageToken'
172
+ collection :operations, as: 'operations', class: Google::Apis::SpeechV1p1beta1::Operation, decorator: Google::Apis::SpeechV1p1beta1::Operation::Representation
173
+
174
+ end
175
+ end
176
+
177
+ class LongRunningRecognizeMetadata
178
+ # @private
179
+ class Representation < Google::Apis::Core::JsonRepresentation
180
+ property :last_update_time, as: 'lastUpdateTime'
181
+ property :progress_percent, as: 'progressPercent'
182
+ property :start_time, as: 'startTime'
183
+ property :uri, as: 'uri'
184
+ end
185
+ end
186
+
187
+ class LongRunningRecognizeRequest
188
+ # @private
189
+ class Representation < Google::Apis::Core::JsonRepresentation
190
+ property :audio, as: 'audio', class: Google::Apis::SpeechV1p1beta1::RecognitionAudio, decorator: Google::Apis::SpeechV1p1beta1::RecognitionAudio::Representation
191
+
192
+ property :config, as: 'config', class: Google::Apis::SpeechV1p1beta1::RecognitionConfig, decorator: Google::Apis::SpeechV1p1beta1::RecognitionConfig::Representation
193
+
194
+ end
195
+ end
196
+
197
+ class LongRunningRecognizeResponse
198
+ # @private
199
+ class Representation < Google::Apis::Core::JsonRepresentation
200
+ collection :results, as: 'results', class: Google::Apis::SpeechV1p1beta1::SpeechRecognitionResult, decorator: Google::Apis::SpeechV1p1beta1::SpeechRecognitionResult::Representation
201
+
202
+ end
203
+ end
204
+
205
+ class Operation
206
+ # @private
207
+ class Representation < Google::Apis::Core::JsonRepresentation
208
+ property :done, as: 'done'
209
+ property :error, as: 'error', class: Google::Apis::SpeechV1p1beta1::Status, decorator: Google::Apis::SpeechV1p1beta1::Status::Representation
210
+
211
+ hash :metadata, as: 'metadata'
212
+ property :name, as: 'name'
213
+ hash :response, as: 'response'
214
+ end
215
+ end
216
+
217
+ class Phrase
218
+ # @private
219
+ class Representation < Google::Apis::Core::JsonRepresentation
220
+ property :boost, as: 'boost'
221
+ property :value, as: 'value'
222
+ end
223
+ end
224
+
225
+ class PhraseSet
226
+ # @private
227
+ class Representation < Google::Apis::Core::JsonRepresentation
228
+ property :boost, as: 'boost'
229
+ property :name, as: 'name'
230
+ collection :phrases, as: 'phrases', class: Google::Apis::SpeechV1p1beta1::Phrase, decorator: Google::Apis::SpeechV1p1beta1::Phrase::Representation
231
+
232
+ end
233
+ end
234
+
235
+ class RecognitionAudio
236
+ # @private
237
+ class Representation < Google::Apis::Core::JsonRepresentation
238
+ property :content, :base64 => true, as: 'content'
239
+ property :uri, as: 'uri'
240
+ end
241
+ end
242
+
243
+ class RecognitionConfig
244
+ # @private
245
+ class Representation < Google::Apis::Core::JsonRepresentation
246
+ property :adaptation, as: 'adaptation', class: Google::Apis::SpeechV1p1beta1::SpeechAdaptation, decorator: Google::Apis::SpeechV1p1beta1::SpeechAdaptation::Representation
247
+
248
+ collection :alternative_language_codes, as: 'alternativeLanguageCodes'
249
+ property :audio_channel_count, as: 'audioChannelCount'
250
+ property :diarization_config, as: 'diarizationConfig', class: Google::Apis::SpeechV1p1beta1::SpeakerDiarizationConfig, decorator: Google::Apis::SpeechV1p1beta1::SpeakerDiarizationConfig::Representation
251
+
252
+ property :diarization_speaker_count, as: 'diarizationSpeakerCount'
253
+ property :enable_automatic_punctuation, as: 'enableAutomaticPunctuation'
254
+ property :enable_separate_recognition_per_channel, as: 'enableSeparateRecognitionPerChannel'
255
+ property :enable_speaker_diarization, as: 'enableSpeakerDiarization'
256
+ property :enable_word_confidence, as: 'enableWordConfidence'
257
+ property :enable_word_time_offsets, as: 'enableWordTimeOffsets'
258
+ property :encoding, as: 'encoding'
259
+ property :language_code, as: 'languageCode'
260
+ property :max_alternatives, as: 'maxAlternatives'
261
+ property :metadata, as: 'metadata', class: Google::Apis::SpeechV1p1beta1::RecognitionMetadata, decorator: Google::Apis::SpeechV1p1beta1::RecognitionMetadata::Representation
262
+
263
+ property :model, as: 'model'
264
+ property :profanity_filter, as: 'profanityFilter'
265
+ property :sample_rate_hertz, as: 'sampleRateHertz'
266
+ collection :speech_contexts, as: 'speechContexts', class: Google::Apis::SpeechV1p1beta1::SpeechContext, decorator: Google::Apis::SpeechV1p1beta1::SpeechContext::Representation
267
+
268
+ property :use_enhanced, as: 'useEnhanced'
269
+ end
270
+ end
271
+
272
+ class RecognitionMetadata
273
+ # @private
274
+ class Representation < Google::Apis::Core::JsonRepresentation
275
+ property :audio_topic, as: 'audioTopic'
276
+ property :industry_naics_code_of_audio, as: 'industryNaicsCodeOfAudio'
277
+ property :interaction_type, as: 'interactionType'
278
+ property :microphone_distance, as: 'microphoneDistance'
279
+ property :obfuscated_id, :numeric_string => true, as: 'obfuscatedId'
280
+ property :original_media_type, as: 'originalMediaType'
281
+ property :original_mime_type, as: 'originalMimeType'
282
+ property :recording_device_name, as: 'recordingDeviceName'
283
+ property :recording_device_type, as: 'recordingDeviceType'
284
+ end
285
+ end
286
+
287
+ class RecognizeRequest
288
+ # @private
289
+ class Representation < Google::Apis::Core::JsonRepresentation
290
+ property :audio, as: 'audio', class: Google::Apis::SpeechV1p1beta1::RecognitionAudio, decorator: Google::Apis::SpeechV1p1beta1::RecognitionAudio::Representation
291
+
292
+ property :config, as: 'config', class: Google::Apis::SpeechV1p1beta1::RecognitionConfig, decorator: Google::Apis::SpeechV1p1beta1::RecognitionConfig::Representation
293
+
294
+ end
295
+ end
296
+
297
+ class RecognizeResponse
298
+ # @private
299
+ class Representation < Google::Apis::Core::JsonRepresentation
300
+ collection :results, as: 'results', class: Google::Apis::SpeechV1p1beta1::SpeechRecognitionResult, decorator: Google::Apis::SpeechV1p1beta1::SpeechRecognitionResult::Representation
301
+
302
+ end
303
+ end
304
+
305
+ class SpeakerDiarizationConfig
306
+ # @private
307
+ class Representation < Google::Apis::Core::JsonRepresentation
308
+ property :enable_speaker_diarization, as: 'enableSpeakerDiarization'
309
+ property :max_speaker_count, as: 'maxSpeakerCount'
310
+ property :min_speaker_count, as: 'minSpeakerCount'
311
+ property :speaker_tag, as: 'speakerTag'
312
+ end
313
+ end
314
+
315
+ class SpeechAdaptation
316
+ # @private
317
+ class Representation < Google::Apis::Core::JsonRepresentation
318
+ collection :custom_classes, as: 'customClasses', class: Google::Apis::SpeechV1p1beta1::CustomClass, decorator: Google::Apis::SpeechV1p1beta1::CustomClass::Representation
319
+
320
+ collection :phrase_sets, as: 'phraseSets', class: Google::Apis::SpeechV1p1beta1::PhraseSet, decorator: Google::Apis::SpeechV1p1beta1::PhraseSet::Representation
321
+
322
+ end
323
+ end
324
+
325
+ class SpeechContext
326
+ # @private
327
+ class Representation < Google::Apis::Core::JsonRepresentation
328
+ property :boost, as: 'boost'
329
+ collection :phrases, as: 'phrases'
330
+ end
331
+ end
332
+
333
+ class SpeechRecognitionAlternative
334
+ # @private
335
+ class Representation < Google::Apis::Core::JsonRepresentation
336
+ property :confidence, as: 'confidence'
337
+ property :transcript, as: 'transcript'
338
+ collection :words, as: 'words', class: Google::Apis::SpeechV1p1beta1::WordInfo, decorator: Google::Apis::SpeechV1p1beta1::WordInfo::Representation
339
+
340
+ end
341
+ end
342
+
343
+ class SpeechRecognitionResult
344
+ # @private
345
+ class Representation < Google::Apis::Core::JsonRepresentation
346
+ collection :alternatives, as: 'alternatives', class: Google::Apis::SpeechV1p1beta1::SpeechRecognitionAlternative, decorator: Google::Apis::SpeechV1p1beta1::SpeechRecognitionAlternative::Representation
347
+
348
+ property :channel_tag, as: 'channelTag'
349
+ property :language_code, as: 'languageCode'
350
+ end
351
+ end
352
+
353
+ class Status
354
+ # @private
355
+ class Representation < Google::Apis::Core::JsonRepresentation
356
+ property :code, as: 'code'
357
+ collection :details, as: 'details'
358
+ property :message, as: 'message'
359
+ end
360
+ end
361
+
362
+ class WordInfo
363
+ # @private
364
+ class Representation < Google::Apis::Core::JsonRepresentation
365
+ property :confidence, as: 'confidence'
366
+ property :end_time, as: 'endTime'
367
+ property :speaker_tag, as: 'speakerTag'
368
+ property :start_time, as: 'startTime'
369
+ property :word, as: 'word'
370
+ end
371
+ end
372
+ end
373
+ end
374
+ end
@@ -0,0 +1,280 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module SpeechV1p1beta1
23
+ # Cloud Speech-to-Text API
24
+ #
25
+ # Converts audio to text by applying powerful neural network models.
26
+ #
27
+ # @example
28
+ # require 'google/apis/speech_v1p1beta1'
29
+ #
30
+ # Speech = Google::Apis::SpeechV1p1beta1 # Alias the module
31
+ # service = Speech::SpeechService.new
32
+ #
33
+ # @see https://cloud.google.com/speech-to-text/docs/quickstart-protocol
34
+ class SpeechService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://speech.googleapis.com/', '',
47
+ client_name: 'google-apis-speech_v1p1beta1',
48
+ client_version: Google::Apis::SpeechV1p1beta1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Gets the latest state of a long-running operation. Clients can use this method
53
+ # to poll the operation result at intervals as recommended by the API service.
54
+ # @param [String] name
55
+ # The name of the operation resource.
56
+ # @param [String] fields
57
+ # Selector specifying which fields to include in a partial response.
58
+ # @param [String] quota_user
59
+ # Available to use for quota purposes for server-side applications. Can be any
60
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
61
+ # @param [Google::Apis::RequestOptions] options
62
+ # Request-specific options
63
+ #
64
+ # @yield [result, err] Result & error if block supplied
65
+ # @yieldparam result [Google::Apis::SpeechV1p1beta1::Operation] parsed result object
66
+ # @yieldparam err [StandardError] error object if request failed
67
+ #
68
+ # @return [Google::Apis::SpeechV1p1beta1::Operation]
69
+ #
70
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
71
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
72
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
73
+ def get_operation(name, fields: nil, quota_user: nil, options: nil, &block)
74
+ command = make_simple_command(:get, 'v1p1beta1/operations/{+name}', options)
75
+ command.response_representation = Google::Apis::SpeechV1p1beta1::Operation::Representation
76
+ command.response_class = Google::Apis::SpeechV1p1beta1::Operation
77
+ command.params['name'] = name unless name.nil?
78
+ command.query['fields'] = fields unless fields.nil?
79
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
80
+ execute_or_queue_command(command, &block)
81
+ end
82
+
83
+ # Lists operations that match the specified filter in the request. If the server
84
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
85
+ # binding allows API services to override the binding to use different resource
86
+ # name schemes, such as `users/*/operations`. To override the binding, API
87
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
88
+ # service configuration. For backwards compatibility, the default name includes
89
+ # the operations collection id, however overriding users must ensure the name
90
+ # binding is the parent resource, without the operations collection id.
91
+ # @param [String] filter
92
+ # The standard list filter.
93
+ # @param [String] name
94
+ # The name of the operation's parent resource.
95
+ # @param [Fixnum] page_size
96
+ # The standard list page size.
97
+ # @param [String] page_token
98
+ # The standard list page token.
99
+ # @param [String] fields
100
+ # Selector specifying which fields to include in a partial response.
101
+ # @param [String] quota_user
102
+ # Available to use for quota purposes for server-side applications. Can be any
103
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
104
+ # @param [Google::Apis::RequestOptions] options
105
+ # Request-specific options
106
+ #
107
+ # @yield [result, err] Result & error if block supplied
108
+ # @yieldparam result [Google::Apis::SpeechV1p1beta1::ListOperationsResponse] parsed result object
109
+ # @yieldparam err [StandardError] error object if request failed
110
+ #
111
+ # @return [Google::Apis::SpeechV1p1beta1::ListOperationsResponse]
112
+ #
113
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
114
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
115
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
116
+ def list_operations(filter: nil, name: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
117
+ command = make_simple_command(:get, 'v1p1beta1/operations', options)
118
+ command.response_representation = Google::Apis::SpeechV1p1beta1::ListOperationsResponse::Representation
119
+ command.response_class = Google::Apis::SpeechV1p1beta1::ListOperationsResponse
120
+ command.query['filter'] = filter unless filter.nil?
121
+ command.query['name'] = name unless name.nil?
122
+ command.query['pageSize'] = page_size unless page_size.nil?
123
+ command.query['pageToken'] = page_token unless page_token.nil?
124
+ command.query['fields'] = fields unless fields.nil?
125
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
126
+ execute_or_queue_command(command, &block)
127
+ end
128
+
129
+ # Gets the latest state of a long-running operation. Clients can use this method
130
+ # to poll the operation result at intervals as recommended by the API service.
131
+ # @param [String] name
132
+ # The name of the operation resource.
133
+ # @param [String] fields
134
+ # Selector specifying which fields to include in a partial response.
135
+ # @param [String] quota_user
136
+ # Available to use for quota purposes for server-side applications. Can be any
137
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
138
+ # @param [Google::Apis::RequestOptions] options
139
+ # Request-specific options
140
+ #
141
+ # @yield [result, err] Result & error if block supplied
142
+ # @yieldparam result [Google::Apis::SpeechV1p1beta1::Operation] parsed result object
143
+ # @yieldparam err [StandardError] error object if request failed
144
+ #
145
+ # @return [Google::Apis::SpeechV1p1beta1::Operation]
146
+ #
147
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
148
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
149
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
150
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
151
+ command = make_simple_command(:get, 'v1p1beta1/{+name}', options)
152
+ command.response_representation = Google::Apis::SpeechV1p1beta1::Operation::Representation
153
+ command.response_class = Google::Apis::SpeechV1p1beta1::Operation
154
+ command.params['name'] = name unless name.nil?
155
+ command.query['fields'] = fields unless fields.nil?
156
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
157
+ execute_or_queue_command(command, &block)
158
+ end
159
+
160
+ # Lists operations that match the specified filter in the request. If the server
161
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
162
+ # binding allows API services to override the binding to use different resource
163
+ # name schemes, such as `users/*/operations`. To override the binding, API
164
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
165
+ # service configuration. For backwards compatibility, the default name includes
166
+ # the operations collection id, however overriding users must ensure the name
167
+ # binding is the parent resource, without the operations collection id.
168
+ # @param [String] name
169
+ # The name of the operation's parent resource.
170
+ # @param [String] filter
171
+ # The standard list filter.
172
+ # @param [Fixnum] page_size
173
+ # The standard list page size.
174
+ # @param [String] page_token
175
+ # The standard list page token.
176
+ # @param [String] fields
177
+ # Selector specifying which fields to include in a partial response.
178
+ # @param [String] quota_user
179
+ # Available to use for quota purposes for server-side applications. Can be any
180
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
181
+ # @param [Google::Apis::RequestOptions] options
182
+ # Request-specific options
183
+ #
184
+ # @yield [result, err] Result & error if block supplied
185
+ # @yieldparam result [Google::Apis::SpeechV1p1beta1::ListOperationsResponse] parsed result object
186
+ # @yieldparam err [StandardError] error object if request failed
187
+ #
188
+ # @return [Google::Apis::SpeechV1p1beta1::ListOperationsResponse]
189
+ #
190
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
191
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
192
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
193
+ def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
194
+ command = make_simple_command(:get, 'v1p1beta1/{+name}/operations', options)
195
+ command.response_representation = Google::Apis::SpeechV1p1beta1::ListOperationsResponse::Representation
196
+ command.response_class = Google::Apis::SpeechV1p1beta1::ListOperationsResponse
197
+ command.params['name'] = name unless name.nil?
198
+ command.query['filter'] = filter unless filter.nil?
199
+ command.query['pageSize'] = page_size unless page_size.nil?
200
+ command.query['pageToken'] = page_token unless page_token.nil?
201
+ command.query['fields'] = fields unless fields.nil?
202
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
203
+ execute_or_queue_command(command, &block)
204
+ end
205
+
206
+ # Performs asynchronous speech recognition: receive results via the google.
207
+ # longrunning.Operations interface. Returns either an `Operation.error` or an `
208
+ # Operation.response` which contains a `LongRunningRecognizeResponse` message.
209
+ # For more information on asynchronous speech recognition, see the [how-to](
210
+ # https://cloud.google.com/speech-to-text/docs/async-recognize).
211
+ # @param [Google::Apis::SpeechV1p1beta1::LongRunningRecognizeRequest] long_running_recognize_request_object
212
+ # @param [String] fields
213
+ # Selector specifying which fields to include in a partial response.
214
+ # @param [String] quota_user
215
+ # Available to use for quota purposes for server-side applications. Can be any
216
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
217
+ # @param [Google::Apis::RequestOptions] options
218
+ # Request-specific options
219
+ #
220
+ # @yield [result, err] Result & error if block supplied
221
+ # @yieldparam result [Google::Apis::SpeechV1p1beta1::Operation] parsed result object
222
+ # @yieldparam err [StandardError] error object if request failed
223
+ #
224
+ # @return [Google::Apis::SpeechV1p1beta1::Operation]
225
+ #
226
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
227
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
228
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
229
+ def longrunningrecognize_speech(long_running_recognize_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
230
+ command = make_simple_command(:post, 'v1p1beta1/speech:longrunningrecognize', options)
231
+ command.request_representation = Google::Apis::SpeechV1p1beta1::LongRunningRecognizeRequest::Representation
232
+ command.request_object = long_running_recognize_request_object
233
+ command.response_representation = Google::Apis::SpeechV1p1beta1::Operation::Representation
234
+ command.response_class = Google::Apis::SpeechV1p1beta1::Operation
235
+ command.query['fields'] = fields unless fields.nil?
236
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
237
+ execute_or_queue_command(command, &block)
238
+ end
239
+
240
+ # Performs synchronous speech recognition: receive results after all audio has
241
+ # been sent and processed.
242
+ # @param [Google::Apis::SpeechV1p1beta1::RecognizeRequest] recognize_request_object
243
+ # @param [String] fields
244
+ # Selector specifying which fields to include in a partial response.
245
+ # @param [String] quota_user
246
+ # Available to use for quota purposes for server-side applications. Can be any
247
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
248
+ # @param [Google::Apis::RequestOptions] options
249
+ # Request-specific options
250
+ #
251
+ # @yield [result, err] Result & error if block supplied
252
+ # @yieldparam result [Google::Apis::SpeechV1p1beta1::RecognizeResponse] parsed result object
253
+ # @yieldparam err [StandardError] error object if request failed
254
+ #
255
+ # @return [Google::Apis::SpeechV1p1beta1::RecognizeResponse]
256
+ #
257
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
258
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
259
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
260
+ def recognize_speech(recognize_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
261
+ command = make_simple_command(:post, 'v1p1beta1/speech:recognize', options)
262
+ command.request_representation = Google::Apis::SpeechV1p1beta1::RecognizeRequest::Representation
263
+ command.request_object = recognize_request_object
264
+ command.response_representation = Google::Apis::SpeechV1p1beta1::RecognizeResponse::Representation
265
+ command.response_class = Google::Apis::SpeechV1p1beta1::RecognizeResponse
266
+ command.query['fields'] = fields unless fields.nil?
267
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
268
+ execute_or_queue_command(command, &block)
269
+ end
270
+
271
+ protected
272
+
273
+ def apply_command_defaults(command)
274
+ command.query['key'] = key unless key.nil?
275
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
276
+ end
277
+ end
278
+ end
279
+ end
280
+ end