google-cloud-discovery_engine-v1beta 0.7.2 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +235 -4
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/operations.rb +801 -0
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +221 -4
  6. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +1077 -0
  7. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +136 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest.rb +1 -0
  9. data/lib/google/cloud/discovery_engine/v1beta/completion_service.rb +1 -0
  10. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +20 -3
  11. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/paths.rb +91 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +20 -3
  13. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +45 -0
  14. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +925 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/credentials.rb +47 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/operations.rb +801 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/paths.rb +97 -0
  18. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +864 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +1077 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/service_stub.rb +403 -0
  21. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest.rb +54 -0
  22. data/lib/google/cloud/discovery_engine/v1beta/data_store_service.rb +57 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +14 -0
  24. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +887 -0
  25. data/lib/google/cloud/discovery_engine/v1beta/engine_service/credentials.rb +47 -0
  26. data/lib/google/cloud/discovery_engine/v1beta/engine_service/operations.rb +801 -0
  27. data/lib/google/cloud/discovery_engine/v1beta/engine_service/paths.rb +73 -0
  28. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +826 -0
  29. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +1077 -0
  30. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb +366 -0
  31. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest.rb +54 -0
  32. data/lib/google/cloud/discovery_engine/v1beta/engine_service.rb +57 -0
  33. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +22 -3
  34. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/paths.rb +19 -0
  35. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +22 -3
  36. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb +8 -0
  37. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +4 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +14 -0
  39. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +48 -10
  40. data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +19 -0
  41. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +48 -10
  42. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +8 -0
  43. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +646 -0
  44. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/credentials.rb +47 -0
  45. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/paths.rb +146 -0
  46. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +599 -0
  47. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/service_stub.rb +291 -0
  48. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest.rb +52 -0
  49. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service.rb +55 -0
  50. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/client.rb +1635 -0
  51. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/credentials.rb +47 -0
  52. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/operations.rb +801 -0
  53. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/paths.rb +127 -0
  54. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/client.rb +1525 -0
  55. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +1077 -0
  56. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/service_stub.rb +860 -0
  57. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest.rb +53 -0
  58. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service.rb +56 -0
  59. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +14 -0
  60. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  61. data/lib/google/cloud/discovery_engine/v1beta.rb +4 -0
  62. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +6 -1
  63. data/lib/google/cloud/discoveryengine/v1beta/completion_pb.rb +45 -0
  64. data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +4 -1
  65. data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +8 -0
  66. data/lib/google/cloud/discoveryengine/v1beta/conversation_pb.rb +1 -1
  67. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +1 -1
  68. data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +49 -0
  69. data/lib/google/cloud/discoveryengine/v1beta/data_store_service_pb.rb +62 -0
  70. data/lib/google/cloud/discoveryengine/v1beta/data_store_service_services_pb.rb +61 -0
  71. data/lib/google/cloud/discoveryengine/v1beta/document_pb.rb +1 -1
  72. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +1 -1
  73. data/lib/google/cloud/discoveryengine/v1beta/engine_pb.rb +53 -0
  74. data/lib/google/cloud/discoveryengine/v1beta/engine_service_pb.rb +62 -0
  75. data/lib/google/cloud/discoveryengine/v1beta/engine_service_services_pb.rb +55 -0
  76. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +7 -1
  77. data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +6 -1
  78. data/lib/google/cloud/discoveryengine/v1beta/recommendation_service_pb.rb +1 -1
  79. data/lib/google/cloud/discoveryengine/v1beta/schema_pb.rb +1 -1
  80. data/lib/google/cloud/discoveryengine/v1beta/schema_service_pb.rb +1 -1
  81. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +8 -1
  82. data/lib/google/cloud/discoveryengine/v1beta/serving_config_pb.rb +53 -0
  83. data/lib/google/cloud/discoveryengine/v1beta/serving_config_service_pb.rb +54 -0
  84. data/lib/google/cloud/discoveryengine/v1beta/serving_config_service_services_pb.rb +53 -0
  85. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_pb.rb +54 -0
  86. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_service_pb.rb +82 -0
  87. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_service_services_pb.rb +74 -0
  88. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +1 -1
  89. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +1 -1
  90. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +60 -0
  91. data/proto_docs/google/cloud/discoveryengine/v1beta/completion.rb +53 -0
  92. data/proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb +10 -4
  93. data/proto_docs/google/cloud/discoveryengine/v1beta/conversation.rb +2 -0
  94. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +19 -1
  95. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +88 -0
  96. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store_service.rb +216 -0
  97. data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +1 -1
  98. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +219 -0
  99. data/proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb +179 -0
  100. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +66 -0
  101. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +41 -0
  102. data/proto_docs/google/cloud/discoveryengine/v1beta/recommendation_service.rb +22 -3
  103. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +166 -15
  104. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +247 -0
  105. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config_service.rb +85 -0
  106. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine.rb +160 -0
  107. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine_service.rb +528 -0
  108. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +4 -3
  109. metadata +62 -116
@@ -0,0 +1,925 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/errors"
20
+ require "google/cloud/discoveryengine/v1beta/data_store_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DiscoveryEngine
26
+ module V1beta
27
+ module DataStoreService
28
+ ##
29
+ # Client for the DataStoreService service.
30
+ #
31
+ # Service for managing
32
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} configuration.
33
+ #
34
+ class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
37
+
38
+ include Paths
39
+
40
+ # @private
41
+ attr_reader :data_store_service_stub
42
+
43
+ ##
44
+ # Configure the DataStoreService Client class.
45
+ #
46
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client::Configuration}
47
+ # for a description of the configuration fields.
48
+ #
49
+ # @example
50
+ #
51
+ # # Modify the configuration for all DataStoreService clients
52
+ # ::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client.configure do |config|
53
+ # config.timeout = 10.0
54
+ # end
55
+ #
56
+ # @yield [config] Configure the Client client.
57
+ # @yieldparam config [Client::Configuration]
58
+ #
59
+ # @return [Client::Configuration]
60
+ #
61
+ def self.configure
62
+ @configure ||= begin
63
+ namespace = ["Google", "Cloud", "DiscoveryEngine", "V1beta"]
64
+ parent_config = while namespace.any?
65
+ parent_name = namespace.join "::"
66
+ parent_const = const_get parent_name
67
+ break parent_const.configure if parent_const.respond_to? :configure
68
+ namespace.pop
69
+ end
70
+ default_config = Client::Configuration.new parent_config
71
+
72
+ default_config
73
+ end
74
+ yield @configure if block_given?
75
+ @configure
76
+ end
77
+
78
+ ##
79
+ # Configure the DataStoreService Client instance.
80
+ #
81
+ # The configuration is set to the derived mode, meaning that values can be changed,
82
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
83
+ # should be made on {Client.configure}.
84
+ #
85
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client::Configuration}
86
+ # for a description of the configuration fields.
87
+ #
88
+ # @yield [config] Configure the Client client.
89
+ # @yieldparam config [Client::Configuration]
90
+ #
91
+ # @return [Client::Configuration]
92
+ #
93
+ def configure
94
+ yield @config if block_given?
95
+ @config
96
+ end
97
+
98
+ ##
99
+ # The effective universe domain
100
+ #
101
+ # @return [String]
102
+ #
103
+ def universe_domain
104
+ @data_store_service_stub.universe_domain
105
+ end
106
+
107
+ ##
108
+ # Create a new DataStoreService client object.
109
+ #
110
+ # @example
111
+ #
112
+ # # Create a client using the default configuration
113
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client.new
114
+ #
115
+ # # Create a client using a custom configuration
116
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client.new do |config|
117
+ # config.timeout = 10.0
118
+ # end
119
+ #
120
+ # @yield [config] Configure the DataStoreService client.
121
+ # @yieldparam config [Client::Configuration]
122
+ #
123
+ def initialize
124
+ # These require statements are intentionally placed here to initialize
125
+ # the gRPC module only when it's required.
126
+ # See https://github.com/googleapis/toolkit/issues/446
127
+ require "gapic/grpc"
128
+ require "google/cloud/discoveryengine/v1beta/data_store_service_services_pb"
129
+
130
+ # Create the configuration object
131
+ @config = Configuration.new Client.configure
132
+
133
+ # Yield the configuration if needed
134
+ yield @config if block_given?
135
+
136
+ # Create credentials
137
+ credentials = @config.credentials
138
+ # Use self-signed JWT if the endpoint is unchanged from default,
139
+ # but only if the default endpoint does not have a region prefix.
140
+ enable_self_signed_jwt = @config.endpoint.nil? ||
141
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
+ !@config.endpoint.split(".").first.include?("-"))
143
+ credentials ||= Credentials.default scope: @config.scope,
144
+ enable_self_signed_jwt: enable_self_signed_jwt
145
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
146
+ credentials = Credentials.new credentials, scope: @config.scope
147
+ end
148
+ @quota_project_id = @config.quota_project
149
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
150
+
151
+ @operations_client = Operations.new do |config|
152
+ config.credentials = credentials
153
+ config.quota_project = @quota_project_id
154
+ config.endpoint = @config.endpoint
155
+ config.universe_domain = @config.universe_domain
156
+ end
157
+
158
+ @data_store_service_stub = ::Gapic::ServiceStub.new(
159
+ ::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Stub,
160
+ credentials: credentials,
161
+ endpoint: @config.endpoint,
162
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
163
+ universe_domain: @config.universe_domain,
164
+ channel_args: @config.channel_args,
165
+ interceptors: @config.interceptors,
166
+ channel_pool_config: @config.channel_pool
167
+ )
168
+
169
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
170
+ config.credentials = credentials
171
+ config.quota_project = @quota_project_id
172
+ config.endpoint = @data_store_service_stub.endpoint
173
+ config.universe_domain = @data_store_service_stub.universe_domain
174
+ end
175
+ end
176
+
177
+ ##
178
+ # Get the associated client for long-running operations.
179
+ #
180
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Operations]
181
+ #
182
+ attr_reader :operations_client
183
+
184
+ ##
185
+ # Get the associated client for mix-in of the Locations.
186
+ #
187
+ # @return [Google::Cloud::Location::Locations::Client]
188
+ #
189
+ attr_reader :location_client
190
+
191
+ # Service calls
192
+
193
+ ##
194
+ # Creates a {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}.
195
+ #
196
+ # DataStore is for storing
197
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Documents}. To serve these
198
+ # documents for Search, or Recommendation use case, an
199
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Engine Engine} needs to be created
200
+ # separately.
201
+ #
202
+ # @overload create_data_store(request, options = nil)
203
+ # Pass arguments to `create_data_store` via a request object, either of type
204
+ # {::Google::Cloud::DiscoveryEngine::V1beta::CreateDataStoreRequest} or an equivalent Hash.
205
+ #
206
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::CreateDataStoreRequest, ::Hash]
207
+ # A request object representing the call parameters. Required. To specify no
208
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
209
+ # @param options [::Gapic::CallOptions, ::Hash]
210
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
211
+ #
212
+ # @overload create_data_store(parent: nil, data_store: nil, data_store_id: nil, create_advanced_site_search: nil)
213
+ # Pass arguments to `create_data_store` via keyword arguments. Note that at
214
+ # least one keyword argument is required. To specify no parameters, or to keep all
215
+ # the default parameter values, pass an empty Hash as a request object (see above).
216
+ #
217
+ # @param parent [::String]
218
+ # Required. The parent resource name, such as
219
+ # `projects/{project}/locations/{location}/collections/{collection}`.
220
+ # @param data_store [::Google::Cloud::DiscoveryEngine::V1beta::DataStore, ::Hash]
221
+ # Required. The {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} to
222
+ # create.
223
+ # @param data_store_id [::String]
224
+ # Required. The ID to use for the
225
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, which will
226
+ # become the final component of the
227
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}'s resource name.
228
+ #
229
+ # This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
230
+ # standard with a length limit of 63 characters. Otherwise, an
231
+ # INVALID_ARGUMENT error is returned.
232
+ # @param create_advanced_site_search [::Boolean]
233
+ # A boolean flag indicating whether user want to directly create an advanced
234
+ # data store for site search.
235
+ # If the data store is not configured as site
236
+ # search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will
237
+ # be ignored.
238
+ #
239
+ # @yield [response, operation] Access the result along with the RPC operation
240
+ # @yieldparam response [::Gapic::Operation]
241
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
242
+ #
243
+ # @return [::Gapic::Operation]
244
+ #
245
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
246
+ #
247
+ # @example Basic example
248
+ # require "google/cloud/discovery_engine/v1beta"
249
+ #
250
+ # # Create a client object. The client can be reused for multiple calls.
251
+ # client = Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client.new
252
+ #
253
+ # # Create a request. To set request fields, pass in keyword arguments.
254
+ # request = Google::Cloud::DiscoveryEngine::V1beta::CreateDataStoreRequest.new
255
+ #
256
+ # # Call the create_data_store method.
257
+ # result = client.create_data_store request
258
+ #
259
+ # # The returned object is of type Gapic::Operation. You can use it to
260
+ # # check the status of an operation, cancel it, or wait for results.
261
+ # # Here is how to wait for a response.
262
+ # result.wait_until_done! timeout: 60
263
+ # if result.response?
264
+ # p result.response
265
+ # else
266
+ # puts "No response received."
267
+ # end
268
+ #
269
+ def create_data_store request, options = nil
270
+ raise ::ArgumentError, "request must be provided" if request.nil?
271
+
272
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::CreateDataStoreRequest
273
+
274
+ # Converts hash and nil to an options object
275
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
276
+
277
+ # Customize the options with defaults
278
+ metadata = @config.rpcs.create_data_store.metadata.to_h
279
+
280
+ # Set x-goog-api-client and x-goog-user-project headers
281
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
282
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
283
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
284
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
285
+
286
+ header_params = {}
287
+ if request.parent
288
+ header_params["parent"] = request.parent
289
+ end
290
+
291
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
292
+ metadata[:"x-goog-request-params"] ||= request_params_header
293
+
294
+ options.apply_defaults timeout: @config.rpcs.create_data_store.timeout,
295
+ metadata: metadata,
296
+ retry_policy: @config.rpcs.create_data_store.retry_policy
297
+
298
+ options.apply_defaults timeout: @config.timeout,
299
+ metadata: @config.metadata,
300
+ retry_policy: @config.retry_policy
301
+
302
+ @data_store_service_stub.call_rpc :create_data_store, request, options: options do |response, operation|
303
+ response = ::Gapic::Operation.new response, @operations_client, options: options
304
+ yield response, operation if block_given?
305
+ return response
306
+ end
307
+ rescue ::GRPC::BadStatus => e
308
+ raise ::Google::Cloud::Error.from_error(e)
309
+ end
310
+
311
+ ##
312
+ # Gets a {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}.
313
+ #
314
+ # @overload get_data_store(request, options = nil)
315
+ # Pass arguments to `get_data_store` via a request object, either of type
316
+ # {::Google::Cloud::DiscoveryEngine::V1beta::GetDataStoreRequest} or an equivalent Hash.
317
+ #
318
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::GetDataStoreRequest, ::Hash]
319
+ # A request object representing the call parameters. Required. To specify no
320
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
321
+ # @param options [::Gapic::CallOptions, ::Hash]
322
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
323
+ #
324
+ # @overload get_data_store(name: nil)
325
+ # Pass arguments to `get_data_store` via keyword arguments. Note that at
326
+ # least one keyword argument is required. To specify no parameters, or to keep all
327
+ # the default parameter values, pass an empty Hash as a request object (see above).
328
+ #
329
+ # @param name [::String]
330
+ # Required. Full resource name of
331
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
332
+ # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
333
+ #
334
+ # If the caller does not have permission to access the
335
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, regardless of
336
+ # whether or not it exists, a PERMISSION_DENIED error is returned.
337
+ #
338
+ # If the requested {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}
339
+ # does not exist, a NOT_FOUND error is returned.
340
+ #
341
+ # @yield [response, operation] Access the result along with the RPC operation
342
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::DataStore]
343
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
344
+ #
345
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::DataStore]
346
+ #
347
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
348
+ #
349
+ # @example Basic example
350
+ # require "google/cloud/discovery_engine/v1beta"
351
+ #
352
+ # # Create a client object. The client can be reused for multiple calls.
353
+ # client = Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client.new
354
+ #
355
+ # # Create a request. To set request fields, pass in keyword arguments.
356
+ # request = Google::Cloud::DiscoveryEngine::V1beta::GetDataStoreRequest.new
357
+ #
358
+ # # Call the get_data_store method.
359
+ # result = client.get_data_store request
360
+ #
361
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::DataStore.
362
+ # p result
363
+ #
364
+ def get_data_store request, options = nil
365
+ raise ::ArgumentError, "request must be provided" if request.nil?
366
+
367
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::GetDataStoreRequest
368
+
369
+ # Converts hash and nil to an options object
370
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
371
+
372
+ # Customize the options with defaults
373
+ metadata = @config.rpcs.get_data_store.metadata.to_h
374
+
375
+ # Set x-goog-api-client and x-goog-user-project headers
376
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
377
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
378
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
379
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
380
+
381
+ header_params = {}
382
+ if request.name
383
+ header_params["name"] = request.name
384
+ end
385
+
386
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
387
+ metadata[:"x-goog-request-params"] ||= request_params_header
388
+
389
+ options.apply_defaults timeout: @config.rpcs.get_data_store.timeout,
390
+ metadata: metadata,
391
+ retry_policy: @config.rpcs.get_data_store.retry_policy
392
+
393
+ options.apply_defaults timeout: @config.timeout,
394
+ metadata: @config.metadata,
395
+ retry_policy: @config.retry_policy
396
+
397
+ @data_store_service_stub.call_rpc :get_data_store, request, options: options do |response, operation|
398
+ yield response, operation if block_given?
399
+ return response
400
+ end
401
+ rescue ::GRPC::BadStatus => e
402
+ raise ::Google::Cloud::Error.from_error(e)
403
+ end
404
+
405
+ ##
406
+ # Lists all the {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}s
407
+ # associated with the project.
408
+ #
409
+ # @overload list_data_stores(request, options = nil)
410
+ # Pass arguments to `list_data_stores` via a request object, either of type
411
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ListDataStoresRequest} or an equivalent Hash.
412
+ #
413
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ListDataStoresRequest, ::Hash]
414
+ # A request object representing the call parameters. Required. To specify no
415
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
416
+ # @param options [::Gapic::CallOptions, ::Hash]
417
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
418
+ #
419
+ # @overload list_data_stores(parent: nil, page_size: nil, page_token: nil, filter: nil)
420
+ # Pass arguments to `list_data_stores` via keyword arguments. Note that at
421
+ # least one keyword argument is required. To specify no parameters, or to keep all
422
+ # the default parameter values, pass an empty Hash as a request object (see above).
423
+ #
424
+ # @param parent [::String]
425
+ # Required. The parent branch resource name, such as
426
+ # `projects/{project}/locations/{location}/collections/{collection_id}`.
427
+ #
428
+ # If the caller does not have permission to list
429
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}s under this
430
+ # location, regardless of whether or not this data store exists, a
431
+ # PERMISSION_DENIED error is returned.
432
+ # @param page_size [::Integer]
433
+ # Maximum number of
434
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}s to return. If
435
+ # unspecified, defaults to 10. The maximum allowed value is 50. Values above
436
+ # 50 will be coerced to 50.
437
+ #
438
+ # If this field is negative, an INVALID_ARGUMENT is returned.
439
+ # @param page_token [::String]
440
+ # A page token
441
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ListDataStoresResponse#next_page_token ListDataStoresResponse.next_page_token},
442
+ # received from a previous
443
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores}
444
+ # call. Provide this to retrieve the subsequent page.
445
+ #
446
+ # When paginating, all other parameters provided to
447
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores}
448
+ # must match the call that provided the page token. Otherwise, an
449
+ # INVALID_ARGUMENT error is returned.
450
+ # @param filter [::String]
451
+ # Filter by solution type. For example: filter =
452
+ # 'solution_type:SOLUTION_TYPE_SEARCH'
453
+ #
454
+ # @yield [response, operation] Access the result along with the RPC operation
455
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::DataStore>]
456
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
457
+ #
458
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::DataStore>]
459
+ #
460
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
461
+ #
462
+ # @example Basic example
463
+ # require "google/cloud/discovery_engine/v1beta"
464
+ #
465
+ # # Create a client object. The client can be reused for multiple calls.
466
+ # client = Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client.new
467
+ #
468
+ # # Create a request. To set request fields, pass in keyword arguments.
469
+ # request = Google::Cloud::DiscoveryEngine::V1beta::ListDataStoresRequest.new
470
+ #
471
+ # # Call the list_data_stores method.
472
+ # result = client.list_data_stores request
473
+ #
474
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
475
+ # # over elements, and API calls will be issued to fetch pages as needed.
476
+ # result.each do |item|
477
+ # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::DataStore.
478
+ # p item
479
+ # end
480
+ #
481
+ def list_data_stores request, options = nil
482
+ raise ::ArgumentError, "request must be provided" if request.nil?
483
+
484
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ListDataStoresRequest
485
+
486
+ # Converts hash and nil to an options object
487
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
488
+
489
+ # Customize the options with defaults
490
+ metadata = @config.rpcs.list_data_stores.metadata.to_h
491
+
492
+ # Set x-goog-api-client and x-goog-user-project headers
493
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
494
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
495
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
496
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
497
+
498
+ header_params = {}
499
+ if request.parent
500
+ header_params["parent"] = request.parent
501
+ end
502
+
503
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
504
+ metadata[:"x-goog-request-params"] ||= request_params_header
505
+
506
+ options.apply_defaults timeout: @config.rpcs.list_data_stores.timeout,
507
+ metadata: metadata,
508
+ retry_policy: @config.rpcs.list_data_stores.retry_policy
509
+
510
+ options.apply_defaults timeout: @config.timeout,
511
+ metadata: @config.metadata,
512
+ retry_policy: @config.retry_policy
513
+
514
+ @data_store_service_stub.call_rpc :list_data_stores, request, options: options do |response, operation|
515
+ response = ::Gapic::PagedEnumerable.new @data_store_service_stub, :list_data_stores, request, response, operation, options
516
+ yield response, operation if block_given?
517
+ return response
518
+ end
519
+ rescue ::GRPC::BadStatus => e
520
+ raise ::Google::Cloud::Error.from_error(e)
521
+ end
522
+
523
+ ##
524
+ # Deletes a {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}.
525
+ #
526
+ # @overload delete_data_store(request, options = nil)
527
+ # Pass arguments to `delete_data_store` via a request object, either of type
528
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DeleteDataStoreRequest} or an equivalent Hash.
529
+ #
530
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::DeleteDataStoreRequest, ::Hash]
531
+ # A request object representing the call parameters. Required. To specify no
532
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
533
+ # @param options [::Gapic::CallOptions, ::Hash]
534
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
535
+ #
536
+ # @overload delete_data_store(name: nil)
537
+ # Pass arguments to `delete_data_store` via keyword arguments. Note that at
538
+ # least one keyword argument is required. To specify no parameters, or to keep all
539
+ # the default parameter values, pass an empty Hash as a request object (see above).
540
+ #
541
+ # @param name [::String]
542
+ # Required. Full resource name of
543
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, such as
544
+ # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
545
+ #
546
+ # If the caller does not have permission to delete the
547
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, regardless of
548
+ # whether or not it exists, a PERMISSION_DENIED error is returned.
549
+ #
550
+ # If the {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} to delete
551
+ # does not exist, a NOT_FOUND error is returned.
552
+ #
553
+ # @yield [response, operation] Access the result along with the RPC operation
554
+ # @yieldparam response [::Gapic::Operation]
555
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
556
+ #
557
+ # @return [::Gapic::Operation]
558
+ #
559
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
560
+ #
561
+ # @example Basic example
562
+ # require "google/cloud/discovery_engine/v1beta"
563
+ #
564
+ # # Create a client object. The client can be reused for multiple calls.
565
+ # client = Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client.new
566
+ #
567
+ # # Create a request. To set request fields, pass in keyword arguments.
568
+ # request = Google::Cloud::DiscoveryEngine::V1beta::DeleteDataStoreRequest.new
569
+ #
570
+ # # Call the delete_data_store method.
571
+ # result = client.delete_data_store request
572
+ #
573
+ # # The returned object is of type Gapic::Operation. You can use it to
574
+ # # check the status of an operation, cancel it, or wait for results.
575
+ # # Here is how to wait for a response.
576
+ # result.wait_until_done! timeout: 60
577
+ # if result.response?
578
+ # p result.response
579
+ # else
580
+ # puts "No response received."
581
+ # end
582
+ #
583
+ def delete_data_store request, options = nil
584
+ raise ::ArgumentError, "request must be provided" if request.nil?
585
+
586
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::DeleteDataStoreRequest
587
+
588
+ # Converts hash and nil to an options object
589
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
590
+
591
+ # Customize the options with defaults
592
+ metadata = @config.rpcs.delete_data_store.metadata.to_h
593
+
594
+ # Set x-goog-api-client and x-goog-user-project headers
595
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
596
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
597
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
598
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
599
+
600
+ header_params = {}
601
+ if request.name
602
+ header_params["name"] = request.name
603
+ end
604
+
605
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
606
+ metadata[:"x-goog-request-params"] ||= request_params_header
607
+
608
+ options.apply_defaults timeout: @config.rpcs.delete_data_store.timeout,
609
+ metadata: metadata,
610
+ retry_policy: @config.rpcs.delete_data_store.retry_policy
611
+
612
+ options.apply_defaults timeout: @config.timeout,
613
+ metadata: @config.metadata,
614
+ retry_policy: @config.retry_policy
615
+
616
+ @data_store_service_stub.call_rpc :delete_data_store, request, options: options do |response, operation|
617
+ response = ::Gapic::Operation.new response, @operations_client, options: options
618
+ yield response, operation if block_given?
619
+ return response
620
+ end
621
+ rescue ::GRPC::BadStatus => e
622
+ raise ::Google::Cloud::Error.from_error(e)
623
+ end
624
+
625
+ ##
626
+ # Updates a {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}
627
+ #
628
+ # @overload update_data_store(request, options = nil)
629
+ # Pass arguments to `update_data_store` via a request object, either of type
630
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UpdateDataStoreRequest} or an equivalent Hash.
631
+ #
632
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::UpdateDataStoreRequest, ::Hash]
633
+ # A request object representing the call parameters. Required. To specify no
634
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
635
+ # @param options [::Gapic::CallOptions, ::Hash]
636
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
637
+ #
638
+ # @overload update_data_store(data_store: nil, update_mask: nil)
639
+ # Pass arguments to `update_data_store` via keyword arguments. Note that at
640
+ # least one keyword argument is required. To specify no parameters, or to keep all
641
+ # the default parameter values, pass an empty Hash as a request object (see above).
642
+ #
643
+ # @param data_store [::Google::Cloud::DiscoveryEngine::V1beta::DataStore, ::Hash]
644
+ # Required. The {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} to
645
+ # update.
646
+ #
647
+ # If the caller does not have permission to update the
648
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}, regardless of
649
+ # whether or not it exists, a PERMISSION_DENIED error is returned.
650
+ #
651
+ # If the {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} to update
652
+ # does not exist, a NOT_FOUND error is returned.
653
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
654
+ # Indicates which fields in the provided
655
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore} to update.
656
+ #
657
+ # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
658
+ # is returned.
659
+ #
660
+ # @yield [response, operation] Access the result along with the RPC operation
661
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::DataStore]
662
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
663
+ #
664
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::DataStore]
665
+ #
666
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
667
+ #
668
+ # @example Basic example
669
+ # require "google/cloud/discovery_engine/v1beta"
670
+ #
671
+ # # Create a client object. The client can be reused for multiple calls.
672
+ # client = Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client.new
673
+ #
674
+ # # Create a request. To set request fields, pass in keyword arguments.
675
+ # request = Google::Cloud::DiscoveryEngine::V1beta::UpdateDataStoreRequest.new
676
+ #
677
+ # # Call the update_data_store method.
678
+ # result = client.update_data_store request
679
+ #
680
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::DataStore.
681
+ # p result
682
+ #
683
+ def update_data_store request, options = nil
684
+ raise ::ArgumentError, "request must be provided" if request.nil?
685
+
686
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::UpdateDataStoreRequest
687
+
688
+ # Converts hash and nil to an options object
689
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
690
+
691
+ # Customize the options with defaults
692
+ metadata = @config.rpcs.update_data_store.metadata.to_h
693
+
694
+ # Set x-goog-api-client and x-goog-user-project headers
695
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
696
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
697
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
698
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
699
+
700
+ header_params = {}
701
+ if request.data_store&.name
702
+ header_params["data_store.name"] = request.data_store.name
703
+ end
704
+
705
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
706
+ metadata[:"x-goog-request-params"] ||= request_params_header
707
+
708
+ options.apply_defaults timeout: @config.rpcs.update_data_store.timeout,
709
+ metadata: metadata,
710
+ retry_policy: @config.rpcs.update_data_store.retry_policy
711
+
712
+ options.apply_defaults timeout: @config.timeout,
713
+ metadata: @config.metadata,
714
+ retry_policy: @config.retry_policy
715
+
716
+ @data_store_service_stub.call_rpc :update_data_store, request, options: options do |response, operation|
717
+ yield response, operation if block_given?
718
+ return response
719
+ end
720
+ rescue ::GRPC::BadStatus => e
721
+ raise ::Google::Cloud::Error.from_error(e)
722
+ end
723
+
724
+ ##
725
+ # Configuration class for the DataStoreService API.
726
+ #
727
+ # This class represents the configuration for DataStoreService,
728
+ # providing control over timeouts, retry behavior, logging, transport
729
+ # parameters, and other low-level controls. Certain parameters can also be
730
+ # applied individually to specific RPCs. See
731
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client::Configuration::Rpcs}
732
+ # for a list of RPCs that can be configured independently.
733
+ #
734
+ # Configuration can be applied globally to all clients, or to a single client
735
+ # on construction.
736
+ #
737
+ # @example
738
+ #
739
+ # # Modify the global config, setting the timeout for
740
+ # # create_data_store to 20 seconds,
741
+ # # and all remaining timeouts to 10 seconds.
742
+ # ::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client.configure do |config|
743
+ # config.timeout = 10.0
744
+ # config.rpcs.create_data_store.timeout = 20.0
745
+ # end
746
+ #
747
+ # # Apply the above configuration only to a new client.
748
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Client.new do |config|
749
+ # config.timeout = 10.0
750
+ # config.rpcs.create_data_store.timeout = 20.0
751
+ # end
752
+ #
753
+ # @!attribute [rw] endpoint
754
+ # A custom service endpoint, as a hostname or hostname:port. The default is
755
+ # nil, indicating to use the default endpoint in the current universe domain.
756
+ # @return [::String,nil]
757
+ # @!attribute [rw] credentials
758
+ # Credentials to send with calls. You may provide any of the following types:
759
+ # * (`String`) The path to a service account key file in JSON format
760
+ # * (`Hash`) A service account key as a Hash
761
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
762
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
763
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
764
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
765
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
766
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
767
+ # * (`nil`) indicating no credentials
768
+ # @return [::Object]
769
+ # @!attribute [rw] scope
770
+ # The OAuth scopes
771
+ # @return [::Array<::String>]
772
+ # @!attribute [rw] lib_name
773
+ # The library name as recorded in instrumentation and logging
774
+ # @return [::String]
775
+ # @!attribute [rw] lib_version
776
+ # The library version as recorded in instrumentation and logging
777
+ # @return [::String]
778
+ # @!attribute [rw] channel_args
779
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
780
+ # `GRPC::Core::Channel` object is provided as the credential.
781
+ # @return [::Hash]
782
+ # @!attribute [rw] interceptors
783
+ # An array of interceptors that are run before calls are executed.
784
+ # @return [::Array<::GRPC::ClientInterceptor>]
785
+ # @!attribute [rw] timeout
786
+ # The call timeout in seconds.
787
+ # @return [::Numeric]
788
+ # @!attribute [rw] metadata
789
+ # Additional gRPC headers to be sent with the call.
790
+ # @return [::Hash{::Symbol=>::String}]
791
+ # @!attribute [rw] retry_policy
792
+ # The retry policy. The value is a hash with the following keys:
793
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
794
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
795
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
796
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
797
+ # trigger a retry.
798
+ # @return [::Hash]
799
+ # @!attribute [rw] quota_project
800
+ # A separate project against which to charge quota.
801
+ # @return [::String]
802
+ # @!attribute [rw] universe_domain
803
+ # The universe domain within which to make requests. This determines the
804
+ # default endpoint URL. The default value of nil uses the environment
805
+ # universe (usually the default "googleapis.com" universe).
806
+ # @return [::String,nil]
807
+ #
808
+ class Configuration
809
+ extend ::Gapic::Config
810
+
811
+ # @private
812
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
813
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
814
+
815
+ config_attr :endpoint, nil, ::String, nil
816
+ config_attr :credentials, nil do |value|
817
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
818
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
819
+ allowed.any? { |klass| klass === value }
820
+ end
821
+ config_attr :scope, nil, ::String, ::Array, nil
822
+ config_attr :lib_name, nil, ::String, nil
823
+ config_attr :lib_version, nil, ::String, nil
824
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
825
+ config_attr :interceptors, nil, ::Array, nil
826
+ config_attr :timeout, nil, ::Numeric, nil
827
+ config_attr :metadata, nil, ::Hash, nil
828
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
829
+ config_attr :quota_project, nil, ::String, nil
830
+ config_attr :universe_domain, nil, ::String, nil
831
+
832
+ # @private
833
+ def initialize parent_config = nil
834
+ @parent_config = parent_config unless parent_config.nil?
835
+
836
+ yield self if block_given?
837
+ end
838
+
839
+ ##
840
+ # Configurations for individual RPCs
841
+ # @return [Rpcs]
842
+ #
843
+ def rpcs
844
+ @rpcs ||= begin
845
+ parent_rpcs = nil
846
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
847
+ Rpcs.new parent_rpcs
848
+ end
849
+ end
850
+
851
+ ##
852
+ # Configuration for the channel pool
853
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
854
+ #
855
+ def channel_pool
856
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
857
+ end
858
+
859
+ ##
860
+ # Configuration RPC class for the DataStoreService API.
861
+ #
862
+ # Includes fields providing the configuration for each RPC in this service.
863
+ # Each configuration object is of type `Gapic::Config::Method` and includes
864
+ # the following configuration fields:
865
+ #
866
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
867
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
868
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
869
+ # include the following keys:
870
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
871
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
872
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
873
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
874
+ # trigger a retry.
875
+ #
876
+ class Rpcs
877
+ ##
878
+ # RPC-specific configuration for `create_data_store`
879
+ # @return [::Gapic::Config::Method]
880
+ #
881
+ attr_reader :create_data_store
882
+ ##
883
+ # RPC-specific configuration for `get_data_store`
884
+ # @return [::Gapic::Config::Method]
885
+ #
886
+ attr_reader :get_data_store
887
+ ##
888
+ # RPC-specific configuration for `list_data_stores`
889
+ # @return [::Gapic::Config::Method]
890
+ #
891
+ attr_reader :list_data_stores
892
+ ##
893
+ # RPC-specific configuration for `delete_data_store`
894
+ # @return [::Gapic::Config::Method]
895
+ #
896
+ attr_reader :delete_data_store
897
+ ##
898
+ # RPC-specific configuration for `update_data_store`
899
+ # @return [::Gapic::Config::Method]
900
+ #
901
+ attr_reader :update_data_store
902
+
903
+ # @private
904
+ def initialize parent_rpcs = nil
905
+ create_data_store_config = parent_rpcs.create_data_store if parent_rpcs.respond_to? :create_data_store
906
+ @create_data_store = ::Gapic::Config::Method.new create_data_store_config
907
+ get_data_store_config = parent_rpcs.get_data_store if parent_rpcs.respond_to? :get_data_store
908
+ @get_data_store = ::Gapic::Config::Method.new get_data_store_config
909
+ list_data_stores_config = parent_rpcs.list_data_stores if parent_rpcs.respond_to? :list_data_stores
910
+ @list_data_stores = ::Gapic::Config::Method.new list_data_stores_config
911
+ delete_data_store_config = parent_rpcs.delete_data_store if parent_rpcs.respond_to? :delete_data_store
912
+ @delete_data_store = ::Gapic::Config::Method.new delete_data_store_config
913
+ update_data_store_config = parent_rpcs.update_data_store if parent_rpcs.respond_to? :update_data_store
914
+ @update_data_store = ::Gapic::Config::Method.new update_data_store_config
915
+
916
+ yield self if block_given?
917
+ end
918
+ end
919
+ end
920
+ end
921
+ end
922
+ end
923
+ end
924
+ end
925
+ end