google-cloud-dialogflow-cx-v3 1.2.0 → 1.4.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 +31 -21
- data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +44 -12
- data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +44 -12
- data/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +50 -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 +36 -3
- data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +36 -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 +36 -3
- data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +36 -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 +46 -8
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +46 -8
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/operations.rb +50 -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 +42 -10
- data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +42 -10
- data/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +50 -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 +36 -8
- data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +36 -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 +43 -11
- data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +43 -11
- data/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +50 -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 +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb +36 -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 +46 -8
- data/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +46 -8
- data/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb +50 -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 +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +36 -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 +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +36 -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 +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +36 -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 +35 -7
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +35 -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 +45 -13
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +45 -13
- data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +50 -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 +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +36 -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 +38 -8
- data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +19 -15
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +38 -8
- data/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +50 -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 +36 -6
- data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +36 -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/cloud/dialogflow/cx/v3/agent.rb +12 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb +12 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb +4 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +8 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb +4 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb +12 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/page.rb +12 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +28 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +4 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +32 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb +22 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +18 -0
- data/proto_docs/google/longrunning/operations.rb +23 -14
- data/proto_docs/google/protobuf/struct.rb +12 -0
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c7395c9cd13597ac2c9f8f5eca18316a5001cbef972983e54352f0b57752393
|
4
|
+
data.tar.gz: ce21b1169fc6ed217e0918aedd773ba2c7e10227cbca279e86b5f1d69d1a04d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad23fd86e5cfa4dce59f025ff6654eaa9902fe86dd932f2f3a51ac2f75f0cc05bef26645ccde7fbd7bd36a8128dfd4808910017f52da2e6e0443926085c7b6bd
|
7
|
+
data.tar.gz: 8987435b3fa5bce08f239f2ef43cb60ece792084809fdb079b22720fc1d9ce241d4cef71b17214c95e753148dc49611f6e73f1102a40dcfbf6b07e4c62297fab
|
data/README.md
CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/dialogflow)
|
44
44
|
for general usage information.
|
45
45
|
|
46
|
-
##
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
## Debug Logging
|
47
|
+
|
48
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
49
|
+
your application's integration with the API. When logging is activated, key
|
50
|
+
events such as requests and responses, along with data payloads and metadata
|
51
|
+
such as headers and client configuration, are logged to the standard error
|
52
|
+
stream.
|
53
|
+
|
54
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
55
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
56
|
+
customers, private keys, or other security data that could be compromising if
|
57
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
58
|
+
the principle of least access. Google also recommends that Client Library Debug
|
59
|
+
Logging be enabled only temporarily during active debugging, and not used
|
60
|
+
permanently in production.
|
61
|
+
|
62
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
63
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
64
|
+
list of client library gem names. This will select the default logging behavior,
|
65
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
66
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
67
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
68
|
+
results in logs appearing alongside your application logs in the
|
69
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
70
|
+
|
71
|
+
You can customize logging by modifying the `logger` configuration when
|
72
|
+
constructing a client object. For example:
|
55
73
|
|
56
74
|
```ruby
|
75
|
+
require "google/cloud/dialogflow/cx/v3"
|
57
76
|
require "logger"
|
58
77
|
|
59
|
-
|
60
|
-
|
61
|
-
def logger
|
62
|
-
LOGGER
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
67
|
-
module GRPC
|
68
|
-
extend MyLogger
|
78
|
+
client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config|
|
79
|
+
config.logger = Logger.new "my-app.log"
|
69
80
|
end
|
70
81
|
```
|
71
82
|
|
72
|
-
|
73
83
|
## Google Cloud Samples
|
74
84
|
|
75
85
|
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
76
86
|
|
77
87
|
## Supported Ruby Versions
|
78
88
|
|
79
|
-
This library is supported on Ruby
|
89
|
+
This library is supported on Ruby 3.0+.
|
80
90
|
|
81
91
|
Google provides official support for Ruby versions that are actively supported
|
82
92
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
@@ -176,14 +176,26 @@ module Google
|
|
176
176
|
universe_domain: @config.universe_domain,
|
177
177
|
channel_args: @config.channel_args,
|
178
178
|
interceptors: @config.interceptors,
|
179
|
-
channel_pool_config: @config.channel_pool
|
179
|
+
channel_pool_config: @config.channel_pool,
|
180
|
+
logger: @config.logger
|
180
181
|
)
|
181
182
|
|
183
|
+
@agents_stub.stub_logger&.info do |entry|
|
184
|
+
entry.set_system_name
|
185
|
+
entry.set_service
|
186
|
+
entry.message = "Created client for #{entry.service}"
|
187
|
+
entry.set_credentials_fields credentials
|
188
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
189
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
190
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
191
|
+
end
|
192
|
+
|
182
193
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
183
194
|
config.credentials = credentials
|
184
195
|
config.quota_project = @quota_project_id
|
185
196
|
config.endpoint = @agents_stub.endpoint
|
186
197
|
config.universe_domain = @agents_stub.universe_domain
|
198
|
+
config.logger = @agents_stub.logger if config.respond_to? :logger=
|
187
199
|
end
|
188
200
|
end
|
189
201
|
|
@@ -201,6 +213,15 @@ module Google
|
|
201
213
|
#
|
202
214
|
attr_reader :location_client
|
203
215
|
|
216
|
+
##
|
217
|
+
# The logger used for request/response debug logging.
|
218
|
+
#
|
219
|
+
# @return [Logger]
|
220
|
+
#
|
221
|
+
def logger
|
222
|
+
@agents_stub.logger
|
223
|
+
end
|
224
|
+
|
204
225
|
# Service calls
|
205
226
|
|
206
227
|
##
|
@@ -294,7 +315,7 @@ module Google
|
|
294
315
|
@agents_stub.call_rpc :list_agents, request, options: options do |response, operation|
|
295
316
|
response = ::Gapic::PagedEnumerable.new @agents_stub, :list_agents, request, response, operation, options
|
296
317
|
yield response, operation if block_given?
|
297
|
-
|
318
|
+
throw :response, response
|
298
319
|
end
|
299
320
|
rescue ::GRPC::BadStatus => e
|
300
321
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -381,7 +402,6 @@ module Google
|
|
381
402
|
|
382
403
|
@agents_stub.call_rpc :get_agent, request, options: options do |response, operation|
|
383
404
|
yield response, operation if block_given?
|
384
|
-
return response
|
385
405
|
end
|
386
406
|
rescue ::GRPC::BadStatus => e
|
387
407
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -474,7 +494,6 @@ module Google
|
|
474
494
|
|
475
495
|
@agents_stub.call_rpc :create_agent, request, options: options do |response, operation|
|
476
496
|
yield response, operation if block_given?
|
477
|
-
return response
|
478
497
|
end
|
479
498
|
rescue ::GRPC::BadStatus => e
|
480
499
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -567,7 +586,6 @@ module Google
|
|
567
586
|
|
568
587
|
@agents_stub.call_rpc :update_agent, request, options: options do |response, operation|
|
569
588
|
yield response, operation if block_given?
|
570
|
-
return response
|
571
589
|
end
|
572
590
|
rescue ::GRPC::BadStatus => e
|
573
591
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -654,7 +672,6 @@ module Google
|
|
654
672
|
|
655
673
|
@agents_stub.call_rpc :delete_agent, request, options: options do |response, operation|
|
656
674
|
yield response, operation if block_given?
|
657
|
-
return response
|
658
675
|
end
|
659
676
|
rescue ::GRPC::BadStatus => e
|
660
677
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -780,7 +797,7 @@ module Google
|
|
780
797
|
@agents_stub.call_rpc :export_agent, request, options: options do |response, operation|
|
781
798
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
782
799
|
yield response, operation if block_given?
|
783
|
-
|
800
|
+
throw :response, response
|
784
801
|
end
|
785
802
|
rescue ::GRPC::BadStatus => e
|
786
803
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -833,10 +850,16 @@ module Google
|
|
833
850
|
# have read permissions for the object. For more information, see
|
834
851
|
# [Dialogflow access
|
835
852
|
# control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
|
853
|
+
#
|
854
|
+
# Note: The following fields are mutually exclusive: `agent_uri`, `agent_content`, `git_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
836
855
|
# @param agent_content [::String]
|
837
856
|
# Uncompressed raw byte content for agent.
|
857
|
+
#
|
858
|
+
# Note: The following fields are mutually exclusive: `agent_content`, `agent_uri`, `git_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
838
859
|
# @param git_source [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::GitSource, ::Hash]
|
839
860
|
# Setting for restoring from a git branch
|
861
|
+
#
|
862
|
+
# Note: The following fields are mutually exclusive: `git_source`, `agent_uri`, `agent_content`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
840
863
|
# @param restore_option [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::RestoreOption]
|
841
864
|
# Agent restore mode. If not specified, `KEEP` is assumed.
|
842
865
|
#
|
@@ -907,7 +930,7 @@ module Google
|
|
907
930
|
@agents_stub.call_rpc :restore_agent, request, options: options do |response, operation|
|
908
931
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
909
932
|
yield response, operation if block_given?
|
910
|
-
|
933
|
+
throw :response, response
|
911
934
|
end
|
912
935
|
rescue ::GRPC::BadStatus => e
|
913
936
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -998,7 +1021,6 @@ module Google
|
|
998
1021
|
|
999
1022
|
@agents_stub.call_rpc :validate_agent, request, options: options do |response, operation|
|
1000
1023
|
yield response, operation if block_given?
|
1001
|
-
return response
|
1002
1024
|
end
|
1003
1025
|
rescue ::GRPC::BadStatus => e
|
1004
1026
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1089,7 +1111,6 @@ module Google
|
|
1089
1111
|
|
1090
1112
|
@agents_stub.call_rpc :get_agent_validation_result, request, options: options do |response, operation|
|
1091
1113
|
yield response, operation if block_given?
|
1092
|
-
return response
|
1093
1114
|
end
|
1094
1115
|
rescue ::GRPC::BadStatus => e
|
1095
1116
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1178,7 +1199,6 @@ module Google
|
|
1178
1199
|
|
1179
1200
|
@agents_stub.call_rpc :get_generative_settings, request, options: options do |response, operation|
|
1180
1201
|
yield response, operation if block_given?
|
1181
|
-
return response
|
1182
1202
|
end
|
1183
1203
|
rescue ::GRPC::BadStatus => e
|
1184
1204
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1267,7 +1287,6 @@ module Google
|
|
1267
1287
|
|
1268
1288
|
@agents_stub.call_rpc :update_generative_settings, request, options: options do |response, operation|
|
1269
1289
|
yield response, operation if block_given?
|
1270
|
-
return response
|
1271
1290
|
end
|
1272
1291
|
rescue ::GRPC::BadStatus => e
|
1273
1292
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1317,6 +1336,13 @@ module Google
|
|
1317
1336
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
1318
1337
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
1319
1338
|
# * (`nil`) indicating no credentials
|
1339
|
+
#
|
1340
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1341
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1342
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1343
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1344
|
+
# For more information, refer to [Validate credential configurations from external
|
1345
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1320
1346
|
# @return [::Object]
|
1321
1347
|
# @!attribute [rw] scope
|
1322
1348
|
# The OAuth scopes
|
@@ -1356,6 +1382,11 @@ module Google
|
|
1356
1382
|
# default endpoint URL. The default value of nil uses the environment
|
1357
1383
|
# universe (usually the default "googleapis.com" universe).
|
1358
1384
|
# @return [::String,nil]
|
1385
|
+
# @!attribute [rw] logger
|
1386
|
+
# A custom logger to use for request/response debug logging, or the value
|
1387
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1388
|
+
# explicitly disable logging.
|
1389
|
+
# @return [::Logger,:default,nil]
|
1359
1390
|
#
|
1360
1391
|
class Configuration
|
1361
1392
|
extend ::Gapic::Config
|
@@ -1380,6 +1411,7 @@ module Google
|
|
1380
1411
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1381
1412
|
config_attr :quota_project, nil, ::String, nil
|
1382
1413
|
config_attr :universe_domain, nil, ::String, nil
|
1414
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1383
1415
|
|
1384
1416
|
# @private
|
1385
1417
|
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)
|
@@ -650,6 +641,13 @@ module Google
|
|
650
641
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
651
642
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
652
643
|
# * (`nil`) indicating no credentials
|
644
|
+
#
|
645
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
646
|
+
# external source for authentication to Google Cloud, you must validate it before
|
647
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
648
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
649
|
+
# For more information, refer to [Validate credential configurations from external
|
650
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
653
651
|
# @return [::Object]
|
654
652
|
# @!attribute [rw] scope
|
655
653
|
# The OAuth scopes
|
@@ -689,6 +687,11 @@ module Google
|
|
689
687
|
# default endpoint URL. The default value of nil uses the environment
|
690
688
|
# universe (usually the default "googleapis.com" universe).
|
691
689
|
# @return [::String,nil]
|
690
|
+
# @!attribute [rw] logger
|
691
|
+
# A custom logger to use for request/response debug logging, or the value
|
692
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
693
|
+
# explicitly disable logging.
|
694
|
+
# @return [::Logger,:default,nil]
|
692
695
|
#
|
693
696
|
class Configuration
|
694
697
|
extend ::Gapic::Config
|
@@ -713,6 +716,7 @@ module Google
|
|
713
716
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
714
717
|
config_attr :quota_project, nil, ::String, nil
|
715
718
|
config_attr :universe_domain, nil, ::String, nil
|
719
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
716
720
|
|
717
721
|
# @private
|
718
722
|
def initialize parent_config = nil
|
@@ -169,15 +169,27 @@ module Google
|
|
169
169
|
endpoint: @config.endpoint,
|
170
170
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
171
171
|
universe_domain: @config.universe_domain,
|
172
|
-
credentials: credentials
|
172
|
+
credentials: credentials,
|
173
|
+
logger: @config.logger
|
173
174
|
)
|
174
175
|
|
176
|
+
@agents_stub.logger(stub: true)&.info do |entry|
|
177
|
+
entry.set_system_name
|
178
|
+
entry.set_service
|
179
|
+
entry.message = "Created client for #{entry.service}"
|
180
|
+
entry.set_credentials_fields credentials
|
181
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
182
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
183
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
184
|
+
end
|
185
|
+
|
175
186
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
176
187
|
config.credentials = credentials
|
177
188
|
config.quota_project = @quota_project_id
|
178
189
|
config.endpoint = @agents_stub.endpoint
|
179
190
|
config.universe_domain = @agents_stub.universe_domain
|
180
191
|
config.bindings_override = @config.bindings_override
|
192
|
+
config.logger = @agents_stub.logger if config.respond_to? :logger=
|
181
193
|
end
|
182
194
|
end
|
183
195
|
|
@@ -195,6 +207,15 @@ module Google
|
|
195
207
|
#
|
196
208
|
attr_reader :location_client
|
197
209
|
|
210
|
+
##
|
211
|
+
# The logger used for request/response debug logging.
|
212
|
+
#
|
213
|
+
# @return [Logger]
|
214
|
+
#
|
215
|
+
def logger
|
216
|
+
@agents_stub.logger
|
217
|
+
end
|
218
|
+
|
198
219
|
# Service calls
|
199
220
|
|
200
221
|
##
|
@@ -281,7 +302,7 @@ module Google
|
|
281
302
|
@agents_stub.list_agents request, options do |result, operation|
|
282
303
|
result = ::Gapic::Rest::PagedEnumerable.new @agents_stub, :list_agents, "agents", request, result, options
|
283
304
|
yield result, operation if block_given?
|
284
|
-
|
305
|
+
throw :response, result
|
285
306
|
end
|
286
307
|
rescue ::Gapic::Rest::Error => e
|
287
308
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -361,7 +382,6 @@ module Google
|
|
361
382
|
|
362
383
|
@agents_stub.get_agent request, options do |result, operation|
|
363
384
|
yield result, operation if block_given?
|
364
|
-
return result
|
365
385
|
end
|
366
386
|
rescue ::Gapic::Rest::Error => e
|
367
387
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -447,7 +467,6 @@ module Google
|
|
447
467
|
|
448
468
|
@agents_stub.create_agent request, options do |result, operation|
|
449
469
|
yield result, operation if block_given?
|
450
|
-
return result
|
451
470
|
end
|
452
471
|
rescue ::Gapic::Rest::Error => e
|
453
472
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -533,7 +552,6 @@ module Google
|
|
533
552
|
|
534
553
|
@agents_stub.update_agent request, options do |result, operation|
|
535
554
|
yield result, operation if block_given?
|
536
|
-
return result
|
537
555
|
end
|
538
556
|
rescue ::Gapic::Rest::Error => e
|
539
557
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -613,7 +631,6 @@ module Google
|
|
613
631
|
|
614
632
|
@agents_stub.delete_agent request, options do |result, operation|
|
615
633
|
yield result, operation if block_given?
|
616
|
-
return result
|
617
634
|
end
|
618
635
|
rescue ::Gapic::Rest::Error => e
|
619
636
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -732,7 +749,7 @@ module Google
|
|
732
749
|
@agents_stub.export_agent request, options do |result, operation|
|
733
750
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
734
751
|
yield result, operation if block_given?
|
735
|
-
|
752
|
+
throw :response, result
|
736
753
|
end
|
737
754
|
rescue ::Gapic::Rest::Error => e
|
738
755
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -785,10 +802,16 @@ module Google
|
|
785
802
|
# have read permissions for the object. For more information, see
|
786
803
|
# [Dialogflow access
|
787
804
|
# control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
|
805
|
+
#
|
806
|
+
# Note: The following fields are mutually exclusive: `agent_uri`, `agent_content`, `git_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
788
807
|
# @param agent_content [::String]
|
789
808
|
# Uncompressed raw byte content for agent.
|
809
|
+
#
|
810
|
+
# Note: The following fields are mutually exclusive: `agent_content`, `agent_uri`, `git_source`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
790
811
|
# @param git_source [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::GitSource, ::Hash]
|
791
812
|
# Setting for restoring from a git branch
|
813
|
+
#
|
814
|
+
# Note: The following fields are mutually exclusive: `git_source`, `agent_uri`, `agent_content`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
792
815
|
# @param restore_option [::Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest::RestoreOption]
|
793
816
|
# Agent restore mode. If not specified, `KEEP` is assumed.
|
794
817
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
@@ -852,7 +875,7 @@ module Google
|
|
852
875
|
@agents_stub.restore_agent request, options do |result, operation|
|
853
876
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
854
877
|
yield result, operation if block_given?
|
855
|
-
|
878
|
+
throw :response, result
|
856
879
|
end
|
857
880
|
rescue ::Gapic::Rest::Error => e
|
858
881
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -936,7 +959,6 @@ module Google
|
|
936
959
|
|
937
960
|
@agents_stub.validate_agent request, options do |result, operation|
|
938
961
|
yield result, operation if block_given?
|
939
|
-
return result
|
940
962
|
end
|
941
963
|
rescue ::Gapic::Rest::Error => e
|
942
964
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1020,7 +1042,6 @@ module Google
|
|
1020
1042
|
|
1021
1043
|
@agents_stub.get_agent_validation_result request, options do |result, operation|
|
1022
1044
|
yield result, operation if block_given?
|
1023
|
-
return result
|
1024
1045
|
end
|
1025
1046
|
rescue ::Gapic::Rest::Error => e
|
1026
1047
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1102,7 +1123,6 @@ module Google
|
|
1102
1123
|
|
1103
1124
|
@agents_stub.get_generative_settings request, options do |result, operation|
|
1104
1125
|
yield result, operation if block_given?
|
1105
|
-
return result
|
1106
1126
|
end
|
1107
1127
|
rescue ::Gapic::Rest::Error => e
|
1108
1128
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1184,7 +1204,6 @@ module Google
|
|
1184
1204
|
|
1185
1205
|
@agents_stub.update_generative_settings request, options do |result, operation|
|
1186
1206
|
yield result, operation if block_given?
|
1187
|
-
return result
|
1188
1207
|
end
|
1189
1208
|
rescue ::Gapic::Rest::Error => e
|
1190
1209
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1232,6 +1251,13 @@ module Google
|
|
1232
1251
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1233
1252
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1234
1253
|
# * (`nil`) indicating no credentials
|
1254
|
+
#
|
1255
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1256
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1257
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1258
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1259
|
+
# For more information, refer to [Validate credential configurations from external
|
1260
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1235
1261
|
# @return [::Object]
|
1236
1262
|
# @!attribute [rw] scope
|
1237
1263
|
# The OAuth scopes
|
@@ -1264,6 +1290,11 @@ module Google
|
|
1264
1290
|
# default endpoint URL. The default value of nil uses the environment
|
1265
1291
|
# universe (usually the default "googleapis.com" universe).
|
1266
1292
|
# @return [::String,nil]
|
1293
|
+
# @!attribute [rw] logger
|
1294
|
+
# A custom logger to use for request/response debug logging, or the value
|
1295
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1296
|
+
# explicitly disable logging.
|
1297
|
+
# @return [::Logger,:default,nil]
|
1267
1298
|
#
|
1268
1299
|
class Configuration
|
1269
1300
|
extend ::Gapic::Config
|
@@ -1292,6 +1323,7 @@ module Google
|
|
1292
1323
|
# by the host service.
|
1293
1324
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
1294
1325
|
config_attr :bindings_override, {}, ::Hash, nil
|
1326
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1295
1327
|
|
1296
1328
|
# @private
|
1297
1329
|
def initialize parent_config = nil
|