google-cloud-discovery_engine-v1 0.4.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +235 -4
  3. data/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb +801 -0
  4. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +221 -4
  5. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +1091 -0
  6. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/service_stub.rb +136 -0
  7. data/lib/google/cloud/discovery_engine/v1/completion_service/rest.rb +1 -0
  8. data/lib/google/cloud/discovery_engine/v1/completion_service.rb +1 -0
  9. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +20 -3
  10. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb +91 -0
  11. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +20 -3
  12. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +45 -0
  13. data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +924 -0
  14. data/lib/google/cloud/discovery_engine/v1/data_store_service/credentials.rb +47 -0
  15. data/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +801 -0
  16. data/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb +97 -0
  17. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +863 -0
  18. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +1091 -0
  19. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/service_stub.rb +403 -0
  20. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest.rb +54 -0
  21. data/lib/google/cloud/discovery_engine/v1/data_store_service.rb +57 -0
  22. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +14 -0
  23. data/lib/google/cloud/discovery_engine/v1/engine_service/client.rb +885 -0
  24. data/lib/google/cloud/discovery_engine/v1/engine_service/credentials.rb +47 -0
  25. data/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb +801 -0
  26. data/lib/google/cloud/discovery_engine/v1/engine_service/paths.rb +73 -0
  27. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb +824 -0
  28. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +1091 -0
  29. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/service_stub.rb +366 -0
  30. data/lib/google/cloud/discovery_engine/v1/engine_service/rest.rb +54 -0
  31. data/lib/google/cloud/discovery_engine/v1/engine_service.rb +57 -0
  32. data/lib/google/cloud/discovery_engine/v1/rest.rb +3 -0
  33. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +14 -0
  34. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +40 -4
  35. data/lib/google/cloud/discovery_engine/v1/search_service/paths.rb +19 -0
  36. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +40 -4
  37. data/lib/google/cloud/discovery_engine/v1/search_service/rest/service_stub.rb +8 -0
  38. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +1631 -0
  39. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/credentials.rb +47 -0
  40. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +801 -0
  41. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/paths.rb +127 -0
  42. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +1521 -0
  43. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +1091 -0
  44. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb +860 -0
  45. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest.rb +53 -0
  46. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service.rb +56 -0
  47. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +14 -0
  48. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  49. data/lib/google/cloud/discovery_engine/v1.rb +3 -0
  50. data/lib/google/cloud/discoveryengine/v1/common_pb.rb +5 -1
  51. data/lib/google/cloud/discoveryengine/v1/completion_pb.rb +45 -0
  52. data/lib/google/cloud/discoveryengine/v1/completion_service_pb.rb +4 -1
  53. data/lib/google/cloud/discoveryengine/v1/completion_service_services_pb.rb +8 -0
  54. data/lib/google/cloud/discoveryengine/v1/conversation_pb.rb +1 -1
  55. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +1 -1
  56. data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +49 -0
  57. data/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb +62 -0
  58. data/lib/google/cloud/discoveryengine/v1/data_store_service_services_pb.rb +61 -0
  59. data/lib/google/cloud/discoveryengine/v1/document_pb.rb +1 -1
  60. data/lib/google/cloud/discoveryengine/v1/document_service_pb.rb +1 -1
  61. data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +53 -0
  62. data/lib/google/cloud/discoveryengine/v1/engine_service_pb.rb +62 -0
  63. data/lib/google/cloud/discoveryengine/v1/engine_service_services_pb.rb +55 -0
  64. data/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +7 -1
  65. data/lib/google/cloud/discoveryengine/v1/purge_config_pb.rb +6 -1
  66. data/lib/google/cloud/discoveryengine/v1/schema_pb.rb +1 -1
  67. data/lib/google/cloud/discoveryengine/v1/schema_service_pb.rb +1 -1
  68. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +8 -1
  69. data/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +54 -0
  70. data/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb +82 -0
  71. data/lib/google/cloud/discoveryengine/v1/site_search_engine_service_services_pb.rb +73 -0
  72. data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +1 -1
  73. data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +1 -1
  74. data/proto_docs/google/cloud/discoveryengine/v1/common.rb +51 -0
  75. data/proto_docs/google/cloud/discoveryengine/v1/completion.rb +53 -0
  76. data/proto_docs/google/cloud/discoveryengine/v1/completion_service.rb +10 -4
  77. data/proto_docs/google/cloud/discoveryengine/v1/conversation.rb +2 -0
  78. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +19 -1
  79. data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +88 -0
  80. data/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +214 -0
  81. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +1 -1
  82. data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +214 -0
  83. data/proto_docs/google/cloud/discoveryengine/v1/engine_service.rb +177 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +66 -0
  85. data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +41 -0
  86. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +149 -4
  87. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +160 -0
  88. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb +525 -0
  89. data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +3 -3
  90. metadata +48 -2
@@ -0,0 +1,924 @@
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/v1/data_store_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DiscoveryEngine
26
+ module V1
27
+ module DataStoreService
28
+ ##
29
+ # Client for the DataStoreService service.
30
+ #
31
+ # Service for managing {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}
32
+ # 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::V1::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::V1::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", "V1"]
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::V1::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::V1::DataStoreService::Client.new
114
+ #
115
+ # # Create a client using a custom configuration
116
+ # client = ::Google::Cloud::DiscoveryEngine::V1::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/v1/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::V1::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::V1::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::V1::DataStore DataStore}.
195
+ #
196
+ # DataStore is for storing
197
+ # {::Google::Cloud::DiscoveryEngine::V1::Document Documents}. To serve these
198
+ # documents for Search, or Recommendation use case, an
199
+ # {::Google::Cloud::DiscoveryEngine::V1::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::V1::CreateDataStoreRequest} or an equivalent Hash.
205
+ #
206
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::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::V1::DataStore, ::Hash]
221
+ # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to
222
+ # create.
223
+ # @param data_store_id [::String]
224
+ # Required. The ID to use for the
225
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, which will become
226
+ # the final component of the
227
+ # {::Google::Cloud::DiscoveryEngine::V1::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/v1"
249
+ #
250
+ # # Create a client object. The client can be reused for multiple calls.
251
+ # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new
252
+ #
253
+ # # Create a request. To set request fields, pass in keyword arguments.
254
+ # request = Google::Cloud::DiscoveryEngine::V1::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::V1::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::V1::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::V1::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::V1::GetDataStoreRequest} or an equivalent Hash.
317
+ #
318
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::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::V1::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::V1::DataStore DataStore}, regardless of
336
+ # whether or not it exists, a PERMISSION_DENIED error is returned.
337
+ #
338
+ # If the requested {::Google::Cloud::DiscoveryEngine::V1::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::V1::DataStore]
343
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
344
+ #
345
+ # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore]
346
+ #
347
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
348
+ #
349
+ # @example Basic example
350
+ # require "google/cloud/discovery_engine/v1"
351
+ #
352
+ # # Create a client object. The client can be reused for multiple calls.
353
+ # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new
354
+ #
355
+ # # Create a request. To set request fields, pass in keyword arguments.
356
+ # request = Google::Cloud::DiscoveryEngine::V1::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::V1::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::V1::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::V1::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::V1::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::V1::ListDataStoresRequest} or an equivalent Hash.
412
+ #
413
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::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::V1::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 {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}s
434
+ # to return. If unspecified, defaults to 10. The maximum allowed value is 50.
435
+ # Values above 50 will be coerced to 50.
436
+ #
437
+ # If this field is negative, an INVALID_ARGUMENT is returned.
438
+ # @param page_token [::String]
439
+ # A page token
440
+ # {::Google::Cloud::DiscoveryEngine::V1::ListDataStoresResponse#next_page_token ListDataStoresResponse.next_page_token},
441
+ # received from a previous
442
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores}
443
+ # call. Provide this to retrieve the subsequent page.
444
+ #
445
+ # When paginating, all other parameters provided to
446
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#list_data_stores DataStoreService.ListDataStores}
447
+ # must match the call that provided the page token. Otherwise, an
448
+ # INVALID_ARGUMENT error is returned.
449
+ # @param filter [::String]
450
+ # Filter by solution type. For example: filter =
451
+ # 'solution_type:SOLUTION_TYPE_SEARCH'
452
+ #
453
+ # @yield [response, operation] Access the result along with the RPC operation
454
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::DataStore>]
455
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
456
+ #
457
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::DataStore>]
458
+ #
459
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
460
+ #
461
+ # @example Basic example
462
+ # require "google/cloud/discovery_engine/v1"
463
+ #
464
+ # # Create a client object. The client can be reused for multiple calls.
465
+ # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new
466
+ #
467
+ # # Create a request. To set request fields, pass in keyword arguments.
468
+ # request = Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest.new
469
+ #
470
+ # # Call the list_data_stores method.
471
+ # result = client.list_data_stores request
472
+ #
473
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
474
+ # # over elements, and API calls will be issued to fetch pages as needed.
475
+ # result.each do |item|
476
+ # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::DataStore.
477
+ # p item
478
+ # end
479
+ #
480
+ def list_data_stores request, options = nil
481
+ raise ::ArgumentError, "request must be provided" if request.nil?
482
+
483
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListDataStoresRequest
484
+
485
+ # Converts hash and nil to an options object
486
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
487
+
488
+ # Customize the options with defaults
489
+ metadata = @config.rpcs.list_data_stores.metadata.to_h
490
+
491
+ # Set x-goog-api-client and x-goog-user-project headers
492
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
493
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
494
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
495
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
496
+
497
+ header_params = {}
498
+ if request.parent
499
+ header_params["parent"] = request.parent
500
+ end
501
+
502
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
503
+ metadata[:"x-goog-request-params"] ||= request_params_header
504
+
505
+ options.apply_defaults timeout: @config.rpcs.list_data_stores.timeout,
506
+ metadata: metadata,
507
+ retry_policy: @config.rpcs.list_data_stores.retry_policy
508
+
509
+ options.apply_defaults timeout: @config.timeout,
510
+ metadata: @config.metadata,
511
+ retry_policy: @config.retry_policy
512
+
513
+ @data_store_service_stub.call_rpc :list_data_stores, request, options: options do |response, operation|
514
+ response = ::Gapic::PagedEnumerable.new @data_store_service_stub, :list_data_stores, request, response, operation, options
515
+ yield response, operation if block_given?
516
+ return response
517
+ end
518
+ rescue ::GRPC::BadStatus => e
519
+ raise ::Google::Cloud::Error.from_error(e)
520
+ end
521
+
522
+ ##
523
+ # Deletes a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}.
524
+ #
525
+ # @overload delete_data_store(request, options = nil)
526
+ # Pass arguments to `delete_data_store` via a request object, either of type
527
+ # {::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest} or an equivalent Hash.
528
+ #
529
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest, ::Hash]
530
+ # A request object representing the call parameters. Required. To specify no
531
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
532
+ # @param options [::Gapic::CallOptions, ::Hash]
533
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
534
+ #
535
+ # @overload delete_data_store(name: nil)
536
+ # Pass arguments to `delete_data_store` via keyword arguments. Note that at
537
+ # least one keyword argument is required. To specify no parameters, or to keep all
538
+ # the default parameter values, pass an empty Hash as a request object (see above).
539
+ #
540
+ # @param name [::String]
541
+ # Required. Full resource name of
542
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, such as
543
+ # `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
544
+ #
545
+ # If the caller does not have permission to delete the
546
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of
547
+ # whether or not it exists, a PERMISSION_DENIED error is returned.
548
+ #
549
+ # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to delete
550
+ # does not exist, a NOT_FOUND error is returned.
551
+ #
552
+ # @yield [response, operation] Access the result along with the RPC operation
553
+ # @yieldparam response [::Gapic::Operation]
554
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
555
+ #
556
+ # @return [::Gapic::Operation]
557
+ #
558
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
559
+ #
560
+ # @example Basic example
561
+ # require "google/cloud/discovery_engine/v1"
562
+ #
563
+ # # Create a client object. The client can be reused for multiple calls.
564
+ # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new
565
+ #
566
+ # # Create a request. To set request fields, pass in keyword arguments.
567
+ # request = Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest.new
568
+ #
569
+ # # Call the delete_data_store method.
570
+ # result = client.delete_data_store request
571
+ #
572
+ # # The returned object is of type Gapic::Operation. You can use it to
573
+ # # check the status of an operation, cancel it, or wait for results.
574
+ # # Here is how to wait for a response.
575
+ # result.wait_until_done! timeout: 60
576
+ # if result.response?
577
+ # p result.response
578
+ # else
579
+ # puts "No response received."
580
+ # end
581
+ #
582
+ def delete_data_store request, options = nil
583
+ raise ::ArgumentError, "request must be provided" if request.nil?
584
+
585
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteDataStoreRequest
586
+
587
+ # Converts hash and nil to an options object
588
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
589
+
590
+ # Customize the options with defaults
591
+ metadata = @config.rpcs.delete_data_store.metadata.to_h
592
+
593
+ # Set x-goog-api-client and x-goog-user-project headers
594
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
595
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
596
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
597
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
598
+
599
+ header_params = {}
600
+ if request.name
601
+ header_params["name"] = request.name
602
+ end
603
+
604
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
605
+ metadata[:"x-goog-request-params"] ||= request_params_header
606
+
607
+ options.apply_defaults timeout: @config.rpcs.delete_data_store.timeout,
608
+ metadata: metadata,
609
+ retry_policy: @config.rpcs.delete_data_store.retry_policy
610
+
611
+ options.apply_defaults timeout: @config.timeout,
612
+ metadata: @config.metadata,
613
+ retry_policy: @config.retry_policy
614
+
615
+ @data_store_service_stub.call_rpc :delete_data_store, request, options: options do |response, operation|
616
+ response = ::Gapic::Operation.new response, @operations_client, options: options
617
+ yield response, operation if block_given?
618
+ return response
619
+ end
620
+ rescue ::GRPC::BadStatus => e
621
+ raise ::Google::Cloud::Error.from_error(e)
622
+ end
623
+
624
+ ##
625
+ # Updates a {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}
626
+ #
627
+ # @overload update_data_store(request, options = nil)
628
+ # Pass arguments to `update_data_store` via a request object, either of type
629
+ # {::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest} or an equivalent Hash.
630
+ #
631
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest, ::Hash]
632
+ # A request object representing the call parameters. Required. To specify no
633
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
634
+ # @param options [::Gapic::CallOptions, ::Hash]
635
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
636
+ #
637
+ # @overload update_data_store(data_store: nil, update_mask: nil)
638
+ # Pass arguments to `update_data_store` via keyword arguments. Note that at
639
+ # least one keyword argument is required. To specify no parameters, or to keep all
640
+ # the default parameter values, pass an empty Hash as a request object (see above).
641
+ #
642
+ # @param data_store [::Google::Cloud::DiscoveryEngine::V1::DataStore, ::Hash]
643
+ # Required. The {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to
644
+ # update.
645
+ #
646
+ # If the caller does not have permission to update the
647
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}, regardless of
648
+ # whether or not it exists, a PERMISSION_DENIED error is returned.
649
+ #
650
+ # If the {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update
651
+ # does not exist, a NOT_FOUND error is returned.
652
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
653
+ # Indicates which fields in the provided
654
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore} to update.
655
+ #
656
+ # If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
657
+ # is returned.
658
+ #
659
+ # @yield [response, operation] Access the result along with the RPC operation
660
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::DataStore]
661
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
662
+ #
663
+ # @return [::Google::Cloud::DiscoveryEngine::V1::DataStore]
664
+ #
665
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
666
+ #
667
+ # @example Basic example
668
+ # require "google/cloud/discovery_engine/v1"
669
+ #
670
+ # # Create a client object. The client can be reused for multiple calls.
671
+ # client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new
672
+ #
673
+ # # Create a request. To set request fields, pass in keyword arguments.
674
+ # request = Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest.new
675
+ #
676
+ # # Call the update_data_store method.
677
+ # result = client.update_data_store request
678
+ #
679
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::DataStore.
680
+ # p result
681
+ #
682
+ def update_data_store request, options = nil
683
+ raise ::ArgumentError, "request must be provided" if request.nil?
684
+
685
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateDataStoreRequest
686
+
687
+ # Converts hash and nil to an options object
688
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
689
+
690
+ # Customize the options with defaults
691
+ metadata = @config.rpcs.update_data_store.metadata.to_h
692
+
693
+ # Set x-goog-api-client and x-goog-user-project headers
694
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
695
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
696
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
697
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
698
+
699
+ header_params = {}
700
+ if request.data_store&.name
701
+ header_params["data_store.name"] = request.data_store.name
702
+ end
703
+
704
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
705
+ metadata[:"x-goog-request-params"] ||= request_params_header
706
+
707
+ options.apply_defaults timeout: @config.rpcs.update_data_store.timeout,
708
+ metadata: metadata,
709
+ retry_policy: @config.rpcs.update_data_store.retry_policy
710
+
711
+ options.apply_defaults timeout: @config.timeout,
712
+ metadata: @config.metadata,
713
+ retry_policy: @config.retry_policy
714
+
715
+ @data_store_service_stub.call_rpc :update_data_store, request, options: options do |response, operation|
716
+ yield response, operation if block_given?
717
+ return response
718
+ end
719
+ rescue ::GRPC::BadStatus => e
720
+ raise ::Google::Cloud::Error.from_error(e)
721
+ end
722
+
723
+ ##
724
+ # Configuration class for the DataStoreService API.
725
+ #
726
+ # This class represents the configuration for DataStoreService,
727
+ # providing control over timeouts, retry behavior, logging, transport
728
+ # parameters, and other low-level controls. Certain parameters can also be
729
+ # applied individually to specific RPCs. See
730
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client::Configuration::Rpcs}
731
+ # for a list of RPCs that can be configured independently.
732
+ #
733
+ # Configuration can be applied globally to all clients, or to a single client
734
+ # on construction.
735
+ #
736
+ # @example
737
+ #
738
+ # # Modify the global config, setting the timeout for
739
+ # # create_data_store to 20 seconds,
740
+ # # and all remaining timeouts to 10 seconds.
741
+ # ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.configure do |config|
742
+ # config.timeout = 10.0
743
+ # config.rpcs.create_data_store.timeout = 20.0
744
+ # end
745
+ #
746
+ # # Apply the above configuration only to a new client.
747
+ # client = ::Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new do |config|
748
+ # config.timeout = 10.0
749
+ # config.rpcs.create_data_store.timeout = 20.0
750
+ # end
751
+ #
752
+ # @!attribute [rw] endpoint
753
+ # A custom service endpoint, as a hostname or hostname:port. The default is
754
+ # nil, indicating to use the default endpoint in the current universe domain.
755
+ # @return [::String,nil]
756
+ # @!attribute [rw] credentials
757
+ # Credentials to send with calls. You may provide any of the following types:
758
+ # * (`String`) The path to a service account key file in JSON format
759
+ # * (`Hash`) A service account key as a Hash
760
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
761
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
762
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
763
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
764
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
765
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
766
+ # * (`nil`) indicating no credentials
767
+ # @return [::Object]
768
+ # @!attribute [rw] scope
769
+ # The OAuth scopes
770
+ # @return [::Array<::String>]
771
+ # @!attribute [rw] lib_name
772
+ # The library name as recorded in instrumentation and logging
773
+ # @return [::String]
774
+ # @!attribute [rw] lib_version
775
+ # The library version as recorded in instrumentation and logging
776
+ # @return [::String]
777
+ # @!attribute [rw] channel_args
778
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
779
+ # `GRPC::Core::Channel` object is provided as the credential.
780
+ # @return [::Hash]
781
+ # @!attribute [rw] interceptors
782
+ # An array of interceptors that are run before calls are executed.
783
+ # @return [::Array<::GRPC::ClientInterceptor>]
784
+ # @!attribute [rw] timeout
785
+ # The call timeout in seconds.
786
+ # @return [::Numeric]
787
+ # @!attribute [rw] metadata
788
+ # Additional gRPC headers to be sent with the call.
789
+ # @return [::Hash{::Symbol=>::String}]
790
+ # @!attribute [rw] retry_policy
791
+ # The retry policy. The value is a hash with the following keys:
792
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
793
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
794
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
795
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
796
+ # trigger a retry.
797
+ # @return [::Hash]
798
+ # @!attribute [rw] quota_project
799
+ # A separate project against which to charge quota.
800
+ # @return [::String]
801
+ # @!attribute [rw] universe_domain
802
+ # The universe domain within which to make requests. This determines the
803
+ # default endpoint URL. The default value of nil uses the environment
804
+ # universe (usually the default "googleapis.com" universe).
805
+ # @return [::String,nil]
806
+ #
807
+ class Configuration
808
+ extend ::Gapic::Config
809
+
810
+ # @private
811
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
812
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
813
+
814
+ config_attr :endpoint, nil, ::String, nil
815
+ config_attr :credentials, nil do |value|
816
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
817
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
818
+ allowed.any? { |klass| klass === value }
819
+ end
820
+ config_attr :scope, nil, ::String, ::Array, nil
821
+ config_attr :lib_name, nil, ::String, nil
822
+ config_attr :lib_version, nil, ::String, nil
823
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
824
+ config_attr :interceptors, nil, ::Array, nil
825
+ config_attr :timeout, nil, ::Numeric, nil
826
+ config_attr :metadata, nil, ::Hash, nil
827
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
828
+ config_attr :quota_project, nil, ::String, nil
829
+ config_attr :universe_domain, nil, ::String, nil
830
+
831
+ # @private
832
+ def initialize parent_config = nil
833
+ @parent_config = parent_config unless parent_config.nil?
834
+
835
+ yield self if block_given?
836
+ end
837
+
838
+ ##
839
+ # Configurations for individual RPCs
840
+ # @return [Rpcs]
841
+ #
842
+ def rpcs
843
+ @rpcs ||= begin
844
+ parent_rpcs = nil
845
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
846
+ Rpcs.new parent_rpcs
847
+ end
848
+ end
849
+
850
+ ##
851
+ # Configuration for the channel pool
852
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
853
+ #
854
+ def channel_pool
855
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
856
+ end
857
+
858
+ ##
859
+ # Configuration RPC class for the DataStoreService API.
860
+ #
861
+ # Includes fields providing the configuration for each RPC in this service.
862
+ # Each configuration object is of type `Gapic::Config::Method` and includes
863
+ # the following configuration fields:
864
+ #
865
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
866
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
867
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
868
+ # include the following keys:
869
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
870
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
871
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
872
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
873
+ # trigger a retry.
874
+ #
875
+ class Rpcs
876
+ ##
877
+ # RPC-specific configuration for `create_data_store`
878
+ # @return [::Gapic::Config::Method]
879
+ #
880
+ attr_reader :create_data_store
881
+ ##
882
+ # RPC-specific configuration for `get_data_store`
883
+ # @return [::Gapic::Config::Method]
884
+ #
885
+ attr_reader :get_data_store
886
+ ##
887
+ # RPC-specific configuration for `list_data_stores`
888
+ # @return [::Gapic::Config::Method]
889
+ #
890
+ attr_reader :list_data_stores
891
+ ##
892
+ # RPC-specific configuration for `delete_data_store`
893
+ # @return [::Gapic::Config::Method]
894
+ #
895
+ attr_reader :delete_data_store
896
+ ##
897
+ # RPC-specific configuration for `update_data_store`
898
+ # @return [::Gapic::Config::Method]
899
+ #
900
+ attr_reader :update_data_store
901
+
902
+ # @private
903
+ def initialize parent_rpcs = nil
904
+ create_data_store_config = parent_rpcs.create_data_store if parent_rpcs.respond_to? :create_data_store
905
+ @create_data_store = ::Gapic::Config::Method.new create_data_store_config
906
+ get_data_store_config = parent_rpcs.get_data_store if parent_rpcs.respond_to? :get_data_store
907
+ @get_data_store = ::Gapic::Config::Method.new get_data_store_config
908
+ list_data_stores_config = parent_rpcs.list_data_stores if parent_rpcs.respond_to? :list_data_stores
909
+ @list_data_stores = ::Gapic::Config::Method.new list_data_stores_config
910
+ delete_data_store_config = parent_rpcs.delete_data_store if parent_rpcs.respond_to? :delete_data_store
911
+ @delete_data_store = ::Gapic::Config::Method.new delete_data_store_config
912
+ update_data_store_config = parent_rpcs.update_data_store if parent_rpcs.respond_to? :update_data_store
913
+ @update_data_store = ::Gapic::Config::Method.new update_data_store_config
914
+
915
+ yield self if block_given?
916
+ end
917
+ end
918
+ end
919
+ end
920
+ end
921
+ end
922
+ end
923
+ end
924
+ end