google-cloud-discovery_engine-v1beta 0.7.2 → 0.8.0

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