google-cloud-discovery_engine 2.2.0 → 2.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/AUTHENTICATION.md +3 -3
- data/lib/google/cloud/discovery_engine/version.rb +1 -1
- data/lib/google/cloud/discovery_engine.rb +207 -67
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4746637b6d60d527b86a4b2a83bee92c4e87af1763312758cbb5b5f786f9a0d4
|
4
|
+
data.tar.gz: fa8450d7fa4d7696132cf2dcf832ba17985a5545daac360a2a7c8602187439b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65a4074b249504feaef862ca4923ab13d61a225bd3514dffd784afe13d7fb4a179876f55473e0050c1259c90c44226dd0383845c53b69900ed3342e437de8d56
|
7
|
+
data.tar.gz: 3be508227faea3c122ac6ef7890d30f512dacc969a50c947785dcc7b06dc45957df6e4e0a59f5374739052526984dbbfb25bcfef0680b62f0ca25ad9414edd9e
|
data/AUTHENTICATION.md
CHANGED
@@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization:
|
|
56
56
|
```ruby
|
57
57
|
require "google/cloud/discovery_engine"
|
58
58
|
|
59
|
-
client = Google::Cloud::DiscoveryEngine.
|
59
|
+
client = Google::Cloud::DiscoveryEngine.search_service do |config|
|
60
60
|
config.credentials = "path/to/credentialfile.json"
|
61
61
|
end
|
62
62
|
```
|
@@ -70,7 +70,7 @@ Google::Cloud::DiscoveryEngine.configure do |config|
|
|
70
70
|
config.credentials = "path/to/credentialfile.json"
|
71
71
|
end
|
72
72
|
|
73
|
-
client = Google::Cloud::DiscoveryEngine.
|
73
|
+
client = Google::Cloud::DiscoveryEngine.search_service
|
74
74
|
```
|
75
75
|
|
76
76
|
### Environment Variables
|
@@ -100,7 +100,7 @@ require "google/cloud/discovery_engine"
|
|
100
100
|
|
101
101
|
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
|
102
102
|
|
103
|
-
client = Google::Cloud::DiscoveryEngine.
|
103
|
+
client = Google::Cloud::DiscoveryEngine.search_service
|
104
104
|
```
|
105
105
|
|
106
106
|
### Local ADC file
|
@@ -46,57 +46,57 @@ module Google
|
|
46
46
|
module Cloud
|
47
47
|
module DiscoveryEngine
|
48
48
|
##
|
49
|
-
# Create a new client object for
|
49
|
+
# Create a new client object for SearchService.
|
50
50
|
#
|
51
51
|
# By default, this returns an instance of
|
52
|
-
# [Google::Cloud::DiscoveryEngine::V1::
|
52
|
+
# [Google::Cloud::DiscoveryEngine::V1::SearchService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SearchService-Client)
|
53
53
|
# for a gRPC client for version V1 of the API.
|
54
54
|
# However, you can specify a different API version by passing it in the
|
55
|
-
# `version` parameter. If the
|
55
|
+
# `version` parameter. If the SearchService service is
|
56
56
|
# supported by that API version, and the corresponding gem is available, the
|
57
57
|
# appropriate versioned client will be returned.
|
58
58
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
59
59
|
# the `transport` parameter.
|
60
60
|
#
|
61
61
|
# Raises an exception if the currently installed versioned client gem for the
|
62
|
-
# given API version does not support the given transport of the
|
62
|
+
# given API version does not support the given transport of the SearchService service.
|
63
63
|
# You can determine whether the method will succeed by calling
|
64
|
-
# {Google::Cloud::DiscoveryEngine.
|
64
|
+
# {Google::Cloud::DiscoveryEngine.search_service_available?}.
|
65
65
|
#
|
66
|
-
# ## About
|
66
|
+
# ## About SearchService
|
67
67
|
#
|
68
|
-
# Service for
|
68
|
+
# Service for search.
|
69
69
|
#
|
70
70
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
71
71
|
# Defaults to `:v1`.
|
72
72
|
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
73
73
|
# @return [::Object] A client object for the specified version.
|
74
74
|
#
|
75
|
-
def self.
|
75
|
+
def self.search_service version: :v1, transport: :grpc, &block
|
76
76
|
require "google/cloud/discovery_engine/#{version.to_s.downcase}"
|
77
77
|
|
78
78
|
package_name = Google::Cloud::DiscoveryEngine
|
79
79
|
.constants
|
80
80
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
81
81
|
.first
|
82
|
-
service_module = Google::Cloud::DiscoveryEngine.const_get(package_name).const_get(:
|
82
|
+
service_module = Google::Cloud::DiscoveryEngine.const_get(package_name).const_get(:SearchService)
|
83
83
|
service_module = service_module.const_get(:Rest) if transport == :rest
|
84
84
|
service_module.const_get(:Client).new(&block)
|
85
85
|
end
|
86
86
|
|
87
87
|
##
|
88
|
-
# Determines whether the
|
89
|
-
# If true, you can retrieve a client object by calling {Google::Cloud::DiscoveryEngine.
|
88
|
+
# Determines whether the SearchService service is supported by the current client.
|
89
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::DiscoveryEngine.search_service}.
|
90
90
|
# If false, that method will raise an exception. This could happen if the given
|
91
|
-
# API version does not exist or does not support the
|
92
|
-
# or if the versioned client gem needs an update to support the
|
91
|
+
# API version does not exist or does not support the SearchService service,
|
92
|
+
# or if the versioned client gem needs an update to support the SearchService service.
|
93
93
|
#
|
94
94
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
95
95
|
# Defaults to `:v1`.
|
96
96
|
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
97
97
|
# @return [boolean] Whether the service is available.
|
98
98
|
#
|
99
|
-
def self.
|
99
|
+
def self.search_service_available? version: :v1, transport: :grpc
|
100
100
|
require "google/cloud/discovery_engine/#{version.to_s.downcase}"
|
101
101
|
package_name = Google::Cloud::DiscoveryEngine
|
102
102
|
.constants
|
@@ -104,8 +104,8 @@ module Google
|
|
104
104
|
.first
|
105
105
|
return false unless package_name
|
106
106
|
service_module = Google::Cloud::DiscoveryEngine.const_get package_name
|
107
|
-
return false unless service_module.const_defined? :
|
108
|
-
service_module = service_module.const_get :
|
107
|
+
return false unless service_module.const_defined? :SearchService
|
108
|
+
service_module = service_module.const_get :SearchService
|
109
109
|
if transport == :rest
|
110
110
|
return false unless service_module.const_defined? :Rest
|
111
111
|
service_module = service_module.const_get :Rest
|
@@ -116,57 +116,57 @@ module Google
|
|
116
116
|
end
|
117
117
|
|
118
118
|
##
|
119
|
-
# Create a new client object for
|
119
|
+
# Create a new client object for AssistantService.
|
120
120
|
#
|
121
121
|
# By default, this returns an instance of
|
122
|
-
# [Google::Cloud::DiscoveryEngine::V1::
|
122
|
+
# [Google::Cloud::DiscoveryEngine::V1::AssistantService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-AssistantService-Client)
|
123
123
|
# for a gRPC client for version V1 of the API.
|
124
124
|
# However, you can specify a different API version by passing it in the
|
125
|
-
# `version` parameter. If the
|
125
|
+
# `version` parameter. If the AssistantService service is
|
126
126
|
# supported by that API version, and the corresponding gem is available, the
|
127
127
|
# appropriate versioned client will be returned.
|
128
128
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
129
129
|
# the `transport` parameter.
|
130
130
|
#
|
131
131
|
# Raises an exception if the currently installed versioned client gem for the
|
132
|
-
# given API version does not support the given transport of the
|
132
|
+
# given API version does not support the given transport of the AssistantService service.
|
133
133
|
# You can determine whether the method will succeed by calling
|
134
|
-
# {Google::Cloud::DiscoveryEngine.
|
134
|
+
# {Google::Cloud::DiscoveryEngine.assistant_service_available?}.
|
135
135
|
#
|
136
|
-
# ## About
|
136
|
+
# ## About AssistantService
|
137
137
|
#
|
138
|
-
# Service for
|
138
|
+
# Service for managing Assistant configuration and assisting users.
|
139
139
|
#
|
140
140
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
141
141
|
# Defaults to `:v1`.
|
142
142
|
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
143
143
|
# @return [::Object] A client object for the specified version.
|
144
144
|
#
|
145
|
-
def self.
|
145
|
+
def self.assistant_service version: :v1, transport: :grpc, &block
|
146
146
|
require "google/cloud/discovery_engine/#{version.to_s.downcase}"
|
147
147
|
|
148
148
|
package_name = Google::Cloud::DiscoveryEngine
|
149
149
|
.constants
|
150
150
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
151
151
|
.first
|
152
|
-
service_module = Google::Cloud::DiscoveryEngine.const_get(package_name).const_get(:
|
152
|
+
service_module = Google::Cloud::DiscoveryEngine.const_get(package_name).const_get(:AssistantService)
|
153
153
|
service_module = service_module.const_get(:Rest) if transport == :rest
|
154
154
|
service_module.const_get(:Client).new(&block)
|
155
155
|
end
|
156
156
|
|
157
157
|
##
|
158
|
-
# Determines whether the
|
159
|
-
# If true, you can retrieve a client object by calling {Google::Cloud::DiscoveryEngine.
|
158
|
+
# Determines whether the AssistantService service is supported by the current client.
|
159
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::DiscoveryEngine.assistant_service}.
|
160
160
|
# If false, that method will raise an exception. This could happen if the given
|
161
|
-
# API version does not exist or does not support the
|
162
|
-
# or if the versioned client gem needs an update to support the
|
161
|
+
# API version does not exist or does not support the AssistantService service,
|
162
|
+
# or if the versioned client gem needs an update to support the AssistantService service.
|
163
163
|
#
|
164
164
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
165
165
|
# Defaults to `:v1`.
|
166
166
|
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
167
167
|
# @return [boolean] Whether the service is available.
|
168
168
|
#
|
169
|
-
def self.
|
169
|
+
def self.assistant_service_available? version: :v1, transport: :grpc
|
170
170
|
require "google/cloud/discovery_engine/#{version.to_s.downcase}"
|
171
171
|
package_name = Google::Cloud::DiscoveryEngine
|
172
172
|
.constants
|
@@ -174,8 +174,8 @@ module Google
|
|
174
174
|
.first
|
175
175
|
return false unless package_name
|
176
176
|
service_module = Google::Cloud::DiscoveryEngine.const_get package_name
|
177
|
-
return false unless service_module.const_defined? :
|
178
|
-
service_module = service_module.const_get :
|
177
|
+
return false unless service_module.const_defined? :AssistantService
|
178
|
+
service_module = service_module.const_get :AssistantService
|
179
179
|
if transport == :rest
|
180
180
|
return false unless service_module.const_defined? :Rest
|
181
181
|
service_module = service_module.const_get :Rest
|
@@ -186,60 +186,57 @@ module Google
|
|
186
186
|
end
|
187
187
|
|
188
188
|
##
|
189
|
-
# Create a new client object for
|
189
|
+
# Create a new client object for CmekConfigService.
|
190
190
|
#
|
191
191
|
# By default, this returns an instance of
|
192
|
-
# [Google::Cloud::DiscoveryEngine::V1::
|
192
|
+
# [Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-CmekConfigService-Client)
|
193
193
|
# for a gRPC client for version V1 of the API.
|
194
194
|
# However, you can specify a different API version by passing it in the
|
195
|
-
# `version` parameter. If the
|
195
|
+
# `version` parameter. If the CmekConfigService service is
|
196
196
|
# supported by that API version, and the corresponding gem is available, the
|
197
197
|
# appropriate versioned client will be returned.
|
198
198
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
199
199
|
# the `transport` parameter.
|
200
200
|
#
|
201
201
|
# Raises an exception if the currently installed versioned client gem for the
|
202
|
-
# given API version does not support the given transport of the
|
202
|
+
# given API version does not support the given transport of the CmekConfigService service.
|
203
203
|
# You can determine whether the method will succeed by calling
|
204
|
-
# {Google::Cloud::DiscoveryEngine.
|
204
|
+
# {Google::Cloud::DiscoveryEngine.cmek_config_service_available?}.
|
205
205
|
#
|
206
|
-
# ## About
|
206
|
+
# ## About CmekConfigService
|
207
207
|
#
|
208
|
-
# Service for
|
209
|
-
# Controls allow for custom logic to be implemented in the serving path.
|
210
|
-
# Controls need to be attached to a Serving Config to be considered during a
|
211
|
-
# request.
|
208
|
+
# Service for managing CMEK related tasks
|
212
209
|
#
|
213
210
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
214
211
|
# Defaults to `:v1`.
|
215
212
|
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
216
213
|
# @return [::Object] A client object for the specified version.
|
217
214
|
#
|
218
|
-
def self.
|
215
|
+
def self.cmek_config_service version: :v1, transport: :grpc, &block
|
219
216
|
require "google/cloud/discovery_engine/#{version.to_s.downcase}"
|
220
217
|
|
221
218
|
package_name = Google::Cloud::DiscoveryEngine
|
222
219
|
.constants
|
223
220
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
224
221
|
.first
|
225
|
-
service_module = Google::Cloud::DiscoveryEngine.const_get(package_name).const_get(:
|
222
|
+
service_module = Google::Cloud::DiscoveryEngine.const_get(package_name).const_get(:CmekConfigService)
|
226
223
|
service_module = service_module.const_get(:Rest) if transport == :rest
|
227
224
|
service_module.const_get(:Client).new(&block)
|
228
225
|
end
|
229
226
|
|
230
227
|
##
|
231
|
-
# Determines whether the
|
232
|
-
# If true, you can retrieve a client object by calling {Google::Cloud::DiscoveryEngine.
|
228
|
+
# Determines whether the CmekConfigService service is supported by the current client.
|
229
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::DiscoveryEngine.cmek_config_service}.
|
233
230
|
# If false, that method will raise an exception. This could happen if the given
|
234
|
-
# API version does not exist or does not support the
|
235
|
-
# or if the versioned client gem needs an update to support the
|
231
|
+
# API version does not exist or does not support the CmekConfigService service,
|
232
|
+
# or if the versioned client gem needs an update to support the CmekConfigService service.
|
236
233
|
#
|
237
234
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
238
235
|
# Defaults to `:v1`.
|
239
236
|
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
240
237
|
# @return [boolean] Whether the service is available.
|
241
238
|
#
|
242
|
-
def self.
|
239
|
+
def self.cmek_config_service_available? version: :v1, transport: :grpc
|
243
240
|
require "google/cloud/discovery_engine/#{version.to_s.downcase}"
|
244
241
|
package_name = Google::Cloud::DiscoveryEngine
|
245
242
|
.constants
|
@@ -247,8 +244,8 @@ module Google
|
|
247
244
|
.first
|
248
245
|
return false unless package_name
|
249
246
|
service_module = Google::Cloud::DiscoveryEngine.const_get package_name
|
250
|
-
return false unless service_module.const_defined? :
|
251
|
-
service_module = service_module.const_get :
|
247
|
+
return false unless service_module.const_defined? :CmekConfigService
|
248
|
+
service_module = service_module.const_get :CmekConfigService
|
252
249
|
if transport == :rest
|
253
250
|
return false unless service_module.const_defined? :Rest
|
254
251
|
service_module = service_module.const_get :Rest
|
@@ -259,57 +256,57 @@ module Google
|
|
259
256
|
end
|
260
257
|
|
261
258
|
##
|
262
|
-
# Create a new client object for
|
259
|
+
# Create a new client object for CompletionService.
|
263
260
|
#
|
264
261
|
# By default, this returns an instance of
|
265
|
-
# [Google::Cloud::DiscoveryEngine::V1::
|
262
|
+
# [Google::Cloud::DiscoveryEngine::V1::CompletionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-CompletionService-Client)
|
266
263
|
# for a gRPC client for version V1 of the API.
|
267
264
|
# However, you can specify a different API version by passing it in the
|
268
|
-
# `version` parameter. If the
|
265
|
+
# `version` parameter. If the CompletionService service is
|
269
266
|
# supported by that API version, and the corresponding gem is available, the
|
270
267
|
# appropriate versioned client will be returned.
|
271
268
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
272
269
|
# the `transport` parameter.
|
273
270
|
#
|
274
271
|
# Raises an exception if the currently installed versioned client gem for the
|
275
|
-
# given API version does not support the given transport of the
|
272
|
+
# given API version does not support the given transport of the CompletionService service.
|
276
273
|
# You can determine whether the method will succeed by calling
|
277
|
-
# {Google::Cloud::DiscoveryEngine.
|
274
|
+
# {Google::Cloud::DiscoveryEngine.completion_service_available?}.
|
278
275
|
#
|
279
|
-
# ## About
|
276
|
+
# ## About CompletionService
|
280
277
|
#
|
281
|
-
# Service for
|
278
|
+
# Service for Auto-Completion.
|
282
279
|
#
|
283
280
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
284
281
|
# Defaults to `:v1`.
|
285
282
|
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
286
283
|
# @return [::Object] A client object for the specified version.
|
287
284
|
#
|
288
|
-
def self.
|
285
|
+
def self.completion_service version: :v1, transport: :grpc, &block
|
289
286
|
require "google/cloud/discovery_engine/#{version.to_s.downcase}"
|
290
287
|
|
291
288
|
package_name = Google::Cloud::DiscoveryEngine
|
292
289
|
.constants
|
293
290
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
294
291
|
.first
|
295
|
-
service_module = Google::Cloud::DiscoveryEngine.const_get(package_name).const_get(:
|
292
|
+
service_module = Google::Cloud::DiscoveryEngine.const_get(package_name).const_get(:CompletionService)
|
296
293
|
service_module = service_module.const_get(:Rest) if transport == :rest
|
297
294
|
service_module.const_get(:Client).new(&block)
|
298
295
|
end
|
299
296
|
|
300
297
|
##
|
301
|
-
# Determines whether the
|
302
|
-
# If true, you can retrieve a client object by calling {Google::Cloud::DiscoveryEngine.
|
298
|
+
# Determines whether the CompletionService service is supported by the current client.
|
299
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::DiscoveryEngine.completion_service}.
|
303
300
|
# If false, that method will raise an exception. This could happen if the given
|
304
|
-
# API version does not exist or does not support the
|
305
|
-
# or if the versioned client gem needs an update to support the
|
301
|
+
# API version does not exist or does not support the CompletionService service,
|
302
|
+
# or if the versioned client gem needs an update to support the CompletionService service.
|
306
303
|
#
|
307
304
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
308
305
|
# Defaults to `:v1`.
|
309
306
|
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
310
307
|
# @return [boolean] Whether the service is available.
|
311
308
|
#
|
312
|
-
def self.
|
309
|
+
def self.completion_service_available? version: :v1, transport: :grpc
|
313
310
|
require "google/cloud/discovery_engine/#{version.to_s.downcase}"
|
314
311
|
package_name = Google::Cloud::DiscoveryEngine
|
315
312
|
.constants
|
@@ -317,8 +314,81 @@ module Google
|
|
317
314
|
.first
|
318
315
|
return false unless package_name
|
319
316
|
service_module = Google::Cloud::DiscoveryEngine.const_get package_name
|
320
|
-
return false unless service_module.const_defined? :
|
321
|
-
service_module = service_module.const_get :
|
317
|
+
return false unless service_module.const_defined? :CompletionService
|
318
|
+
service_module = service_module.const_get :CompletionService
|
319
|
+
if transport == :rest
|
320
|
+
return false unless service_module.const_defined? :Rest
|
321
|
+
service_module = service_module.const_get :Rest
|
322
|
+
end
|
323
|
+
service_module.const_defined? :Client
|
324
|
+
rescue ::LoadError
|
325
|
+
false
|
326
|
+
end
|
327
|
+
|
328
|
+
##
|
329
|
+
# Create a new client object for ControlService.
|
330
|
+
#
|
331
|
+
# By default, this returns an instance of
|
332
|
+
# [Google::Cloud::DiscoveryEngine::V1::ControlService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ControlService-Client)
|
333
|
+
# for a gRPC client for version V1 of the API.
|
334
|
+
# However, you can specify a different API version by passing it in the
|
335
|
+
# `version` parameter. If the ControlService service is
|
336
|
+
# supported by that API version, and the corresponding gem is available, the
|
337
|
+
# appropriate versioned client will be returned.
|
338
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
339
|
+
# the `transport` parameter.
|
340
|
+
#
|
341
|
+
# Raises an exception if the currently installed versioned client gem for the
|
342
|
+
# given API version does not support the given transport of the ControlService service.
|
343
|
+
# You can determine whether the method will succeed by calling
|
344
|
+
# {Google::Cloud::DiscoveryEngine.control_service_available?}.
|
345
|
+
#
|
346
|
+
# ## About ControlService
|
347
|
+
#
|
348
|
+
# Service for performing CRUD operations on Controls.
|
349
|
+
# Controls allow for custom logic to be implemented in the serving path.
|
350
|
+
# Controls need to be attached to a Serving Config to be considered during a
|
351
|
+
# request.
|
352
|
+
#
|
353
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
354
|
+
# Defaults to `:v1`.
|
355
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
356
|
+
# @return [::Object] A client object for the specified version.
|
357
|
+
#
|
358
|
+
def self.control_service version: :v1, transport: :grpc, &block
|
359
|
+
require "google/cloud/discovery_engine/#{version.to_s.downcase}"
|
360
|
+
|
361
|
+
package_name = Google::Cloud::DiscoveryEngine
|
362
|
+
.constants
|
363
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
364
|
+
.first
|
365
|
+
service_module = Google::Cloud::DiscoveryEngine.const_get(package_name).const_get(:ControlService)
|
366
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
367
|
+
service_module.const_get(:Client).new(&block)
|
368
|
+
end
|
369
|
+
|
370
|
+
##
|
371
|
+
# Determines whether the ControlService service is supported by the current client.
|
372
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::DiscoveryEngine.control_service}.
|
373
|
+
# If false, that method will raise an exception. This could happen if the given
|
374
|
+
# API version does not exist or does not support the ControlService service,
|
375
|
+
# or if the versioned client gem needs an update to support the ControlService service.
|
376
|
+
#
|
377
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
378
|
+
# Defaults to `:v1`.
|
379
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
380
|
+
# @return [boolean] Whether the service is available.
|
381
|
+
#
|
382
|
+
def self.control_service_available? version: :v1, transport: :grpc
|
383
|
+
require "google/cloud/discovery_engine/#{version.to_s.downcase}"
|
384
|
+
package_name = Google::Cloud::DiscoveryEngine
|
385
|
+
.constants
|
386
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
387
|
+
.first
|
388
|
+
return false unless package_name
|
389
|
+
service_module = Google::Cloud::DiscoveryEngine.const_get package_name
|
390
|
+
return false unless service_module.const_defined? :ControlService
|
391
|
+
service_module = service_module.const_get :ControlService
|
322
392
|
if transport == :rest
|
323
393
|
return false unless service_module.const_defined? :Rest
|
324
394
|
service_module = service_module.const_get :Rest
|
@@ -1173,6 +1243,76 @@ module Google
|
|
1173
1243
|
false
|
1174
1244
|
end
|
1175
1245
|
|
1246
|
+
##
|
1247
|
+
# Create a new client object for SessionService.
|
1248
|
+
#
|
1249
|
+
# By default, this returns an instance of
|
1250
|
+
# [Google::Cloud::DiscoveryEngine::V1::SessionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SessionService-Client)
|
1251
|
+
# for a gRPC client for version V1 of the API.
|
1252
|
+
# However, you can specify a different API version by passing it in the
|
1253
|
+
# `version` parameter. If the SessionService service is
|
1254
|
+
# supported by that API version, and the corresponding gem is available, the
|
1255
|
+
# appropriate versioned client will be returned.
|
1256
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
1257
|
+
# the `transport` parameter.
|
1258
|
+
#
|
1259
|
+
# Raises an exception if the currently installed versioned client gem for the
|
1260
|
+
# given API version does not support the given transport of the SessionService service.
|
1261
|
+
# You can determine whether the method will succeed by calling
|
1262
|
+
# {Google::Cloud::DiscoveryEngine.session_service_available?}.
|
1263
|
+
#
|
1264
|
+
# ## About SessionService
|
1265
|
+
#
|
1266
|
+
# Service for managing Sessions and Session-related resources.
|
1267
|
+
#
|
1268
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
1269
|
+
# Defaults to `:v1`.
|
1270
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
1271
|
+
# @return [::Object] A client object for the specified version.
|
1272
|
+
#
|
1273
|
+
def self.session_service version: :v1, transport: :grpc, &block
|
1274
|
+
require "google/cloud/discovery_engine/#{version.to_s.downcase}"
|
1275
|
+
|
1276
|
+
package_name = Google::Cloud::DiscoveryEngine
|
1277
|
+
.constants
|
1278
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
1279
|
+
.first
|
1280
|
+
service_module = Google::Cloud::DiscoveryEngine.const_get(package_name).const_get(:SessionService)
|
1281
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
1282
|
+
service_module.const_get(:Client).new(&block)
|
1283
|
+
end
|
1284
|
+
|
1285
|
+
##
|
1286
|
+
# Determines whether the SessionService service is supported by the current client.
|
1287
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::DiscoveryEngine.session_service}.
|
1288
|
+
# If false, that method will raise an exception. This could happen if the given
|
1289
|
+
# API version does not exist or does not support the SessionService service,
|
1290
|
+
# or if the versioned client gem needs an update to support the SessionService service.
|
1291
|
+
#
|
1292
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
1293
|
+
# Defaults to `:v1`.
|
1294
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
1295
|
+
# @return [boolean] Whether the service is available.
|
1296
|
+
#
|
1297
|
+
def self.session_service_available? version: :v1, transport: :grpc
|
1298
|
+
require "google/cloud/discovery_engine/#{version.to_s.downcase}"
|
1299
|
+
package_name = Google::Cloud::DiscoveryEngine
|
1300
|
+
.constants
|
1301
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
1302
|
+
.first
|
1303
|
+
return false unless package_name
|
1304
|
+
service_module = Google::Cloud::DiscoveryEngine.const_get package_name
|
1305
|
+
return false unless service_module.const_defined? :SessionService
|
1306
|
+
service_module = service_module.const_get :SessionService
|
1307
|
+
if transport == :rest
|
1308
|
+
return false unless service_module.const_defined? :Rest
|
1309
|
+
service_module = service_module.const_get :Rest
|
1310
|
+
end
|
1311
|
+
service_module.const_defined? :Client
|
1312
|
+
rescue ::LoadError
|
1313
|
+
false
|
1314
|
+
end
|
1315
|
+
|
1176
1316
|
##
|
1177
1317
|
# Create a new client object for SiteSearchEngineService.
|
1178
1318
|
#
|