google-cloud-speech-v1p1beta1 0.9.2 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/speech/v1p1beta1/adaptation/client.rb +273 -78
- data/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb.rb +2 -2
- data/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_services_pb.rb +1 -1
- data/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb +6 -2
- data/lib/google/cloud/speech/v1p1beta1/cloud_speech_services_pb.rb +1 -1
- data/lib/google/cloud/speech/v1p1beta1/resource_pb.rb +13 -2
- data/lib/google/cloud/speech/v1p1beta1/speech/client.rb +99 -39
- data/lib/google/cloud/speech/v1p1beta1/speech/operations.rb +145 -33
- data/lib/google/cloud/speech/v1p1beta1/version.rb +1 -1
- data/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb +16 -0
- data/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.rb +2 -2
- data/proto_docs/google/cloud/speech/v1p1beta1/resource.rb +30 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6c494ab22862d39805ed177dc3f2bbcbb3673768d7b56b00b0b752b393e40cc
|
4
|
+
data.tar.gz: 5774cafe56f7a7a64941030510ca4f529ff07d75107c41d2fc4b2bad1f011ce2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ad87b5a2ee943e592caa93aa39275c64b66a9d6952bc3a5dc5db8a8fe2f5fdc14843d30e766982f2a7f2be450980db7f2523eae77a3f1045dee5d9841c44977
|
7
|
+
data.tar.gz: 663ecfdf1bae5c988c74d33789af3fa577b6fa266ed0e8d1e32cfd7118d2bc7ef8080c38f77a559fdf78e9fd33d9c67741d712038ae70c4e1fec35f352bef3d5
|
@@ -41,13 +41,12 @@ module Google
|
|
41
41
|
# See {::Google::Cloud::Speech::V1p1beta1::Adaptation::Client::Configuration}
|
42
42
|
# for a description of the configuration fields.
|
43
43
|
#
|
44
|
-
#
|
44
|
+
# @example
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# end
|
46
|
+
# # Modify the configuration for all Adaptation clients
|
47
|
+
# ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
51
50
|
#
|
52
51
|
# @yield [config] Configure the Client client.
|
53
52
|
# @yieldparam config [Client::Configuration]
|
@@ -94,19 +93,15 @@ module Google
|
|
94
93
|
##
|
95
94
|
# Create a new Adaptation client object.
|
96
95
|
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
# To create a new Adaptation client with the default
|
100
|
-
# configuration:
|
101
|
-
#
|
102
|
-
# client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
96
|
+
# @example
|
103
97
|
#
|
104
|
-
#
|
105
|
-
#
|
98
|
+
# # Create a client using the default configuration
|
99
|
+
# client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
106
100
|
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
101
|
+
# # Create a client using a custom configuration
|
102
|
+
# client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config|
|
103
|
+
# config.timeout = 10.0
|
104
|
+
# end
|
110
105
|
#
|
111
106
|
# @yield [config] Configure the Adaptation client.
|
112
107
|
# @yieldparam config [Client::Configuration]
|
@@ -126,10 +121,9 @@ module Google
|
|
126
121
|
|
127
122
|
# Create credentials
|
128
123
|
credentials = @config.credentials
|
129
|
-
# Use self-signed JWT if the
|
124
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
130
125
|
# but only if the default endpoint does not have a region prefix.
|
131
|
-
enable_self_signed_jwt = @config.
|
132
|
-
@config.endpoint == Client.configure.endpoint &&
|
126
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
133
127
|
!@config.endpoint.split(".").first.include?("-")
|
134
128
|
credentials ||= Credentials.default scope: @config.scope,
|
135
129
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -175,7 +169,7 @@ module Google
|
|
175
169
|
# Format:
|
176
170
|
# \\{api_version}/projects/\\{project}/locations/\\{location}/phraseSets
|
177
171
|
# @param phrase_set_id [::String]
|
178
|
-
# The ID to use for the phrase set, which will become the final
|
172
|
+
# Required. The ID to use for the phrase set, which will become the final
|
179
173
|
# component of the phrase set's resource name.
|
180
174
|
#
|
181
175
|
# This value should be 4-63 characters, and valid characters
|
@@ -191,6 +185,21 @@ module Google
|
|
191
185
|
#
|
192
186
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
193
187
|
#
|
188
|
+
# @example Basic example
|
189
|
+
# require "google/cloud/speech/v1p1beta1"
|
190
|
+
#
|
191
|
+
# # Create a client object. The client can be reused for multiple calls.
|
192
|
+
# client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
193
|
+
#
|
194
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
195
|
+
# request = Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new
|
196
|
+
#
|
197
|
+
# # Call the create_phrase_set method.
|
198
|
+
# result = client.create_phrase_set request
|
199
|
+
#
|
200
|
+
# # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet.
|
201
|
+
# p result
|
202
|
+
#
|
194
203
|
def create_phrase_set request, options = nil
|
195
204
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
196
205
|
|
@@ -208,16 +217,20 @@ module Google
|
|
208
217
|
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
|
209
218
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
210
219
|
|
211
|
-
header_params = {
|
212
|
-
|
213
|
-
|
220
|
+
header_params = {}
|
221
|
+
if request.parent
|
222
|
+
header_params["parent"] = request.parent
|
223
|
+
end
|
224
|
+
|
214
225
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
215
226
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
216
227
|
|
217
228
|
options.apply_defaults timeout: @config.rpcs.create_phrase_set.timeout,
|
218
229
|
metadata: metadata,
|
219
230
|
retry_policy: @config.rpcs.create_phrase_set.retry_policy
|
220
|
-
|
231
|
+
|
232
|
+
options.apply_defaults timeout: @config.timeout,
|
233
|
+
metadata: @config.metadata,
|
221
234
|
retry_policy: @config.retry_policy
|
222
235
|
|
223
236
|
@adaptation_stub.call_rpc :create_phrase_set, request, options: options do |response, operation|
|
@@ -259,6 +272,21 @@ module Google
|
|
259
272
|
#
|
260
273
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
261
274
|
#
|
275
|
+
# @example Basic example
|
276
|
+
# require "google/cloud/speech/v1p1beta1"
|
277
|
+
#
|
278
|
+
# # Create a client object. The client can be reused for multiple calls.
|
279
|
+
# client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
280
|
+
#
|
281
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
282
|
+
# request = Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new
|
283
|
+
#
|
284
|
+
# # Call the get_phrase_set method.
|
285
|
+
# result = client.get_phrase_set request
|
286
|
+
#
|
287
|
+
# # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet.
|
288
|
+
# p result
|
289
|
+
#
|
262
290
|
def get_phrase_set request, options = nil
|
263
291
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
264
292
|
|
@@ -276,16 +304,20 @@ module Google
|
|
276
304
|
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
|
277
305
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
278
306
|
|
279
|
-
header_params = {
|
280
|
-
|
281
|
-
|
307
|
+
header_params = {}
|
308
|
+
if request.name
|
309
|
+
header_params["name"] = request.name
|
310
|
+
end
|
311
|
+
|
282
312
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
283
313
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
284
314
|
|
285
315
|
options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout,
|
286
316
|
metadata: metadata,
|
287
317
|
retry_policy: @config.rpcs.get_phrase_set.retry_policy
|
288
|
-
|
318
|
+
|
319
|
+
options.apply_defaults timeout: @config.timeout,
|
320
|
+
metadata: @config.metadata,
|
289
321
|
retry_policy: @config.retry_policy
|
290
322
|
|
291
323
|
@adaptation_stub.call_rpc :get_phrase_set, request, options: options do |response, operation|
|
@@ -338,6 +370,27 @@ module Google
|
|
338
370
|
#
|
339
371
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
340
372
|
#
|
373
|
+
# @example Basic example
|
374
|
+
# require "google/cloud/speech/v1p1beta1"
|
375
|
+
#
|
376
|
+
# # Create a client object. The client can be reused for multiple calls.
|
377
|
+
# client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
378
|
+
#
|
379
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
380
|
+
# request = Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.new
|
381
|
+
#
|
382
|
+
# # Call the list_phrase_set method.
|
383
|
+
# result = client.list_phrase_set request
|
384
|
+
#
|
385
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
386
|
+
# # iterate over all elements by calling #each, and the enumerable
|
387
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
388
|
+
# # methods are also available for managing paging directly.
|
389
|
+
# result.each do |response|
|
390
|
+
# # Each element is of type ::Google::Cloud::Speech::V1p1beta1::PhraseSet.
|
391
|
+
# p response
|
392
|
+
# end
|
393
|
+
#
|
341
394
|
def list_phrase_set request, options = nil
|
342
395
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
343
396
|
|
@@ -355,16 +408,20 @@ module Google
|
|
355
408
|
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
|
356
409
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
357
410
|
|
358
|
-
header_params = {
|
359
|
-
|
360
|
-
|
411
|
+
header_params = {}
|
412
|
+
if request.parent
|
413
|
+
header_params["parent"] = request.parent
|
414
|
+
end
|
415
|
+
|
361
416
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
362
417
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
363
418
|
|
364
419
|
options.apply_defaults timeout: @config.rpcs.list_phrase_set.timeout,
|
365
420
|
metadata: metadata,
|
366
421
|
retry_policy: @config.rpcs.list_phrase_set.retry_policy
|
367
|
-
|
422
|
+
|
423
|
+
options.apply_defaults timeout: @config.timeout,
|
424
|
+
metadata: @config.metadata,
|
368
425
|
retry_policy: @config.retry_policy
|
369
426
|
|
370
427
|
@adaptation_stub.call_rpc :list_phrase_set, request, options: options do |response, operation|
|
@@ -411,6 +468,21 @@ module Google
|
|
411
468
|
#
|
412
469
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
413
470
|
#
|
471
|
+
# @example Basic example
|
472
|
+
# require "google/cloud/speech/v1p1beta1"
|
473
|
+
#
|
474
|
+
# # Create a client object. The client can be reused for multiple calls.
|
475
|
+
# client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
476
|
+
#
|
477
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
478
|
+
# request = Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new
|
479
|
+
#
|
480
|
+
# # Call the update_phrase_set method.
|
481
|
+
# result = client.update_phrase_set request
|
482
|
+
#
|
483
|
+
# # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet.
|
484
|
+
# p result
|
485
|
+
#
|
414
486
|
def update_phrase_set request, options = nil
|
415
487
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
416
488
|
|
@@ -428,16 +500,20 @@ module Google
|
|
428
500
|
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
|
429
501
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
430
502
|
|
431
|
-
header_params = {
|
432
|
-
|
433
|
-
|
503
|
+
header_params = {}
|
504
|
+
if request.phrase_set&.name
|
505
|
+
header_params["phrase_set.name"] = request.phrase_set.name
|
506
|
+
end
|
507
|
+
|
434
508
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
435
509
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
436
510
|
|
437
511
|
options.apply_defaults timeout: @config.rpcs.update_phrase_set.timeout,
|
438
512
|
metadata: metadata,
|
439
513
|
retry_policy: @config.rpcs.update_phrase_set.retry_policy
|
440
|
-
|
514
|
+
|
515
|
+
options.apply_defaults timeout: @config.timeout,
|
516
|
+
metadata: @config.metadata,
|
441
517
|
retry_policy: @config.retry_policy
|
442
518
|
|
443
519
|
@adaptation_stub.call_rpc :update_phrase_set, request, options: options do |response, operation|
|
@@ -479,6 +555,21 @@ module Google
|
|
479
555
|
#
|
480
556
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
481
557
|
#
|
558
|
+
# @example Basic example
|
559
|
+
# require "google/cloud/speech/v1p1beta1"
|
560
|
+
#
|
561
|
+
# # Create a client object. The client can be reused for multiple calls.
|
562
|
+
# client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
563
|
+
#
|
564
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
565
|
+
# request = Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new
|
566
|
+
#
|
567
|
+
# # Call the delete_phrase_set method.
|
568
|
+
# result = client.delete_phrase_set request
|
569
|
+
#
|
570
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
571
|
+
# p result
|
572
|
+
#
|
482
573
|
def delete_phrase_set request, options = nil
|
483
574
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
484
575
|
|
@@ -496,16 +587,20 @@ module Google
|
|
496
587
|
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
|
497
588
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
498
589
|
|
499
|
-
header_params = {
|
500
|
-
|
501
|
-
|
590
|
+
header_params = {}
|
591
|
+
if request.name
|
592
|
+
header_params["name"] = request.name
|
593
|
+
end
|
594
|
+
|
502
595
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
503
596
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
504
597
|
|
505
598
|
options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout,
|
506
599
|
metadata: metadata,
|
507
600
|
retry_policy: @config.rpcs.delete_phrase_set.retry_policy
|
508
|
-
|
601
|
+
|
602
|
+
options.apply_defaults timeout: @config.timeout,
|
603
|
+
metadata: @config.metadata,
|
509
604
|
retry_policy: @config.retry_policy
|
510
605
|
|
511
606
|
@adaptation_stub.call_rpc :delete_phrase_set, request, options: options do |response, operation|
|
@@ -539,7 +634,7 @@ module Google
|
|
539
634
|
# Format:
|
540
635
|
# \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses
|
541
636
|
# @param custom_class_id [::String]
|
542
|
-
# The ID to use for the custom class, which will become the final
|
637
|
+
# Required. The ID to use for the custom class, which will become the final
|
543
638
|
# component of the custom class' resource name.
|
544
639
|
#
|
545
640
|
# This value should be 4-63 characters, and valid characters
|
@@ -555,6 +650,21 @@ module Google
|
|
555
650
|
#
|
556
651
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
557
652
|
#
|
653
|
+
# @example Basic example
|
654
|
+
# require "google/cloud/speech/v1p1beta1"
|
655
|
+
#
|
656
|
+
# # Create a client object. The client can be reused for multiple calls.
|
657
|
+
# client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
658
|
+
#
|
659
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
660
|
+
# request = Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new
|
661
|
+
#
|
662
|
+
# # Call the create_custom_class method.
|
663
|
+
# result = client.create_custom_class request
|
664
|
+
#
|
665
|
+
# # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass.
|
666
|
+
# p result
|
667
|
+
#
|
558
668
|
def create_custom_class request, options = nil
|
559
669
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
560
670
|
|
@@ -572,16 +682,20 @@ module Google
|
|
572
682
|
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
|
573
683
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
574
684
|
|
575
|
-
header_params = {
|
576
|
-
|
577
|
-
|
685
|
+
header_params = {}
|
686
|
+
if request.parent
|
687
|
+
header_params["parent"] = request.parent
|
688
|
+
end
|
689
|
+
|
578
690
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
579
691
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
580
692
|
|
581
693
|
options.apply_defaults timeout: @config.rpcs.create_custom_class.timeout,
|
582
694
|
metadata: metadata,
|
583
695
|
retry_policy: @config.rpcs.create_custom_class.retry_policy
|
584
|
-
|
696
|
+
|
697
|
+
options.apply_defaults timeout: @config.timeout,
|
698
|
+
metadata: @config.metadata,
|
585
699
|
retry_policy: @config.retry_policy
|
586
700
|
|
587
701
|
@adaptation_stub.call_rpc :create_custom_class, request, options: options do |response, operation|
|
@@ -623,6 +737,21 @@ module Google
|
|
623
737
|
#
|
624
738
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
625
739
|
#
|
740
|
+
# @example Basic example
|
741
|
+
# require "google/cloud/speech/v1p1beta1"
|
742
|
+
#
|
743
|
+
# # Create a client object. The client can be reused for multiple calls.
|
744
|
+
# client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
745
|
+
#
|
746
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
747
|
+
# request = Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new
|
748
|
+
#
|
749
|
+
# # Call the get_custom_class method.
|
750
|
+
# result = client.get_custom_class request
|
751
|
+
#
|
752
|
+
# # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass.
|
753
|
+
# p result
|
754
|
+
#
|
626
755
|
def get_custom_class request, options = nil
|
627
756
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
628
757
|
|
@@ -640,16 +769,20 @@ module Google
|
|
640
769
|
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
|
641
770
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
642
771
|
|
643
|
-
header_params = {
|
644
|
-
|
645
|
-
|
772
|
+
header_params = {}
|
773
|
+
if request.name
|
774
|
+
header_params["name"] = request.name
|
775
|
+
end
|
776
|
+
|
646
777
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
647
778
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
648
779
|
|
649
780
|
options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout,
|
650
781
|
metadata: metadata,
|
651
782
|
retry_policy: @config.rpcs.get_custom_class.retry_policy
|
652
|
-
|
783
|
+
|
784
|
+
options.apply_defaults timeout: @config.timeout,
|
785
|
+
metadata: @config.metadata,
|
653
786
|
retry_policy: @config.retry_policy
|
654
787
|
|
655
788
|
@adaptation_stub.call_rpc :get_custom_class, request, options: options do |response, operation|
|
@@ -702,6 +835,27 @@ module Google
|
|
702
835
|
#
|
703
836
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
704
837
|
#
|
838
|
+
# @example Basic example
|
839
|
+
# require "google/cloud/speech/v1p1beta1"
|
840
|
+
#
|
841
|
+
# # Create a client object. The client can be reused for multiple calls.
|
842
|
+
# client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
843
|
+
#
|
844
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
845
|
+
# request = Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.new
|
846
|
+
#
|
847
|
+
# # Call the list_custom_classes method.
|
848
|
+
# result = client.list_custom_classes request
|
849
|
+
#
|
850
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
851
|
+
# # iterate over all elements by calling #each, and the enumerable
|
852
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
853
|
+
# # methods are also available for managing paging directly.
|
854
|
+
# result.each do |response|
|
855
|
+
# # Each element is of type ::Google::Cloud::Speech::V1p1beta1::CustomClass.
|
856
|
+
# p response
|
857
|
+
# end
|
858
|
+
#
|
705
859
|
def list_custom_classes request, options = nil
|
706
860
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
707
861
|
|
@@ -719,16 +873,20 @@ module Google
|
|
719
873
|
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
|
720
874
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
721
875
|
|
722
|
-
header_params = {
|
723
|
-
|
724
|
-
|
876
|
+
header_params = {}
|
877
|
+
if request.parent
|
878
|
+
header_params["parent"] = request.parent
|
879
|
+
end
|
880
|
+
|
725
881
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
726
882
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
727
883
|
|
728
884
|
options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout,
|
729
885
|
metadata: metadata,
|
730
886
|
retry_policy: @config.rpcs.list_custom_classes.retry_policy
|
731
|
-
|
887
|
+
|
888
|
+
options.apply_defaults timeout: @config.timeout,
|
889
|
+
metadata: @config.metadata,
|
732
890
|
retry_policy: @config.retry_policy
|
733
891
|
|
734
892
|
@adaptation_stub.call_rpc :list_custom_classes, request, options: options do |response, operation|
|
@@ -775,6 +933,21 @@ module Google
|
|
775
933
|
#
|
776
934
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
777
935
|
#
|
936
|
+
# @example Basic example
|
937
|
+
# require "google/cloud/speech/v1p1beta1"
|
938
|
+
#
|
939
|
+
# # Create a client object. The client can be reused for multiple calls.
|
940
|
+
# client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
941
|
+
#
|
942
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
943
|
+
# request = Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new
|
944
|
+
#
|
945
|
+
# # Call the update_custom_class method.
|
946
|
+
# result = client.update_custom_class request
|
947
|
+
#
|
948
|
+
# # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass.
|
949
|
+
# p result
|
950
|
+
#
|
778
951
|
def update_custom_class request, options = nil
|
779
952
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
780
953
|
|
@@ -792,16 +965,20 @@ module Google
|
|
792
965
|
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
|
793
966
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
794
967
|
|
795
|
-
header_params = {
|
796
|
-
|
797
|
-
|
968
|
+
header_params = {}
|
969
|
+
if request.custom_class&.name
|
970
|
+
header_params["custom_class.name"] = request.custom_class.name
|
971
|
+
end
|
972
|
+
|
798
973
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
799
974
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
800
975
|
|
801
976
|
options.apply_defaults timeout: @config.rpcs.update_custom_class.timeout,
|
802
977
|
metadata: metadata,
|
803
978
|
retry_policy: @config.rpcs.update_custom_class.retry_policy
|
804
|
-
|
979
|
+
|
980
|
+
options.apply_defaults timeout: @config.timeout,
|
981
|
+
metadata: @config.metadata,
|
805
982
|
retry_policy: @config.retry_policy
|
806
983
|
|
807
984
|
@adaptation_stub.call_rpc :update_custom_class, request, options: options do |response, operation|
|
@@ -843,6 +1020,21 @@ module Google
|
|
843
1020
|
#
|
844
1021
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
845
1022
|
#
|
1023
|
+
# @example Basic example
|
1024
|
+
# require "google/cloud/speech/v1p1beta1"
|
1025
|
+
#
|
1026
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1027
|
+
# client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
1028
|
+
#
|
1029
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1030
|
+
# request = Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new
|
1031
|
+
#
|
1032
|
+
# # Call the delete_custom_class method.
|
1033
|
+
# result = client.delete_custom_class request
|
1034
|
+
#
|
1035
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1036
|
+
# p result
|
1037
|
+
#
|
846
1038
|
def delete_custom_class request, options = nil
|
847
1039
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
848
1040
|
|
@@ -860,16 +1052,20 @@ module Google
|
|
860
1052
|
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
|
861
1053
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
862
1054
|
|
863
|
-
header_params = {
|
864
|
-
|
865
|
-
|
1055
|
+
header_params = {}
|
1056
|
+
if request.name
|
1057
|
+
header_params["name"] = request.name
|
1058
|
+
end
|
1059
|
+
|
866
1060
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
867
1061
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
868
1062
|
|
869
1063
|
options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout,
|
870
1064
|
metadata: metadata,
|
871
1065
|
retry_policy: @config.rpcs.delete_custom_class.retry_policy
|
872
|
-
|
1066
|
+
|
1067
|
+
options.apply_defaults timeout: @config.timeout,
|
1068
|
+
metadata: @config.metadata,
|
873
1069
|
retry_policy: @config.retry_policy
|
874
1070
|
|
875
1071
|
@adaptation_stub.call_rpc :delete_custom_class, request, options: options do |response, operation|
|
@@ -893,22 +1089,21 @@ module Google
|
|
893
1089
|
# Configuration can be applied globally to all clients, or to a single client
|
894
1090
|
# on construction.
|
895
1091
|
#
|
896
|
-
#
|
897
|
-
#
|
898
|
-
#
|
899
|
-
# to 20 seconds,
|
900
|
-
#
|
901
|
-
#
|
902
|
-
#
|
903
|
-
#
|
904
|
-
#
|
905
|
-
#
|
906
|
-
#
|
907
|
-
#
|
908
|
-
#
|
909
|
-
#
|
910
|
-
#
|
911
|
-
# end
|
1092
|
+
# @example
|
1093
|
+
#
|
1094
|
+
# # Modify the global config, setting the timeout for
|
1095
|
+
# # create_phrase_set to 20 seconds,
|
1096
|
+
# # and all remaining timeouts to 10 seconds.
|
1097
|
+
# ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.configure do |config|
|
1098
|
+
# config.timeout = 10.0
|
1099
|
+
# config.rpcs.create_phrase_set.timeout = 20.0
|
1100
|
+
# end
|
1101
|
+
#
|
1102
|
+
# # Apply the above configuration only to a new client.
|
1103
|
+
# client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config|
|
1104
|
+
# config.timeout = 10.0
|
1105
|
+
# config.rpcs.create_phrase_set.timeout = 20.0
|
1106
|
+
# end
|
912
1107
|
#
|
913
1108
|
# @!attribute [rw] endpoint
|
914
1109
|
# The hostname or hostname:port of the service endpoint.
|
@@ -1,8 +1,6 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto
|
3
3
|
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
4
|
require 'google/api/annotations_pb'
|
7
5
|
require 'google/api/client_pb'
|
8
6
|
require 'google/api/field_behavior_pb'
|
@@ -10,6 +8,8 @@ require 'google/api/resource_pb'
|
|
10
8
|
require 'google/cloud/speech/v1p1beta1/resource_pb'
|
11
9
|
require 'google/protobuf/empty_pb'
|
12
10
|
require 'google/protobuf/field_mask_pb'
|
11
|
+
require 'google/protobuf'
|
12
|
+
|
13
13
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
14
14
|
add_file("google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto", :syntax => :proto3) do
|
15
15
|
add_message "google.cloud.speech.v1p1beta1.CreatePhraseSetRequest" do
|