google-cloud-dialogflow-cx-v3 0.22.0 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +2 -1
  4. data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +33 -8
  5. data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +28 -6
  6. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +35 -7
  7. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +33 -8
  8. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +14 -2
  9. data/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb +2 -1
  10. data/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +32 -8
  11. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +34 -7
  12. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +14 -2
  13. data/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +32 -8
  14. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +34 -7
  15. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +14 -2
  16. data/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb +1 -1
  17. data/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb +2 -2
  18. data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +151 -127
  19. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +146 -119
  20. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +62 -50
  21. data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +33 -8
  22. data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +28 -6
  23. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +35 -7
  24. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +33 -8
  25. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb +14 -2
  26. data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +32 -8
  27. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +34 -7
  28. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +14 -2
  29. data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +33 -8
  30. data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +28 -6
  31. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +35 -7
  32. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +33 -8
  33. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb +14 -2
  34. data/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb +60 -0
  35. data/lib/google/cloud/dialogflow/cx/v3/generator_services_pb.rb +55 -0
  36. data/lib/google/cloud/dialogflow/cx/v3/generators/client.rb +851 -0
  37. data/lib/google/cloud/dialogflow/cx/v3/generators/credentials.rb +54 -0
  38. data/lib/google/cloud/dialogflow/cx/v3/generators/paths.rb +75 -0
  39. data/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb +798 -0
  40. data/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb +359 -0
  41. data/lib/google/cloud/dialogflow/cx/v3/generators/rest.rb +55 -0
  42. data/lib/google/cloud/dialogflow/cx/v3/generators.rb +57 -0
  43. data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +33 -8
  44. data/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb +28 -6
  45. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +35 -7
  46. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb +33 -8
  47. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +14 -2
  48. data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +32 -8
  49. data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +34 -7
  50. data/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +14 -2
  51. data/lib/google/cloud/dialogflow/cx/v3/rest.rb +1 -0
  52. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +32 -8
  53. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +34 -7
  54. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb +14 -2
  55. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +32 -8
  56. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +34 -7
  57. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb +14 -2
  58. data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +12 -1
  59. data/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb +3 -0
  60. data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +133 -8
  61. data/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb +45 -0
  62. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +128 -7
  63. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +74 -2
  64. data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +33 -8
  65. data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +28 -6
  66. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +35 -7
  67. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +33 -8
  68. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb +14 -2
  69. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +32 -8
  70. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +34 -7
  71. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb +14 -2
  72. data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
  73. data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +33 -8
  74. data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +28 -6
  75. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +35 -7
  76. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +33 -8
  77. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb +14 -2
  78. data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +32 -8
  79. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +34 -7
  80. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +14 -2
  81. data/lib/google/cloud/dialogflow/cx/v3.rb +1 -0
  82. data/proto_docs/google/api/client.rb +14 -0
  83. data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +16 -0
  84. data/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb +47 -3
  85. data/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb +187 -0
  86. data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +187 -0
  87. data/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb +1 -0
  88. data/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +2 -0
  89. metadata +17 -7
@@ -0,0 +1,359 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/dialogflow/cx/v3/generator_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Dialogflow
24
+ module CX
25
+ module V3
26
+ module Generators
27
+ module Rest
28
+ ##
29
+ # REST service stub for the Generators service.
30
+ # Service stub contains baseline method implementations
31
+ # including transcoding, making the REST call, and deserialing the response.
32
+ #
33
+ class ServiceStub
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
40
+ endpoint_template: endpoint_template,
41
+ universe_domain: universe_domain,
42
+ credentials: credentials,
43
+ numeric_enums: true,
44
+ raise_faraday_errors: false
45
+ end
46
+
47
+ ##
48
+ # The effective universe domain
49
+ #
50
+ # @return [String]
51
+ #
52
+ def universe_domain
53
+ @client_stub.universe_domain
54
+ end
55
+
56
+ ##
57
+ # Baseline implementation for the list_generators REST call
58
+ #
59
+ # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest]
60
+ # A request object representing the call parameters. Required.
61
+ # @param options [::Gapic::CallOptions]
62
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
63
+ #
64
+ # @yield [result, operation] Access the result along with the TransportOperation object
65
+ # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsResponse]
66
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
67
+ #
68
+ # @return [::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsResponse]
69
+ # A result object deserialized from the server's reply
70
+ def list_generators request_pb, options = nil
71
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
72
+
73
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_generators_request request_pb
74
+ query_string_params = if query_string_params.any?
75
+ query_string_params.to_h { |p| p.split "=", 2 }
76
+ else
77
+ {}
78
+ end
79
+
80
+ response = @client_stub.make_http_request(
81
+ verb,
82
+ uri: uri,
83
+ body: body || "",
84
+ params: query_string_params,
85
+ options: options
86
+ )
87
+ operation = ::Gapic::Rest::TransportOperation.new response
88
+ result = ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsResponse.decode_json response.body, ignore_unknown_fields: true
89
+
90
+ yield result, operation if block_given?
91
+ result
92
+ end
93
+
94
+ ##
95
+ # Baseline implementation for the get_generator REST call
96
+ #
97
+ # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest]
98
+ # A request object representing the call parameters. Required.
99
+ # @param options [::Gapic::CallOptions]
100
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
101
+ #
102
+ # @yield [result, operation] Access the result along with the TransportOperation object
103
+ # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Generator]
104
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
105
+ #
106
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Generator]
107
+ # A result object deserialized from the server's reply
108
+ def get_generator request_pb, options = nil
109
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
110
+
111
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_generator_request request_pb
112
+ query_string_params = if query_string_params.any?
113
+ query_string_params.to_h { |p| p.split "=", 2 }
114
+ else
115
+ {}
116
+ end
117
+
118
+ response = @client_stub.make_http_request(
119
+ verb,
120
+ uri: uri,
121
+ body: body || "",
122
+ params: query_string_params,
123
+ options: options
124
+ )
125
+ operation = ::Gapic::Rest::TransportOperation.new response
126
+ result = ::Google::Cloud::Dialogflow::CX::V3::Generator.decode_json response.body, ignore_unknown_fields: true
127
+
128
+ yield result, operation if block_given?
129
+ result
130
+ end
131
+
132
+ ##
133
+ # Baseline implementation for the create_generator REST call
134
+ #
135
+ # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest]
136
+ # A request object representing the call parameters. Required.
137
+ # @param options [::Gapic::CallOptions]
138
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
139
+ #
140
+ # @yield [result, operation] Access the result along with the TransportOperation object
141
+ # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Generator]
142
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
143
+ #
144
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Generator]
145
+ # A result object deserialized from the server's reply
146
+ def create_generator request_pb, options = nil
147
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
148
+
149
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_generator_request request_pb
150
+ query_string_params = if query_string_params.any?
151
+ query_string_params.to_h { |p| p.split "=", 2 }
152
+ else
153
+ {}
154
+ end
155
+
156
+ response = @client_stub.make_http_request(
157
+ verb,
158
+ uri: uri,
159
+ body: body || "",
160
+ params: query_string_params,
161
+ options: options
162
+ )
163
+ operation = ::Gapic::Rest::TransportOperation.new response
164
+ result = ::Google::Cloud::Dialogflow::CX::V3::Generator.decode_json response.body, ignore_unknown_fields: true
165
+
166
+ yield result, operation if block_given?
167
+ result
168
+ end
169
+
170
+ ##
171
+ # Baseline implementation for the update_generator REST call
172
+ #
173
+ # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest]
174
+ # A request object representing the call parameters. Required.
175
+ # @param options [::Gapic::CallOptions]
176
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
177
+ #
178
+ # @yield [result, operation] Access the result along with the TransportOperation object
179
+ # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Generator]
180
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
181
+ #
182
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Generator]
183
+ # A result object deserialized from the server's reply
184
+ def update_generator request_pb, options = nil
185
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
186
+
187
+ verb, uri, query_string_params, body = ServiceStub.transcode_update_generator_request request_pb
188
+ query_string_params = if query_string_params.any?
189
+ query_string_params.to_h { |p| p.split "=", 2 }
190
+ else
191
+ {}
192
+ end
193
+
194
+ response = @client_stub.make_http_request(
195
+ verb,
196
+ uri: uri,
197
+ body: body || "",
198
+ params: query_string_params,
199
+ options: options
200
+ )
201
+ operation = ::Gapic::Rest::TransportOperation.new response
202
+ result = ::Google::Cloud::Dialogflow::CX::V3::Generator.decode_json response.body, ignore_unknown_fields: true
203
+
204
+ yield result, operation if block_given?
205
+ result
206
+ end
207
+
208
+ ##
209
+ # Baseline implementation for the delete_generator REST call
210
+ #
211
+ # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest]
212
+ # A request object representing the call parameters. Required.
213
+ # @param options [::Gapic::CallOptions]
214
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
215
+ #
216
+ # @yield [result, operation] Access the result along with the TransportOperation object
217
+ # @yieldparam result [::Google::Protobuf::Empty]
218
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
219
+ #
220
+ # @return [::Google::Protobuf::Empty]
221
+ # A result object deserialized from the server's reply
222
+ def delete_generator request_pb, options = nil
223
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
224
+
225
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_generator_request request_pb
226
+ query_string_params = if query_string_params.any?
227
+ query_string_params.to_h { |p| p.split "=", 2 }
228
+ else
229
+ {}
230
+ end
231
+
232
+ response = @client_stub.make_http_request(
233
+ verb,
234
+ uri: uri,
235
+ body: body || "",
236
+ params: query_string_params,
237
+ options: options
238
+ )
239
+ operation = ::Gapic::Rest::TransportOperation.new response
240
+ result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
241
+
242
+ yield result, operation if block_given?
243
+ result
244
+ end
245
+
246
+ ##
247
+ # @private
248
+ #
249
+ # GRPC transcoding helper method for the list_generators REST call
250
+ #
251
+ # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest]
252
+ # A request object representing the call parameters. Required.
253
+ # @return [Array(String, [String, nil], Hash{String => String})]
254
+ # Uri, Body, Query string parameters
255
+ def self.transcode_list_generators_request request_pb
256
+ transcoder = Gapic::Rest::GrpcTranscoder.new
257
+ .with_bindings(
258
+ uri_method: :get,
259
+ uri_template: "/v3/{parent}/generators",
260
+ matches: [
261
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false]
262
+ ]
263
+ )
264
+ transcoder.transcode request_pb
265
+ end
266
+
267
+ ##
268
+ # @private
269
+ #
270
+ # GRPC transcoding helper method for the get_generator REST call
271
+ #
272
+ # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest]
273
+ # A request object representing the call parameters. Required.
274
+ # @return [Array(String, [String, nil], Hash{String => String})]
275
+ # Uri, Body, Query string parameters
276
+ def self.transcode_get_generator_request request_pb
277
+ transcoder = Gapic::Rest::GrpcTranscoder.new
278
+ .with_bindings(
279
+ uri_method: :get,
280
+ uri_template: "/v3/{name}",
281
+ matches: [
282
+ ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generators/[^/]+/?$}, false]
283
+ ]
284
+ )
285
+ transcoder.transcode request_pb
286
+ end
287
+
288
+ ##
289
+ # @private
290
+ #
291
+ # GRPC transcoding helper method for the create_generator REST call
292
+ #
293
+ # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest]
294
+ # A request object representing the call parameters. Required.
295
+ # @return [Array(String, [String, nil], Hash{String => String})]
296
+ # Uri, Body, Query string parameters
297
+ def self.transcode_create_generator_request request_pb
298
+ transcoder = Gapic::Rest::GrpcTranscoder.new
299
+ .with_bindings(
300
+ uri_method: :post,
301
+ uri_template: "/v3/{parent}/generators",
302
+ body: "generator",
303
+ matches: [
304
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false]
305
+ ]
306
+ )
307
+ transcoder.transcode request_pb
308
+ end
309
+
310
+ ##
311
+ # @private
312
+ #
313
+ # GRPC transcoding helper method for the update_generator REST call
314
+ #
315
+ # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest]
316
+ # A request object representing the call parameters. Required.
317
+ # @return [Array(String, [String, nil], Hash{String => String})]
318
+ # Uri, Body, Query string parameters
319
+ def self.transcode_update_generator_request request_pb
320
+ transcoder = Gapic::Rest::GrpcTranscoder.new
321
+ .with_bindings(
322
+ uri_method: :patch,
323
+ uri_template: "/v3/{generator.name}",
324
+ body: "generator",
325
+ matches: [
326
+ ["generator.name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generators/[^/]+/?$}, false]
327
+ ]
328
+ )
329
+ transcoder.transcode request_pb
330
+ end
331
+
332
+ ##
333
+ # @private
334
+ #
335
+ # GRPC transcoding helper method for the delete_generator REST call
336
+ #
337
+ # @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest]
338
+ # A request object representing the call parameters. Required.
339
+ # @return [Array(String, [String, nil], Hash{String => String})]
340
+ # Uri, Body, Query string parameters
341
+ def self.transcode_delete_generator_request request_pb
342
+ transcoder = Gapic::Rest::GrpcTranscoder.new
343
+ .with_bindings(
344
+ uri_method: :delete,
345
+ uri_template: "/v3/{name}",
346
+ matches: [
347
+ ["name", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/generators/[^/]+/?$}, false]
348
+ ]
349
+ )
350
+ transcoder.transcode request_pb
351
+ end
352
+ end
353
+ end
354
+ end
355
+ end
356
+ end
357
+ end
358
+ end
359
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/dialogflow/cx/v3/version"
24
+ require "google/cloud/dialogflow/cx/v3/bindings_override"
25
+
26
+ require "google/cloud/dialogflow/cx/v3/generators/credentials"
27
+ require "google/cloud/dialogflow/cx/v3/generators/paths"
28
+ require "google/cloud/dialogflow/cx/v3/generators/rest/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Dialogflow
33
+ module CX
34
+ module V3
35
+ ##
36
+ # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Generator Generators}
37
+ #
38
+ # To load this service and instantiate a REST client:
39
+ #
40
+ # require "google/cloud/dialogflow/cx/v3/generators/rest"
41
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new
42
+ #
43
+ module Generators
44
+ # Client for the REST transport
45
+ module Rest
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
55
+ require "google/cloud/dialogflow/cx/v3/generators/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/dialogflow/cx/v3/version"
24
+
25
+ require "google/cloud/dialogflow/cx/v3/generators/credentials"
26
+ require "google/cloud/dialogflow/cx/v3/generators/paths"
27
+ require "google/cloud/dialogflow/cx/v3/generators/client"
28
+ require "google/cloud/dialogflow/cx/v3/generators/rest"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Dialogflow
33
+ module CX
34
+ module V3
35
+ ##
36
+ # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Generator Generators}
37
+ #
38
+ # @example Load this service and instantiate a gRPC client
39
+ #
40
+ # require "google/cloud/dialogflow/cx/v3/generators"
41
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Client.new
42
+ #
43
+ # @example Load this service and instantiate a REST client
44
+ #
45
+ # require "google/cloud/dialogflow/cx/v3/generators/rest"
46
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Generators::Rest::Client.new
47
+ #
48
+ module Generators
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+
56
+ helper_path = ::File.join __dir__, "generators", "helpers.rb"
57
+ require "google/cloud/dialogflow/cx/v3/generators/helpers" if ::File.file? helper_path
@@ -32,6 +32,9 @@ module Google
32
32
  # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Intent Intents}.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$"
37
+
35
38
  include Paths
36
39
 
37
40
  # @private
@@ -97,6 +100,15 @@ module Google
97
100
  @config
98
101
  end
99
102
 
103
+ ##
104
+ # The effective universe domain
105
+ #
106
+ # @return [String]
107
+ #
108
+ def universe_domain
109
+ @intents_stub.universe_domain
110
+ end
111
+
100
112
  ##
101
113
  # Create a new Intents client object.
102
114
  #
@@ -130,8 +142,9 @@ module Google
130
142
  credentials = @config.credentials
131
143
  # Use self-signed JWT if the endpoint is unchanged from default,
132
144
  # but only if the default endpoint does not have a region prefix.
133
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
134
- !@config.endpoint.split(".").first.include?("-")
145
+ enable_self_signed_jwt = @config.endpoint.nil? ||
146
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
147
+ !@config.endpoint.split(".").first.include?("-"))
135
148
  credentials ||= Credentials.default scope: @config.scope,
136
149
  enable_self_signed_jwt: enable_self_signed_jwt
137
150
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -144,18 +157,22 @@ module Google
144
157
  config.credentials = credentials
145
158
  config.quota_project = @quota_project_id
146
159
  config.endpoint = @config.endpoint
160
+ config.universe_domain = @config.universe_domain
147
161
  end
148
162
 
149
163
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
150
164
  config.credentials = credentials
151
165
  config.quota_project = @quota_project_id
152
166
  config.endpoint = @config.endpoint
167
+ config.universe_domain = @config.universe_domain
153
168
  end
154
169
 
155
170
  @intents_stub = ::Gapic::ServiceStub.new(
156
171
  ::Google::Cloud::Dialogflow::CX::V3::Intents::Stub,
157
- credentials: credentials,
158
- endpoint: @config.endpoint,
172
+ credentials: credentials,
173
+ endpoint: @config.endpoint,
174
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
175
+ universe_domain: @config.universe_domain,
159
176
  channel_args: @config.channel_args,
160
177
  interceptors: @config.interceptors,
161
178
  channel_pool_config: @config.channel_pool
@@ -951,9 +968,9 @@ module Google
951
968
  # end
952
969
  #
953
970
  # @!attribute [rw] endpoint
954
- # The hostname or hostname:port of the service endpoint.
955
- # Defaults to `"dialogflow.googleapis.com"`.
956
- # @return [::String]
971
+ # A custom service endpoint, as a hostname or hostname:port. The default is
972
+ # nil, indicating to use the default endpoint in the current universe domain.
973
+ # @return [::String,nil]
957
974
  # @!attribute [rw] credentials
958
975
  # Credentials to send with calls. You may provide any of the following types:
959
976
  # * (`String`) The path to a service account key file in JSON format
@@ -999,13 +1016,20 @@ module Google
999
1016
  # @!attribute [rw] quota_project
1000
1017
  # A separate project against which to charge quota.
1001
1018
  # @return [::String]
1019
+ # @!attribute [rw] universe_domain
1020
+ # The universe domain within which to make requests. This determines the
1021
+ # default endpoint URL. The default value of nil uses the environment
1022
+ # universe (usually the default "googleapis.com" universe).
1023
+ # @return [::String,nil]
1002
1024
  #
1003
1025
  class Configuration
1004
1026
  extend ::Gapic::Config
1005
1027
 
1028
+ # @private
1029
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1006
1030
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
1007
1031
 
1008
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1032
+ config_attr :endpoint, nil, ::String, nil
1009
1033
  config_attr :credentials, nil do |value|
1010
1034
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1011
1035
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1020,6 +1044,7 @@ module Google
1020
1044
  config_attr :metadata, nil, ::Hash, nil
1021
1045
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1022
1046
  config_attr :quota_project, nil, ::String, nil
1047
+ config_attr :universe_domain, nil, ::String, nil
1023
1048
 
1024
1049
  # @private
1025
1050
  def initialize parent_config = nil
@@ -27,6 +27,9 @@ module Google
27
27
  module Intents
28
28
  # Service that implements Longrunning Operations API.
29
29
  class Operations
30
+ # @private
31
+ DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$"
32
+
30
33
  # @private
31
34
  attr_reader :operations_stub
32
35
 
@@ -61,6 +64,15 @@ module Google
61
64
  @config
62
65
  end
63
66
 
67
+ ##
68
+ # The effective universe domain
69
+ #
70
+ # @return [String]
71
+ #
72
+ def universe_domain
73
+ @operations_stub.universe_domain
74
+ end
75
+
64
76
  ##
65
77
  # Create a new Operations client object.
66
78
  #
@@ -91,8 +103,10 @@ module Google
91
103
 
92
104
  @operations_stub = ::Gapic::ServiceStub.new(
93
105
  ::Google::Longrunning::Operations::Stub,
94
- credentials: credentials,
95
- endpoint: @config.endpoint,
106
+ credentials: credentials,
107
+ endpoint: @config.endpoint,
108
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
109
+ universe_domain: @config.universe_domain,
96
110
  channel_args: @config.channel_args,
97
111
  interceptors: @config.interceptors,
98
112
  channel_pool_config: @config.channel_pool
@@ -614,9 +628,9 @@ module Google
614
628
  # end
615
629
  #
616
630
  # @!attribute [rw] endpoint
617
- # The hostname or hostname:port of the service endpoint.
618
- # Defaults to `"dialogflow.googleapis.com"`.
619
- # @return [::String]
631
+ # A custom service endpoint, as a hostname or hostname:port. The default is
632
+ # nil, indicating to use the default endpoint in the current universe domain.
633
+ # @return [::String,nil]
620
634
  # @!attribute [rw] credentials
621
635
  # Credentials to send with calls. You may provide any of the following types:
622
636
  # * (`String`) The path to a service account key file in JSON format
@@ -662,13 +676,20 @@ module Google
662
676
  # @!attribute [rw] quota_project
663
677
  # A separate project against which to charge quota.
664
678
  # @return [::String]
679
+ # @!attribute [rw] universe_domain
680
+ # The universe domain within which to make requests. This determines the
681
+ # default endpoint URL. The default value of nil uses the environment
682
+ # universe (usually the default "googleapis.com" universe).
683
+ # @return [::String,nil]
665
684
  #
666
685
  class Configuration
667
686
  extend ::Gapic::Config
668
687
 
688
+ # @private
689
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
669
690
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
670
691
 
671
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
692
+ config_attr :endpoint, nil, ::String, nil
672
693
  config_attr :credentials, nil do |value|
673
694
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
674
695
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -683,6 +704,7 @@ module Google
683
704
  config_attr :metadata, nil, ::Hash, nil
684
705
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
685
706
  config_attr :quota_project, nil, ::String, nil
707
+ config_attr :universe_domain, nil, ::String, nil
686
708
 
687
709
  # @private
688
710
  def initialize parent_config = nil