google-cloud-speech-v1p1beta1 0.21.1 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85a08eda2a2512a895144f83a36f723b599d430dd33c43b7313dd6a86587ecc5
4
- data.tar.gz: 2b06431ba68c1785ba963a8c75538c12c6faf53efdb561b1c91425cad5e8debb
3
+ metadata.gz: 38cb906a36d469f72788165d8cfb92b4fff54b048f77f53c6a38f678d3935a74
4
+ data.tar.gz: 70a9b2b4048e1a0c13c1256bd372289b61cbef1e1b59e64790a4c5104e216802
5
5
  SHA512:
6
- metadata.gz: 7659f054c69214e5b58fa314cd9971616b4330cdea68e51714a8e0f80204230e728edec6d338d2639d9294b5ef6326e3ba8cff07e92ee6f220e8928feb99fd62
7
- data.tar.gz: b64a7486095c14f9ff7cb78e59a6e3dc95479ab15e9459e2a5fbd515cae60854302294656704889120b5a227fc597b5340ced2500dbf3c38178a581e09fc00f1
6
+ metadata.gz: 51e4586035ad05a592ac8d4bfd53440e6584411d42fc016aa053057bf3d161b7c5093dae8ddcc0fa19512c142f57a98d65fa88378660a4c6d83b7c19d4b78a4d
7
+ data.tar.gz: 35553ce9f1dce9accd7f2a82937b796c6b82f7de9ddc07c1e38be23761fd5fb0c3536576a86f75e88338468151773e8c7c019d5099ebe3c9b8ee4a4c3dc43636
data/README.md CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/speech-to-text)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/speech/v1p1beta1"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
86
 
77
87
  ## Supported Ruby Versions
78
88
 
79
- This library is supported on Ruby 2.7+.
89
+ This library is supported on Ruby 3.0+.
80
90
 
81
91
  Google provides official support for Ruby versions that are actively supported
82
92
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -157,8 +157,28 @@ module Google
157
157
  universe_domain: @config.universe_domain,
158
158
  channel_args: @config.channel_args,
159
159
  interceptors: @config.interceptors,
160
- channel_pool_config: @config.channel_pool
160
+ channel_pool_config: @config.channel_pool,
161
+ logger: @config.logger
161
162
  )
163
+
164
+ @adaptation_stub.stub_logger&.info do |entry|
165
+ entry.set_system_name
166
+ entry.set_service
167
+ entry.message = "Created client for #{entry.service}"
168
+ entry.set_credentials_fields credentials
169
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
170
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
171
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
172
+ end
173
+ end
174
+
175
+ ##
176
+ # The logger used for request/response debug logging.
177
+ #
178
+ # @return [Logger]
179
+ #
180
+ def logger
181
+ @adaptation_stub.logger
162
182
  end
163
183
 
164
184
  # Service calls
@@ -262,7 +282,6 @@ module Google
262
282
 
263
283
  @adaptation_stub.call_rpc :create_phrase_set, request, options: options do |response, operation|
264
284
  yield response, operation if block_given?
265
- return response
266
285
  end
267
286
  rescue ::GRPC::BadStatus => e
268
287
  raise ::Google::Cloud::Error.from_error(e)
@@ -356,7 +375,6 @@ module Google
356
375
 
357
376
  @adaptation_stub.call_rpc :get_phrase_set, request, options: options do |response, operation|
358
377
  yield response, operation if block_given?
359
- return response
360
378
  end
361
379
  rescue ::GRPC::BadStatus => e
362
380
  raise ::Google::Cloud::Error.from_error(e)
@@ -466,7 +484,7 @@ module Google
466
484
  @adaptation_stub.call_rpc :list_phrase_set, request, options: options do |response, operation|
467
485
  response = ::Gapic::PagedEnumerable.new @adaptation_stub, :list_phrase_set, request, response, operation, options
468
486
  yield response, operation if block_given?
469
- return response
487
+ throw :response, response
470
488
  end
471
489
  rescue ::GRPC::BadStatus => e
472
490
  raise ::Google::Cloud::Error.from_error(e)
@@ -565,7 +583,6 @@ module Google
565
583
 
566
584
  @adaptation_stub.call_rpc :update_phrase_set, request, options: options do |response, operation|
567
585
  yield response, operation if block_given?
568
- return response
569
586
  end
570
587
  rescue ::GRPC::BadStatus => e
571
588
  raise ::Google::Cloud::Error.from_error(e)
@@ -653,7 +670,6 @@ module Google
653
670
 
654
671
  @adaptation_stub.call_rpc :delete_phrase_set, request, options: options do |response, operation|
655
672
  yield response, operation if block_given?
656
- return response
657
673
  end
658
674
  rescue ::GRPC::BadStatus => e
659
675
  raise ::Google::Cloud::Error.from_error(e)
@@ -756,7 +772,6 @@ module Google
756
772
 
757
773
  @adaptation_stub.call_rpc :create_custom_class, request, options: options do |response, operation|
758
774
  yield response, operation if block_given?
759
- return response
760
775
  end
761
776
  rescue ::GRPC::BadStatus => e
762
777
  raise ::Google::Cloud::Error.from_error(e)
@@ -844,7 +859,6 @@ module Google
844
859
 
845
860
  @adaptation_stub.call_rpc :get_custom_class, request, options: options do |response, operation|
846
861
  yield response, operation if block_given?
847
- return response
848
862
  end
849
863
  rescue ::GRPC::BadStatus => e
850
864
  raise ::Google::Cloud::Error.from_error(e)
@@ -954,7 +968,7 @@ module Google
954
968
  @adaptation_stub.call_rpc :list_custom_classes, request, options: options do |response, operation|
955
969
  response = ::Gapic::PagedEnumerable.new @adaptation_stub, :list_custom_classes, request, response, operation, options
956
970
  yield response, operation if block_given?
957
- return response
971
+ throw :response, response
958
972
  end
959
973
  rescue ::GRPC::BadStatus => e
960
974
  raise ::Google::Cloud::Error.from_error(e)
@@ -1053,7 +1067,6 @@ module Google
1053
1067
 
1054
1068
  @adaptation_stub.call_rpc :update_custom_class, request, options: options do |response, operation|
1055
1069
  yield response, operation if block_given?
1056
- return response
1057
1070
  end
1058
1071
  rescue ::GRPC::BadStatus => e
1059
1072
  raise ::Google::Cloud::Error.from_error(e)
@@ -1147,7 +1160,6 @@ module Google
1147
1160
 
1148
1161
  @adaptation_stub.call_rpc :delete_custom_class, request, options: options do |response, operation|
1149
1162
  yield response, operation if block_given?
1150
- return response
1151
1163
  end
1152
1164
  rescue ::GRPC::BadStatus => e
1153
1165
  raise ::Google::Cloud::Error.from_error(e)
@@ -1197,6 +1209,13 @@ module Google
1197
1209
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1198
1210
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1199
1211
  # * (`nil`) indicating no credentials
1212
+ #
1213
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1214
+ # external source for authentication to Google Cloud, you must validate it before
1215
+ # providing it to a Google API client library. Providing an unvalidated credential
1216
+ # configuration to Google APIs can compromise the security of your systems and data.
1217
+ # For more information, refer to [Validate credential configurations from external
1218
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1200
1219
  # @return [::Object]
1201
1220
  # @!attribute [rw] scope
1202
1221
  # The OAuth scopes
@@ -1236,6 +1255,11 @@ module Google
1236
1255
  # default endpoint URL. The default value of nil uses the environment
1237
1256
  # universe (usually the default "googleapis.com" universe).
1238
1257
  # @return [::String,nil]
1258
+ # @!attribute [rw] logger
1259
+ # A custom logger to use for request/response debug logging, or the value
1260
+ # `:default` (the default) to construct a default logger, or `nil` to
1261
+ # explicitly disable logging.
1262
+ # @return [::Logger,:default,nil]
1239
1263
  #
1240
1264
  class Configuration
1241
1265
  extend ::Gapic::Config
@@ -1260,6 +1284,7 @@ module Google
1260
1284
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1261
1285
  config_attr :quota_project, nil, ::String, nil
1262
1286
  config_attr :universe_domain, nil, ::String, nil
1287
+ config_attr :logger, :default, ::Logger, nil, :default
1263
1288
 
1264
1289
  # @private
1265
1290
  def initialize parent_config = nil
@@ -150,8 +150,28 @@ module Google
150
150
  endpoint: @config.endpoint,
151
151
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
152
152
  universe_domain: @config.universe_domain,
153
- credentials: credentials
153
+ credentials: credentials,
154
+ logger: @config.logger
154
155
  )
156
+
157
+ @adaptation_stub.logger(stub: true)&.info do |entry|
158
+ entry.set_system_name
159
+ entry.set_service
160
+ entry.message = "Created client for #{entry.service}"
161
+ entry.set_credentials_fields credentials
162
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
163
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
164
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
165
+ end
166
+ end
167
+
168
+ ##
169
+ # The logger used for request/response debug logging.
170
+ #
171
+ # @return [Logger]
172
+ #
173
+ def logger
174
+ @adaptation_stub.logger
155
175
  end
156
176
 
157
177
  # Service calls
@@ -248,7 +268,6 @@ module Google
248
268
 
249
269
  @adaptation_stub.create_phrase_set request, options do |result, operation|
250
270
  yield result, operation if block_given?
251
- return result
252
271
  end
253
272
  rescue ::Gapic::Rest::Error => e
254
273
  raise ::Google::Cloud::Error.from_error(e)
@@ -335,7 +354,6 @@ module Google
335
354
 
336
355
  @adaptation_stub.get_phrase_set request, options do |result, operation|
337
356
  yield result, operation if block_given?
338
- return result
339
357
  end
340
358
  rescue ::Gapic::Rest::Error => e
341
359
  raise ::Google::Cloud::Error.from_error(e)
@@ -438,7 +456,7 @@ module Google
438
456
  @adaptation_stub.list_phrase_set request, options do |result, operation|
439
457
  result = ::Gapic::Rest::PagedEnumerable.new @adaptation_stub, :list_phrase_set, "phrase_sets", request, result, options
440
458
  yield result, operation if block_given?
441
- return result
459
+ throw :response, result
442
460
  end
443
461
  rescue ::Gapic::Rest::Error => e
444
462
  raise ::Google::Cloud::Error.from_error(e)
@@ -530,7 +548,6 @@ module Google
530
548
 
531
549
  @adaptation_stub.update_phrase_set request, options do |result, operation|
532
550
  yield result, operation if block_given?
533
- return result
534
551
  end
535
552
  rescue ::Gapic::Rest::Error => e
536
553
  raise ::Google::Cloud::Error.from_error(e)
@@ -611,7 +628,6 @@ module Google
611
628
 
612
629
  @adaptation_stub.delete_phrase_set request, options do |result, operation|
613
630
  yield result, operation if block_given?
614
- return result
615
631
  end
616
632
  rescue ::Gapic::Rest::Error => e
617
633
  raise ::Google::Cloud::Error.from_error(e)
@@ -707,7 +723,6 @@ module Google
707
723
 
708
724
  @adaptation_stub.create_custom_class request, options do |result, operation|
709
725
  yield result, operation if block_given?
710
- return result
711
726
  end
712
727
  rescue ::Gapic::Rest::Error => e
713
728
  raise ::Google::Cloud::Error.from_error(e)
@@ -788,7 +803,6 @@ module Google
788
803
 
789
804
  @adaptation_stub.get_custom_class request, options do |result, operation|
790
805
  yield result, operation if block_given?
791
- return result
792
806
  end
793
807
  rescue ::Gapic::Rest::Error => e
794
808
  raise ::Google::Cloud::Error.from_error(e)
@@ -891,7 +905,7 @@ module Google
891
905
  @adaptation_stub.list_custom_classes request, options do |result, operation|
892
906
  result = ::Gapic::Rest::PagedEnumerable.new @adaptation_stub, :list_custom_classes, "custom_classes", request, result, options
893
907
  yield result, operation if block_given?
894
- return result
908
+ throw :response, result
895
909
  end
896
910
  rescue ::Gapic::Rest::Error => e
897
911
  raise ::Google::Cloud::Error.from_error(e)
@@ -983,7 +997,6 @@ module Google
983
997
 
984
998
  @adaptation_stub.update_custom_class request, options do |result, operation|
985
999
  yield result, operation if block_given?
986
- return result
987
1000
  end
988
1001
  rescue ::Gapic::Rest::Error => e
989
1002
  raise ::Google::Cloud::Error.from_error(e)
@@ -1070,7 +1083,6 @@ module Google
1070
1083
 
1071
1084
  @adaptation_stub.delete_custom_class request, options do |result, operation|
1072
1085
  yield result, operation if block_given?
1073
- return result
1074
1086
  end
1075
1087
  rescue ::Gapic::Rest::Error => e
1076
1088
  raise ::Google::Cloud::Error.from_error(e)
@@ -1118,6 +1130,13 @@ module Google
1118
1130
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1119
1131
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1120
1132
  # * (`nil`) indicating no credentials
1133
+ #
1134
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1135
+ # external source for authentication to Google Cloud, you must validate it before
1136
+ # providing it to a Google API client library. Providing an unvalidated credential
1137
+ # configuration to Google APIs can compromise the security of your systems and data.
1138
+ # For more information, refer to [Validate credential configurations from external
1139
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1121
1140
  # @return [::Object]
1122
1141
  # @!attribute [rw] scope
1123
1142
  # The OAuth scopes
@@ -1150,6 +1169,11 @@ module Google
1150
1169
  # default endpoint URL. The default value of nil uses the environment
1151
1170
  # universe (usually the default "googleapis.com" universe).
1152
1171
  # @return [::String,nil]
1172
+ # @!attribute [rw] logger
1173
+ # A custom logger to use for request/response debug logging, or the value
1174
+ # `:default` (the default) to construct a default logger, or `nil` to
1175
+ # explicitly disable logging.
1176
+ # @return [::Logger,:default,nil]
1153
1177
  #
1154
1178
  class Configuration
1155
1179
  extend ::Gapic::Config
@@ -1171,6 +1195,7 @@ module Google
1171
1195
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1172
1196
  config_attr :quota_project, nil, ::String, nil
1173
1197
  config_attr :universe_domain, nil, ::String, nil
1198
+ config_attr :logger, :default, ::Logger, nil, :default
1174
1199
 
1175
1200
  # @private
1176
1201
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the create_phrase_set REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "create_phrase_set",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "get_phrase_set",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "list_phrase_set",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "update_phrase_set",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::Speech::V1p1beta1::PhraseSet.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "delete_phrase_set",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -277,16 +299,18 @@ module Google
277
299
 
278
300
  response = @client_stub.make_http_request(
279
301
  verb,
280
- uri: uri,
281
- body: body || "",
282
- params: query_string_params,
302
+ uri: uri,
303
+ body: body || "",
304
+ params: query_string_params,
305
+ method_name: "create_custom_class",
283
306
  options: options
284
307
  )
285
308
  operation = ::Gapic::Rest::TransportOperation.new response
286
309
  result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.decode_json response.body, ignore_unknown_fields: true
287
-
288
- yield result, operation if block_given?
289
- result
310
+ catch :response do
311
+ yield result, operation if block_given?
312
+ result
313
+ end
290
314
  end
291
315
 
292
316
  ##
@@ -315,16 +339,18 @@ module Google
315
339
 
316
340
  response = @client_stub.make_http_request(
317
341
  verb,
318
- uri: uri,
319
- body: body || "",
320
- params: query_string_params,
342
+ uri: uri,
343
+ body: body || "",
344
+ params: query_string_params,
345
+ method_name: "get_custom_class",
321
346
  options: options
322
347
  )
323
348
  operation = ::Gapic::Rest::TransportOperation.new response
324
349
  result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.decode_json response.body, ignore_unknown_fields: true
325
-
326
- yield result, operation if block_given?
327
- result
350
+ catch :response do
351
+ yield result, operation if block_given?
352
+ result
353
+ end
328
354
  end
329
355
 
330
356
  ##
@@ -353,16 +379,18 @@ module Google
353
379
 
354
380
  response = @client_stub.make_http_request(
355
381
  verb,
356
- uri: uri,
357
- body: body || "",
358
- params: query_string_params,
382
+ uri: uri,
383
+ body: body || "",
384
+ params: query_string_params,
385
+ method_name: "list_custom_classes",
359
386
  options: options
360
387
  )
361
388
  operation = ::Gapic::Rest::TransportOperation.new response
362
389
  result = ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse.decode_json response.body, ignore_unknown_fields: true
363
-
364
- yield result, operation if block_given?
365
- result
390
+ catch :response do
391
+ yield result, operation if block_given?
392
+ result
393
+ end
366
394
  end
367
395
 
368
396
  ##
@@ -391,16 +419,18 @@ module Google
391
419
 
392
420
  response = @client_stub.make_http_request(
393
421
  verb,
394
- uri: uri,
395
- body: body || "",
396
- params: query_string_params,
422
+ uri: uri,
423
+ body: body || "",
424
+ params: query_string_params,
425
+ method_name: "update_custom_class",
397
426
  options: options
398
427
  )
399
428
  operation = ::Gapic::Rest::TransportOperation.new response
400
429
  result = ::Google::Cloud::Speech::V1p1beta1::CustomClass.decode_json response.body, ignore_unknown_fields: true
401
-
402
- yield result, operation if block_given?
403
- result
430
+ catch :response do
431
+ yield result, operation if block_given?
432
+ result
433
+ end
404
434
  end
405
435
 
406
436
  ##
@@ -429,16 +459,18 @@ module Google
429
459
 
430
460
  response = @client_stub.make_http_request(
431
461
  verb,
432
- uri: uri,
433
- body: body || "",
434
- params: query_string_params,
462
+ uri: uri,
463
+ body: body || "",
464
+ params: query_string_params,
465
+ method_name: "delete_custom_class",
435
466
  options: options
436
467
  )
437
468
  operation = ::Gapic::Rest::TransportOperation.new response
438
469
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
439
-
440
- yield result, operation if block_given?
441
- result
470
+ catch :response do
471
+ yield result, operation if block_given?
472
+ result
473
+ end
442
474
  end
443
475
 
444
476
  ##