google-cloud-dialogflow-v2 0.11.4 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/AUTHENTICATION.md +7 -25
  4. data/lib/google/cloud/dialogflow/v2/agents/client.rb +215 -27
  5. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +115 -12
  6. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +46 -6
  7. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +1 -1
  8. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +126 -18
  9. data/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb +1 -1
  10. data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +2 -0
  11. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +9 -0
  12. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +106 -15
  13. data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +19 -0
  14. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +112 -15
  15. data/lib/google/cloud/dialogflow/v2/document_pb.rb +33 -0
  16. data/lib/google/cloud/dialogflow/v2/document_services_pb.rb +21 -0
  17. data/lib/google/cloud/dialogflow/v2/documents/client.rb +426 -20
  18. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +115 -12
  19. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +242 -30
  20. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +115 -12
  21. data/lib/google/cloud/dialogflow/v2/environments/client.rb +132 -18
  22. data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +40 -6
  23. data/lib/google/cloud/dialogflow/v2/gcs_pb.rb +9 -1
  24. data/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb +1 -1
  25. data/lib/google/cloud/dialogflow/v2/intents/client.rb +161 -21
  26. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +115 -12
  27. data/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb +1 -0
  28. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +134 -16
  29. data/lib/google/cloud/dialogflow/v2/participant_pb.rb +31 -0
  30. data/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +3 -0
  31. data/lib/google/cloud/dialogflow/v2/participants/client.rb +268 -28
  32. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +106 -15
  33. data/lib/google/cloud/dialogflow/v2/session_pb.rb +1 -0
  34. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +44 -3
  35. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  36. data/lib/google/cloud/dialogflow/v2/versions/client.rb +106 -15
  37. data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +1 -1
  38. data/lib/google/cloud/dialogflow/v2.rb +1 -1
  39. data/proto_docs/google/api/resource.rb +10 -71
  40. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +4 -1
  41. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +41 -8
  42. data/proto_docs/google/cloud/dialogflow/v2/document.rb +118 -0
  43. data/proto_docs/google/cloud/dialogflow/v2/gcs.rb +50 -0
  44. data/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb +28 -0
  45. data/proto_docs/google/cloud/dialogflow/v2/participant.rb +157 -6
  46. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e42639a68d360c1a6931228d89c59d25ef302c5a004079e2d3126a147815ecd1
4
- data.tar.gz: f6448a0999113c3105ab2e6600a9f43fcde6ec166636fd49e5a146b7812dbcda
3
+ metadata.gz: 3231bca201f6d59200723584d77013bade56fc63cb9dc62f2fc3394fe81abb5d
4
+ data.tar.gz: 81fd657b5838cf3a7baa8c15286a66b83225cab04bceb888a55226fc5af7f65c
5
5
  SHA512:
6
- metadata.gz: da841cda52712d07d32576facdc5b96460c7a17f1f6dc4f23527d01f2c7d118e08670b32a551763eda77495275d6d5779e3cd98606925bcc98863c18008289de
7
- data.tar.gz: 2d0af294ce9b58889ee049f4147431d78bb9460d53fb299450a4dde5476b230a0b617eff9dd0950d5186a76dcf4bb937c4bee33c2e03fdaf11ff6d7a46f988e0
6
+ metadata.gz: c378f99053501b2b0d37ab7d89f87b72163322bb9485bdc15c01fe25494da6be9acff47347788ab490ebc3dddbc581f0ad99266bab1cb1411dafd6ca323a32d6
7
+ data.tar.gz: a79eec1d29803050543ae5051413bb666efefd4d483d378c467b8d1036737320a955e21e304c5f37d97287fa63647f3ace35cf26ff37e258bc01ca73242e5299
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Dialogflow V2 API
2
+ --title="Dialogflow V2 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.
@@ -140,6 +140,7 @@ module Google
140
140
 
141
141
  @operations_client = Operations.new do |config|
142
142
  config.credentials = credentials
143
+ config.quota_project = @quota_project_id
143
144
  config.endpoint = @config.endpoint
144
145
  end
145
146
 
@@ -191,6 +192,21 @@ module Google
191
192
  #
192
193
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
193
194
  #
195
+ # @example Basic example
196
+ # require "google/cloud/dialogflow/v2"
197
+ #
198
+ # # Create a client object. The client can be reused for multiple calls.
199
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
200
+ #
201
+ # # Create a request. To set request fields, pass in keyword arguments.
202
+ # request = Google::Cloud::Dialogflow::V2::GetAgentRequest.new
203
+ #
204
+ # # Call the get_agent method.
205
+ # result = client.get_agent request
206
+ #
207
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent.
208
+ # p result
209
+ #
194
210
  def get_agent request, options = nil
195
211
  raise ::ArgumentError, "request must be provided" if request.nil?
196
212
 
@@ -208,9 +224,11 @@ module Google
208
224
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
209
225
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
210
226
 
211
- header_params = {
212
- "parent" => request.parent
213
- }
227
+ header_params = {}
228
+ if request.parent
229
+ header_params["parent"] = request.parent
230
+ end
231
+
214
232
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
215
233
  metadata[:"x-goog-request-params"] ||= request_params_header
216
234
 
@@ -265,6 +283,21 @@ module Google
265
283
  #
266
284
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
267
285
  #
286
+ # @example Basic example
287
+ # require "google/cloud/dialogflow/v2"
288
+ #
289
+ # # Create a client object. The client can be reused for multiple calls.
290
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
291
+ #
292
+ # # Create a request. To set request fields, pass in keyword arguments.
293
+ # request = Google::Cloud::Dialogflow::V2::SetAgentRequest.new
294
+ #
295
+ # # Call the set_agent method.
296
+ # result = client.set_agent request
297
+ #
298
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent.
299
+ # p result
300
+ #
268
301
  def set_agent request, options = nil
269
302
  raise ::ArgumentError, "request must be provided" if request.nil?
270
303
 
@@ -282,9 +315,11 @@ module Google
282
315
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
283
316
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
284
317
 
285
- header_params = {
286
- "agent.parent" => request.agent.parent
287
- }
318
+ header_params = {}
319
+ if request.agent&.parent
320
+ header_params["agent.parent"] = request.agent.parent
321
+ end
322
+
288
323
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
289
324
  metadata[:"x-goog-request-params"] ||= request_params_header
290
325
 
@@ -334,6 +369,21 @@ module Google
334
369
  #
335
370
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
336
371
  #
372
+ # @example Basic example
373
+ # require "google/cloud/dialogflow/v2"
374
+ #
375
+ # # Create a client object. The client can be reused for multiple calls.
376
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
377
+ #
378
+ # # Create a request. To set request fields, pass in keyword arguments.
379
+ # request = Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new
380
+ #
381
+ # # Call the delete_agent method.
382
+ # result = client.delete_agent request
383
+ #
384
+ # # The returned object is of type Google::Protobuf::Empty.
385
+ # p result
386
+ #
337
387
  def delete_agent request, options = nil
338
388
  raise ::ArgumentError, "request must be provided" if request.nil?
339
389
 
@@ -351,9 +401,11 @@ module Google
351
401
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
352
402
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
403
 
354
- header_params = {
355
- "parent" => request.parent
356
- }
404
+ header_params = {}
405
+ if request.parent
406
+ header_params["parent"] = request.parent
407
+ end
408
+
357
409
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
358
410
  metadata[:"x-goog-request-params"] ||= request_params_header
359
411
 
@@ -414,6 +466,27 @@ module Google
414
466
  #
415
467
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
416
468
  #
469
+ # @example Basic example
470
+ # require "google/cloud/dialogflow/v2"
471
+ #
472
+ # # Create a client object. The client can be reused for multiple calls.
473
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
474
+ #
475
+ # # Create a request. To set request fields, pass in keyword arguments.
476
+ # request = Google::Cloud::Dialogflow::V2::SearchAgentsRequest.new
477
+ #
478
+ # # Call the search_agents method.
479
+ # result = client.search_agents request
480
+ #
481
+ # # The returned object is of type Gapic::PagedEnumerable. You can
482
+ # # iterate over all elements by calling #each, and the enumerable
483
+ # # will lazily make API calls to fetch subsequent pages. Other
484
+ # # methods are also available for managing paging directly.
485
+ # result.each do |response|
486
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::Agent.
487
+ # p response
488
+ # end
489
+ #
417
490
  def search_agents request, options = nil
418
491
  raise ::ArgumentError, "request must be provided" if request.nil?
419
492
 
@@ -431,9 +504,11 @@ module Google
431
504
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
432
505
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
433
506
 
434
- header_params = {
435
- "parent" => request.parent
436
- }
507
+ header_params = {}
508
+ if request.parent
509
+ header_params["parent"] = request.parent
510
+ end
511
+
437
512
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
438
513
  metadata[:"x-goog-request-params"] ||= request_params_header
439
514
 
@@ -497,6 +572,28 @@ module Google
497
572
  #
498
573
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
499
574
  #
575
+ # @example Basic example
576
+ # require "google/cloud/dialogflow/v2"
577
+ #
578
+ # # Create a client object. The client can be reused for multiple calls.
579
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
580
+ #
581
+ # # Create a request. To set request fields, pass in keyword arguments.
582
+ # request = Google::Cloud::Dialogflow::V2::TrainAgentRequest.new
583
+ #
584
+ # # Call the train_agent method.
585
+ # result = client.train_agent request
586
+ #
587
+ # # The returned object is of type Gapic::Operation. You can use this
588
+ # # object to check the status of an operation, cancel it, or wait
589
+ # # for results. Here is how to block until completion:
590
+ # result.wait_until_done! timeout: 60
591
+ # if result.response?
592
+ # p result.response
593
+ # else
594
+ # puts "Error!"
595
+ # end
596
+ #
500
597
  def train_agent request, options = nil
501
598
  raise ::ArgumentError, "request must be provided" if request.nil?
502
599
 
@@ -514,9 +611,11 @@ module Google
514
611
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
515
612
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
516
613
 
517
- header_params = {
518
- "parent" => request.parent
519
- }
614
+ header_params = {}
615
+ if request.parent
616
+ header_params["parent"] = request.parent
617
+ end
618
+
520
619
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
521
620
  metadata[:"x-goog-request-params"] ||= request_params_header
522
621
 
@@ -580,6 +679,28 @@ module Google
580
679
  #
581
680
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
582
681
  #
682
+ # @example Basic example
683
+ # require "google/cloud/dialogflow/v2"
684
+ #
685
+ # # Create a client object. The client can be reused for multiple calls.
686
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
687
+ #
688
+ # # Create a request. To set request fields, pass in keyword arguments.
689
+ # request = Google::Cloud::Dialogflow::V2::ExportAgentRequest.new
690
+ #
691
+ # # Call the export_agent method.
692
+ # result = client.export_agent request
693
+ #
694
+ # # The returned object is of type Gapic::Operation. You can use this
695
+ # # object to check the status of an operation, cancel it, or wait
696
+ # # for results. Here is how to block until completion:
697
+ # result.wait_until_done! timeout: 60
698
+ # if result.response?
699
+ # p result.response
700
+ # else
701
+ # puts "Error!"
702
+ # end
703
+ #
583
704
  def export_agent request, options = nil
584
705
  raise ::ArgumentError, "request must be provided" if request.nil?
585
706
 
@@ -597,9 +718,11 @@ module Google
597
718
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
598
719
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
599
720
 
600
- header_params = {
601
- "parent" => request.parent
602
- }
721
+ header_params = {}
722
+ if request.parent
723
+ header_params["parent"] = request.parent
724
+ end
725
+
603
726
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
604
727
  metadata[:"x-goog-request-params"] ||= request_params_header
605
728
 
@@ -679,6 +802,28 @@ module Google
679
802
  #
680
803
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
681
804
  #
805
+ # @example Basic example
806
+ # require "google/cloud/dialogflow/v2"
807
+ #
808
+ # # Create a client object. The client can be reused for multiple calls.
809
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
810
+ #
811
+ # # Create a request. To set request fields, pass in keyword arguments.
812
+ # request = Google::Cloud::Dialogflow::V2::ImportAgentRequest.new
813
+ #
814
+ # # Call the import_agent method.
815
+ # result = client.import_agent request
816
+ #
817
+ # # The returned object is of type Gapic::Operation. You can use this
818
+ # # object to check the status of an operation, cancel it, or wait
819
+ # # for results. Here is how to block until completion:
820
+ # result.wait_until_done! timeout: 60
821
+ # if result.response?
822
+ # p result.response
823
+ # else
824
+ # puts "Error!"
825
+ # end
826
+ #
682
827
  def import_agent request, options = nil
683
828
  raise ::ArgumentError, "request must be provided" if request.nil?
684
829
 
@@ -696,9 +841,11 @@ module Google
696
841
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
697
842
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
698
843
 
699
- header_params = {
700
- "parent" => request.parent
701
- }
844
+ header_params = {}
845
+ if request.parent
846
+ header_params["parent"] = request.parent
847
+ end
848
+
702
849
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
703
850
  metadata[:"x-goog-request-params"] ||= request_params_header
704
851
 
@@ -777,6 +924,28 @@ module Google
777
924
  #
778
925
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
779
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::Agents::Client.new
932
+ #
933
+ # # Create a request. To set request fields, pass in keyword arguments.
934
+ # request = Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new
935
+ #
936
+ # # Call the restore_agent method.
937
+ # result = client.restore_agent 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
+ #
780
949
  def restore_agent request, options = nil
781
950
  raise ::ArgumentError, "request must be provided" if request.nil?
782
951
 
@@ -794,9 +963,11 @@ module Google
794
963
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
795
964
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
796
965
 
797
- header_params = {
798
- "parent" => request.parent
799
- }
966
+ header_params = {}
967
+ if request.parent
968
+ header_params["parent"] = request.parent
969
+ end
970
+
800
971
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
801
972
  metadata[:"x-goog-request-params"] ||= request_params_header
802
973
 
@@ -854,6 +1025,21 @@ module Google
854
1025
  #
855
1026
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
856
1027
  #
1028
+ # @example Basic example
1029
+ # require "google/cloud/dialogflow/v2"
1030
+ #
1031
+ # # Create a client object. The client can be reused for multiple calls.
1032
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
1033
+ #
1034
+ # # Create a request. To set request fields, pass in keyword arguments.
1035
+ # request = Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new
1036
+ #
1037
+ # # Call the get_validation_result method.
1038
+ # result = client.get_validation_result request
1039
+ #
1040
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::ValidationResult.
1041
+ # p result
1042
+ #
857
1043
  def get_validation_result request, options = nil
858
1044
  raise ::ArgumentError, "request must be provided" if request.nil?
859
1045
 
@@ -871,9 +1057,11 @@ module Google
871
1057
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
872
1058
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
873
1059
 
874
- header_params = {
875
- "parent" => request.parent
876
- }
1060
+ header_params = {}
1061
+ if request.parent
1062
+ header_params["parent"] = request.parent
1063
+ end
1064
+
877
1065
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
878
1066
  metadata[:"x-goog-request-params"] ||= request_params_header
879
1067
 
@@ -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