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
@@ -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_pages 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_pages",
|
94
107
|
options: options
|
95
108
|
)
|
96
109
|
operation = ::Gapic::Rest::TransportOperation.new response
|
97
110
|
result = ::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse.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_page",
|
132
147
|
options: options
|
133
148
|
)
|
134
149
|
operation = ::Gapic::Rest::TransportOperation.new response
|
135
150
|
result = ::Google::Cloud::Dialogflow::CX::V3::Page.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_page",
|
170
187
|
options: options
|
171
188
|
)
|
172
189
|
operation = ::Gapic::Rest::TransportOperation.new response
|
173
190
|
result = ::Google::Cloud::Dialogflow::CX::V3::Page.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_page",
|
208
227
|
options: options
|
209
228
|
)
|
210
229
|
operation = ::Gapic::Rest::TransportOperation.new response
|
211
230
|
result = ::Google::Cloud::Dialogflow::CX::V3::Page.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_page",
|
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
|
##
|
@@ -7,7 +7,7 @@ require 'google/protobuf'
|
|
7
7
|
require 'google/api/field_behavior_pb'
|
8
8
|
|
9
9
|
|
10
|
-
descriptor_data = "\n3google/cloud/dialogflow/cx/v3/safety_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\"\x97\x01\n\x0eSafetySettings\x12L\n\x0e\x62\x61nned_phrases\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase\x1a\x37\n\x06Phrase\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\x42\
|
10
|
+
descriptor_data = "\n3google/cloud/dialogflow/cx/v3/safety_settings.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1fgoogle/api/field_behavior.proto\"\x97\x01\n\x0eSafetySettings\x12L\n\x0e\x62\x61nned_phrases\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.SafetySettings.Phrase\x1a\x37\n\x06Phrase\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\x42\xb6\x01\n!com.google.cloud.dialogflow.cx.v3B\x13SafetySettingsProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3"
|
11
11
|
|
12
12
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
13
13
|
|
@@ -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
|
+
@security_settings_service_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 = @security_settings_service_stub.endpoint
|
174
185
|
config.universe_domain = @security_settings_service_stub.universe_domain
|
186
|
+
config.logger = @security_settings_service_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
|
+
@security_settings_service_stub.logger
|
204
|
+
end
|
205
|
+
|
185
206
|
# Service calls
|
186
207
|
|
187
208
|
##
|
@@ -205,7 +226,7 @@ module Google
|
|
205
226
|
# @param parent [::String]
|
206
227
|
# Required. The location to create an
|
207
228
|
# {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} for.
|
208
|
-
# Format: `projects/<
|
229
|
+
# Format: `projects/<ProjectID>/locations/<LocationID>`.
|
209
230
|
# @param security_settings [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings, ::Hash]
|
210
231
|
# Required. The security settings to create.
|
211
232
|
#
|
@@ -268,7 +289,6 @@ module Google
|
|
268
289
|
|
269
290
|
@security_settings_service_stub.call_rpc :create_security_settings, request, options: options do |response, operation|
|
270
291
|
yield response, operation if block_given?
|
271
|
-
return response
|
272
292
|
end
|
273
293
|
rescue ::GRPC::BadStatus => e
|
274
294
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -296,8 +316,8 @@ module Google
|
|
296
316
|
#
|
297
317
|
# @param name [::String]
|
298
318
|
# Required. Resource name of the settings.
|
299
|
-
# Format:
|
300
|
-
#
|
319
|
+
# Format:
|
320
|
+
# `projects/<ProjectID>/locations/<LocationID>/securitySettings/<securitysettingsID>`.
|
301
321
|
#
|
302
322
|
# @yield [response, operation] Access the result along with the RPC operation
|
303
323
|
# @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings]
|
@@ -358,7 +378,6 @@ module Google
|
|
358
378
|
|
359
379
|
@security_settings_service_stub.call_rpc :get_security_settings, request, options: options do |response, operation|
|
360
380
|
yield response, operation if block_given?
|
361
|
-
return response
|
362
381
|
end
|
363
382
|
rescue ::GRPC::BadStatus => e
|
364
383
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -449,7 +468,6 @@ module Google
|
|
449
468
|
|
450
469
|
@security_settings_service_stub.call_rpc :update_security_settings, request, options: options do |response, operation|
|
451
470
|
yield response, operation if block_given?
|
452
|
-
return response
|
453
471
|
end
|
454
472
|
rescue ::GRPC::BadStatus => e
|
455
473
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -475,7 +493,7 @@ module Google
|
|
475
493
|
#
|
476
494
|
# @param parent [::String]
|
477
495
|
# Required. The location to list all security settings for.
|
478
|
-
# Format: `projects/<
|
496
|
+
# Format: `projects/<ProjectID>/locations/<LocationID>`.
|
479
497
|
# @param page_size [::Integer]
|
480
498
|
# The maximum number of items to return in a single page. By default 20 and
|
481
499
|
# at most 100.
|
@@ -546,7 +564,7 @@ module Google
|
|
546
564
|
@security_settings_service_stub.call_rpc :list_security_settings, request, options: options do |response, operation|
|
547
565
|
response = ::Gapic::PagedEnumerable.new @security_settings_service_stub, :list_security_settings, request, response, operation, options
|
548
566
|
yield response, operation if block_given?
|
549
|
-
|
567
|
+
throw :response, response
|
550
568
|
end
|
551
569
|
rescue ::GRPC::BadStatus => e
|
552
570
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -574,8 +592,8 @@ module Google
|
|
574
592
|
# @param name [::String]
|
575
593
|
# Required. The name of the
|
576
594
|
# {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} to
|
577
|
-
# delete. Format:
|
578
|
-
#
|
595
|
+
# delete. Format:
|
596
|
+
# `projects/<ProjectID>/locations/<LocationID>/securitySettings/<SecuritySettingsID>`.
|
579
597
|
#
|
580
598
|
# @yield [response, operation] Access the result along with the RPC operation
|
581
599
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -636,7 +654,6 @@ module Google
|
|
636
654
|
|
637
655
|
@security_settings_service_stub.call_rpc :delete_security_settings, request, options: options do |response, operation|
|
638
656
|
yield response, operation if block_given?
|
639
|
-
return response
|
640
657
|
end
|
641
658
|
rescue ::GRPC::BadStatus => e
|
642
659
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -725,6 +742,11 @@ module Google
|
|
725
742
|
# default endpoint URL. The default value of nil uses the environment
|
726
743
|
# universe (usually the default "googleapis.com" universe).
|
727
744
|
# @return [::String,nil]
|
745
|
+
# @!attribute [rw] logger
|
746
|
+
# A custom logger to use for request/response debug logging, or the value
|
747
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
748
|
+
# explicitly disable logging.
|
749
|
+
# @return [::Logger,:default,nil]
|
728
750
|
#
|
729
751
|
class Configuration
|
730
752
|
extend ::Gapic::Config
|
@@ -749,6 +771,7 @@ module Google
|
|
749
771
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
750
772
|
config_attr :quota_project, nil, ::String, nil
|
751
773
|
config_attr :universe_domain, nil, ::String, nil
|
774
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
752
775
|
|
753
776
|
# @private
|
754
777
|
def initialize parent_config = nil
|
@@ -157,15 +157,27 @@ module Google
|
|
157
157
|
endpoint: @config.endpoint,
|
158
158
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
159
159
|
universe_domain: @config.universe_domain,
|
160
|
-
credentials: credentials
|
160
|
+
credentials: credentials,
|
161
|
+
logger: @config.logger
|
161
162
|
)
|
162
163
|
|
164
|
+
@security_settings_service_stub.logger(stub: true)&.info do |entry|
|
165
|
+
entry.set_system_name
|
166
|
+
entry.set_service
|
167
|
+
entry.message = "Created client for #{entry.service}"
|
168
|
+
entry.set_credentials_fields credentials
|
169
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
170
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
171
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
172
|
+
end
|
173
|
+
|
163
174
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
164
175
|
config.credentials = credentials
|
165
176
|
config.quota_project = @quota_project_id
|
166
177
|
config.endpoint = @security_settings_service_stub.endpoint
|
167
178
|
config.universe_domain = @security_settings_service_stub.universe_domain
|
168
179
|
config.bindings_override = @config.bindings_override
|
180
|
+
config.logger = @security_settings_service_stub.logger if config.respond_to? :logger=
|
169
181
|
end
|
170
182
|
end
|
171
183
|
|
@@ -176,6 +188,15 @@ module Google
|
|
176
188
|
#
|
177
189
|
attr_reader :location_client
|
178
190
|
|
191
|
+
##
|
192
|
+
# The logger used for request/response debug logging.
|
193
|
+
#
|
194
|
+
# @return [Logger]
|
195
|
+
#
|
196
|
+
def logger
|
197
|
+
@security_settings_service_stub.logger
|
198
|
+
end
|
199
|
+
|
179
200
|
# Service calls
|
180
201
|
|
181
202
|
##
|
@@ -199,7 +220,7 @@ module Google
|
|
199
220
|
# @param parent [::String]
|
200
221
|
# Required. The location to create an
|
201
222
|
# {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} for.
|
202
|
-
# Format: `projects/<
|
223
|
+
# Format: `projects/<ProjectID>/locations/<LocationID>`.
|
203
224
|
# @param security_settings [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings, ::Hash]
|
204
225
|
# Required. The security settings to create.
|
205
226
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
@@ -255,7 +276,6 @@ module Google
|
|
255
276
|
|
256
277
|
@security_settings_service_stub.create_security_settings request, options do |result, operation|
|
257
278
|
yield result, operation if block_given?
|
258
|
-
return result
|
259
279
|
end
|
260
280
|
rescue ::Gapic::Rest::Error => e
|
261
281
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -283,8 +303,8 @@ module Google
|
|
283
303
|
#
|
284
304
|
# @param name [::String]
|
285
305
|
# Required. Resource name of the settings.
|
286
|
-
# Format:
|
287
|
-
#
|
306
|
+
# Format:
|
307
|
+
# `projects/<ProjectID>/locations/<LocationID>/securitySettings/<securitysettingsID>`.
|
288
308
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
289
309
|
# @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings]
|
290
310
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -338,7 +358,6 @@ module Google
|
|
338
358
|
|
339
359
|
@security_settings_service_stub.get_security_settings request, options do |result, operation|
|
340
360
|
yield result, operation if block_given?
|
341
|
-
return result
|
342
361
|
end
|
343
362
|
rescue ::Gapic::Rest::Error => e
|
344
363
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -422,7 +441,6 @@ module Google
|
|
422
441
|
|
423
442
|
@security_settings_service_stub.update_security_settings request, options do |result, operation|
|
424
443
|
yield result, operation if block_given?
|
425
|
-
return result
|
426
444
|
end
|
427
445
|
rescue ::Gapic::Rest::Error => e
|
428
446
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -448,7 +466,7 @@ module Google
|
|
448
466
|
#
|
449
467
|
# @param parent [::String]
|
450
468
|
# Required. The location to list all security settings for.
|
451
|
-
# Format: `projects/<
|
469
|
+
# Format: `projects/<ProjectID>/locations/<LocationID>`.
|
452
470
|
# @param page_size [::Integer]
|
453
471
|
# The maximum number of items to return in a single page. By default 20 and
|
454
472
|
# at most 100.
|
@@ -512,7 +530,7 @@ module Google
|
|
512
530
|
@security_settings_service_stub.list_security_settings request, options do |result, operation|
|
513
531
|
result = ::Gapic::Rest::PagedEnumerable.new @security_settings_service_stub, :list_security_settings, "security_settings", request, result, options
|
514
532
|
yield result, operation if block_given?
|
515
|
-
|
533
|
+
throw :response, result
|
516
534
|
end
|
517
535
|
rescue ::Gapic::Rest::Error => e
|
518
536
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -540,8 +558,8 @@ module Google
|
|
540
558
|
# @param name [::String]
|
541
559
|
# Required. The name of the
|
542
560
|
# {::Google::Cloud::Dialogflow::CX::V3::SecuritySettings SecuritySettings} to
|
543
|
-
# delete. Format:
|
544
|
-
#
|
561
|
+
# delete. Format:
|
562
|
+
# `projects/<ProjectID>/locations/<LocationID>/securitySettings/<SecuritySettingsID>`.
|
545
563
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
546
564
|
# @yieldparam result [::Google::Protobuf::Empty]
|
547
565
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -595,7 +613,6 @@ module Google
|
|
595
613
|
|
596
614
|
@security_settings_service_stub.delete_security_settings request, options do |result, operation|
|
597
615
|
yield result, operation if block_given?
|
598
|
-
return result
|
599
616
|
end
|
600
617
|
rescue ::Gapic::Rest::Error => e
|
601
618
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -675,6 +692,11 @@ module Google
|
|
675
692
|
# default endpoint URL. The default value of nil uses the environment
|
676
693
|
# universe (usually the default "googleapis.com" universe).
|
677
694
|
# @return [::String,nil]
|
695
|
+
# @!attribute [rw] logger
|
696
|
+
# A custom logger to use for request/response debug logging, or the value
|
697
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
698
|
+
# explicitly disable logging.
|
699
|
+
# @return [::Logger,:default,nil]
|
678
700
|
#
|
679
701
|
class Configuration
|
680
702
|
extend ::Gapic::Config
|
@@ -703,6 +725,7 @@ module Google
|
|
703
725
|
# by the host service.
|
704
726
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
705
727
|
config_attr :bindings_override, {}, ::Hash, nil
|
728
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
706
729
|
|
707
730
|
# @private
|
708
731
|
def initialize parent_config = nil
|
@@ -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 create_security_settings 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: "create_security_settings",
|
94
107
|
options: options
|
95
108
|
)
|
96
109
|
operation = ::Gapic::Rest::TransportOperation.new response
|
97
110
|
result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.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_security_settings",
|
132
147
|
options: options
|
133
148
|
)
|
134
149
|
operation = ::Gapic::Rest::TransportOperation.new response
|
135
150
|
result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.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: "update_security_settings",
|
170
187
|
options: options
|
171
188
|
)
|
172
189
|
operation = ::Gapic::Rest::TransportOperation.new response
|
173
190
|
result = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings.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: "list_security_settings",
|
208
227
|
options: options
|
209
228
|
)
|
210
229
|
operation = ::Gapic::Rest::TransportOperation.new response
|
211
230
|
result = ::Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsResponse.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_security_settings",
|
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
|
##
|