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,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2a7cac9d0950592d846b86946fda9b9f0536b51236c1f7ed6baa923231fa6203
4
+ data.tar.gz: 55e4cfb5ba5d35103ff9407dd87361ee1f4117973e2b65fe09c4e63cef2b3495
5
+ SHA512:
6
+ metadata.gz: 5f72b8522ddf8d0971967888ee8bf65569e54f8fdbd613ea019c67ff0864473644a94bcf4cccc1ec3e8b2638a026a5085267746274cb52af7de5da08ac1e9ac4
7
+ data.tar.gz: c62af7d9554b83474cb29e7fea070b26df0d599b7c5beebb2ab8475966f0d0cc8c901567a5834d4504afc91db960708a2c90162fdd0d5add9ed6a8aa52f63a6b
@@ -0,0 +1,13 @@
1
+ --hide-void-return
2
+ --no-private
3
+ --verbose
4
+ --title=google-apis-speech_v1p1beta1
5
+ --markup-provider=redcarpet
6
+ --markup=markdown
7
+ --main OVERVIEW.md
8
+ lib/google/apis/speech_v1p1beta1/*.rb
9
+ lib/google/apis/speech_v1p1beta1.rb
10
+ -
11
+ OVERVIEW.md
12
+ CHANGELOG.md
13
+ LICENSE.md
@@ -0,0 +1,7 @@
1
+ # Release history for google-apis-speech_v1p1beta1
2
+
3
+ ### v0.1.0 (2021-01-07)
4
+
5
+ * Regenerated using generator version 0.1.1
6
+ * Regenerated from discovery document revision 20201207
7
+
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,96 @@
1
+ # Simple REST client for version V1p1beta1 of the Cloud Speech-to-Text API
2
+
3
+ This is a simple client library for version V1p1beta1 of the Cloud Speech-to-Text API. It provides:
4
+
5
+ * A client object that connects to the HTTP/JSON REST endpoint for the service.
6
+ * Ruby objects for data structures related to the service.
7
+ * Integration with the googleauth gem for authentication using OAuth, API keys, and service accounts.
8
+ * Control of retry, pagination, and timeouts.
9
+
10
+ Note that although this client library is supported and will continue to be updated to track changes to the service, it is otherwise considered complete and not under active development. Many Google services, especially Google Cloud Platform services, may provide a more modern client that is under more active development and improvement. See the section below titled *Which client should I use?* for more information.
11
+
12
+ ## Getting started
13
+
14
+ ### Before you begin
15
+
16
+ There are a few setup steps you need to complete before you can use this library:
17
+
18
+ 1. If you don't already have a Google account, [sign up](https://www.google.com/accounts).
19
+ 2. If you have never created a Google APIs Console project, read about [Managing Projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects) and create a project in the [Google API Console](https://console.cloud.google.com/).
20
+ 3. Most APIs need to be enabled for your project. [Enable it](https://console.cloud.google.com/apis/library/speech.googleapis.com) in the console.
21
+
22
+ ### Installation
23
+
24
+ Add this line to your application's Gemfile:
25
+
26
+ ```ruby
27
+ gem 'google-apis-speech_v1p1beta1', '~> 0.1'
28
+ ```
29
+
30
+ And then execute:
31
+
32
+ ```
33
+ $ bundle
34
+ ```
35
+
36
+ Or install it yourself as:
37
+
38
+ ```
39
+ $ gem install google-apis-speech_v1p1beta1
40
+ ```
41
+
42
+ ### Creating a client object
43
+
44
+ Once the gem is installed, you can load the client code and instantiate a client.
45
+
46
+ ```ruby
47
+ # Load the client
48
+ require "google/apis/speech_v1p1beta1"
49
+
50
+ # Create a client object
51
+ client = Google::Apis::SpeechV1p1beta1::SpeechService.new
52
+
53
+ # Authenticate calls
54
+ client.authentication = # ... use the googleauth gem to create credentials
55
+ ```
56
+
57
+ See the class reference docs for information on the methods you can call from a client.
58
+
59
+ ## Documentation
60
+
61
+ More detailed descriptions of the Google simple REST clients are available in two documents.
62
+
63
+ * The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/usage-guide.md) discusses how to make API calls, how to use the provided data structures, and how to work the various features of the client library, including media upload and download, error handling, retries, pagination, and logging.
64
+ * The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/auth-guide.md) discusses authentication in the client libraries, including API keys, OAuth 2.0, service accounts, and environment variables.
65
+
66
+ (Note: the above documents are written for the simple REST clients in general, and their examples may not reflect the Speech service in particular.)
67
+
68
+ For reference information on specific calls in the Cloud Speech-to-Text API, see the {Google::Apis::SpeechV1p1beta1::SpeechService class reference docs}.
69
+
70
+ ## Which client should I use?
71
+
72
+ Google provides two types of Ruby API client libraries: **simple REST clients** and **modern clients**.
73
+
74
+ This library, `google-apis-speech_v1p1beta1`, is a simple REST client. You can identify these clients by their gem names, which are always in the form `google-apis-<servicename>_<serviceversion>`. The simple REST clients connect to HTTP/JSON REST endpoints and are automatically generated from service discovery documents. They support most API functionality, but their class interfaces are sometimes awkward.
75
+
76
+ Modern clients are produced by a modern code generator, sometimes combined with hand-crafted functionality. Most modern clients connect to high-performance gRPC endpoints, although a few are backed by REST services. Modern clients are available for many Google services, especially Google Cloud Platform services, but do not yet support all the services covered by the simple clients.
77
+
78
+ Gem names for modern clients are often of the form `google-cloud-<service_name>`. (For example, [google-cloud-pubsub](https://rubygems.org/gems/google-cloud-pubsub).) Note that most modern clients also have corresponding "versioned" gems with names like `google-cloud-<service_name>-<version>`. (For example, [google-cloud-pubsub-v1](https://rubygems.org/gems/google-cloud-pubsub-v1).) The "versioned" gems can be used directly, but often provide lower-level interfaces. In most cases, the main gem is recommended.
79
+
80
+ **For most users, we recommend the modern client, if one is available.** Compared with simple clients, modern clients are generally much easier to use and more Ruby-like, support more advanced features such as streaming and long-running operations, and often provide much better performance. You may consider using a simple client instead, if a modern client is not yet available for the service you want to use, or if you are not able to use gRPC on your infrastructure.
81
+
82
+ The [product documentation](https://cloud.google.com/speech-to-text/docs/quickstart-protocol) may provide guidance regarding the preferred client library to use.
83
+
84
+ ## Supported Ruby versions
85
+
86
+ This library is supported on Ruby 2.5+.
87
+
88
+ Google provides official support for Ruby versions that are actively supported by Ruby Core -- that is, Ruby versions that are either in normal maintenance or in security maintenance, and not end of life. Currently, this means Ruby 2.5 and later. Older versions of Ruby _may_ still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby support schedule.
89
+
90
+ ## License
91
+
92
+ This library is licensed under Apache 2.0. Full license text is available in the {file:LICENSE.md LICENSE}.
93
+
94
+ ## Support
95
+
96
+ Please [report bugs at the project on Github](https://github.com/google/google-api-ruby-client/issues). Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-api-ruby-client) about the client or APIs on [StackOverflow](http://stackoverflow.com).
@@ -0,0 +1,15 @@
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/speech_v1p1beta1"
@@ -0,0 +1,36 @@
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/speech_v1p1beta1/service.rb'
16
+ require 'google/apis/speech_v1p1beta1/classes.rb'
17
+ require 'google/apis/speech_v1p1beta1/representations.rb'
18
+ require 'google/apis/speech_v1p1beta1/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # Cloud Speech-to-Text API
23
+ #
24
+ # Converts audio to text by applying powerful neural network models.
25
+ #
26
+ # @see https://cloud.google.com/speech-to-text/docs/quickstart-protocol
27
+ module SpeechV1p1beta1
28
+ # Version of the Cloud Speech-to-Text API this client connects to.
29
+ # This is NOT the gem version.
30
+ VERSION = 'V1p1beta1'
31
+
32
+ # View and manage your data across Google Cloud Platform services
33
+ AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,998 @@
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
+ # An item of the class.
26
+ class ClassItem
27
+ include Google::Apis::Core::Hashable
28
+
29
+ # The class item's value.
30
+ # Corresponds to the JSON property `value`
31
+ # @return [String]
32
+ attr_accessor :value
33
+
34
+ def initialize(**args)
35
+ update!(**args)
36
+ end
37
+
38
+ # Update properties of this object
39
+ def update!(**args)
40
+ @value = args[:value] if args.key?(:value)
41
+ end
42
+ end
43
+
44
+ # A set of words or phrases that represents a common concept likely to appear in
45
+ # your audio, for example a list of passenger ship names. CustomClass items can
46
+ # be substituted into placeholders that you set in PhraseSet phrases.
47
+ class CustomClass
48
+ include Google::Apis::Core::Hashable
49
+
50
+ # If this custom class is a resource, the custom_class_id is the resource id of
51
+ # the CustomClass. Case sensitive.
52
+ # Corresponds to the JSON property `customClassId`
53
+ # @return [String]
54
+ attr_accessor :custom_class_id
55
+
56
+ # A collection of class items.
57
+ # Corresponds to the JSON property `items`
58
+ # @return [Array<Google::Apis::SpeechV1p1beta1::ClassItem>]
59
+ attr_accessor :items
60
+
61
+ # The resource name of the custom class.
62
+ # Corresponds to the JSON property `name`
63
+ # @return [String]
64
+ attr_accessor :name
65
+
66
+ def initialize(**args)
67
+ update!(**args)
68
+ end
69
+
70
+ # Update properties of this object
71
+ def update!(**args)
72
+ @custom_class_id = args[:custom_class_id] if args.key?(:custom_class_id)
73
+ @items = args[:items] if args.key?(:items)
74
+ @name = args[:name] if args.key?(:name)
75
+ end
76
+ end
77
+
78
+ # The response message for Operations.ListOperations.
79
+ class ListOperationsResponse
80
+ include Google::Apis::Core::Hashable
81
+
82
+ # The standard List next-page token.
83
+ # Corresponds to the JSON property `nextPageToken`
84
+ # @return [String]
85
+ attr_accessor :next_page_token
86
+
87
+ # A list of operations that matches the specified filter in the request.
88
+ # Corresponds to the JSON property `operations`
89
+ # @return [Array<Google::Apis::SpeechV1p1beta1::Operation>]
90
+ attr_accessor :operations
91
+
92
+ def initialize(**args)
93
+ update!(**args)
94
+ end
95
+
96
+ # Update properties of this object
97
+ def update!(**args)
98
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
99
+ @operations = args[:operations] if args.key?(:operations)
100
+ end
101
+ end
102
+
103
+ # Describes the progress of a long-running `LongRunningRecognize` call. It is
104
+ # included in the `metadata` field of the `Operation` returned by the `
105
+ # GetOperation` call of the `google::longrunning::Operations` service.
106
+ class LongRunningRecognizeMetadata
107
+ include Google::Apis::Core::Hashable
108
+
109
+ # Time of the most recent processing update.
110
+ # Corresponds to the JSON property `lastUpdateTime`
111
+ # @return [String]
112
+ attr_accessor :last_update_time
113
+
114
+ # Approximate percentage of audio processed thus far. Guaranteed to be 100 when
115
+ # the audio is fully processed and the results are available.
116
+ # Corresponds to the JSON property `progressPercent`
117
+ # @return [Fixnum]
118
+ attr_accessor :progress_percent
119
+
120
+ # Time when the request was received.
121
+ # Corresponds to the JSON property `startTime`
122
+ # @return [String]
123
+ attr_accessor :start_time
124
+
125
+ # Output only. The URI of the audio file being transcribed. Empty if the audio
126
+ # was sent as byte content.
127
+ # Corresponds to the JSON property `uri`
128
+ # @return [String]
129
+ attr_accessor :uri
130
+
131
+ def initialize(**args)
132
+ update!(**args)
133
+ end
134
+
135
+ # Update properties of this object
136
+ def update!(**args)
137
+ @last_update_time = args[:last_update_time] if args.key?(:last_update_time)
138
+ @progress_percent = args[:progress_percent] if args.key?(:progress_percent)
139
+ @start_time = args[:start_time] if args.key?(:start_time)
140
+ @uri = args[:uri] if args.key?(:uri)
141
+ end
142
+ end
143
+
144
+ # The top-level message sent by the client for the `LongRunningRecognize` method.
145
+ class LongRunningRecognizeRequest
146
+ include Google::Apis::Core::Hashable
147
+
148
+ # Contains audio data in the encoding specified in the `RecognitionConfig`.
149
+ # Either `content` or `uri` must be supplied. Supplying both or neither returns
150
+ # google.rpc.Code.INVALID_ARGUMENT. See [content limits](https://cloud.google.
151
+ # com/speech-to-text/quotas#content).
152
+ # Corresponds to the JSON property `audio`
153
+ # @return [Google::Apis::SpeechV1p1beta1::RecognitionAudio]
154
+ attr_accessor :audio
155
+
156
+ # Provides information to the recognizer that specifies how to process the
157
+ # request.
158
+ # Corresponds to the JSON property `config`
159
+ # @return [Google::Apis::SpeechV1p1beta1::RecognitionConfig]
160
+ attr_accessor :config
161
+
162
+ def initialize(**args)
163
+ update!(**args)
164
+ end
165
+
166
+ # Update properties of this object
167
+ def update!(**args)
168
+ @audio = args[:audio] if args.key?(:audio)
169
+ @config = args[:config] if args.key?(:config)
170
+ end
171
+ end
172
+
173
+ # The only message returned to the client by the `LongRunningRecognize` method.
174
+ # It contains the result as zero or more sequential `SpeechRecognitionResult`
175
+ # messages. It is included in the `result.response` field of the `Operation`
176
+ # returned by the `GetOperation` call of the `google::longrunning::Operations`
177
+ # service.
178
+ class LongRunningRecognizeResponse
179
+ include Google::Apis::Core::Hashable
180
+
181
+ # Sequential list of transcription results corresponding to sequential portions
182
+ # of audio.
183
+ # Corresponds to the JSON property `results`
184
+ # @return [Array<Google::Apis::SpeechV1p1beta1::SpeechRecognitionResult>]
185
+ attr_accessor :results
186
+
187
+ def initialize(**args)
188
+ update!(**args)
189
+ end
190
+
191
+ # Update properties of this object
192
+ def update!(**args)
193
+ @results = args[:results] if args.key?(:results)
194
+ end
195
+ end
196
+
197
+ # This resource represents a long-running operation that is the result of a
198
+ # network API call.
199
+ class Operation
200
+ include Google::Apis::Core::Hashable
201
+
202
+ # If the value is `false`, it means the operation is still in progress. If `true`
203
+ # , the operation is completed, and either `error` or `response` is available.
204
+ # Corresponds to the JSON property `done`
205
+ # @return [Boolean]
206
+ attr_accessor :done
207
+ alias_method :done?, :done
208
+
209
+ # The `Status` type defines a logical error model that is suitable for different
210
+ # programming environments, including REST APIs and RPC APIs. It is used by [
211
+ # gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
212
+ # data: error code, error message, and error details. You can find out more
213
+ # about this error model and how to work with it in the [API Design Guide](https:
214
+ # //cloud.google.com/apis/design/errors).
215
+ # Corresponds to the JSON property `error`
216
+ # @return [Google::Apis::SpeechV1p1beta1::Status]
217
+ attr_accessor :error
218
+
219
+ # Service-specific metadata associated with the operation. It typically contains
220
+ # progress information and common metadata such as create time. Some services
221
+ # might not provide such metadata. Any method that returns a long-running
222
+ # operation should document the metadata type, if any.
223
+ # Corresponds to the JSON property `metadata`
224
+ # @return [Hash<String,Object>]
225
+ attr_accessor :metadata
226
+
227
+ # The server-assigned name, which is only unique within the same service that
228
+ # originally returns it. If you use the default HTTP mapping, the `name` should
229
+ # be a resource name ending with `operations/`unique_id``.
230
+ # Corresponds to the JSON property `name`
231
+ # @return [String]
232
+ attr_accessor :name
233
+
234
+ # The normal response of the operation in case of success. If the original
235
+ # method returns no data on success, such as `Delete`, the response is `google.
236
+ # protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`,
237
+ # the response should be the resource. For other methods, the response should
238
+ # have the type `XxxResponse`, where `Xxx` is the original method name. For
239
+ # example, if the original method name is `TakeSnapshot()`, the inferred
240
+ # response type is `TakeSnapshotResponse`.
241
+ # Corresponds to the JSON property `response`
242
+ # @return [Hash<String,Object>]
243
+ attr_accessor :response
244
+
245
+ def initialize(**args)
246
+ update!(**args)
247
+ end
248
+
249
+ # Update properties of this object
250
+ def update!(**args)
251
+ @done = args[:done] if args.key?(:done)
252
+ @error = args[:error] if args.key?(:error)
253
+ @metadata = args[:metadata] if args.key?(:metadata)
254
+ @name = args[:name] if args.key?(:name)
255
+ @response = args[:response] if args.key?(:response)
256
+ end
257
+ end
258
+
259
+ # A phrases containing words and phrase "hints" so that the speech recognition
260
+ # is more likely to recognize them. This can be used to improve the accuracy for
261
+ # specific words and phrases, for example, if specific commands are typically
262
+ # spoken by the user. This can also be used to add additional words to the
263
+ # vocabulary of the recognizer. See [usage limits](https://cloud.google.com/
264
+ # speech-to-text/quotas#content). List items can also include pre-built or
265
+ # custom classes containing groups of words that represent common concepts that
266
+ # occur in natural language. For example, rather than providing a phrase hint
267
+ # for every month of the year (e.g. "i was born in january", "i was born in
268
+ # febuary", ...), use the pre-built `$MONTH` class improves the likelihood of
269
+ # correctly transcribing audio that includes months (e.g. "i was born in $month")
270
+ # . To refer to pre-built classes, use the class' symbol prepended with `$` e.g.
271
+ # `$MONTH`. To refer to custom classes that were defined inline in the request,
272
+ # set the class's `custom_class_id` to a string unique to all class resources
273
+ # and inline classes. Then use the class' id wrapped in $``...`` e.g. "$`my-
274
+ # months`". To refer to custom classes resources, use the class' id wrapped in `$
275
+ # ``` (e.g. `$`my-months``).
276
+ class Phrase
277
+ include Google::Apis::Core::Hashable
278
+
279
+ # Hint Boost. Overrides the boost set at the phrase set level. Positive value
280
+ # will increase the probability that a specific phrase will be recognized over
281
+ # other similar sounding phrases. The higher the boost, the higher the chance of
282
+ # false positive recognition as well. Negative boost values would correspond to
283
+ # anti-biasing. Anti-biasing is not enabled, so negative boost will simply be
284
+ # ignored. Though `boost` can accept a wide range of positive values, most use
285
+ # cases are best served with values between 0 and 20. We recommend using a
286
+ # binary search approach to finding the optimal value for your use case. Speech
287
+ # recognition will skip PhraseSets with a boost value of 0.
288
+ # Corresponds to the JSON property `boost`
289
+ # @return [Float]
290
+ attr_accessor :boost
291
+
292
+ # The phrase itself.
293
+ # Corresponds to the JSON property `value`
294
+ # @return [String]
295
+ attr_accessor :value
296
+
297
+ def initialize(**args)
298
+ update!(**args)
299
+ end
300
+
301
+ # Update properties of this object
302
+ def update!(**args)
303
+ @boost = args[:boost] if args.key?(:boost)
304
+ @value = args[:value] if args.key?(:value)
305
+ end
306
+ end
307
+
308
+ # Provides "hints" to the speech recognizer to favor specific words and phrases
309
+ # in the results.
310
+ class PhraseSet
311
+ include Google::Apis::Core::Hashable
312
+
313
+ # Hint Boost. Positive value will increase the probability that a specific
314
+ # phrase will be recognized over other similar sounding phrases. The higher the
315
+ # boost, the higher the chance of false positive recognition as well. Negative
316
+ # boost values would correspond to anti-biasing. Anti-biasing is not enabled, so
317
+ # negative boost will simply be ignored. Though `boost` can accept a wide range
318
+ # of positive values, most use cases are best served with values between 0 (
319
+ # exclusive) and 20. We recommend using a binary search approach to finding the
320
+ # optimal value for your use case. Speech recognition will skip PhraseSets with
321
+ # a boost value of 0.
322
+ # Corresponds to the JSON property `boost`
323
+ # @return [Float]
324
+ attr_accessor :boost
325
+
326
+ # The resource name of the phrase set.
327
+ # Corresponds to the JSON property `name`
328
+ # @return [String]
329
+ attr_accessor :name
330
+
331
+ # A list of word and phrases.
332
+ # Corresponds to the JSON property `phrases`
333
+ # @return [Array<Google::Apis::SpeechV1p1beta1::Phrase>]
334
+ attr_accessor :phrases
335
+
336
+ def initialize(**args)
337
+ update!(**args)
338
+ end
339
+
340
+ # Update properties of this object
341
+ def update!(**args)
342
+ @boost = args[:boost] if args.key?(:boost)
343
+ @name = args[:name] if args.key?(:name)
344
+ @phrases = args[:phrases] if args.key?(:phrases)
345
+ end
346
+ end
347
+
348
+ # Contains audio data in the encoding specified in the `RecognitionConfig`.
349
+ # Either `content` or `uri` must be supplied. Supplying both or neither returns
350
+ # google.rpc.Code.INVALID_ARGUMENT. See [content limits](https://cloud.google.
351
+ # com/speech-to-text/quotas#content).
352
+ class RecognitionAudio
353
+ include Google::Apis::Core::Hashable
354
+
355
+ # The audio data bytes encoded as specified in `RecognitionConfig`. Note: as
356
+ # with all bytes fields, proto buffers use a pure binary representation, whereas
357
+ # JSON representations use base64.
358
+ # Corresponds to the JSON property `content`
359
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
360
+ # @return [String]
361
+ attr_accessor :content
362
+
363
+ # URI that points to a file that contains audio data bytes as specified in `
364
+ # RecognitionConfig`. The file must not be compressed (for example, gzip).
365
+ # Currently, only Google Cloud Storage URIs are supported, which must be
366
+ # specified in the following format: `gs://bucket_name/object_name` (other URI
367
+ # formats return google.rpc.Code.INVALID_ARGUMENT). For more information, see [
368
+ # Request URIs](https://cloud.google.com/storage/docs/reference-uris).
369
+ # Corresponds to the JSON property `uri`
370
+ # @return [String]
371
+ attr_accessor :uri
372
+
373
+ def initialize(**args)
374
+ update!(**args)
375
+ end
376
+
377
+ # Update properties of this object
378
+ def update!(**args)
379
+ @content = args[:content] if args.key?(:content)
380
+ @uri = args[:uri] if args.key?(:uri)
381
+ end
382
+ end
383
+
384
+ # Provides information to the recognizer that specifies how to process the
385
+ # request.
386
+ class RecognitionConfig
387
+ include Google::Apis::Core::Hashable
388
+
389
+ # Speech adaptation configuration.
390
+ # Corresponds to the JSON property `adaptation`
391
+ # @return [Google::Apis::SpeechV1p1beta1::SpeechAdaptation]
392
+ attr_accessor :adaptation
393
+
394
+ # A list of up to 3 additional [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.
395
+ # txt) language tags, listing possible alternative languages of the supplied
396
+ # audio. See [Language Support](https://cloud.google.com/speech-to-text/docs/
397
+ # languages) for a list of the currently supported language codes. If
398
+ # alternative languages are listed, recognition result will contain recognition
399
+ # in the most likely language detected including the main language_code. The
400
+ # recognition result will include the language tag of the language detected in
401
+ # the audio. Note: This feature is only supported for Voice Command and Voice
402
+ # Search use cases and performance may vary for other use cases (e.g., phone
403
+ # call transcription).
404
+ # Corresponds to the JSON property `alternativeLanguageCodes`
405
+ # @return [Array<String>]
406
+ attr_accessor :alternative_language_codes
407
+
408
+ # The number of channels in the input audio data. ONLY set this for MULTI-
409
+ # CHANNEL recognition. Valid values for LINEAR16 and FLAC are `1`-`8`. Valid
410
+ # values for OGG_OPUS are '1'-'254'. Valid value for MULAW, AMR, AMR_WB and
411
+ # SPEEX_WITH_HEADER_BYTE is only `1`. If `0` or omitted, defaults to one channel
412
+ # (mono). Note: We only recognize the first channel by default. To perform
413
+ # independent recognition on each channel set `
414
+ # enable_separate_recognition_per_channel` to 'true'.
415
+ # Corresponds to the JSON property `audioChannelCount`
416
+ # @return [Fixnum]
417
+ attr_accessor :audio_channel_count
418
+
419
+ # Config to enable speaker diarization.
420
+ # Corresponds to the JSON property `diarizationConfig`
421
+ # @return [Google::Apis::SpeechV1p1beta1::SpeakerDiarizationConfig]
422
+ attr_accessor :diarization_config
423
+
424
+ # If set, specifies the estimated number of speakers in the conversation.
425
+ # Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
426
+ # Note: Use diarization_config instead.
427
+ # Corresponds to the JSON property `diarizationSpeakerCount`
428
+ # @return [Fixnum]
429
+ attr_accessor :diarization_speaker_count
430
+
431
+ # If 'true', adds punctuation to recognition result hypotheses. This feature is
432
+ # only available in select languages. Setting this for requests in other
433
+ # languages has no effect at all. The default 'false' value does not add
434
+ # punctuation to result hypotheses.
435
+ # Corresponds to the JSON property `enableAutomaticPunctuation`
436
+ # @return [Boolean]
437
+ attr_accessor :enable_automatic_punctuation
438
+ alias_method :enable_automatic_punctuation?, :enable_automatic_punctuation
439
+
440
+ # This needs to be set to `true` explicitly and `audio_channel_count` > 1 to get
441
+ # each channel recognized separately. The recognition result will contain a `
442
+ # channel_tag` field to state which channel that result belongs to. If this is
443
+ # not true, we will only recognize the first channel. The request is billed
444
+ # cumulatively for all channels recognized: `audio_channel_count` multiplied by
445
+ # the length of the audio.
446
+ # Corresponds to the JSON property `enableSeparateRecognitionPerChannel`
447
+ # @return [Boolean]
448
+ attr_accessor :enable_separate_recognition_per_channel
449
+ alias_method :enable_separate_recognition_per_channel?, :enable_separate_recognition_per_channel
450
+
451
+ # If 'true', enables speaker detection for each recognized word in the top
452
+ # alternative of the recognition result using a speaker_tag provided in the
453
+ # WordInfo. Note: Use diarization_config instead.
454
+ # Corresponds to the JSON property `enableSpeakerDiarization`
455
+ # @return [Boolean]
456
+ attr_accessor :enable_speaker_diarization
457
+ alias_method :enable_speaker_diarization?, :enable_speaker_diarization
458
+
459
+ # If `true`, the top result includes a list of words and the confidence for
460
+ # those words. If `false`, no word-level confidence information is returned. The
461
+ # default is `false`.
462
+ # Corresponds to the JSON property `enableWordConfidence`
463
+ # @return [Boolean]
464
+ attr_accessor :enable_word_confidence
465
+ alias_method :enable_word_confidence?, :enable_word_confidence
466
+
467
+ # If `true`, the top result includes a list of words and the start and end time
468
+ # offsets (timestamps) for those words. If `false`, no word-level time offset
469
+ # information is returned. The default is `false`.
470
+ # Corresponds to the JSON property `enableWordTimeOffsets`
471
+ # @return [Boolean]
472
+ attr_accessor :enable_word_time_offsets
473
+ alias_method :enable_word_time_offsets?, :enable_word_time_offsets
474
+
475
+ # Encoding of audio data sent in all `RecognitionAudio` messages. This field is
476
+ # optional for `FLAC` and `WAV` audio files and required for all other audio
477
+ # formats. For details, see AudioEncoding.
478
+ # Corresponds to the JSON property `encoding`
479
+ # @return [String]
480
+ attr_accessor :encoding
481
+
482
+ # Required. The language of the supplied audio as a [BCP-47](https://www.rfc-
483
+ # editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US". See [Language
484
+ # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list of
485
+ # the currently supported language codes.
486
+ # Corresponds to the JSON property `languageCode`
487
+ # @return [String]
488
+ attr_accessor :language_code
489
+
490
+ # Maximum number of recognition hypotheses to be returned. Specifically, the
491
+ # maximum number of `SpeechRecognitionAlternative` messages within each `
492
+ # SpeechRecognitionResult`. The server may return fewer than `max_alternatives`.
493
+ # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of one.
494
+ # If omitted, will return a maximum of one.
495
+ # Corresponds to the JSON property `maxAlternatives`
496
+ # @return [Fixnum]
497
+ attr_accessor :max_alternatives
498
+
499
+ # Description of audio data to be recognized.
500
+ # Corresponds to the JSON property `metadata`
501
+ # @return [Google::Apis::SpeechV1p1beta1::RecognitionMetadata]
502
+ attr_accessor :metadata
503
+
504
+ # Which model to select for the given request. Select the model best suited to
505
+ # your domain to get best results. If a model is not explicitly specified, then
506
+ # we auto-select a model based on the parameters in the RecognitionConfig. *
507
+ # Model* *Description* command_and_search Best for short queries such as voice
508
+ # commands or voice search. phone_call Best for audio that originated from a
509
+ # phone call (typically recorded at an 8khz sampling rate). video Best for audio
510
+ # that originated from from video or includes multiple speakers. Ideally the
511
+ # audio is recorded at a 16khz or greater sampling rate. This is a premium model
512
+ # that costs more than the standard rate. default Best for audio that is not one
513
+ # of the specific audio models. For example, long-form audio. Ideally the audio
514
+ # is high-fidelity, recorded at a 16khz or greater sampling rate.
515
+ # Corresponds to the JSON property `model`
516
+ # @return [String]
517
+ attr_accessor :model
518
+
519
+ # If set to `true`, the server will attempt to filter out profanities, replacing
520
+ # all but the initial character in each filtered word with asterisks, e.g. "f***"
521
+ # . If set to `false` or omitted, profanities won't be filtered out.
522
+ # Corresponds to the JSON property `profanityFilter`
523
+ # @return [Boolean]
524
+ attr_accessor :profanity_filter
525
+ alias_method :profanity_filter?, :profanity_filter
526
+
527
+ # Sample rate in Hertz of the audio data sent in all `RecognitionAudio` messages.
528
+ # Valid values are: 8000-48000. 16000 is optimal. For best results, set the
529
+ # sampling rate of the audio source to 16000 Hz. If that's not possible, use the
530
+ # native sample rate of the audio source (instead of re-sampling). This field is
531
+ # optional for FLAC and WAV audio files, but is required for all other audio
532
+ # formats. For details, see AudioEncoding.
533
+ # Corresponds to the JSON property `sampleRateHertz`
534
+ # @return [Fixnum]
535
+ attr_accessor :sample_rate_hertz
536
+
537
+ # Array of SpeechContext. A means to provide context to assist the speech
538
+ # recognition. For more information, see [speech adaptation](https://cloud.
539
+ # google.com/speech-to-text/docs/context-strength).
540
+ # Corresponds to the JSON property `speechContexts`
541
+ # @return [Array<Google::Apis::SpeechV1p1beta1::SpeechContext>]
542
+ attr_accessor :speech_contexts
543
+
544
+ # Set to true to use an enhanced model for speech recognition. If `use_enhanced`
545
+ # is set to true and the `model` field is not set, then an appropriate enhanced
546
+ # model is chosen if an enhanced model exists for the audio. If `use_enhanced`
547
+ # is true and an enhanced version of the specified model does not exist, then
548
+ # the speech is recognized using the standard version of the specified model.
549
+ # Corresponds to the JSON property `useEnhanced`
550
+ # @return [Boolean]
551
+ attr_accessor :use_enhanced
552
+ alias_method :use_enhanced?, :use_enhanced
553
+
554
+ def initialize(**args)
555
+ update!(**args)
556
+ end
557
+
558
+ # Update properties of this object
559
+ def update!(**args)
560
+ @adaptation = args[:adaptation] if args.key?(:adaptation)
561
+ @alternative_language_codes = args[:alternative_language_codes] if args.key?(:alternative_language_codes)
562
+ @audio_channel_count = args[:audio_channel_count] if args.key?(:audio_channel_count)
563
+ @diarization_config = args[:diarization_config] if args.key?(:diarization_config)
564
+ @diarization_speaker_count = args[:diarization_speaker_count] if args.key?(:diarization_speaker_count)
565
+ @enable_automatic_punctuation = args[:enable_automatic_punctuation] if args.key?(:enable_automatic_punctuation)
566
+ @enable_separate_recognition_per_channel = args[:enable_separate_recognition_per_channel] if args.key?(:enable_separate_recognition_per_channel)
567
+ @enable_speaker_diarization = args[:enable_speaker_diarization] if args.key?(:enable_speaker_diarization)
568
+ @enable_word_confidence = args[:enable_word_confidence] if args.key?(:enable_word_confidence)
569
+ @enable_word_time_offsets = args[:enable_word_time_offsets] if args.key?(:enable_word_time_offsets)
570
+ @encoding = args[:encoding] if args.key?(:encoding)
571
+ @language_code = args[:language_code] if args.key?(:language_code)
572
+ @max_alternatives = args[:max_alternatives] if args.key?(:max_alternatives)
573
+ @metadata = args[:metadata] if args.key?(:metadata)
574
+ @model = args[:model] if args.key?(:model)
575
+ @profanity_filter = args[:profanity_filter] if args.key?(:profanity_filter)
576
+ @sample_rate_hertz = args[:sample_rate_hertz] if args.key?(:sample_rate_hertz)
577
+ @speech_contexts = args[:speech_contexts] if args.key?(:speech_contexts)
578
+ @use_enhanced = args[:use_enhanced] if args.key?(:use_enhanced)
579
+ end
580
+ end
581
+
582
+ # Description of audio data to be recognized.
583
+ class RecognitionMetadata
584
+ include Google::Apis::Core::Hashable
585
+
586
+ # Description of the content. Eg. "Recordings of federal supreme court hearings
587
+ # from 2012".
588
+ # Corresponds to the JSON property `audioTopic`
589
+ # @return [String]
590
+ attr_accessor :audio_topic
591
+
592
+ # The industry vertical to which this speech recognition request most closely
593
+ # applies. This is most indicative of the topics contained in the audio. Use the
594
+ # 6-digit NAICS code to identify the industry vertical - see https://www.naics.
595
+ # com/search/.
596
+ # Corresponds to the JSON property `industryNaicsCodeOfAudio`
597
+ # @return [Fixnum]
598
+ attr_accessor :industry_naics_code_of_audio
599
+
600
+ # The use case most closely describing the audio content to be recognized.
601
+ # Corresponds to the JSON property `interactionType`
602
+ # @return [String]
603
+ attr_accessor :interaction_type
604
+
605
+ # The audio type that most closely describes the audio being recognized.
606
+ # Corresponds to the JSON property `microphoneDistance`
607
+ # @return [String]
608
+ attr_accessor :microphone_distance
609
+
610
+ # Obfuscated (privacy-protected) ID of the user, to identify number of unique
611
+ # users using the service.
612
+ # Corresponds to the JSON property `obfuscatedId`
613
+ # @return [Fixnum]
614
+ attr_accessor :obfuscated_id
615
+
616
+ # The original media the speech was recorded on.
617
+ # Corresponds to the JSON property `originalMediaType`
618
+ # @return [String]
619
+ attr_accessor :original_media_type
620
+
621
+ # Mime type of the original audio file. For example `audio/m4a`, `audio/x-alaw-
622
+ # basic`, `audio/mp3`, `audio/3gpp`. A list of possible audio mime types is
623
+ # maintained at http://www.iana.org/assignments/media-types/media-types.xhtml#
624
+ # audio
625
+ # Corresponds to the JSON property `originalMimeType`
626
+ # @return [String]
627
+ attr_accessor :original_mime_type
628
+
629
+ # The device used to make the recording. Examples 'Nexus 5X' or 'Polycom
630
+ # SoundStation IP 6000' or 'POTS' or 'VoIP' or 'Cardioid Microphone'.
631
+ # Corresponds to the JSON property `recordingDeviceName`
632
+ # @return [String]
633
+ attr_accessor :recording_device_name
634
+
635
+ # The type of device the speech was recorded with.
636
+ # Corresponds to the JSON property `recordingDeviceType`
637
+ # @return [String]
638
+ attr_accessor :recording_device_type
639
+
640
+ def initialize(**args)
641
+ update!(**args)
642
+ end
643
+
644
+ # Update properties of this object
645
+ def update!(**args)
646
+ @audio_topic = args[:audio_topic] if args.key?(:audio_topic)
647
+ @industry_naics_code_of_audio = args[:industry_naics_code_of_audio] if args.key?(:industry_naics_code_of_audio)
648
+ @interaction_type = args[:interaction_type] if args.key?(:interaction_type)
649
+ @microphone_distance = args[:microphone_distance] if args.key?(:microphone_distance)
650
+ @obfuscated_id = args[:obfuscated_id] if args.key?(:obfuscated_id)
651
+ @original_media_type = args[:original_media_type] if args.key?(:original_media_type)
652
+ @original_mime_type = args[:original_mime_type] if args.key?(:original_mime_type)
653
+ @recording_device_name = args[:recording_device_name] if args.key?(:recording_device_name)
654
+ @recording_device_type = args[:recording_device_type] if args.key?(:recording_device_type)
655
+ end
656
+ end
657
+
658
+ # The top-level message sent by the client for the `Recognize` method.
659
+ class RecognizeRequest
660
+ include Google::Apis::Core::Hashable
661
+
662
+ # Contains audio data in the encoding specified in the `RecognitionConfig`.
663
+ # Either `content` or `uri` must be supplied. Supplying both or neither returns
664
+ # google.rpc.Code.INVALID_ARGUMENT. See [content limits](https://cloud.google.
665
+ # com/speech-to-text/quotas#content).
666
+ # Corresponds to the JSON property `audio`
667
+ # @return [Google::Apis::SpeechV1p1beta1::RecognitionAudio]
668
+ attr_accessor :audio
669
+
670
+ # Provides information to the recognizer that specifies how to process the
671
+ # request.
672
+ # Corresponds to the JSON property `config`
673
+ # @return [Google::Apis::SpeechV1p1beta1::RecognitionConfig]
674
+ attr_accessor :config
675
+
676
+ def initialize(**args)
677
+ update!(**args)
678
+ end
679
+
680
+ # Update properties of this object
681
+ def update!(**args)
682
+ @audio = args[:audio] if args.key?(:audio)
683
+ @config = args[:config] if args.key?(:config)
684
+ end
685
+ end
686
+
687
+ # The only message returned to the client by the `Recognize` method. It contains
688
+ # the result as zero or more sequential `SpeechRecognitionResult` messages.
689
+ class RecognizeResponse
690
+ include Google::Apis::Core::Hashable
691
+
692
+ # Sequential list of transcription results corresponding to sequential portions
693
+ # of audio.
694
+ # Corresponds to the JSON property `results`
695
+ # @return [Array<Google::Apis::SpeechV1p1beta1::SpeechRecognitionResult>]
696
+ attr_accessor :results
697
+
698
+ def initialize(**args)
699
+ update!(**args)
700
+ end
701
+
702
+ # Update properties of this object
703
+ def update!(**args)
704
+ @results = args[:results] if args.key?(:results)
705
+ end
706
+ end
707
+
708
+ # Config to enable speaker diarization.
709
+ class SpeakerDiarizationConfig
710
+ include Google::Apis::Core::Hashable
711
+
712
+ # If 'true', enables speaker detection for each recognized word in the top
713
+ # alternative of the recognition result using a speaker_tag provided in the
714
+ # WordInfo.
715
+ # Corresponds to the JSON property `enableSpeakerDiarization`
716
+ # @return [Boolean]
717
+ attr_accessor :enable_speaker_diarization
718
+ alias_method :enable_speaker_diarization?, :enable_speaker_diarization
719
+
720
+ # Maximum number of speakers in the conversation. This range gives you more
721
+ # flexibility by allowing the system to automatically determine the correct
722
+ # number of speakers. If not set, the default value is 6.
723
+ # Corresponds to the JSON property `maxSpeakerCount`
724
+ # @return [Fixnum]
725
+ attr_accessor :max_speaker_count
726
+
727
+ # Minimum number of speakers in the conversation. This range gives you more
728
+ # flexibility by allowing the system to automatically determine the correct
729
+ # number of speakers. If not set, the default value is 2.
730
+ # Corresponds to the JSON property `minSpeakerCount`
731
+ # @return [Fixnum]
732
+ attr_accessor :min_speaker_count
733
+
734
+ # Output only. Unused.
735
+ # Corresponds to the JSON property `speakerTag`
736
+ # @return [Fixnum]
737
+ attr_accessor :speaker_tag
738
+
739
+ def initialize(**args)
740
+ update!(**args)
741
+ end
742
+
743
+ # Update properties of this object
744
+ def update!(**args)
745
+ @enable_speaker_diarization = args[:enable_speaker_diarization] if args.key?(:enable_speaker_diarization)
746
+ @max_speaker_count = args[:max_speaker_count] if args.key?(:max_speaker_count)
747
+ @min_speaker_count = args[:min_speaker_count] if args.key?(:min_speaker_count)
748
+ @speaker_tag = args[:speaker_tag] if args.key?(:speaker_tag)
749
+ end
750
+ end
751
+
752
+ # Speech adaptation configuration.
753
+ class SpeechAdaptation
754
+ include Google::Apis::Core::Hashable
755
+
756
+ # A collection of custom classes. To specify the classes inline, leave the class'
757
+ # `name` blank and fill in the rest of its fields, giving it a unique `
758
+ # custom_class_id`. Refer to the inline defined class in phrase hints by its `
759
+ # custom_class_id`.
760
+ # Corresponds to the JSON property `customClasses`
761
+ # @return [Array<Google::Apis::SpeechV1p1beta1::CustomClass>]
762
+ attr_accessor :custom_classes
763
+
764
+ # A collection of phrase sets. To specify the hints inline, leave the phrase set'
765
+ # s `name` blank and fill in the rest of its fields. Any phrase set can use any
766
+ # custom class.
767
+ # Corresponds to the JSON property `phraseSets`
768
+ # @return [Array<Google::Apis::SpeechV1p1beta1::PhraseSet>]
769
+ attr_accessor :phrase_sets
770
+
771
+ def initialize(**args)
772
+ update!(**args)
773
+ end
774
+
775
+ # Update properties of this object
776
+ def update!(**args)
777
+ @custom_classes = args[:custom_classes] if args.key?(:custom_classes)
778
+ @phrase_sets = args[:phrase_sets] if args.key?(:phrase_sets)
779
+ end
780
+ end
781
+
782
+ # Provides "hints" to the speech recognizer to favor specific words and phrases
783
+ # in the results.
784
+ class SpeechContext
785
+ include Google::Apis::Core::Hashable
786
+
787
+ # Hint Boost. Positive value will increase the probability that a specific
788
+ # phrase will be recognized over other similar sounding phrases. The higher the
789
+ # boost, the higher the chance of false positive recognition as well. Negative
790
+ # boost values would correspond to anti-biasing. Anti-biasing is not enabled, so
791
+ # negative boost will simply be ignored. Though `boost` can accept a wide range
792
+ # of positive values, most use cases are best served with values between 0 and
793
+ # 20. We recommend using a binary search approach to finding the optimal value
794
+ # for your use case.
795
+ # Corresponds to the JSON property `boost`
796
+ # @return [Float]
797
+ attr_accessor :boost
798
+
799
+ # A list of strings containing words and phrases "hints" so that the speech
800
+ # recognition is more likely to recognize them. This can be used to improve the
801
+ # accuracy for specific words and phrases, for example, if specific commands are
802
+ # typically spoken by the user. This can also be used to add additional words to
803
+ # the vocabulary of the recognizer. See [usage limits](https://cloud.google.com/
804
+ # speech-to-text/quotas#content). List items can also be set to classes for
805
+ # groups of words that represent common concepts that occur in natural language.
806
+ # For example, rather than providing phrase hints for every month of the year,
807
+ # using the $MONTH class improves the likelihood of correctly transcribing audio
808
+ # that includes months.
809
+ # Corresponds to the JSON property `phrases`
810
+ # @return [Array<String>]
811
+ attr_accessor :phrases
812
+
813
+ def initialize(**args)
814
+ update!(**args)
815
+ end
816
+
817
+ # Update properties of this object
818
+ def update!(**args)
819
+ @boost = args[:boost] if args.key?(:boost)
820
+ @phrases = args[:phrases] if args.key?(:phrases)
821
+ end
822
+ end
823
+
824
+ # Alternative hypotheses (a.k.a. n-best list).
825
+ class SpeechRecognitionAlternative
826
+ include Google::Apis::Core::Hashable
827
+
828
+ # The confidence estimate between 0.0 and 1.0. A higher number indicates an
829
+ # estimated greater likelihood that the recognized words are correct. This field
830
+ # is set only for the top alternative of a non-streaming result or, of a
831
+ # streaming result where `is_final=true`. This field is not guaranteed to be
832
+ # accurate and users should not rely on it to be always provided. The default of
833
+ # 0.0 is a sentinel value indicating `confidence` was not set.
834
+ # Corresponds to the JSON property `confidence`
835
+ # @return [Float]
836
+ attr_accessor :confidence
837
+
838
+ # Transcript text representing the words that the user spoke.
839
+ # Corresponds to the JSON property `transcript`
840
+ # @return [String]
841
+ attr_accessor :transcript
842
+
843
+ # A list of word-specific information for each recognized word. Note: When `
844
+ # enable_speaker_diarization` is true, you will see all the words from the
845
+ # beginning of the audio.
846
+ # Corresponds to the JSON property `words`
847
+ # @return [Array<Google::Apis::SpeechV1p1beta1::WordInfo>]
848
+ attr_accessor :words
849
+
850
+ def initialize(**args)
851
+ update!(**args)
852
+ end
853
+
854
+ # Update properties of this object
855
+ def update!(**args)
856
+ @confidence = args[:confidence] if args.key?(:confidence)
857
+ @transcript = args[:transcript] if args.key?(:transcript)
858
+ @words = args[:words] if args.key?(:words)
859
+ end
860
+ end
861
+
862
+ # A speech recognition result corresponding to a portion of the audio.
863
+ class SpeechRecognitionResult
864
+ include Google::Apis::Core::Hashable
865
+
866
+ # May contain one or more recognition hypotheses (up to the maximum specified in
867
+ # `max_alternatives`). These alternatives are ordered in terms of accuracy, with
868
+ # the top (first) alternative being the most probable, as ranked by the
869
+ # recognizer.
870
+ # Corresponds to the JSON property `alternatives`
871
+ # @return [Array<Google::Apis::SpeechV1p1beta1::SpeechRecognitionAlternative>]
872
+ attr_accessor :alternatives
873
+
874
+ # For multi-channel audio, this is the channel number corresponding to the
875
+ # recognized result for the audio from that channel. For audio_channel_count = N,
876
+ # its output values can range from '1' to 'N'.
877
+ # Corresponds to the JSON property `channelTag`
878
+ # @return [Fixnum]
879
+ attr_accessor :channel_tag
880
+
881
+ # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
882
+ # language tag of the language in this result. This language code was detected
883
+ # to have the most likelihood of being spoken in the audio.
884
+ # Corresponds to the JSON property `languageCode`
885
+ # @return [String]
886
+ attr_accessor :language_code
887
+
888
+ def initialize(**args)
889
+ update!(**args)
890
+ end
891
+
892
+ # Update properties of this object
893
+ def update!(**args)
894
+ @alternatives = args[:alternatives] if args.key?(:alternatives)
895
+ @channel_tag = args[:channel_tag] if args.key?(:channel_tag)
896
+ @language_code = args[:language_code] if args.key?(:language_code)
897
+ end
898
+ end
899
+
900
+ # The `Status` type defines a logical error model that is suitable for different
901
+ # programming environments, including REST APIs and RPC APIs. It is used by [
902
+ # gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
903
+ # data: error code, error message, and error details. You can find out more
904
+ # about this error model and how to work with it in the [API Design Guide](https:
905
+ # //cloud.google.com/apis/design/errors).
906
+ class Status
907
+ include Google::Apis::Core::Hashable
908
+
909
+ # The status code, which should be an enum value of google.rpc.Code.
910
+ # Corresponds to the JSON property `code`
911
+ # @return [Fixnum]
912
+ attr_accessor :code
913
+
914
+ # A list of messages that carry the error details. There is a common set of
915
+ # message types for APIs to use.
916
+ # Corresponds to the JSON property `details`
917
+ # @return [Array<Hash<String,Object>>]
918
+ attr_accessor :details
919
+
920
+ # A developer-facing error message, which should be in English. Any user-facing
921
+ # error message should be localized and sent in the google.rpc.Status.details
922
+ # field, or localized by the client.
923
+ # Corresponds to the JSON property `message`
924
+ # @return [String]
925
+ attr_accessor :message
926
+
927
+ def initialize(**args)
928
+ update!(**args)
929
+ end
930
+
931
+ # Update properties of this object
932
+ def update!(**args)
933
+ @code = args[:code] if args.key?(:code)
934
+ @details = args[:details] if args.key?(:details)
935
+ @message = args[:message] if args.key?(:message)
936
+ end
937
+ end
938
+
939
+ # Word-specific information for recognized words.
940
+ class WordInfo
941
+ include Google::Apis::Core::Hashable
942
+
943
+ # The confidence estimate between 0.0 and 1.0. A higher number indicates an
944
+ # estimated greater likelihood that the recognized words are correct. This field
945
+ # is set only for the top alternative of a non-streaming result or, of a
946
+ # streaming result where `is_final=true`. This field is not guaranteed to be
947
+ # accurate and users should not rely on it to be always provided. The default of
948
+ # 0.0 is a sentinel value indicating `confidence` was not set.
949
+ # Corresponds to the JSON property `confidence`
950
+ # @return [Float]
951
+ attr_accessor :confidence
952
+
953
+ # Time offset relative to the beginning of the audio, and corresponding to the
954
+ # end of the spoken word. This field is only set if `enable_word_time_offsets=
955
+ # true` and only in the top hypothesis. This is an experimental feature and the
956
+ # accuracy of the time offset can vary.
957
+ # Corresponds to the JSON property `endTime`
958
+ # @return [String]
959
+ attr_accessor :end_time
960
+
961
+ # Output only. A distinct integer value is assigned for every speaker within the
962
+ # audio. This field specifies which one of those speakers was detected to have
963
+ # spoken this word. Value ranges from '1' to diarization_speaker_count.
964
+ # speaker_tag is set if enable_speaker_diarization = 'true' and only in the top
965
+ # alternative.
966
+ # Corresponds to the JSON property `speakerTag`
967
+ # @return [Fixnum]
968
+ attr_accessor :speaker_tag
969
+
970
+ # Time offset relative to the beginning of the audio, and corresponding to the
971
+ # start of the spoken word. This field is only set if `enable_word_time_offsets=
972
+ # true` and only in the top hypothesis. This is an experimental feature and the
973
+ # accuracy of the time offset can vary.
974
+ # Corresponds to the JSON property `startTime`
975
+ # @return [String]
976
+ attr_accessor :start_time
977
+
978
+ # The word corresponding to this set of information.
979
+ # Corresponds to the JSON property `word`
980
+ # @return [String]
981
+ attr_accessor :word
982
+
983
+ def initialize(**args)
984
+ update!(**args)
985
+ end
986
+
987
+ # Update properties of this object
988
+ def update!(**args)
989
+ @confidence = args[:confidence] if args.key?(:confidence)
990
+ @end_time = args[:end_time] if args.key?(:end_time)
991
+ @speaker_tag = args[:speaker_tag] if args.key?(:speaker_tag)
992
+ @start_time = args[:start_time] if args.key?(:start_time)
993
+ @word = args[:word] if args.key?(:word)
994
+ end
995
+ end
996
+ end
997
+ end
998
+ end