google-cloud-speech 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +2 -2
- data/lib/google-cloud-speech.rb +2 -2
- data/lib/google/cloud/speech.rb +2 -2
- data/lib/google/cloud/speech/audio.rb +2 -2
- data/lib/google/cloud/speech/convert.rb +2 -2
- data/lib/google/cloud/speech/credentials.rb +2 -2
- data/lib/google/cloud/speech/operation.rb +2 -2
- data/lib/google/cloud/speech/project.rb +2 -2
- data/lib/google/cloud/speech/result.rb +2 -2
- data/lib/google/cloud/speech/service.rb +9 -4
- data/lib/google/cloud/speech/stream.rb +2 -2
- data/lib/google/cloud/speech/v1.rb +104 -2
- data/lib/google/cloud/speech/v1/cloud_speech_services_pb.rb +1 -1
- data/lib/google/cloud/speech/v1/doc/google/cloud/speech/v1/cloud_speech.rb +2 -2
- data/lib/google/cloud/speech/v1/doc/google/protobuf/any.rb +2 -2
- data/lib/google/cloud/speech/v1/doc/google/protobuf/duration.rb +2 -2
- data/lib/google/cloud/speech/v1/doc/google/rpc/status.rb +2 -2
- data/lib/google/cloud/speech/v1/doc/overview.rb +5 -4
- data/lib/google/cloud/speech/v1/speech_client.rb +14 -21
- data/lib/google/cloud/speech/version.rb +3 -3
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5ea8bfc2549536e0da9030f8dfc3cc3abbbdf6f2f611ad761901720e67d84b8f
|
|
4
|
+
data.tar.gz: 83808483ace60d98c0166416867ee40122f3158e92e6757d46684264b3c6ac45
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 89d38a6c84418d91afac2858a919d94e5486bee9c0b461dac6ace854eb2b1a940f9210c576c65d2f091a25fc40d23e0e5008e63152b46ceaf6bf1ccc374dc2be
|
|
7
|
+
data.tar.gz: c070e9db594451f1567e01a0f7739dc95692c99cfd129ae0a5a668ccd35897de05c6410a83c82925837f0c725308005499ccdf8b9303f87bcb2c49a7fd546900
|
data/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Apache License
|
|
2
2
|
Version 2.0, January 2004
|
|
3
|
-
|
|
3
|
+
https://www.apache.org/licenses/
|
|
4
4
|
|
|
5
5
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
6
|
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
193
193
|
You may obtain a copy of the License at
|
|
194
194
|
|
|
195
|
-
|
|
195
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
196
196
|
|
|
197
197
|
Unless required by applicable law or agreed to in writing, software
|
|
198
198
|
distributed under the License is distributed on an "AS IS" BASIS,
|
data/lib/google-cloud-speech.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2016 Google
|
|
1
|
+
# Copyright 2016 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
data/lib/google/cloud/speech.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2016 Google
|
|
1
|
+
# Copyright 2016 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2016 Google
|
|
1
|
+
# Copyright 2016 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2017 Google
|
|
1
|
+
# Copyright 2017 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2016 Google
|
|
1
|
+
# Copyright 2016 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2016 Google
|
|
1
|
+
# Copyright 2016 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2016 Google
|
|
1
|
+
# Copyright 2016 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2016 Google
|
|
1
|
+
# Copyright 2016 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2016 Google
|
|
1
|
+
# Copyright 2016 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -27,6 +27,12 @@ module Google
|
|
|
27
27
|
class Service
|
|
28
28
|
attr_accessor :project, :credentials, :timeout, :client_config
|
|
29
29
|
|
|
30
|
+
##
|
|
31
|
+
# LRO client configured for Speech
|
|
32
|
+
class SpeechOperationsClient < Google::Longrunning::OperationsClient
|
|
33
|
+
SERVICE_ADDRESS = V1::SpeechClient::SERVICE_ADDRESS
|
|
34
|
+
end
|
|
35
|
+
|
|
30
36
|
##
|
|
31
37
|
# Creates a new Service instance.
|
|
32
38
|
def initialize project, credentials, timeout: nil, client_config: nil
|
|
@@ -51,8 +57,7 @@ module Google
|
|
|
51
57
|
def ops
|
|
52
58
|
return mocked_ops if mocked_ops
|
|
53
59
|
@ops ||= \
|
|
54
|
-
|
|
55
|
-
service_path: V1::SpeechClient::SERVICE_ADDRESS,
|
|
60
|
+
SpeechOperationsClient.new(
|
|
56
61
|
credentials: credentials,
|
|
57
62
|
timeout: timeout,
|
|
58
63
|
client_config: client_config,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2016 Google
|
|
1
|
+
# Copyright 2016 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
# Copyright 2017
|
|
1
|
+
# Copyright 2017 Google LLC
|
|
2
|
+
#
|
|
2
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
# you may not use this file except in compliance with the License.
|
|
4
5
|
# You may obtain a copy of the License at
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
9
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -12,3 +13,104 @@
|
|
|
12
13
|
# limitations under the License.
|
|
13
14
|
|
|
14
15
|
require "google/cloud/speech/v1/speech_client"
|
|
16
|
+
|
|
17
|
+
module Google
|
|
18
|
+
module Cloud
|
|
19
|
+
# rubocop:disable LineLength
|
|
20
|
+
|
|
21
|
+
##
|
|
22
|
+
# # Ruby Client for Google Cloud Speech API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
|
|
23
|
+
#
|
|
24
|
+
# [Google Cloud Speech API][Product Documentation]:
|
|
25
|
+
# Google Cloud Speech API.
|
|
26
|
+
# - [Product Documentation][]
|
|
27
|
+
#
|
|
28
|
+
# ## Quick Start
|
|
29
|
+
# In order to use this library, you first need to go through the following
|
|
30
|
+
# steps:
|
|
31
|
+
#
|
|
32
|
+
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
|
33
|
+
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
|
34
|
+
# 3. [Enable the Google Cloud Speech API.](https://console.cloud.google.com/apis/api/speech)
|
|
35
|
+
# 4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
|
|
36
|
+
#
|
|
37
|
+
# ### Preview
|
|
38
|
+
# #### SpeechClient
|
|
39
|
+
# ```rb
|
|
40
|
+
# require "google/cloud/speech/v1"
|
|
41
|
+
#
|
|
42
|
+
# speech_client = Google::Cloud::Speech::V1.new
|
|
43
|
+
# language_code = "en-US"
|
|
44
|
+
# sample_rate_hertz = 44100
|
|
45
|
+
# encoding = :FLAC
|
|
46
|
+
# config = {
|
|
47
|
+
# language_code: language_code,
|
|
48
|
+
# sample_rate_hertz: sample_rate_hertz,
|
|
49
|
+
# encoding: encoding
|
|
50
|
+
# }
|
|
51
|
+
# uri = "gs://gapic-toolkit/hello.flac"
|
|
52
|
+
# audio = { uri: uri }
|
|
53
|
+
# response = speech_client.recognize(config, audio)
|
|
54
|
+
# ```
|
|
55
|
+
#
|
|
56
|
+
# ### Next Steps
|
|
57
|
+
# - Read the [Google Cloud Speech API Product documentation][Product Documentation]
|
|
58
|
+
# to learn more about the product and see How-to Guides.
|
|
59
|
+
# - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
|
|
60
|
+
# to see the full list of Cloud APIs that we cover.
|
|
61
|
+
#
|
|
62
|
+
# [Product Documentation]: https://cloud.google.com/speech
|
|
63
|
+
#
|
|
64
|
+
#
|
|
65
|
+
module Speech
|
|
66
|
+
module V1
|
|
67
|
+
# rubocop:enable LineLength
|
|
68
|
+
|
|
69
|
+
##
|
|
70
|
+
# Service that implements Google Cloud Speech API.
|
|
71
|
+
#
|
|
72
|
+
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
|
73
|
+
# Provides the means for authenticating requests made by the client. This parameter can
|
|
74
|
+
# be many types.
|
|
75
|
+
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
|
76
|
+
# authenticating requests made by this client.
|
|
77
|
+
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
|
78
|
+
# credentials for this client.
|
|
79
|
+
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
|
80
|
+
# credentials for this client.
|
|
81
|
+
# A `GRPC::Core::Channel` will be used to make calls through.
|
|
82
|
+
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
|
83
|
+
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
|
84
|
+
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
|
85
|
+
# metadata for requests, generally, to give OAuth credentials.
|
|
86
|
+
# @param scopes [Array<String>]
|
|
87
|
+
# The OAuth scopes for this service. This parameter is ignored if
|
|
88
|
+
# an updater_proc is supplied.
|
|
89
|
+
# @param client_config [Hash]
|
|
90
|
+
# A Hash for call options for each method. See
|
|
91
|
+
# Google::Gax#construct_settings for the structure of
|
|
92
|
+
# this data. Falls back to the default config if not specified
|
|
93
|
+
# or the specified config is missing data points.
|
|
94
|
+
# @param timeout [Numeric]
|
|
95
|
+
# The default timeout, in seconds, for calls made through this client.
|
|
96
|
+
def self.new \
|
|
97
|
+
credentials: nil,
|
|
98
|
+
scopes: nil,
|
|
99
|
+
client_config: nil,
|
|
100
|
+
timeout: nil,
|
|
101
|
+
lib_name: nil,
|
|
102
|
+
lib_version: nil
|
|
103
|
+
kwargs = {
|
|
104
|
+
credentials: credentials,
|
|
105
|
+
scopes: scopes,
|
|
106
|
+
client_config: client_config,
|
|
107
|
+
timeout: timeout,
|
|
108
|
+
lib_name: lib_name,
|
|
109
|
+
lib_version: lib_version
|
|
110
|
+
}.select { |_, v| v != nil }
|
|
111
|
+
Google::Cloud::Speech::V1::SpeechClient.new(**kwargs)
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
8
8
|
# You may obtain a copy of the License at
|
|
9
9
|
#
|
|
10
|
-
#
|
|
10
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
11
11
|
#
|
|
12
12
|
# Unless required by applicable law or agreed to in writing, software
|
|
13
13
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2017
|
|
1
|
+
# Copyright 2017 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2017
|
|
1
|
+
# Copyright 2017 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2017
|
|
1
|
+
# Copyright 2017 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2017
|
|
1
|
+
# Copyright 2017 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2017
|
|
1
|
+
# Copyright 2017 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -28,8 +28,9 @@ module Google
|
|
|
28
28
|
# steps:
|
|
29
29
|
#
|
|
30
30
|
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
|
31
|
-
# 2. [Enable
|
|
32
|
-
# 3. [
|
|
31
|
+
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
|
32
|
+
# 3. [Enable the Google Cloud Speech API.](https://console.cloud.google.com/apis/api/speech)
|
|
33
|
+
# 4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
|
|
33
34
|
#
|
|
34
35
|
# ### Installation
|
|
35
36
|
# ```
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2017
|
|
1
|
+
# Copyright 2017 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -57,6 +57,10 @@ module Google
|
|
|
57
57
|
"https://www.googleapis.com/auth/cloud-platform"
|
|
58
58
|
].freeze
|
|
59
59
|
|
|
60
|
+
class OperationsClient < Google::Longrunning::OperationsClient
|
|
61
|
+
SERVICE_ADDRESS = SERVICE_ADDRESS
|
|
62
|
+
end
|
|
63
|
+
|
|
60
64
|
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
|
61
65
|
# Provides the means for authenticating requests made by the client. This parameter can
|
|
62
66
|
# be many types.
|
|
@@ -82,11 +86,6 @@ module Google
|
|
|
82
86
|
# @param timeout [Numeric]
|
|
83
87
|
# The default timeout, in seconds, for calls made through this client.
|
|
84
88
|
def initialize \
|
|
85
|
-
service_path: SERVICE_ADDRESS,
|
|
86
|
-
port: DEFAULT_SERVICE_PORT,
|
|
87
|
-
channel: nil,
|
|
88
|
-
chan_creds: nil,
|
|
89
|
-
updater_proc: nil,
|
|
90
89
|
credentials: nil,
|
|
91
90
|
scopes: ALL_SCOPES,
|
|
92
91
|
client_config: {},
|
|
@@ -99,21 +98,9 @@ module Google
|
|
|
99
98
|
require "google/gax/grpc"
|
|
100
99
|
require "google/cloud/speech/v1/cloud_speech_services_pb"
|
|
101
100
|
|
|
102
|
-
if channel || chan_creds || updater_proc
|
|
103
|
-
warn "The `channel`, `chan_creds`, and `updater_proc` parameters will be removed " \
|
|
104
|
-
"on 2017/09/08"
|
|
105
|
-
credentials ||= channel
|
|
106
|
-
credentials ||= chan_creds
|
|
107
|
-
credentials ||= updater_proc
|
|
108
|
-
end
|
|
109
|
-
if service_path != SERVICE_ADDRESS || port != DEFAULT_SERVICE_PORT
|
|
110
|
-
warn "`service_path` and `port` parameters are deprecated and will be removed"
|
|
111
|
-
end
|
|
112
|
-
|
|
113
101
|
credentials ||= Google::Cloud::Speech::Credentials.default
|
|
114
102
|
|
|
115
|
-
@operations_client =
|
|
116
|
-
service_path: service_path,
|
|
103
|
+
@operations_client = OperationsClient.new(
|
|
117
104
|
credentials: credentials,
|
|
118
105
|
scopes: scopes,
|
|
119
106
|
client_config: client_config,
|
|
@@ -138,9 +125,11 @@ module Google
|
|
|
138
125
|
updater_proc = credentials.updater_proc
|
|
139
126
|
end
|
|
140
127
|
|
|
128
|
+
package_version = Gem.loaded_specs['google-cloud-speech'].version.version
|
|
129
|
+
|
|
141
130
|
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
|
142
131
|
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
|
143
|
-
google_api_client << " gapic
|
|
132
|
+
google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
|
|
144
133
|
google_api_client << " grpc/#{GRPC::VERSION}"
|
|
145
134
|
google_api_client.freeze
|
|
146
135
|
|
|
@@ -159,6 +148,10 @@ module Google
|
|
|
159
148
|
kwargs: headers
|
|
160
149
|
)
|
|
161
150
|
end
|
|
151
|
+
|
|
152
|
+
# Allow overriding the service path/port in subclasses.
|
|
153
|
+
service_path = self.class::SERVICE_ADDRESS
|
|
154
|
+
port = self.class::DEFAULT_SERVICE_PORT
|
|
162
155
|
@speech_stub = Google::Gax::Grpc.create_stub(
|
|
163
156
|
service_path,
|
|
164
157
|
port,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Copyright 2016 Google
|
|
1
|
+
# Copyright 2016 Google LLC
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
5
5
|
# You may obtain a copy of the License at
|
|
6
6
|
#
|
|
7
|
-
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
#
|
|
9
9
|
# Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
module Google
|
|
17
17
|
module Cloud
|
|
18
18
|
module Speech
|
|
19
|
-
VERSION = "0.
|
|
19
|
+
VERSION = "0.28.0"
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google-cloud-speech
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.28.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mike Moore
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2017-
|
|
12
|
+
date: 2017-12-19 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: google-cloud-core
|
|
@@ -31,14 +31,14 @@ dependencies:
|
|
|
31
31
|
requirements:
|
|
32
32
|
- - "~>"
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
|
-
version: 0
|
|
34
|
+
version: '1.0'
|
|
35
35
|
type: :runtime
|
|
36
36
|
prerelease: false
|
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
|
38
38
|
requirements:
|
|
39
39
|
- - "~>"
|
|
40
40
|
- !ruby/object:Gem::Version
|
|
41
|
-
version: 0
|
|
41
|
+
version: '1.0'
|
|
42
42
|
- !ruby/object:Gem::Dependency
|
|
43
43
|
name: minitest
|
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
217
217
|
version: '0'
|
|
218
218
|
requirements: []
|
|
219
219
|
rubyforge_project:
|
|
220
|
-
rubygems_version: 2.7.
|
|
220
|
+
rubygems_version: 2.7.3
|
|
221
221
|
signing_key:
|
|
222
222
|
specification_version: 4
|
|
223
223
|
summary: API Client library for Google Cloud Speech API
|