google-cloud-speech-v1p1beta1 0.10.1 → 0.12.1

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: 20f63757c8cfc052d0d74875c69ce42acf77cec45a59c35f332dad3625fa5c24
4
- data.tar.gz: 79923a57f03488321d859a7d0b132b51c1d38948aade2ab4ad6f94e6c262b772
3
+ metadata.gz: 180beb388724116bb984b0030921210424a17c90607f91439f24b4ee047a8a78
4
+ data.tar.gz: 9c067e63b3a6d9a3640212c19a419c43c5cfc683e7b8c0983ac6ec2d8dadf56d
5
5
  SHA512:
6
- metadata.gz: bde0d60815c6a4cf07e3b42796fddc514fde3dace61b49ba4c48a0ee34d7fe79d748eab0e80c265e07aa7614a887c2e0d5519cdae186f71a8fe0f4dcdf8db857
7
- data.tar.gz: 23e2cb90679b48e9cdacd61508ff9cee7089bec5760c90e8c9c503175ff591b385340236d7d2e74b61f113f2401e9feb91911e459940e7ebe3d19993d85a6430
6
+ metadata.gz: 76e27e18f6564f226bca8bc078be445d7ec8148f3bf042f7a175163209b14d87a3eebefee3b18bce5b75a0a27b32ea36abae976b95d4a4aa90e967ee2e345ccb
7
+ data.tar.gz: f9433ddd977051cdbbe81ecd0ce02b6d38d49dc4d827d7687da1ffc1d976ba8f429e6274acf98a1b3ef47ed47a674d48eba07f63129637e2279459e8b047cf50
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Cloud Speech-to-Text V1p1beta1 API
2
+ --title="Cloud Speech-to-Text V1p1beta1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/AUTHENTICATION.md CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
121
121
  *should* only be used during development.
122
122
 
123
- [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
124
- [dev-console]: https://console.cloud.google.com/project
125
-
126
- [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
127
-
128
- [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
129
- [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
130
- [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
131
-
132
123
  ## Creating a Service Account
133
124
 
134
125
  Google Cloud requires **Service Account Credentials** to
@@ -139,31 +130,22 @@ If you are not running this client within
139
130
  [Google Cloud Platform environments](#google-cloud-platform-environments), you
140
131
  need a Google Developers service account.
141
132
 
142
- 1. Visit the [Google Developers Console][dev-console].
133
+ 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
143
134
  2. Create a new project or click on an existing project.
144
- 3. Activate the slide-out navigation tray and select **API Manager**. From
135
+ 3. Activate the menu in the upper left and select **APIs & Services**. From
145
136
  here, you will enable the APIs that your application requires.
146
137
 
147
- ![Enable the APIs that your application requires][enable-apis]
148
-
149
138
  *Note: You may need to enable billing in order to use these services.*
150
139
 
151
140
  4. Select **Credentials** from the side navigation.
152
141
 
153
- You should see a screen like one of the following.
154
-
155
- ![Create a new service account][create-new-service-account]
156
-
157
- ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
158
-
159
- Find the "Add credentials" drop down and select "Service account" to be
160
- guided through downloading a new JSON key file.
142
+ Find the "Create credentials" drop down near the top of the page, and select
143
+ "Service account" to be guided through downloading a new JSON key file.
161
144
 
162
145
  If you want to re-use an existing service account, you can easily generate a
163
- new key file. Just select the account you wish to re-use, and click "Generate
164
- new JSON key":
165
-
166
- ![Re-use an existing service account][reuse-service-account]
146
+ new key file. Just select the account you wish to re-use, click the pencil
147
+ tool on the right side to edit the service account, select the **Keys** tab,
148
+ and then select **Add Key**.
167
149
 
168
150
  The key file you download will be used by this library to authenticate API
169
151
  requests and should be stored in a secure location.
@@ -165,9 +165,15 @@ module Google
165
165
  # the default parameter values, pass an empty Hash as a request object (see above).
166
166
  #
167
167
  # @param parent [::String]
168
- # Required. The parent resource where this phrase set will be created.
169
- # Format:
170
- # \\{api_version}/projects/\\{project}/locations/\\{location}/phraseSets
168
+ # Required. The parent resource where this phrase set will be created. Format:
169
+ #
170
+ # `projects/{project}/locations/{location}/phraseSets`
171
+ #
172
+ # Speech-to-Text supports three locations: `global`, `us` (US North America),
173
+ # and `eu` (Europe). If you are calling the `speech.googleapis.com`
174
+ # endpoint, use the `global` location. To specify a region, use a
175
+ # [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
176
+ # `eu` location value.
171
177
  # @param phrase_set_id [::String]
172
178
  # Required. The ID to use for the phrase set, which will become the final
173
179
  # component of the phrase set's resource name.
@@ -185,6 +191,21 @@ module Google
185
191
  #
186
192
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
187
193
  #
194
+ # @example Basic example
195
+ # require "google/cloud/speech/v1p1beta1"
196
+ #
197
+ # # Create a client object. The client can be reused for multiple calls.
198
+ # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
199
+ #
200
+ # # Create a request. To set request fields, pass in keyword arguments.
201
+ # request = Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new
202
+ #
203
+ # # Call the create_phrase_set method.
204
+ # result = client.create_phrase_set request
205
+ #
206
+ # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet.
207
+ # p result
208
+ #
188
209
  def create_phrase_set request, options = nil
189
210
  raise ::ArgumentError, "request must be provided" if request.nil?
190
211
 
@@ -202,9 +223,11 @@ module Google
202
223
  gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
203
224
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
204
225
 
205
- header_params = {
206
- "parent" => request.parent
207
- }
226
+ header_params = {}
227
+ if request.parent
228
+ header_params["parent"] = request.parent
229
+ end
230
+
208
231
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
209
232
  metadata[:"x-goog-request-params"] ||= request_params_header
210
233
 
@@ -243,9 +266,15 @@ module Google
243
266
  # the default parameter values, pass an empty Hash as a request object (see above).
244
267
  #
245
268
  # @param name [::String]
246
- # Required. The name of the phrase set to retrieve.
247
- # Format:
248
- # \\{api_version}/projects/\\{project}/locations/\\{location}/phraseSets/\\{phrase_set}
269
+ # Required. The name of the phrase set to retrieve. Format:
270
+ #
271
+ # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
272
+ #
273
+ # Speech-to-Text supports three locations: `global`, `us` (US North America),
274
+ # and `eu` (Europe). If you are calling the `speech.googleapis.com`
275
+ # endpoint, use the `global` location. To specify a region, use a
276
+ # [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
277
+ # `eu` location value.
249
278
  #
250
279
  # @yield [response, operation] Access the result along with the RPC operation
251
280
  # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::PhraseSet]
@@ -255,6 +284,21 @@ module Google
255
284
  #
256
285
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
257
286
  #
287
+ # @example Basic example
288
+ # require "google/cloud/speech/v1p1beta1"
289
+ #
290
+ # # Create a client object. The client can be reused for multiple calls.
291
+ # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
292
+ #
293
+ # # Create a request. To set request fields, pass in keyword arguments.
294
+ # request = Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new
295
+ #
296
+ # # Call the get_phrase_set method.
297
+ # result = client.get_phrase_set request
298
+ #
299
+ # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet.
300
+ # p result
301
+ #
258
302
  def get_phrase_set request, options = nil
259
303
  raise ::ArgumentError, "request must be provided" if request.nil?
260
304
 
@@ -272,9 +316,11 @@ module Google
272
316
  gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
273
317
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
274
318
 
275
- header_params = {
276
- "name" => request.name
277
- }
319
+ header_params = {}
320
+ if request.name
321
+ header_params["name"] = request.name
322
+ end
323
+
278
324
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
279
325
  metadata[:"x-goog-request-params"] ||= request_params_header
280
326
 
@@ -313,9 +359,15 @@ module Google
313
359
  # the default parameter values, pass an empty Hash as a request object (see above).
314
360
  #
315
361
  # @param parent [::String]
316
- # Required. The parent, which owns this collection of phrase set.
317
- # Format:
318
- # projects/\\{project}/locations/\\{location}
362
+ # Required. The parent, which owns this collection of phrase set. Format:
363
+ #
364
+ # `projects/{project}/locations/{location}`
365
+ #
366
+ # Speech-to-Text supports three locations: `global`, `us` (US North America),
367
+ # and `eu` (Europe). If you are calling the `speech.googleapis.com`
368
+ # endpoint, use the `global` location. To specify a region, use a
369
+ # [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
370
+ # `eu` location value.
319
371
  # @param page_size [::Integer]
320
372
  # The maximum number of phrase sets to return. The service may return
321
373
  # fewer than this value. If unspecified, at most 50 phrase sets will be
@@ -336,6 +388,27 @@ module Google
336
388
  #
337
389
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
338
390
  #
391
+ # @example Basic example
392
+ # require "google/cloud/speech/v1p1beta1"
393
+ #
394
+ # # Create a client object. The client can be reused for multiple calls.
395
+ # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
396
+ #
397
+ # # Create a request. To set request fields, pass in keyword arguments.
398
+ # request = Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.new
399
+ #
400
+ # # Call the list_phrase_set method.
401
+ # result = client.list_phrase_set request
402
+ #
403
+ # # The returned object is of type Gapic::PagedEnumerable. You can
404
+ # # iterate over all elements by calling #each, and the enumerable
405
+ # # will lazily make API calls to fetch subsequent pages. Other
406
+ # # methods are also available for managing paging directly.
407
+ # result.each do |response|
408
+ # # Each element is of type ::Google::Cloud::Speech::V1p1beta1::PhraseSet.
409
+ # p response
410
+ # end
411
+ #
339
412
  def list_phrase_set request, options = nil
340
413
  raise ::ArgumentError, "request must be provided" if request.nil?
341
414
 
@@ -353,9 +426,11 @@ module Google
353
426
  gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
354
427
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
355
428
 
356
- header_params = {
357
- "parent" => request.parent
358
- }
429
+ header_params = {}
430
+ if request.parent
431
+ header_params["parent"] = request.parent
432
+ end
433
+
359
434
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
360
435
  metadata[:"x-goog-request-params"] ||= request_params_header
361
436
 
@@ -399,7 +474,14 @@ module Google
399
474
  #
400
475
  # The phrase set's `name` field is used to identify the set to be
401
476
  # updated. Format:
402
- # \\{api_version}/projects/\\{project}/locations/\\{location}/phraseSets/\\{phrase_set}
477
+ #
478
+ # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
479
+ #
480
+ # Speech-to-Text supports three locations: `global`, `us` (US North America),
481
+ # and `eu` (Europe). If you are calling the `speech.googleapis.com`
482
+ # endpoint, use the `global` location. To specify a region, use a
483
+ # [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
484
+ # `eu` location value.
403
485
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
404
486
  # The list of fields to be updated.
405
487
  #
@@ -411,6 +493,21 @@ module Google
411
493
  #
412
494
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
413
495
  #
496
+ # @example Basic example
497
+ # require "google/cloud/speech/v1p1beta1"
498
+ #
499
+ # # Create a client object. The client can be reused for multiple calls.
500
+ # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
501
+ #
502
+ # # Create a request. To set request fields, pass in keyword arguments.
503
+ # request = Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new
504
+ #
505
+ # # Call the update_phrase_set method.
506
+ # result = client.update_phrase_set request
507
+ #
508
+ # # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet.
509
+ # p result
510
+ #
414
511
  def update_phrase_set request, options = nil
415
512
  raise ::ArgumentError, "request must be provided" if request.nil?
416
513
 
@@ -428,9 +525,11 @@ module Google
428
525
  gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
429
526
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
430
527
 
431
- header_params = {
432
- "phrase_set.name" => request.phrase_set.name
433
- }
528
+ header_params = {}
529
+ if request.phrase_set&.name
530
+ header_params["phrase_set.name"] = request.phrase_set.name
531
+ end
532
+
434
533
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
435
534
  metadata[:"x-goog-request-params"] ||= request_params_header
436
535
 
@@ -469,9 +568,9 @@ module Google
469
568
  # the default parameter values, pass an empty Hash as a request object (see above).
470
569
  #
471
570
  # @param name [::String]
472
- # Required. The name of the phrase set to delete.
473
- # Format:
474
- # \\{api_version}/projects/\\{project}/locations/\\{location}/phraseSets/\\{phrase_set}
571
+ # Required. The name of the phrase set to delete. Format:
572
+ #
573
+ # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
475
574
  #
476
575
  # @yield [response, operation] Access the result along with the RPC operation
477
576
  # @yieldparam response [::Google::Protobuf::Empty]
@@ -481,6 +580,21 @@ module Google
481
580
  #
482
581
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
483
582
  #
583
+ # @example Basic example
584
+ # require "google/cloud/speech/v1p1beta1"
585
+ #
586
+ # # Create a client object. The client can be reused for multiple calls.
587
+ # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
588
+ #
589
+ # # Create a request. To set request fields, pass in keyword arguments.
590
+ # request = Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new
591
+ #
592
+ # # Call the delete_phrase_set method.
593
+ # result = client.delete_phrase_set request
594
+ #
595
+ # # The returned object is of type Google::Protobuf::Empty.
596
+ # p result
597
+ #
484
598
  def delete_phrase_set request, options = nil
485
599
  raise ::ArgumentError, "request must be provided" if request.nil?
486
600
 
@@ -498,9 +612,11 @@ module Google
498
612
  gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
499
613
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
500
614
 
501
- header_params = {
502
- "name" => request.name
503
- }
615
+ header_params = {}
616
+ if request.name
617
+ header_params["name"] = request.name
618
+ end
619
+
504
620
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
505
621
  metadata[:"x-goog-request-params"] ||= request_params_header
506
622
 
@@ -539,9 +655,15 @@ module Google
539
655
  # the default parameter values, pass an empty Hash as a request object (see above).
540
656
  #
541
657
  # @param parent [::String]
542
- # Required. The parent resource where this custom class will be created.
543
- # Format:
544
- # \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses
658
+ # Required. The parent resource where this custom class will be created. Format:
659
+ #
660
+ # `projects/{project}/locations/{location}/customClasses`
661
+ #
662
+ # Speech-to-Text supports three locations: `global`, `us` (US North America),
663
+ # and `eu` (Europe). If you are calling the `speech.googleapis.com`
664
+ # endpoint, use the `global` location. To specify a region, use a
665
+ # [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
666
+ # `eu` location value.
545
667
  # @param custom_class_id [::String]
546
668
  # Required. The ID to use for the custom class, which will become the final
547
669
  # component of the custom class' resource name.
@@ -559,6 +681,21 @@ module Google
559
681
  #
560
682
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
561
683
  #
684
+ # @example Basic example
685
+ # require "google/cloud/speech/v1p1beta1"
686
+ #
687
+ # # Create a client object. The client can be reused for multiple calls.
688
+ # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
689
+ #
690
+ # # Create a request. To set request fields, pass in keyword arguments.
691
+ # request = Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new
692
+ #
693
+ # # Call the create_custom_class method.
694
+ # result = client.create_custom_class request
695
+ #
696
+ # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass.
697
+ # p result
698
+ #
562
699
  def create_custom_class request, options = nil
563
700
  raise ::ArgumentError, "request must be provided" if request.nil?
564
701
 
@@ -576,9 +713,11 @@ module Google
576
713
  gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
577
714
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
578
715
 
579
- header_params = {
580
- "parent" => request.parent
581
- }
716
+ header_params = {}
717
+ if request.parent
718
+ header_params["parent"] = request.parent
719
+ end
720
+
582
721
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
583
722
  metadata[:"x-goog-request-params"] ||= request_params_header
584
723
 
@@ -617,9 +756,9 @@ module Google
617
756
  # the default parameter values, pass an empty Hash as a request object (see above).
618
757
  #
619
758
  # @param name [::String]
620
- # Required. The name of the custom class to retrieve.
621
- # Format:
622
- # \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses/\\{custom_class}
759
+ # Required. The name of the custom class to retrieve. Format:
760
+ #
761
+ # `projects/{project}/locations/{location}/customClasses/{custom_class}`
623
762
  #
624
763
  # @yield [response, operation] Access the result along with the RPC operation
625
764
  # @yieldparam response [::Google::Cloud::Speech::V1p1beta1::CustomClass]
@@ -629,6 +768,21 @@ module Google
629
768
  #
630
769
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
631
770
  #
771
+ # @example Basic example
772
+ # require "google/cloud/speech/v1p1beta1"
773
+ #
774
+ # # Create a client object. The client can be reused for multiple calls.
775
+ # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
776
+ #
777
+ # # Create a request. To set request fields, pass in keyword arguments.
778
+ # request = Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new
779
+ #
780
+ # # Call the get_custom_class method.
781
+ # result = client.get_custom_class request
782
+ #
783
+ # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass.
784
+ # p result
785
+ #
632
786
  def get_custom_class request, options = nil
633
787
  raise ::ArgumentError, "request must be provided" if request.nil?
634
788
 
@@ -646,9 +800,11 @@ module Google
646
800
  gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
647
801
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
648
802
 
649
- header_params = {
650
- "name" => request.name
651
- }
803
+ header_params = {}
804
+ if request.name
805
+ header_params["name"] = request.name
806
+ end
807
+
652
808
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
653
809
  metadata[:"x-goog-request-params"] ||= request_params_header
654
810
 
@@ -687,9 +843,15 @@ module Google
687
843
  # the default parameter values, pass an empty Hash as a request object (see above).
688
844
  #
689
845
  # @param parent [::String]
690
- # Required. The parent, which owns this collection of custom classes.
691
- # Format:
692
- # \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses
846
+ # Required. The parent, which owns this collection of custom classes. Format:
847
+ #
848
+ # `projects/{project}/locations/{location}/customClasses`
849
+ #
850
+ # Speech-to-Text supports three locations: `global`, `us` (US North America),
851
+ # and `eu` (Europe). If you are calling the `speech.googleapis.com`
852
+ # endpoint, use the `global` location. To specify a region, use a
853
+ # [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
854
+ # `eu` location value.
693
855
  # @param page_size [::Integer]
694
856
  # The maximum number of custom classes to return. The service may return
695
857
  # fewer than this value. If unspecified, at most 50 custom classes will be
@@ -710,6 +872,27 @@ module Google
710
872
  #
711
873
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
712
874
  #
875
+ # @example Basic example
876
+ # require "google/cloud/speech/v1p1beta1"
877
+ #
878
+ # # Create a client object. The client can be reused for multiple calls.
879
+ # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
880
+ #
881
+ # # Create a request. To set request fields, pass in keyword arguments.
882
+ # request = Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.new
883
+ #
884
+ # # Call the list_custom_classes method.
885
+ # result = client.list_custom_classes request
886
+ #
887
+ # # The returned object is of type Gapic::PagedEnumerable. You can
888
+ # # iterate over all elements by calling #each, and the enumerable
889
+ # # will lazily make API calls to fetch subsequent pages. Other
890
+ # # methods are also available for managing paging directly.
891
+ # result.each do |response|
892
+ # # Each element is of type ::Google::Cloud::Speech::V1p1beta1::CustomClass.
893
+ # p response
894
+ # end
895
+ #
713
896
  def list_custom_classes request, options = nil
714
897
  raise ::ArgumentError, "request must be provided" if request.nil?
715
898
 
@@ -727,9 +910,11 @@ module Google
727
910
  gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
728
911
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
729
912
 
730
- header_params = {
731
- "parent" => request.parent
732
- }
913
+ header_params = {}
914
+ if request.parent
915
+ header_params["parent"] = request.parent
916
+ end
917
+
733
918
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
734
919
  metadata[:"x-goog-request-params"] ||= request_params_header
735
920
 
@@ -773,7 +958,14 @@ module Google
773
958
  #
774
959
  # The custom class's `name` field is used to identify the custom class to be
775
960
  # updated. Format:
776
- # \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses/\\{custom_class}
961
+ #
962
+ # `projects/{project}/locations/{location}/customClasses/{custom_class}`
963
+ #
964
+ # Speech-to-Text supports three locations: `global`, `us` (US North America),
965
+ # and `eu` (Europe). If you are calling the `speech.googleapis.com`
966
+ # endpoint, use the `global` location. To specify a region, use a
967
+ # [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
968
+ # `eu` location value.
777
969
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
778
970
  # The list of fields to be updated.
779
971
  #
@@ -785,6 +977,21 @@ module Google
785
977
  #
786
978
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
787
979
  #
980
+ # @example Basic example
981
+ # require "google/cloud/speech/v1p1beta1"
982
+ #
983
+ # # Create a client object. The client can be reused for multiple calls.
984
+ # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
985
+ #
986
+ # # Create a request. To set request fields, pass in keyword arguments.
987
+ # request = Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new
988
+ #
989
+ # # Call the update_custom_class method.
990
+ # result = client.update_custom_class request
991
+ #
992
+ # # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass.
993
+ # p result
994
+ #
788
995
  def update_custom_class request, options = nil
789
996
  raise ::ArgumentError, "request must be provided" if request.nil?
790
997
 
@@ -802,9 +1009,11 @@ module Google
802
1009
  gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
803
1010
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
804
1011
 
805
- header_params = {
806
- "custom_class.name" => request.custom_class.name
807
- }
1012
+ header_params = {}
1013
+ if request.custom_class&.name
1014
+ header_params["custom_class.name"] = request.custom_class.name
1015
+ end
1016
+
808
1017
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
809
1018
  metadata[:"x-goog-request-params"] ||= request_params_header
810
1019
 
@@ -843,9 +1052,15 @@ module Google
843
1052
  # the default parameter values, pass an empty Hash as a request object (see above).
844
1053
  #
845
1054
  # @param name [::String]
846
- # Required. The name of the custom class to delete.
847
- # Format:
848
- # \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses/\\{custom_class}
1055
+ # Required. The name of the custom class to delete. Format:
1056
+ #
1057
+ # `projects/{project}/locations/{location}/customClasses/{custom_class}`
1058
+ #
1059
+ # Speech-to-Text supports three locations: `global`, `us` (US North America),
1060
+ # and `eu` (Europe). If you are calling the `speech.googleapis.com`
1061
+ # endpoint, use the `global` location. To specify a region, use a
1062
+ # [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
1063
+ # `eu` location value.
849
1064
  #
850
1065
  # @yield [response, operation] Access the result along with the RPC operation
851
1066
  # @yieldparam response [::Google::Protobuf::Empty]
@@ -855,6 +1070,21 @@ module Google
855
1070
  #
856
1071
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
857
1072
  #
1073
+ # @example Basic example
1074
+ # require "google/cloud/speech/v1p1beta1"
1075
+ #
1076
+ # # Create a client object. The client can be reused for multiple calls.
1077
+ # client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
1078
+ #
1079
+ # # Create a request. To set request fields, pass in keyword arguments.
1080
+ # request = Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new
1081
+ #
1082
+ # # Call the delete_custom_class method.
1083
+ # result = client.delete_custom_class request
1084
+ #
1085
+ # # The returned object is of type Google::Protobuf::Empty.
1086
+ # p result
1087
+ #
858
1088
  def delete_custom_class request, options = nil
859
1089
  raise ::ArgumentError, "request must be provided" if request.nil?
860
1090
 
@@ -872,9 +1102,11 @@ module Google
872
1102
  gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
873
1103
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
874
1104
 
875
- header_params = {
876
- "name" => request.name
877
- }
1105
+ header_params = {}
1106
+ if request.name
1107
+ header_params["name"] = request.name
1108
+ end
1109
+
878
1110
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
879
1111
  metadata[:"x-goog-request-params"] ||= request_params_header
880
1112
 
@@ -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
@@ -27,7 +27,7 @@ module Google
27
27
  # Service that implements Google Cloud Speech Adaptation API.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode