google-cloud-dialogflow-v2 0.11.4 → 0.11.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/dialogflow/v2/agents/client.rb +214 -27
  3. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +115 -12
  4. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +46 -6
  5. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +126 -18
  6. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +2 -0
  7. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +106 -15
  8. data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +19 -0
  9. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +112 -15
  10. data/lib/google/cloud/dialogflow/v2/documents/client.rb +154 -18
  11. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +115 -12
  12. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +241 -30
  13. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +115 -12
  14. data/lib/google/cloud/dialogflow/v2/environments/client.rb +132 -18
  15. data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +40 -6
  16. data/lib/google/cloud/dialogflow/v2/intents/client.rb +160 -21
  17. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +115 -12
  18. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +106 -15
  19. data/lib/google/cloud/dialogflow/v2/participants/client.rb +146 -21
  20. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +106 -15
  21. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +44 -3
  22. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  23. data/lib/google/cloud/dialogflow/v2/versions/client.rb +106 -15
  24. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +25 -8
  25. metadata +2 -2
@@ -202,6 +202,27 @@ module Google
202
202
  #
203
203
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
204
204
  #
205
+ # @example Basic example
206
+ # require "google/cloud/dialogflow/v2"
207
+ #
208
+ # # Create a client object. The client can be reused for multiple calls.
209
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
210
+ #
211
+ # # Create a request. To set request fields, pass in keyword arguments.
212
+ # request = Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new
213
+ #
214
+ # # Call the list_entity_types method.
215
+ # result = client.list_entity_types request
216
+ #
217
+ # # The returned object is of type Gapic::PagedEnumerable. You can
218
+ # # iterate over all elements by calling #each, and the enumerable
219
+ # # will lazily make API calls to fetch subsequent pages. Other
220
+ # # methods are also available for managing paging directly.
221
+ # result.each do |response|
222
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::EntityType.
223
+ # p response
224
+ # end
225
+ #
205
226
  def list_entity_types request, options = nil
206
227
  raise ::ArgumentError, "request must be provided" if request.nil?
207
228
 
@@ -219,9 +240,11 @@ module Google
219
240
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
220
241
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
221
242
 
222
- header_params = {
223
- "parent" => request.parent
224
- }
243
+ header_params = {}
244
+ if request.parent
245
+ header_params["parent"] = request.parent
246
+ end
247
+
225
248
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
226
249
  metadata[:"x-goog-request-params"] ||= request_params_header
227
250
 
@@ -278,6 +301,21 @@ module Google
278
301
  #
279
302
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
280
303
  #
304
+ # @example Basic example
305
+ # require "google/cloud/dialogflow/v2"
306
+ #
307
+ # # Create a client object. The client can be reused for multiple calls.
308
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
309
+ #
310
+ # # Create a request. To set request fields, pass in keyword arguments.
311
+ # request = Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new
312
+ #
313
+ # # Call the get_entity_type method.
314
+ # result = client.get_entity_type request
315
+ #
316
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType.
317
+ # p result
318
+ #
281
319
  def get_entity_type request, options = nil
282
320
  raise ::ArgumentError, "request must be provided" if request.nil?
283
321
 
@@ -295,9 +333,11 @@ module Google
295
333
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
296
334
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
297
335
 
298
- header_params = {
299
- "name" => request.name
300
- }
336
+ header_params = {}
337
+ if request.name
338
+ header_params["name"] = request.name
339
+ end
340
+
301
341
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
302
342
  metadata[:"x-goog-request-params"] ||= request_params_header
303
343
 
@@ -359,6 +399,21 @@ module Google
359
399
  #
360
400
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
361
401
  #
402
+ # @example Basic example
403
+ # require "google/cloud/dialogflow/v2"
404
+ #
405
+ # # Create a client object. The client can be reused for multiple calls.
406
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
407
+ #
408
+ # # Create a request. To set request fields, pass in keyword arguments.
409
+ # request = Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new
410
+ #
411
+ # # Call the create_entity_type method.
412
+ # result = client.create_entity_type request
413
+ #
414
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType.
415
+ # p result
416
+ #
362
417
  def create_entity_type request, options = nil
363
418
  raise ::ArgumentError, "request must be provided" if request.nil?
364
419
 
@@ -376,9 +431,11 @@ module Google
376
431
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
377
432
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
378
433
 
379
- header_params = {
380
- "parent" => request.parent
381
- }
434
+ header_params = {}
435
+ if request.parent
436
+ header_params["parent"] = request.parent
437
+ end
438
+
382
439
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
383
440
  metadata[:"x-goog-request-params"] ||= request_params_header
384
441
 
@@ -439,6 +496,21 @@ module Google
439
496
  #
440
497
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
441
498
  #
499
+ # @example Basic example
500
+ # require "google/cloud/dialogflow/v2"
501
+ #
502
+ # # Create a client object. The client can be reused for multiple calls.
503
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
504
+ #
505
+ # # Create a request. To set request fields, pass in keyword arguments.
506
+ # request = Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new
507
+ #
508
+ # # Call the update_entity_type method.
509
+ # result = client.update_entity_type request
510
+ #
511
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType.
512
+ # p result
513
+ #
442
514
  def update_entity_type request, options = nil
443
515
  raise ::ArgumentError, "request must be provided" if request.nil?
444
516
 
@@ -456,9 +528,11 @@ module Google
456
528
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
457
529
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
458
530
 
459
- header_params = {
460
- "entity_type.name" => request.entity_type.name
461
- }
531
+ header_params = {}
532
+ if request.entity_type&.name
533
+ header_params["entity_type.name"] = request.entity_type.name
534
+ end
535
+
462
536
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
463
537
  metadata[:"x-goog-request-params"] ||= request_params_header
464
538
 
@@ -512,6 +586,21 @@ module Google
512
586
  #
513
587
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
514
588
  #
589
+ # @example Basic example
590
+ # require "google/cloud/dialogflow/v2"
591
+ #
592
+ # # Create a client object. The client can be reused for multiple calls.
593
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
594
+ #
595
+ # # Create a request. To set request fields, pass in keyword arguments.
596
+ # request = Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new
597
+ #
598
+ # # Call the delete_entity_type method.
599
+ # result = client.delete_entity_type request
600
+ #
601
+ # # The returned object is of type Google::Protobuf::Empty.
602
+ # p result
603
+ #
515
604
  def delete_entity_type request, options = nil
516
605
  raise ::ArgumentError, "request must be provided" if request.nil?
517
606
 
@@ -529,9 +618,11 @@ module Google
529
618
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
530
619
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
531
620
 
532
- header_params = {
533
- "name" => request.name
534
- }
621
+ header_params = {}
622
+ if request.name
623
+ header_params["name"] = request.name
624
+ end
625
+
535
626
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
536
627
  metadata[:"x-goog-request-params"] ||= request_params_header
537
628
 
@@ -608,6 +699,28 @@ module Google
608
699
  #
609
700
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
610
701
  #
702
+ # @example Basic example
703
+ # require "google/cloud/dialogflow/v2"
704
+ #
705
+ # # Create a client object. The client can be reused for multiple calls.
706
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
707
+ #
708
+ # # Create a request. To set request fields, pass in keyword arguments.
709
+ # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new
710
+ #
711
+ # # Call the batch_update_entity_types method.
712
+ # result = client.batch_update_entity_types request
713
+ #
714
+ # # The returned object is of type Gapic::Operation. You can use this
715
+ # # object to check the status of an operation, cancel it, or wait
716
+ # # for results. Here is how to block until completion:
717
+ # result.wait_until_done! timeout: 60
718
+ # if result.response?
719
+ # p result.response
720
+ # else
721
+ # puts "Error!"
722
+ # end
723
+ #
611
724
  def batch_update_entity_types request, options = nil
612
725
  raise ::ArgumentError, "request must be provided" if request.nil?
613
726
 
@@ -625,9 +738,11 @@ module Google
625
738
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
626
739
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
627
740
 
628
- header_params = {
629
- "parent" => request.parent
630
- }
741
+ header_params = {}
742
+ if request.parent
743
+ header_params["parent"] = request.parent
744
+ end
745
+
631
746
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
632
747
  metadata[:"x-goog-request-params"] ||= request_params_header
633
748
 
@@ -694,6 +809,28 @@ module Google
694
809
  #
695
810
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
696
811
  #
812
+ # @example Basic example
813
+ # require "google/cloud/dialogflow/v2"
814
+ #
815
+ # # Create a client object. The client can be reused for multiple calls.
816
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
817
+ #
818
+ # # Create a request. To set request fields, pass in keyword arguments.
819
+ # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new
820
+ #
821
+ # # Call the batch_delete_entity_types method.
822
+ # result = client.batch_delete_entity_types request
823
+ #
824
+ # # The returned object is of type Gapic::Operation. You can use this
825
+ # # object to check the status of an operation, cancel it, or wait
826
+ # # for results. Here is how to block until completion:
827
+ # result.wait_until_done! timeout: 60
828
+ # if result.response?
829
+ # p result.response
830
+ # else
831
+ # puts "Error!"
832
+ # end
833
+ #
697
834
  def batch_delete_entity_types request, options = nil
698
835
  raise ::ArgumentError, "request must be provided" if request.nil?
699
836
 
@@ -711,9 +848,11 @@ module Google
711
848
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
712
849
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
713
850
 
714
- header_params = {
715
- "parent" => request.parent
716
- }
851
+ header_params = {}
852
+ if request.parent
853
+ header_params["parent"] = request.parent
854
+ end
855
+
717
856
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
718
857
  metadata[:"x-goog-request-params"] ||= request_params_header
719
858
 
@@ -785,6 +924,28 @@ module Google
785
924
  #
786
925
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
787
926
  #
927
+ # @example Basic example
928
+ # require "google/cloud/dialogflow/v2"
929
+ #
930
+ # # Create a client object. The client can be reused for multiple calls.
931
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
932
+ #
933
+ # # Create a request. To set request fields, pass in keyword arguments.
934
+ # request = Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new
935
+ #
936
+ # # Call the batch_create_entities method.
937
+ # result = client.batch_create_entities request
938
+ #
939
+ # # The returned object is of type Gapic::Operation. You can use this
940
+ # # object to check the status of an operation, cancel it, or wait
941
+ # # for results. Here is how to block until completion:
942
+ # result.wait_until_done! timeout: 60
943
+ # if result.response?
944
+ # p result.response
945
+ # else
946
+ # puts "Error!"
947
+ # end
948
+ #
788
949
  def batch_create_entities request, options = nil
789
950
  raise ::ArgumentError, "request must be provided" if request.nil?
790
951
 
@@ -802,9 +963,11 @@ module Google
802
963
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
803
964
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
804
965
 
805
- header_params = {
806
- "parent" => request.parent
807
- }
966
+ header_params = {}
967
+ if request.parent
968
+ header_params["parent"] = request.parent
969
+ end
970
+
808
971
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
809
972
  metadata[:"x-goog-request-params"] ||= request_params_header
810
973
 
@@ -880,6 +1043,28 @@ module Google
880
1043
  #
881
1044
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
882
1045
  #
1046
+ # @example Basic example
1047
+ # require "google/cloud/dialogflow/v2"
1048
+ #
1049
+ # # Create a client object. The client can be reused for multiple calls.
1050
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
1051
+ #
1052
+ # # Create a request. To set request fields, pass in keyword arguments.
1053
+ # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new
1054
+ #
1055
+ # # Call the batch_update_entities method.
1056
+ # result = client.batch_update_entities request
1057
+ #
1058
+ # # The returned object is of type Gapic::Operation. You can use this
1059
+ # # object to check the status of an operation, cancel it, or wait
1060
+ # # for results. Here is how to block until completion:
1061
+ # result.wait_until_done! timeout: 60
1062
+ # if result.response?
1063
+ # p result.response
1064
+ # else
1065
+ # puts "Error!"
1066
+ # end
1067
+ #
883
1068
  def batch_update_entities request, options = nil
884
1069
  raise ::ArgumentError, "request must be provided" if request.nil?
885
1070
 
@@ -897,9 +1082,11 @@ module Google
897
1082
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
898
1083
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
899
1084
 
900
- header_params = {
901
- "parent" => request.parent
902
- }
1085
+ header_params = {}
1086
+ if request.parent
1087
+ header_params["parent"] = request.parent
1088
+ end
1089
+
903
1090
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
904
1091
  metadata[:"x-goog-request-params"] ||= request_params_header
905
1092
 
@@ -973,6 +1160,28 @@ module Google
973
1160
  #
974
1161
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
975
1162
  #
1163
+ # @example Basic example
1164
+ # require "google/cloud/dialogflow/v2"
1165
+ #
1166
+ # # Create a client object. The client can be reused for multiple calls.
1167
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
1168
+ #
1169
+ # # Create a request. To set request fields, pass in keyword arguments.
1170
+ # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new
1171
+ #
1172
+ # # Call the batch_delete_entities method.
1173
+ # result = client.batch_delete_entities request
1174
+ #
1175
+ # # The returned object is of type Gapic::Operation. You can use this
1176
+ # # object to check the status of an operation, cancel it, or wait
1177
+ # # for results. Here is how to block until completion:
1178
+ # result.wait_until_done! timeout: 60
1179
+ # if result.response?
1180
+ # p result.response
1181
+ # else
1182
+ # puts "Error!"
1183
+ # end
1184
+ #
976
1185
  def batch_delete_entities request, options = nil
977
1186
  raise ::ArgumentError, "request must be provided" if request.nil?
978
1187
 
@@ -990,9 +1199,11 @@ module Google
990
1199
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
991
1200
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
992
1201
 
993
- header_params = {
994
- "parent" => request.parent
995
- }
1202
+ header_params = {}
1203
+ if request.parent
1204
+ header_params["parent"] = request.parent
1205
+ end
1206
+
996
1207
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
997
1208
  metadata[:"x-goog-request-params"] ||= request_params_header
998
1209
 
@@ -143,6 +143,27 @@ module Google
143
143
  #
144
144
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
145
145
  #
146
+ # @example Basic example
147
+ # require "google/longrunning"
148
+ #
149
+ # # Create a client object. The client can be reused for multiple calls.
150
+ # client = Google::Longrunning::Operations::Client.new
151
+ #
152
+ # # Create a request. To set request fields, pass in keyword arguments.
153
+ # request = Google::Longrunning::ListOperationsRequest.new
154
+ #
155
+ # # Call the list_operations method.
156
+ # result = client.list_operations request
157
+ #
158
+ # # The returned object is of type Gapic::PagedEnumerable. You can
159
+ # # iterate over all elements by calling #each, and the enumerable
160
+ # # will lazily make API calls to fetch subsequent pages. Other
161
+ # # methods are also available for managing paging directly.
162
+ # result.each do |response|
163
+ # # Each element is of type ::Google::Longrunning::Operation.
164
+ # p response
165
+ # end
166
+ #
146
167
  def list_operations request, options = nil
147
168
  raise ::ArgumentError, "request must be provided" if request.nil?
148
169
 
@@ -160,9 +181,11 @@ module Google
160
181
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
161
182
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
162
183
 
163
- header_params = {
164
- "name" => request.name
165
- }
184
+ header_params = {}
185
+ if request.name
186
+ header_params["name"] = request.name
187
+ end
188
+
166
189
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
167
190
  metadata[:"x-goog-request-params"] ||= request_params_header
168
191
 
@@ -215,6 +238,28 @@ module Google
215
238
  #
216
239
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
217
240
  #
241
+ # @example Basic example
242
+ # require "google/longrunning"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Longrunning::Operations::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Longrunning::GetOperationRequest.new
249
+ #
250
+ # # Call the get_operation method.
251
+ # result = client.get_operation request
252
+ #
253
+ # # The returned object is of type Gapic::Operation. You can use this
254
+ # # object to check the status of an operation, cancel it, or wait
255
+ # # for results. Here is how to block until completion:
256
+ # result.wait_until_done! timeout: 60
257
+ # if result.response?
258
+ # p result.response
259
+ # else
260
+ # puts "Error!"
261
+ # end
262
+ #
218
263
  def get_operation request, options = nil
219
264
  raise ::ArgumentError, "request must be provided" if request.nil?
220
265
 
@@ -232,9 +277,11 @@ module Google
232
277
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
233
278
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
234
279
 
235
- header_params = {
236
- "name" => request.name
237
- }
280
+ header_params = {}
281
+ if request.name
282
+ header_params["name"] = request.name
283
+ end
284
+
238
285
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
239
286
  metadata[:"x-goog-request-params"] ||= request_params_header
240
287
 
@@ -287,6 +334,21 @@ module Google
287
334
  #
288
335
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
289
336
  #
337
+ # @example Basic example
338
+ # require "google/longrunning"
339
+ #
340
+ # # Create a client object. The client can be reused for multiple calls.
341
+ # client = Google::Longrunning::Operations::Client.new
342
+ #
343
+ # # Create a request. To set request fields, pass in keyword arguments.
344
+ # request = Google::Longrunning::DeleteOperationRequest.new
345
+ #
346
+ # # Call the delete_operation method.
347
+ # result = client.delete_operation request
348
+ #
349
+ # # The returned object is of type Google::Protobuf::Empty.
350
+ # p result
351
+ #
290
352
  def delete_operation request, options = nil
291
353
  raise ::ArgumentError, "request must be provided" if request.nil?
292
354
 
@@ -304,9 +366,11 @@ module Google
304
366
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
305
367
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
306
368
 
307
- header_params = {
308
- "name" => request.name
309
- }
369
+ header_params = {}
370
+ if request.name
371
+ header_params["name"] = request.name
372
+ end
373
+
310
374
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
311
375
  metadata[:"x-goog-request-params"] ||= request_params_header
312
376
 
@@ -364,6 +428,21 @@ module Google
364
428
  #
365
429
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
366
430
  #
431
+ # @example Basic example
432
+ # require "google/longrunning"
433
+ #
434
+ # # Create a client object. The client can be reused for multiple calls.
435
+ # client = Google::Longrunning::Operations::Client.new
436
+ #
437
+ # # Create a request. To set request fields, pass in keyword arguments.
438
+ # request = Google::Longrunning::CancelOperationRequest.new
439
+ #
440
+ # # Call the cancel_operation method.
441
+ # result = client.cancel_operation request
442
+ #
443
+ # # The returned object is of type Google::Protobuf::Empty.
444
+ # p result
445
+ #
367
446
  def cancel_operation request, options = nil
368
447
  raise ::ArgumentError, "request must be provided" if request.nil?
369
448
 
@@ -381,9 +460,11 @@ module Google
381
460
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
382
461
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
383
462
 
384
- header_params = {
385
- "name" => request.name
386
- }
463
+ header_params = {}
464
+ if request.name
465
+ header_params["name"] = request.name
466
+ end
467
+
387
468
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
388
469
  metadata[:"x-goog-request-params"] ||= request_params_header
389
470
 
@@ -444,6 +525,28 @@ module Google
444
525
  #
445
526
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
446
527
  #
528
+ # @example Basic example
529
+ # require "google/longrunning"
530
+ #
531
+ # # Create a client object. The client can be reused for multiple calls.
532
+ # client = Google::Longrunning::Operations::Client.new
533
+ #
534
+ # # Create a request. To set request fields, pass in keyword arguments.
535
+ # request = Google::Longrunning::WaitOperationRequest.new
536
+ #
537
+ # # Call the wait_operation method.
538
+ # result = client.wait_operation request
539
+ #
540
+ # # The returned object is of type Gapic::Operation. You can use this
541
+ # # object to check the status of an operation, cancel it, or wait
542
+ # # for results. Here is how to block until completion:
543
+ # result.wait_until_done! timeout: 60
544
+ # if result.response?
545
+ # p result.response
546
+ # else
547
+ # puts "Error!"
548
+ # end
549
+ #
447
550
  def wait_operation request, options = nil
448
551
  raise ::ArgumentError, "request must be provided" if request.nil?
449
552