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.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +2 -1
- data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +44 -25
- data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +12 -15
- data/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb +19 -0
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +44 -25
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +43 -38
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +102 -68
- data/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +32 -6
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +32 -6
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +30 -14
- data/lib/google/cloud/dialogflow/cx/v3/data_store_connection_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +32 -8
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +32 -8
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +30 -14
- data/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +43 -21
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb +12 -15
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +43 -21
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb +43 -38
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +70 -44
- data/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +50 -27
- data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +12 -15
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +50 -27
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +43 -38
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb +86 -56
- data/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +38 -21
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +38 -21
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +70 -44
- data/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +47 -26
- data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +12 -15
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +47 -26
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +43 -38
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb +94 -62
- data/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/gcs_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/generative_settings_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb +2 -1
- data/lib/google/cloud/dialogflow/cx/v3/generators/client.rb +35 -12
- data/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb +35 -12
- data/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/import_strategy_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +41 -19
- data/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb +12 -15
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +41 -19
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb +43 -38
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +70 -44
- data/lib/google/cloud/dialogflow/cx/v3/page_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +37 -14
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +37 -14
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/safety_settings_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +35 -12
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +35 -12
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +54 -29
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +54 -29
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +5 -1
- data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +40 -16
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +40 -14
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +47 -26
- data/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +59 -38
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +12 -15
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +59 -38
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +43 -38
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb +110 -74
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +43 -21
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +43 -21
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/version_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +44 -22
- data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +12 -15
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +44 -22
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +43 -38
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb +70 -44
- data/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +35 -12
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +35 -12
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +54 -32
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb +1 -1
- data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +44 -20
- data/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb +6 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb +5 -5
- data/proto_docs/google/cloud/dialogflow/cx/v3/deployment.rb +11 -13
- data/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb +16 -17
- data/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb +26 -28
- data/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb +15 -19
- data/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +28 -27
- data/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb +2 -2
- data/proto_docs/google/cloud/dialogflow/cx/v3/generative_settings.rb +2 -2
- data/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb +41 -8
- data/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb +19 -19
- data/proto_docs/google/cloud/dialogflow/cx/v3/page.rb +33 -33
- data/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +2 -1
- data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +14 -14
- data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +107 -22
- data/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb +30 -28
- data/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb +41 -43
- data/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb +16 -18
- data/proto_docs/google/cloud/dialogflow/cx/v3/version.rb +19 -19
- data/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +24 -25
- data/proto_docs/google/longrunning/operations.rb +19 -14
- 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
|
+
@intents_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 = @intents_stub.endpoint
|
181
192
|
config.universe_domain = @intents_stub.universe_domain
|
193
|
+
config.logger = @intents_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
|
+
@intents_stub.logger
|
218
|
+
end
|
219
|
+
|
199
220
|
# Service calls
|
200
221
|
|
201
222
|
##
|
@@ -218,7 +239,7 @@ module Google
|
|
218
239
|
#
|
219
240
|
# @param parent [::String]
|
220
241
|
# Required. The agent to list all intents for.
|
221
|
-
# Format: `projects/<
|
242
|
+
# Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
|
222
243
|
# @param language_code [::String]
|
223
244
|
# The language to list intents for. The following fields are language
|
224
245
|
# dependent:
|
@@ -302,7 +323,7 @@ module Google
|
|
302
323
|
@intents_stub.call_rpc :list_intents, request, options: options do |response, operation|
|
303
324
|
response = ::Gapic::PagedEnumerable.new @intents_stub, :list_intents, request, response, operation, options
|
304
325
|
yield response, operation if block_given?
|
305
|
-
|
326
|
+
throw :response, response
|
306
327
|
end
|
307
328
|
rescue ::GRPC::BadStatus => e
|
308
329
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -328,8 +349,8 @@ module Google
|
|
328
349
|
#
|
329
350
|
# @param name [::String]
|
330
351
|
# Required. The name of the intent.
|
331
|
-
# Format:
|
332
|
-
#
|
352
|
+
# Format:
|
353
|
+
# `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>`.
|
333
354
|
# @param language_code [::String]
|
334
355
|
# The language to retrieve the intent for. The following fields are language
|
335
356
|
# dependent:
|
@@ -401,7 +422,6 @@ module Google
|
|
401
422
|
|
402
423
|
@intents_stub.call_rpc :get_intent, request, options: options do |response, operation|
|
403
424
|
yield response, operation if block_given?
|
404
|
-
return response
|
405
425
|
end
|
406
426
|
rescue ::GRPC::BadStatus => e
|
407
427
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -431,7 +451,7 @@ module Google
|
|
431
451
|
#
|
432
452
|
# @param parent [::String]
|
433
453
|
# Required. The agent to create an intent for.
|
434
|
-
# Format: `projects/<
|
454
|
+
# Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
|
435
455
|
# @param intent [::Google::Cloud::Dialogflow::CX::V3::Intent, ::Hash]
|
436
456
|
# Required. The intent to create.
|
437
457
|
# @param language_code [::String]
|
@@ -504,7 +524,6 @@ module Google
|
|
504
524
|
|
505
525
|
@intents_stub.call_rpc :create_intent, request, options: options do |response, operation|
|
506
526
|
yield response, operation if block_given?
|
507
|
-
return response
|
508
527
|
end
|
509
528
|
rescue ::GRPC::BadStatus => e
|
510
529
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -607,7 +626,6 @@ module Google
|
|
607
626
|
|
608
627
|
@intents_stub.call_rpc :update_intent, request, options: options do |response, operation|
|
609
628
|
yield response, operation if block_given?
|
610
|
-
return response
|
611
629
|
end
|
612
630
|
rescue ::GRPC::BadStatus => e
|
613
631
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -637,8 +655,8 @@ module Google
|
|
637
655
|
#
|
638
656
|
# @param name [::String]
|
639
657
|
# Required. The name of the intent to delete.
|
640
|
-
# Format:
|
641
|
-
#
|
658
|
+
# Format:
|
659
|
+
# `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>`.
|
642
660
|
#
|
643
661
|
# @yield [response, operation] Access the result along with the RPC operation
|
644
662
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -699,7 +717,6 @@ module Google
|
|
699
717
|
|
700
718
|
@intents_stub.call_rpc :delete_intent, request, options: options do |response, operation|
|
701
719
|
yield response, operation if block_given?
|
702
|
-
return response
|
703
720
|
end
|
704
721
|
rescue ::GRPC::BadStatus => e
|
705
722
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -734,7 +751,7 @@ module Google
|
|
734
751
|
#
|
735
752
|
# @param parent [::String]
|
736
753
|
# Required. The agent to import the intents into.
|
737
|
-
# Format: `projects/<
|
754
|
+
# Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
|
738
755
|
# @param intents_uri [::String]
|
739
756
|
# The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
|
740
757
|
# to import intents from. The format of this URI must be
|
@@ -817,7 +834,7 @@ module Google
|
|
817
834
|
@intents_stub.call_rpc :import_intents, request, options: options do |response, operation|
|
818
835
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
819
836
|
yield response, operation if block_given?
|
820
|
-
|
837
|
+
throw :response, response
|
821
838
|
end
|
822
839
|
rescue ::GRPC::BadStatus => e
|
823
840
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -852,12 +869,11 @@ module Google
|
|
852
869
|
#
|
853
870
|
# @param parent [::String]
|
854
871
|
# Required. The name of the parent agent to export intents.
|
855
|
-
# Format: `projects/<
|
856
|
-
# ID>`.
|
872
|
+
# Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
|
857
873
|
# @param intents [::Array<::String>]
|
858
874
|
# Required. The name of the intents to export.
|
859
|
-
# Format:
|
860
|
-
#
|
875
|
+
# Format:
|
876
|
+
# `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>`.
|
861
877
|
# @param intents_uri [::String]
|
862
878
|
# Optional. The [Google Cloud
|
863
879
|
# Storage](https://cloud.google.com/storage/docs/) URI to export the
|
@@ -942,7 +958,7 @@ module Google
|
|
942
958
|
@intents_stub.call_rpc :export_intents, request, options: options do |response, operation|
|
943
959
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
944
960
|
yield response, operation if block_given?
|
945
|
-
|
961
|
+
throw :response, response
|
946
962
|
end
|
947
963
|
rescue ::GRPC::BadStatus => e
|
948
964
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1031,6 +1047,11 @@ module Google
|
|
1031
1047
|
# default endpoint URL. The default value of nil uses the environment
|
1032
1048
|
# universe (usually the default "googleapis.com" universe).
|
1033
1049
|
# @return [::String,nil]
|
1050
|
+
# @!attribute [rw] logger
|
1051
|
+
# A custom logger to use for request/response debug logging, or the value
|
1052
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1053
|
+
# explicitly disable logging.
|
1054
|
+
# @return [::Logger,:default,nil]
|
1034
1055
|
#
|
1035
1056
|
class Configuration
|
1036
1057
|
extend ::Gapic::Config
|
@@ -1055,6 +1076,7 @@ module Google
|
|
1055
1076
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1056
1077
|
config_attr :quota_project, nil, ::String, nil
|
1057
1078
|
config_attr :universe_domain, nil, ::String, nil
|
1079
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1058
1080
|
|
1059
1081
|
# @private
|
1060
1082
|
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
|
-
|
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
|
-
|
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
|
426
|
-
# corresponding to
|
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
|
-
|
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
|
+
@intents_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 = @intents_stub.endpoint
|
174
185
|
config.universe_domain = @intents_stub.universe_domain
|
175
186
|
config.bindings_override = @config.bindings_override
|
187
|
+
config.logger = @intents_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
|
+
@intents_stub.logger
|
212
|
+
end
|
213
|
+
|
193
214
|
# Service calls
|
194
215
|
|
195
216
|
##
|
@@ -212,7 +233,7 @@ module Google
|
|
212
233
|
#
|
213
234
|
# @param parent [::String]
|
214
235
|
# Required. The agent to list all intents for.
|
215
|
-
# Format: `projects/<
|
236
|
+
# Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
|
216
237
|
# @param language_code [::String]
|
217
238
|
# The language to list intents for. The following fields are language
|
218
239
|
# dependent:
|
@@ -289,7 +310,7 @@ module Google
|
|
289
310
|
@intents_stub.list_intents request, options do |result, operation|
|
290
311
|
result = ::Gapic::Rest::PagedEnumerable.new @intents_stub, :list_intents, "intents", request, result, options
|
291
312
|
yield result, operation if block_given?
|
292
|
-
|
313
|
+
throw :response, result
|
293
314
|
end
|
294
315
|
rescue ::Gapic::Rest::Error => e
|
295
316
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -315,8 +336,8 @@ module Google
|
|
315
336
|
#
|
316
337
|
# @param name [::String]
|
317
338
|
# Required. The name of the intent.
|
318
|
-
# Format:
|
319
|
-
#
|
339
|
+
# Format:
|
340
|
+
# `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>`.
|
320
341
|
# @param language_code [::String]
|
321
342
|
# The language to retrieve the intent for. The following fields are language
|
322
343
|
# dependent:
|
@@ -381,7 +402,6 @@ module Google
|
|
381
402
|
|
382
403
|
@intents_stub.get_intent request, options do |result, operation|
|
383
404
|
yield result, operation if block_given?
|
384
|
-
return result
|
385
405
|
end
|
386
406
|
rescue ::Gapic::Rest::Error => e
|
387
407
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -411,7 +431,7 @@ module Google
|
|
411
431
|
#
|
412
432
|
# @param parent [::String]
|
413
433
|
# Required. The agent to create an intent for.
|
414
|
-
# Format: `projects/<
|
434
|
+
# Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
|
415
435
|
# @param intent [::Google::Cloud::Dialogflow::CX::V3::Intent, ::Hash]
|
416
436
|
# Required. The intent to create.
|
417
437
|
# @param language_code [::String]
|
@@ -477,7 +497,6 @@ module Google
|
|
477
497
|
|
478
498
|
@intents_stub.create_intent request, options do |result, operation|
|
479
499
|
yield result, operation if block_given?
|
480
|
-
return result
|
481
500
|
end
|
482
501
|
rescue ::Gapic::Rest::Error => e
|
483
502
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -573,7 +592,6 @@ module Google
|
|
573
592
|
|
574
593
|
@intents_stub.update_intent request, options do |result, operation|
|
575
594
|
yield result, operation if block_given?
|
576
|
-
return result
|
577
595
|
end
|
578
596
|
rescue ::Gapic::Rest::Error => e
|
579
597
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -603,8 +621,8 @@ module Google
|
|
603
621
|
#
|
604
622
|
# @param name [::String]
|
605
623
|
# Required. The name of the intent to delete.
|
606
|
-
# Format:
|
607
|
-
#
|
624
|
+
# Format:
|
625
|
+
# `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>`.
|
608
626
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
609
627
|
# @yieldparam result [::Google::Protobuf::Empty]
|
610
628
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -658,7 +676,6 @@ module Google
|
|
658
676
|
|
659
677
|
@intents_stub.delete_intent request, options do |result, operation|
|
660
678
|
yield result, operation if block_given?
|
661
|
-
return result
|
662
679
|
end
|
663
680
|
rescue ::Gapic::Rest::Error => e
|
664
681
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -693,7 +710,7 @@ module Google
|
|
693
710
|
#
|
694
711
|
# @param parent [::String]
|
695
712
|
# Required. The agent to import the intents into.
|
696
|
-
# Format: `projects/<
|
713
|
+
# Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
|
697
714
|
# @param intents_uri [::String]
|
698
715
|
# The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
|
699
716
|
# to import intents from. The format of this URI must be
|
@@ -769,7 +786,7 @@ module Google
|
|
769
786
|
@intents_stub.import_intents request, options do |result, operation|
|
770
787
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
771
788
|
yield result, operation if block_given?
|
772
|
-
|
789
|
+
throw :response, result
|
773
790
|
end
|
774
791
|
rescue ::Gapic::Rest::Error => e
|
775
792
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -804,12 +821,11 @@ module Google
|
|
804
821
|
#
|
805
822
|
# @param parent [::String]
|
806
823
|
# Required. The name of the parent agent to export intents.
|
807
|
-
# Format: `projects/<
|
808
|
-
# ID>`.
|
824
|
+
# Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
|
809
825
|
# @param intents [::Array<::String>]
|
810
826
|
# Required. The name of the intents to export.
|
811
|
-
# Format:
|
812
|
-
#
|
827
|
+
# Format:
|
828
|
+
# `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/intents/<IntentID>`.
|
813
829
|
# @param intents_uri [::String]
|
814
830
|
# Optional. The [Google Cloud
|
815
831
|
# Storage](https://cloud.google.com/storage/docs/) URI to export the
|
@@ -887,7 +903,7 @@ module Google
|
|
887
903
|
@intents_stub.export_intents request, options do |result, operation|
|
888
904
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
889
905
|
yield result, operation if block_given?
|
890
|
-
|
906
|
+
throw :response, result
|
891
907
|
end
|
892
908
|
rescue ::Gapic::Rest::Error => e
|
893
909
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -967,6 +983,11 @@ module Google
|
|
967
983
|
# default endpoint URL. The default value of nil uses the environment
|
968
984
|
# universe (usually the default "googleapis.com" universe).
|
969
985
|
# @return [::String,nil]
|
986
|
+
# @!attribute [rw] logger
|
987
|
+
# A custom logger to use for request/response debug logging, or the value
|
988
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
989
|
+
# explicitly disable logging.
|
990
|
+
# @return [::Logger,:default,nil]
|
970
991
|
#
|
971
992
|
class Configuration
|
972
993
|
extend ::Gapic::Config
|
@@ -995,6 +1016,7 @@ module Google
|
|
995
1016
|
# by the host service.
|
996
1017
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
997
1018
|
config_attr :bindings_override, {}, ::Hash, nil
|
1019
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
998
1020
|
|
999
1021
|
# @private
|
1000
1022
|
def initialize parent_config = nil
|
@@ -116,14 +116,6 @@ module Google
|
|
116
116
|
# Lists operations that match the specified filter in the request. If the
|
117
117
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
118
118
|
#
|
119
|
-
# NOTE: the `name` binding allows API services to override the binding
|
120
|
-
# to use different resource name schemes, such as `users/*/operations`. To
|
121
|
-
# override the binding, API services can add a binding such as
|
122
|
-
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
123
|
-
# For backwards compatibility, the default name includes the operations
|
124
|
-
# collection id, however overriding users must ensure the name binding
|
125
|
-
# is the parent resource, without the operations collection id.
|
126
|
-
#
|
127
119
|
# @overload list_operations(request, options = nil)
|
128
120
|
# Pass arguments to `list_operations` via a request object, either of type
|
129
121
|
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
@@ -205,7 +197,7 @@ module Google
|
|
205
197
|
@operations_stub.list_operations request, options do |result, operation|
|
206
198
|
result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
|
207
199
|
yield result, operation if block_given?
|
208
|
-
|
200
|
+
throw :response, result
|
209
201
|
end
|
210
202
|
rescue ::Gapic::Rest::Error => e
|
211
203
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -294,7 +286,7 @@ module Google
|
|
294
286
|
@operations_stub.get_operation request, options do |result, operation|
|
295
287
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
296
288
|
yield result, operation if block_given?
|
297
|
-
|
289
|
+
throw :response, result
|
298
290
|
end
|
299
291
|
rescue ::Gapic::Rest::Error => e
|
300
292
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -376,7 +368,6 @@ module Google
|
|
376
368
|
|
377
369
|
@operations_stub.delete_operation request, options do |result, operation|
|
378
370
|
yield result, operation if block_given?
|
379
|
-
return result
|
380
371
|
end
|
381
372
|
rescue ::Gapic::Rest::Error => e
|
382
373
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -391,8 +382,9 @@ module Google
|
|
391
382
|
# other methods to check whether the cancellation succeeded or whether the
|
392
383
|
# operation completed despite cancellation. On successful cancellation,
|
393
384
|
# the operation is not deleted; instead, it becomes an operation with
|
394
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
395
|
-
# corresponding to
|
385
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
386
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
|
387
|
+
# `Code.CANCELLED`.
|
396
388
|
#
|
397
389
|
# @overload cancel_operation(request, options = nil)
|
398
390
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -464,7 +456,6 @@ module Google
|
|
464
456
|
|
465
457
|
@operations_stub.cancel_operation request, options do |result, operation|
|
466
458
|
yield result, operation if block_given?
|
467
|
-
return result
|
468
459
|
end
|
469
460
|
rescue ::Gapic::Rest::Error => e
|
470
461
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -544,6 +535,11 @@ module Google
|
|
544
535
|
# default endpoint URL. The default value of nil uses the environment
|
545
536
|
# universe (usually the default "googleapis.com" universe).
|
546
537
|
# @return [::String,nil]
|
538
|
+
# @!attribute [rw] logger
|
539
|
+
# A custom logger to use for request/response debug logging, or the value
|
540
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
541
|
+
# explicitly disable logging.
|
542
|
+
# @return [::Logger,:default,nil]
|
547
543
|
#
|
548
544
|
class Configuration
|
549
545
|
extend ::Gapic::Config
|
@@ -565,6 +561,7 @@ module Google
|
|
565
561
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
566
562
|
config_attr :quota_project, nil, ::String, nil
|
567
563
|
config_attr :universe_domain, nil, ::String, nil
|
564
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
568
565
|
|
569
566
|
# @private
|
570
567
|
def initialize parent_config = nil
|
@@ -684,16 +681,18 @@ module Google
|
|
684
681
|
|
685
682
|
response = @client_stub.make_http_request(
|
686
683
|
verb,
|
687
|
-
uri:
|
688
|
-
body:
|
689
|
-
params:
|
684
|
+
uri: uri,
|
685
|
+
body: body || "",
|
686
|
+
params: query_string_params,
|
687
|
+
method_name: "list_operations",
|
690
688
|
options: options
|
691
689
|
)
|
692
690
|
operation = ::Gapic::Rest::TransportOperation.new response
|
693
691
|
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
|
694
|
-
|
695
|
-
|
696
|
-
|
692
|
+
catch :response do
|
693
|
+
yield result, operation if block_given?
|
694
|
+
result
|
695
|
+
end
|
697
696
|
end
|
698
697
|
|
699
698
|
##
|
@@ -722,16 +721,18 @@ module Google
|
|
722
721
|
|
723
722
|
response = @client_stub.make_http_request(
|
724
723
|
verb,
|
725
|
-
uri:
|
726
|
-
body:
|
727
|
-
params:
|
724
|
+
uri: uri,
|
725
|
+
body: body || "",
|
726
|
+
params: query_string_params,
|
727
|
+
method_name: "get_operation",
|
728
728
|
options: options
|
729
729
|
)
|
730
730
|
operation = ::Gapic::Rest::TransportOperation.new response
|
731
731
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
732
|
-
|
733
|
-
|
734
|
-
|
732
|
+
catch :response do
|
733
|
+
yield result, operation if block_given?
|
734
|
+
result
|
735
|
+
end
|
735
736
|
end
|
736
737
|
|
737
738
|
##
|
@@ -760,16 +761,18 @@ module Google
|
|
760
761
|
|
761
762
|
response = @client_stub.make_http_request(
|
762
763
|
verb,
|
763
|
-
uri:
|
764
|
-
body:
|
765
|
-
params:
|
764
|
+
uri: uri,
|
765
|
+
body: body || "",
|
766
|
+
params: query_string_params,
|
767
|
+
method_name: "delete_operation",
|
766
768
|
options: options
|
767
769
|
)
|
768
770
|
operation = ::Gapic::Rest::TransportOperation.new response
|
769
771
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
770
|
-
|
771
|
-
|
772
|
-
|
772
|
+
catch :response do
|
773
|
+
yield result, operation if block_given?
|
774
|
+
result
|
775
|
+
end
|
773
776
|
end
|
774
777
|
|
775
778
|
##
|
@@ -798,16 +801,18 @@ module Google
|
|
798
801
|
|
799
802
|
response = @client_stub.make_http_request(
|
800
803
|
verb,
|
801
|
-
uri:
|
802
|
-
body:
|
803
|
-
params:
|
804
|
+
uri: uri,
|
805
|
+
body: body || "",
|
806
|
+
params: query_string_params,
|
807
|
+
method_name: "cancel_operation",
|
804
808
|
options: options
|
805
809
|
)
|
806
810
|
operation = ::Gapic::Rest::TransportOperation.new response
|
807
811
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
808
|
-
|
809
|
-
|
810
|
-
|
812
|
+
catch :response do
|
813
|
+
yield result, operation if block_given?
|
814
|
+
result
|
815
|
+
end
|
811
816
|
end
|
812
817
|
|
813
818
|
##
|