google-cloud-dialogflow-cx-v3 1.1.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb +1 -1
  4. data/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +2 -1
  5. data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +44 -25
  6. data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +12 -15
  7. data/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb +19 -0
  8. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +44 -25
  9. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +43 -38
  10. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +102 -68
  11. data/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb +1 -1
  12. data/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb +1 -1
  13. data/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +32 -6
  14. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +32 -6
  15. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +30 -14
  16. data/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb +1 -1
  17. data/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +32 -8
  18. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +32 -8
  19. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +30 -14
  20. data/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb +1 -1
  21. data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +43 -21
  22. data/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb +12 -15
  23. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +43 -21
  24. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb +43 -38
  25. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +70 -44
  26. data/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb +1 -1
  27. data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +50 -27
  28. data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +12 -15
  29. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +50 -27
  30. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +43 -38
  31. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb +86 -56
  32. data/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb +1 -1
  33. data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +38 -21
  34. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +38 -21
  35. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +70 -44
  36. data/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb +1 -1
  37. data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +47 -26
  38. data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +12 -15
  39. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +47 -26
  40. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +43 -38
  41. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb +94 -62
  42. data/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb +1 -1
  43. data/lib/google/cloud/dialogflow/cx/v3/gcs_pb.rb +1 -1
  44. data/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb +1 -1
  45. data/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb +2 -1
  46. data/lib/google/cloud/dialogflow/cx/v3/generators/client.rb +35 -12
  47. data/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb +35 -12
  48. data/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb +54 -32
  49. data/lib/google/cloud/dialogflow/cx/v3/import_strategy_pb.rb +1 -1
  50. data/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb +1 -1
  51. data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +41 -19
  52. data/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb +12 -15
  53. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +41 -19
  54. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb +43 -38
  55. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +70 -44
  56. data/lib/google/cloud/dialogflow/cx/v3/page_pb.rb +1 -1
  57. data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +37 -14
  58. data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +37 -14
  59. data/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +54 -32
  60. data/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb +1 -1
  61. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +35 -12
  62. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +35 -12
  63. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb +54 -32
  64. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +54 -29
  65. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +54 -29
  66. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb +54 -32
  67. data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +5 -1
  68. data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +40 -16
  69. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +40 -14
  70. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +47 -26
  71. data/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb +1 -1
  72. data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +59 -38
  73. data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +12 -15
  74. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +59 -38
  75. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +43 -38
  76. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb +110 -74
  77. data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb +1 -1
  78. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +43 -21
  79. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +43 -21
  80. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb +54 -32
  81. data/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb +1 -1
  82. data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
  83. data/lib/google/cloud/dialogflow/cx/v3/version_pb.rb +1 -1
  84. data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +44 -22
  85. data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +12 -15
  86. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +44 -22
  87. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +43 -38
  88. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb +70 -44
  89. data/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb +1 -1
  90. data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +35 -12
  91. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +35 -12
  92. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +54 -32
  93. data/proto_docs/google/api/client.rb +39 -0
  94. data/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb +1 -1
  95. data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +44 -20
  96. data/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb +6 -0
  97. data/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb +5 -5
  98. data/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb +11 -13
  99. data/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb +16 -17
  100. data/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb +26 -28
  101. data/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb +15 -19
  102. data/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +28 -27
  103. data/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb +2 -2
  104. data/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb +2 -2
  105. data/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb +41 -8
  106. data/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb +19 -19
  107. data/proto_docs/google/cloud/dialogflow/cx/v3/page.rb +33 -33
  108. data/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +2 -1
  109. data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +14 -14
  110. data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +107 -22
  111. data/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb +30 -28
  112. data/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb +41 -43
  113. data/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb +16 -18
  114. data/proto_docs/google/cloud/dialogflow/cx/v3/version.rb +19 -19
  115. data/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +24 -25
  116. data/proto_docs/google/longrunning/operations.rb +19 -14
  117. metadata +5 -5
@@ -171,14 +171,26 @@ module Google
171
171
  universe_domain: @config.universe_domain,
172
172
  channel_args: @config.channel_args,
173
173
  interceptors: @config.interceptors,
174
- channel_pool_config: @config.channel_pool
174
+ channel_pool_config: @config.channel_pool,
175
+ logger: @config.logger
175
176
  )
176
177
 
178
+ @flows_stub.stub_logger&.info do |entry|
179
+ entry.set_system_name
180
+ entry.set_service
181
+ entry.message = "Created client for #{entry.service}"
182
+ entry.set_credentials_fields credentials
183
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
184
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
185
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
186
+ end
187
+
177
188
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
178
189
  config.credentials = credentials
179
190
  config.quota_project = @quota_project_id
180
191
  config.endpoint = @flows_stub.endpoint
181
192
  config.universe_domain = @flows_stub.universe_domain
193
+ config.logger = @flows_stub.logger if config.respond_to? :logger=
182
194
  end
183
195
  end
184
196
 
@@ -196,6 +208,15 @@ module Google
196
208
  #
197
209
  attr_reader :location_client
198
210
 
211
+ ##
212
+ # The logger used for request/response debug logging.
213
+ #
214
+ # @return [Logger]
215
+ #
216
+ def logger
217
+ @flows_stub.logger
218
+ end
219
+
199
220
  # Service calls
200
221
 
201
222
  ##
@@ -222,7 +243,7 @@ module Google
222
243
  #
223
244
  # @param parent [::String]
224
245
  # Required. The agent to create a flow for.
225
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
246
+ # Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
226
247
  # @param flow [::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash]
227
248
  # Required. The flow to create.
228
249
  # @param language_code [::String]
@@ -298,7 +319,6 @@ module Google
298
319
 
299
320
  @flows_stub.call_rpc :create_flow, request, options: options do |response, operation|
300
321
  yield response, operation if block_given?
301
- return response
302
322
  end
303
323
  rescue ::GRPC::BadStatus => e
304
324
  raise ::Google::Cloud::Error.from_error(e)
@@ -324,8 +344,8 @@ module Google
324
344
  #
325
345
  # @param name [::String]
326
346
  # Required. The name of the flow to delete.
327
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
328
- # ID>/flows/<Flow ID>`.
347
+ # Format:
348
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.
329
349
  # @param force [::Boolean]
330
350
  # This field has no effect for flows with no incoming transitions.
331
351
  # For flows with incoming transitions:
@@ -397,7 +417,6 @@ module Google
397
417
 
398
418
  @flows_stub.call_rpc :delete_flow, request, options: options do |response, operation|
399
419
  yield response, operation if block_given?
400
- return response
401
420
  end
402
421
  rescue ::GRPC::BadStatus => e
403
422
  raise ::Google::Cloud::Error.from_error(e)
@@ -423,7 +442,7 @@ module Google
423
442
  #
424
443
  # @param parent [::String]
425
444
  # Required. The agent containing the flows.
426
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
445
+ # Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
427
446
  # @param page_size [::Integer]
428
447
  # The maximum number of items to return in a single page. By default 100 and
429
448
  # at most 1000.
@@ -508,7 +527,7 @@ module Google
508
527
  @flows_stub.call_rpc :list_flows, request, options: options do |response, operation|
509
528
  response = ::Gapic::PagedEnumerable.new @flows_stub, :list_flows, request, response, operation, options
510
529
  yield response, operation if block_given?
511
- return response
530
+ throw :response, response
512
531
  end
513
532
  rescue ::GRPC::BadStatus => e
514
533
  raise ::Google::Cloud::Error.from_error(e)
@@ -534,8 +553,8 @@ module Google
534
553
  #
535
554
  # @param name [::String]
536
555
  # Required. The name of the flow to get.
537
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
538
- # ID>/flows/<Flow ID>`.
556
+ # Format:
557
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.
539
558
  # @param language_code [::String]
540
559
  # The language to retrieve the flow for. The following fields are language
541
560
  # dependent:
@@ -610,7 +629,6 @@ module Google
610
629
 
611
630
  @flows_stub.call_rpc :get_flow, request, options: options do |response, operation|
612
631
  yield response, operation if block_given?
613
- return response
614
632
  end
615
633
  rescue ::GRPC::BadStatus => e
616
634
  raise ::Google::Cloud::Error.from_error(e)
@@ -716,7 +734,6 @@ module Google
716
734
 
717
735
  @flows_stub.call_rpc :update_flow, request, options: options do |response, operation|
718
736
  yield response, operation if block_given?
719
- return response
720
737
  end
721
738
  rescue ::GRPC::BadStatus => e
722
739
  raise ::Google::Cloud::Error.from_error(e)
@@ -756,8 +773,8 @@ module Google
756
773
  #
757
774
  # @param name [::String]
758
775
  # Required. The flow to train.
759
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
760
- # ID>/flows/<Flow ID>`.
776
+ # Format:
777
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.
761
778
  #
762
779
  # @yield [response, operation] Access the result along with the RPC operation
763
780
  # @yieldparam response [::Gapic::Operation]
@@ -826,7 +843,7 @@ module Google
826
843
  @flows_stub.call_rpc :train_flow, request, options: options do |response, operation|
827
844
  response = ::Gapic::Operation.new response, @operations_client, options: options
828
845
  yield response, operation if block_given?
829
- return response
846
+ throw :response, response
830
847
  end
831
848
  rescue ::GRPC::BadStatus => e
832
849
  raise ::Google::Cloud::Error.from_error(e)
@@ -854,8 +871,8 @@ module Google
854
871
  #
855
872
  # @param name [::String]
856
873
  # Required. The flow to validate.
857
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
858
- # ID>/flows/<Flow ID>`.
874
+ # Format:
875
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.
859
876
  # @param language_code [::String]
860
877
  # If not specified, the agent's default language is used.
861
878
  #
@@ -918,7 +935,6 @@ module Google
918
935
 
919
936
  @flows_stub.call_rpc :validate_flow, request, options: options do |response, operation|
920
937
  yield response, operation if block_given?
921
- return response
922
938
  end
923
939
  rescue ::GRPC::BadStatus => e
924
940
  raise ::Google::Cloud::Error.from_error(e)
@@ -945,8 +961,8 @@ module Google
945
961
  #
946
962
  # @param name [::String]
947
963
  # Required. The flow name.
948
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
949
- # ID>/flows/<Flow ID>/validationResult`.
964
+ # Format:
965
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/validationResult`.
950
966
  # @param language_code [::String]
951
967
  # If not specified, the agent's default language is used.
952
968
  #
@@ -1009,7 +1025,6 @@ module Google
1009
1025
 
1010
1026
  @flows_stub.call_rpc :get_flow_validation_result, request, options: options do |response, operation|
1011
1027
  yield response, operation if block_given?
1012
- return response
1013
1028
  end
1014
1029
  rescue ::GRPC::BadStatus => e
1015
1030
  raise ::Google::Cloud::Error.from_error(e)
@@ -1048,7 +1063,7 @@ module Google
1048
1063
  #
1049
1064
  # @param parent [::String]
1050
1065
  # Required. The agent to import the flow into.
1051
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
1066
+ # Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
1052
1067
  # @param flow_uri [::String]
1053
1068
  # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
1054
1069
  # to import flow from. The format of this URI must be
@@ -1134,7 +1149,7 @@ module Google
1134
1149
  @flows_stub.call_rpc :import_flow, request, options: options do |response, operation|
1135
1150
  response = ::Gapic::Operation.new response, @operations_client, options: options
1136
1151
  yield response, operation if block_given?
1137
- return response
1152
+ throw :response, response
1138
1153
  end
1139
1154
  rescue ::GRPC::BadStatus => e
1140
1155
  raise ::Google::Cloud::Error.from_error(e)
@@ -1172,8 +1187,8 @@ module Google
1172
1187
  #
1173
1188
  # @param name [::String]
1174
1189
  # Required. The name of the flow to export.
1175
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
1176
- # ID>/flows/<Flow ID>`.
1190
+ # Format:
1191
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.
1177
1192
  # @param flow_uri [::String]
1178
1193
  # Optional. The [Google Cloud
1179
1194
  # Storage](https://cloud.google.com/storage/docs/) URI to export the flow to.
@@ -1255,7 +1270,7 @@ module Google
1255
1270
  @flows_stub.call_rpc :export_flow, request, options: options do |response, operation|
1256
1271
  response = ::Gapic::Operation.new response, @operations_client, options: options
1257
1272
  yield response, operation if block_given?
1258
- return response
1273
+ throw :response, response
1259
1274
  end
1260
1275
  rescue ::GRPC::BadStatus => e
1261
1276
  raise ::Google::Cloud::Error.from_error(e)
@@ -1344,6 +1359,11 @@ module Google
1344
1359
  # default endpoint URL. The default value of nil uses the environment
1345
1360
  # universe (usually the default "googleapis.com" universe).
1346
1361
  # @return [::String,nil]
1362
+ # @!attribute [rw] logger
1363
+ # A custom logger to use for request/response debug logging, or the value
1364
+ # `:default` (the default) to construct a default logger, or `nil` to
1365
+ # explicitly disable logging.
1366
+ # @return [::Logger,:default,nil]
1347
1367
  #
1348
1368
  class Configuration
1349
1369
  extend ::Gapic::Config
@@ -1368,6 +1388,7 @@ module Google
1368
1388
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1369
1389
  config_attr :quota_project, nil, ::String, nil
1370
1390
  config_attr :universe_domain, nil, ::String, nil
1391
+ config_attr :logger, :default, ::Logger, nil, :default
1371
1392
 
1372
1393
  # @private
1373
1394
  def initialize parent_config = nil
@@ -125,14 +125,6 @@ module Google
125
125
  # Lists operations that match the specified filter in the request. If the
126
126
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
127
127
  #
128
- # NOTE: the `name` binding allows API services to override the binding
129
- # to use different resource name schemes, such as `users/*/operations`. To
130
- # override the binding, API services can add a binding such as
131
- # `"/v1/{name=users/*}/operations"` to their service configuration.
132
- # For backwards compatibility, the default name includes the operations
133
- # collection id, however overriding users must ensure the name binding
134
- # is the parent resource, without the operations collection id.
135
- #
136
128
  # @overload list_operations(request, options = nil)
137
129
  # Pass arguments to `list_operations` via a request object, either of type
138
130
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -222,7 +214,7 @@ module Google
222
214
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
223
215
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
224
216
  yield response, operation if block_given?
225
- return response
217
+ throw :response, response
226
218
  end
227
219
  rescue ::GRPC::BadStatus => e
228
220
  raise ::Google::Cloud::Error.from_error(e)
@@ -318,7 +310,7 @@ module Google
318
310
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
319
311
  response = ::Gapic::Operation.new response, @operations_client, options: options
320
312
  yield response, operation if block_given?
321
- return response
313
+ throw :response, response
322
314
  end
323
315
  rescue ::GRPC::BadStatus => e
324
316
  raise ::Google::Cloud::Error.from_error(e)
@@ -407,7 +399,6 @@ module Google
407
399
 
408
400
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
409
401
  yield response, operation if block_given?
410
- return response
411
402
  end
412
403
  rescue ::GRPC::BadStatus => e
413
404
  raise ::Google::Cloud::Error.from_error(e)
@@ -422,8 +413,9 @@ module Google
422
413
  # other methods to check whether the cancellation succeeded or whether the
423
414
  # operation completed despite cancellation. On successful cancellation,
424
415
  # the operation is not deleted; instead, it becomes an operation with
425
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
426
- # corresponding to `Code.CANCELLED`.
416
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
417
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
418
+ # `Code.CANCELLED`.
427
419
  #
428
420
  # @overload cancel_operation(request, options = nil)
429
421
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -502,7 +494,6 @@ module Google
502
494
 
503
495
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
504
496
  yield response, operation if block_given?
505
- return response
506
497
  end
507
498
  rescue ::GRPC::BadStatus => e
508
499
  raise ::Google::Cloud::Error.from_error(e)
@@ -600,7 +591,7 @@ module Google
600
591
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
601
592
  response = ::Gapic::Operation.new response, @operations_client, options: options
602
593
  yield response, operation if block_given?
603
- return response
594
+ throw :response, response
604
595
  end
605
596
  rescue ::GRPC::BadStatus => e
606
597
  raise ::Google::Cloud::Error.from_error(e)
@@ -689,6 +680,11 @@ module Google
689
680
  # default endpoint URL. The default value of nil uses the environment
690
681
  # universe (usually the default "googleapis.com" universe).
691
682
  # @return [::String,nil]
683
+ # @!attribute [rw] logger
684
+ # A custom logger to use for request/response debug logging, or the value
685
+ # `:default` (the default) to construct a default logger, or `nil` to
686
+ # explicitly disable logging.
687
+ # @return [::Logger,:default,nil]
692
688
  #
693
689
  class Configuration
694
690
  extend ::Gapic::Config
@@ -713,6 +709,7 @@ module Google
713
709
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
714
710
  config_attr :quota_project, nil, ::String, nil
715
711
  config_attr :universe_domain, nil, ::String, nil
712
+ config_attr :logger, :default, ::Logger, nil, :default
716
713
 
717
714
  # @private
718
715
  def initialize parent_config = nil
@@ -164,15 +164,27 @@ module Google
164
164
  endpoint: @config.endpoint,
165
165
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
166
166
  universe_domain: @config.universe_domain,
167
- credentials: credentials
167
+ credentials: credentials,
168
+ logger: @config.logger
168
169
  )
169
170
 
171
+ @flows_stub.logger(stub: true)&.info do |entry|
172
+ entry.set_system_name
173
+ entry.set_service
174
+ entry.message = "Created client for #{entry.service}"
175
+ entry.set_credentials_fields credentials
176
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
177
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
178
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
179
+ end
180
+
170
181
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
171
182
  config.credentials = credentials
172
183
  config.quota_project = @quota_project_id
173
184
  config.endpoint = @flows_stub.endpoint
174
185
  config.universe_domain = @flows_stub.universe_domain
175
186
  config.bindings_override = @config.bindings_override
187
+ config.logger = @flows_stub.logger if config.respond_to? :logger=
176
188
  end
177
189
  end
178
190
 
@@ -190,6 +202,15 @@ module Google
190
202
  #
191
203
  attr_reader :location_client
192
204
 
205
+ ##
206
+ # The logger used for request/response debug logging.
207
+ #
208
+ # @return [Logger]
209
+ #
210
+ def logger
211
+ @flows_stub.logger
212
+ end
213
+
193
214
  # Service calls
194
215
 
195
216
  ##
@@ -216,7 +237,7 @@ module Google
216
237
  #
217
238
  # @param parent [::String]
218
239
  # Required. The agent to create a flow for.
219
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
240
+ # Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
220
241
  # @param flow [::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash]
221
242
  # Required. The flow to create.
222
243
  # @param language_code [::String]
@@ -285,7 +306,6 @@ module Google
285
306
 
286
307
  @flows_stub.create_flow request, options do |result, operation|
287
308
  yield result, operation if block_given?
288
- return result
289
309
  end
290
310
  rescue ::Gapic::Rest::Error => e
291
311
  raise ::Google::Cloud::Error.from_error(e)
@@ -311,8 +331,8 @@ module Google
311
331
  #
312
332
  # @param name [::String]
313
333
  # Required. The name of the flow to delete.
314
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
315
- # ID>/flows/<Flow ID>`.
334
+ # Format:
335
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.
316
336
  # @param force [::Boolean]
317
337
  # This field has no effect for flows with no incoming transitions.
318
338
  # For flows with incoming transitions:
@@ -377,7 +397,6 @@ module Google
377
397
 
378
398
  @flows_stub.delete_flow request, options do |result, operation|
379
399
  yield result, operation if block_given?
380
- return result
381
400
  end
382
401
  rescue ::Gapic::Rest::Error => e
383
402
  raise ::Google::Cloud::Error.from_error(e)
@@ -403,7 +422,7 @@ module Google
403
422
  #
404
423
  # @param parent [::String]
405
424
  # Required. The agent containing the flows.
406
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
425
+ # Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
407
426
  # @param page_size [::Integer]
408
427
  # The maximum number of items to return in a single page. By default 100 and
409
428
  # at most 1000.
@@ -481,7 +500,7 @@ module Google
481
500
  @flows_stub.list_flows request, options do |result, operation|
482
501
  result = ::Gapic::Rest::PagedEnumerable.new @flows_stub, :list_flows, "flows", request, result, options
483
502
  yield result, operation if block_given?
484
- return result
503
+ throw :response, result
485
504
  end
486
505
  rescue ::Gapic::Rest::Error => e
487
506
  raise ::Google::Cloud::Error.from_error(e)
@@ -507,8 +526,8 @@ module Google
507
526
  #
508
527
  # @param name [::String]
509
528
  # Required. The name of the flow to get.
510
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
511
- # ID>/flows/<Flow ID>`.
529
+ # Format:
530
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.
512
531
  # @param language_code [::String]
513
532
  # The language to retrieve the flow for. The following fields are language
514
533
  # dependent:
@@ -576,7 +595,6 @@ module Google
576
595
 
577
596
  @flows_stub.get_flow request, options do |result, operation|
578
597
  yield result, operation if block_given?
579
- return result
580
598
  end
581
599
  rescue ::Gapic::Rest::Error => e
582
600
  raise ::Google::Cloud::Error.from_error(e)
@@ -675,7 +693,6 @@ module Google
675
693
 
676
694
  @flows_stub.update_flow request, options do |result, operation|
677
695
  yield result, operation if block_given?
678
- return result
679
696
  end
680
697
  rescue ::Gapic::Rest::Error => e
681
698
  raise ::Google::Cloud::Error.from_error(e)
@@ -715,8 +732,8 @@ module Google
715
732
  #
716
733
  # @param name [::String]
717
734
  # Required. The flow to train.
718
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
719
- # ID>/flows/<Flow ID>`.
735
+ # Format:
736
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.
720
737
  # @yield [result, operation] Access the result along with the TransportOperation object
721
738
  # @yieldparam result [::Gapic::Operation]
722
739
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -778,7 +795,7 @@ module Google
778
795
  @flows_stub.train_flow request, options do |result, operation|
779
796
  result = ::Gapic::Operation.new result, @operations_client, options: options
780
797
  yield result, operation if block_given?
781
- return result
798
+ throw :response, result
782
799
  end
783
800
  rescue ::Gapic::Rest::Error => e
784
801
  raise ::Google::Cloud::Error.from_error(e)
@@ -806,8 +823,8 @@ module Google
806
823
  #
807
824
  # @param name [::String]
808
825
  # Required. The flow to validate.
809
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
810
- # ID>/flows/<Flow ID>`.
826
+ # Format:
827
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.
811
828
  # @param language_code [::String]
812
829
  # If not specified, the agent's default language is used.
813
830
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -863,7 +880,6 @@ module Google
863
880
 
864
881
  @flows_stub.validate_flow request, options do |result, operation|
865
882
  yield result, operation if block_given?
866
- return result
867
883
  end
868
884
  rescue ::Gapic::Rest::Error => e
869
885
  raise ::Google::Cloud::Error.from_error(e)
@@ -890,8 +906,8 @@ module Google
890
906
  #
891
907
  # @param name [::String]
892
908
  # Required. The flow name.
893
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
894
- # ID>/flows/<Flow ID>/validationResult`.
909
+ # Format:
910
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/validationResult`.
895
911
  # @param language_code [::String]
896
912
  # If not specified, the agent's default language is used.
897
913
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -947,7 +963,6 @@ module Google
947
963
 
948
964
  @flows_stub.get_flow_validation_result request, options do |result, operation|
949
965
  yield result, operation if block_given?
950
- return result
951
966
  end
952
967
  rescue ::Gapic::Rest::Error => e
953
968
  raise ::Google::Cloud::Error.from_error(e)
@@ -986,7 +1001,7 @@ module Google
986
1001
  #
987
1002
  # @param parent [::String]
988
1003
  # Required. The agent to import the flow into.
989
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
1004
+ # Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
990
1005
  # @param flow_uri [::String]
991
1006
  # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
992
1007
  # to import flow from. The format of this URI must be
@@ -1065,7 +1080,7 @@ module Google
1065
1080
  @flows_stub.import_flow request, options do |result, operation|
1066
1081
  result = ::Gapic::Operation.new result, @operations_client, options: options
1067
1082
  yield result, operation if block_given?
1068
- return result
1083
+ throw :response, result
1069
1084
  end
1070
1085
  rescue ::Gapic::Rest::Error => e
1071
1086
  raise ::Google::Cloud::Error.from_error(e)
@@ -1103,8 +1118,8 @@ module Google
1103
1118
  #
1104
1119
  # @param name [::String]
1105
1120
  # Required. The name of the flow to export.
1106
- # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
1107
- # ID>/flows/<Flow ID>`.
1121
+ # Format:
1122
+ # `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.
1108
1123
  # @param flow_uri [::String]
1109
1124
  # Optional. The [Google Cloud
1110
1125
  # Storage](https://cloud.google.com/storage/docs/) URI to export the flow to.
@@ -1179,7 +1194,7 @@ module Google
1179
1194
  @flows_stub.export_flow request, options do |result, operation|
1180
1195
  result = ::Gapic::Operation.new result, @operations_client, options: options
1181
1196
  yield result, operation if block_given?
1182
- return result
1197
+ throw :response, result
1183
1198
  end
1184
1199
  rescue ::Gapic::Rest::Error => e
1185
1200
  raise ::Google::Cloud::Error.from_error(e)
@@ -1259,6 +1274,11 @@ module Google
1259
1274
  # default endpoint URL. The default value of nil uses the environment
1260
1275
  # universe (usually the default "googleapis.com" universe).
1261
1276
  # @return [::String,nil]
1277
+ # @!attribute [rw] logger
1278
+ # A custom logger to use for request/response debug logging, or the value
1279
+ # `:default` (the default) to construct a default logger, or `nil` to
1280
+ # explicitly disable logging.
1281
+ # @return [::Logger,:default,nil]
1262
1282
  #
1263
1283
  class Configuration
1264
1284
  extend ::Gapic::Config
@@ -1287,6 +1307,7 @@ module Google
1287
1307
  # by the host service.
1288
1308
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1289
1309
  config_attr :bindings_override, {}, ::Hash, nil
1310
+ config_attr :logger, :default, ::Logger, nil, :default
1290
1311
 
1291
1312
  # @private
1292
1313
  def initialize parent_config = nil