google-cloud-dialogflow-cx-v3 1.2.0 → 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/agents/client.rb +31 -12
- data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +12 -15
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +31 -12
- 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/changelogs/client.rb +29 -3
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +29 -3
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +30 -14
- data/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +29 -3
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +29 -3
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +30 -14
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +31 -8
- 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 +31 -8
- 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/environments/client.rb +35 -10
- data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +12 -15
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +35 -10
- 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/experiments/client.rb +29 -8
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +29 -8
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +70 -44
- data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +32 -11
- data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +12 -15
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +32 -11
- 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/generators/client.rb +29 -6
- data/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb +29 -6
- data/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +31 -8
- data/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb +12 -15
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +31 -8
- 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/pages/client.rb +29 -6
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +29 -6
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +29 -6
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +29 -6
- 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 +29 -6
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +29 -6
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +28 -7
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +28 -5
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +47 -26
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +34 -13
- 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 +34 -13
- 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_groups/client.rb +29 -6
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +29 -6
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb +54 -32
- data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +31 -8
- data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +12 -15
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +31 -8
- 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/webhooks/client.rb +29 -6
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +29 -6
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +54 -32
- data/proto_docs/google/api/client.rb +19 -0
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +5 -5
|
@@ -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
|
##
|
|
@@ -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)
|
|
@@ -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)
|
|
@@ -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)
|
|
@@ -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)
|
|
@@ -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)
|
|
@@ -886,7 +903,7 @@ module Google
|
|
|
886
903
|
@intents_stub.export_intents request, options do |result, operation|
|
|
887
904
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
888
905
|
yield result, operation if block_given?
|
|
889
|
-
|
|
906
|
+
throw :response, result
|
|
890
907
|
end
|
|
891
908
|
rescue ::Gapic::Rest::Error => e
|
|
892
909
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -966,6 +983,11 @@ module Google
|
|
|
966
983
|
# default endpoint URL. The default value of nil uses the environment
|
|
967
984
|
# universe (usually the default "googleapis.com" universe).
|
|
968
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]
|
|
969
991
|
#
|
|
970
992
|
class Configuration
|
|
971
993
|
extend ::Gapic::Config
|
|
@@ -994,6 +1016,7 @@ module Google
|
|
|
994
1016
|
# by the host service.
|
|
995
1017
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
|
996
1018
|
config_attr :bindings_override, {}, ::Hash, nil
|
|
1019
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
|
997
1020
|
|
|
998
1021
|
# @private
|
|
999
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
|
##
|
|
@@ -31,7 +31,8 @@ module Google
|
|
|
31
31
|
# including transcoding, making the REST call, and deserialing the response.
|
|
32
32
|
#
|
|
33
33
|
class ServiceStub
|
|
34
|
-
|
|
34
|
+
# @private
|
|
35
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
|
35
36
|
# These require statements are intentionally placed here to initialize
|
|
36
37
|
# the REST modules only when it's required.
|
|
37
38
|
require "gapic/rest"
|
|
@@ -41,7 +42,9 @@ module Google
|
|
|
41
42
|
universe_domain: universe_domain,
|
|
42
43
|
credentials: credentials,
|
|
43
44
|
numeric_enums: true,
|
|
44
|
-
|
|
45
|
+
service_name: self.class,
|
|
46
|
+
raise_faraday_errors: false,
|
|
47
|
+
logger: logger
|
|
45
48
|
end
|
|
46
49
|
|
|
47
50
|
##
|
|
@@ -62,6 +65,15 @@ module Google
|
|
|
62
65
|
@client_stub.endpoint
|
|
63
66
|
end
|
|
64
67
|
|
|
68
|
+
##
|
|
69
|
+
# The logger used for request/response debug logging.
|
|
70
|
+
#
|
|
71
|
+
# @return [Logger]
|
|
72
|
+
#
|
|
73
|
+
def logger stub: false
|
|
74
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
|
75
|
+
end
|
|
76
|
+
|
|
65
77
|
##
|
|
66
78
|
# Baseline implementation for the list_intents REST call
|
|
67
79
|
#
|
|
@@ -88,16 +100,18 @@ module Google
|
|
|
88
100
|
|
|
89
101
|
response = @client_stub.make_http_request(
|
|
90
102
|
verb,
|
|
91
|
-
uri:
|
|
92
|
-
body:
|
|
93
|
-
params:
|
|
103
|
+
uri: uri,
|
|
104
|
+
body: body || "",
|
|
105
|
+
params: query_string_params,
|
|
106
|
+
method_name: "list_intents",
|
|
94
107
|
options: options
|
|
95
108
|
)
|
|
96
109
|
operation = ::Gapic::Rest::TransportOperation.new response
|
|
97
110
|
result = ::Google::Cloud::Dialogflow::CX::V3::ListIntentsResponse.decode_json response.body, ignore_unknown_fields: true
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
111
|
+
catch :response do
|
|
112
|
+
yield result, operation if block_given?
|
|
113
|
+
result
|
|
114
|
+
end
|
|
101
115
|
end
|
|
102
116
|
|
|
103
117
|
##
|
|
@@ -126,16 +140,18 @@ module Google
|
|
|
126
140
|
|
|
127
141
|
response = @client_stub.make_http_request(
|
|
128
142
|
verb,
|
|
129
|
-
uri:
|
|
130
|
-
body:
|
|
131
|
-
params:
|
|
143
|
+
uri: uri,
|
|
144
|
+
body: body || "",
|
|
145
|
+
params: query_string_params,
|
|
146
|
+
method_name: "get_intent",
|
|
132
147
|
options: options
|
|
133
148
|
)
|
|
134
149
|
operation = ::Gapic::Rest::TransportOperation.new response
|
|
135
150
|
result = ::Google::Cloud::Dialogflow::CX::V3::Intent.decode_json response.body, ignore_unknown_fields: true
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
151
|
+
catch :response do
|
|
152
|
+
yield result, operation if block_given?
|
|
153
|
+
result
|
|
154
|
+
end
|
|
139
155
|
end
|
|
140
156
|
|
|
141
157
|
##
|
|
@@ -164,16 +180,18 @@ module Google
|
|
|
164
180
|
|
|
165
181
|
response = @client_stub.make_http_request(
|
|
166
182
|
verb,
|
|
167
|
-
uri:
|
|
168
|
-
body:
|
|
169
|
-
params:
|
|
183
|
+
uri: uri,
|
|
184
|
+
body: body || "",
|
|
185
|
+
params: query_string_params,
|
|
186
|
+
method_name: "create_intent",
|
|
170
187
|
options: options
|
|
171
188
|
)
|
|
172
189
|
operation = ::Gapic::Rest::TransportOperation.new response
|
|
173
190
|
result = ::Google::Cloud::Dialogflow::CX::V3::Intent.decode_json response.body, ignore_unknown_fields: true
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
191
|
+
catch :response do
|
|
192
|
+
yield result, operation if block_given?
|
|
193
|
+
result
|
|
194
|
+
end
|
|
177
195
|
end
|
|
178
196
|
|
|
179
197
|
##
|
|
@@ -202,16 +220,18 @@ module Google
|
|
|
202
220
|
|
|
203
221
|
response = @client_stub.make_http_request(
|
|
204
222
|
verb,
|
|
205
|
-
uri:
|
|
206
|
-
body:
|
|
207
|
-
params:
|
|
223
|
+
uri: uri,
|
|
224
|
+
body: body || "",
|
|
225
|
+
params: query_string_params,
|
|
226
|
+
method_name: "update_intent",
|
|
208
227
|
options: options
|
|
209
228
|
)
|
|
210
229
|
operation = ::Gapic::Rest::TransportOperation.new response
|
|
211
230
|
result = ::Google::Cloud::Dialogflow::CX::V3::Intent.decode_json response.body, ignore_unknown_fields: true
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
231
|
+
catch :response do
|
|
232
|
+
yield result, operation if block_given?
|
|
233
|
+
result
|
|
234
|
+
end
|
|
215
235
|
end
|
|
216
236
|
|
|
217
237
|
##
|
|
@@ -240,16 +260,18 @@ module Google
|
|
|
240
260
|
|
|
241
261
|
response = @client_stub.make_http_request(
|
|
242
262
|
verb,
|
|
243
|
-
uri:
|
|
244
|
-
body:
|
|
245
|
-
params:
|
|
263
|
+
uri: uri,
|
|
264
|
+
body: body || "",
|
|
265
|
+
params: query_string_params,
|
|
266
|
+
method_name: "delete_intent",
|
|
246
267
|
options: options
|
|
247
268
|
)
|
|
248
269
|
operation = ::Gapic::Rest::TransportOperation.new response
|
|
249
270
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
271
|
+
catch :response do
|
|
272
|
+
yield result, operation if block_given?
|
|
273
|
+
result
|
|
274
|
+
end
|
|
253
275
|
end
|
|
254
276
|
|
|
255
277
|
##
|
|
@@ -278,16 +300,18 @@ module Google
|
|
|
278
300
|
|
|
279
301
|
response = @client_stub.make_http_request(
|
|
280
302
|
verb,
|
|
281
|
-
uri:
|
|
282
|
-
body:
|
|
283
|
-
params:
|
|
303
|
+
uri: uri,
|
|
304
|
+
body: body || "",
|
|
305
|
+
params: query_string_params,
|
|
306
|
+
method_name: "import_intents",
|
|
284
307
|
options: options
|
|
285
308
|
)
|
|
286
309
|
operation = ::Gapic::Rest::TransportOperation.new response
|
|
287
310
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
311
|
+
catch :response do
|
|
312
|
+
yield result, operation if block_given?
|
|
313
|
+
result
|
|
314
|
+
end
|
|
291
315
|
end
|
|
292
316
|
|
|
293
317
|
##
|
|
@@ -316,16 +340,18 @@ module Google
|
|
|
316
340
|
|
|
317
341
|
response = @client_stub.make_http_request(
|
|
318
342
|
verb,
|
|
319
|
-
uri:
|
|
320
|
-
body:
|
|
321
|
-
params:
|
|
343
|
+
uri: uri,
|
|
344
|
+
body: body || "",
|
|
345
|
+
params: query_string_params,
|
|
346
|
+
method_name: "export_intents",
|
|
322
347
|
options: options
|
|
323
348
|
)
|
|
324
349
|
operation = ::Gapic::Rest::TransportOperation.new response
|
|
325
350
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
351
|
+
catch :response do
|
|
352
|
+
yield result, operation if block_given?
|
|
353
|
+
result
|
|
354
|
+
end
|
|
329
355
|
end
|
|
330
356
|
|
|
331
357
|
##
|
|
@@ -164,14 +164,26 @@ module Google
|
|
|
164
164
|
universe_domain: @config.universe_domain,
|
|
165
165
|
channel_args: @config.channel_args,
|
|
166
166
|
interceptors: @config.interceptors,
|
|
167
|
-
channel_pool_config: @config.channel_pool
|
|
167
|
+
channel_pool_config: @config.channel_pool,
|
|
168
|
+
logger: @config.logger
|
|
168
169
|
)
|
|
169
170
|
|
|
171
|
+
@pages_stub.stub_logger&.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::Client.new do |config|
|
|
171
182
|
config.credentials = credentials
|
|
172
183
|
config.quota_project = @quota_project_id
|
|
173
184
|
config.endpoint = @pages_stub.endpoint
|
|
174
185
|
config.universe_domain = @pages_stub.universe_domain
|
|
186
|
+
config.logger = @pages_stub.logger if config.respond_to? :logger=
|
|
175
187
|
end
|
|
176
188
|
end
|
|
177
189
|
|
|
@@ -182,6 +194,15 @@ module Google
|
|
|
182
194
|
#
|
|
183
195
|
attr_reader :location_client
|
|
184
196
|
|
|
197
|
+
##
|
|
198
|
+
# The logger used for request/response debug logging.
|
|
199
|
+
#
|
|
200
|
+
# @return [Logger]
|
|
201
|
+
#
|
|
202
|
+
def logger
|
|
203
|
+
@pages_stub.logger
|
|
204
|
+
end
|
|
205
|
+
|
|
185
206
|
# Service calls
|
|
186
207
|
|
|
187
208
|
##
|
|
@@ -298,7 +319,7 @@ module Google
|
|
|
298
319
|
@pages_stub.call_rpc :list_pages, request, options: options do |response, operation|
|
|
299
320
|
response = ::Gapic::PagedEnumerable.new @pages_stub, :list_pages, request, response, operation, options
|
|
300
321
|
yield response, operation if block_given?
|
|
301
|
-
|
|
322
|
+
throw :response, response
|
|
302
323
|
end
|
|
303
324
|
rescue ::GRPC::BadStatus => e
|
|
304
325
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -408,7 +429,6 @@ module Google
|
|
|
408
429
|
|
|
409
430
|
@pages_stub.call_rpc :get_page, request, options: options do |response, operation|
|
|
410
431
|
yield response, operation if block_given?
|
|
411
|
-
return response
|
|
412
432
|
end
|
|
413
433
|
rescue ::GRPC::BadStatus => e
|
|
414
434
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -523,7 +543,6 @@ module Google
|
|
|
523
543
|
|
|
524
544
|
@pages_stub.call_rpc :create_page, request, options: options do |response, operation|
|
|
525
545
|
yield response, operation if block_given?
|
|
526
|
-
return response
|
|
527
546
|
end
|
|
528
547
|
rescue ::GRPC::BadStatus => e
|
|
529
548
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -637,7 +656,6 @@ module Google
|
|
|
637
656
|
|
|
638
657
|
@pages_stub.call_rpc :update_page, request, options: options do |response, operation|
|
|
639
658
|
yield response, operation if block_given?
|
|
640
|
-
return response
|
|
641
659
|
end
|
|
642
660
|
rescue ::GRPC::BadStatus => e
|
|
643
661
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -740,7 +758,6 @@ module Google
|
|
|
740
758
|
|
|
741
759
|
@pages_stub.call_rpc :delete_page, request, options: options do |response, operation|
|
|
742
760
|
yield response, operation if block_given?
|
|
743
|
-
return response
|
|
744
761
|
end
|
|
745
762
|
rescue ::GRPC::BadStatus => e
|
|
746
763
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -829,6 +846,11 @@ module Google
|
|
|
829
846
|
# default endpoint URL. The default value of nil uses the environment
|
|
830
847
|
# universe (usually the default "googleapis.com" universe).
|
|
831
848
|
# @return [::String,nil]
|
|
849
|
+
# @!attribute [rw] logger
|
|
850
|
+
# A custom logger to use for request/response debug logging, or the value
|
|
851
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
|
852
|
+
# explicitly disable logging.
|
|
853
|
+
# @return [::Logger,:default,nil]
|
|
832
854
|
#
|
|
833
855
|
class Configuration
|
|
834
856
|
extend ::Gapic::Config
|
|
@@ -853,6 +875,7 @@ module Google
|
|
|
853
875
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
|
854
876
|
config_attr :quota_project, nil, ::String, nil
|
|
855
877
|
config_attr :universe_domain, nil, ::String, nil
|
|
878
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
|
856
879
|
|
|
857
880
|
# @private
|
|
858
881
|
def initialize parent_config = nil
|