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,646 @@
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/serving_config_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DiscoveryEngine
26
+ module V1beta
27
+ module ServingConfigService
28
+ ##
29
+ # Client for the ServingConfigService service.
30
+ #
31
+ # Service for modifying ServingConfig.
32
+ #
33
+ class Client
34
+ # @private
35
+ DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
36
+
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :serving_config_service_stub
41
+
42
+ ##
43
+ # Configure the ServingConfigService Client class.
44
+ #
45
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::ServingConfigService::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all ServingConfigService clients
51
+ # ::Google::Cloud::DiscoveryEngine::V1beta::ServingConfigService::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "DiscoveryEngine", "V1beta"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config
72
+ end
73
+ yield @configure if block_given?
74
+ @configure
75
+ end
76
+
77
+ ##
78
+ # Configure the ServingConfigService Client instance.
79
+ #
80
+ # The configuration is set to the derived mode, meaning that values can be changed,
81
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
82
+ # should be made on {Client.configure}.
83
+ #
84
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::ServingConfigService::Client::Configuration}
85
+ # for a description of the configuration fields.
86
+ #
87
+ # @yield [config] Configure the Client client.
88
+ # @yieldparam config [Client::Configuration]
89
+ #
90
+ # @return [Client::Configuration]
91
+ #
92
+ def configure
93
+ yield @config if block_given?
94
+ @config
95
+ end
96
+
97
+ ##
98
+ # The effective universe domain
99
+ #
100
+ # @return [String]
101
+ #
102
+ def universe_domain
103
+ @serving_config_service_stub.universe_domain
104
+ end
105
+
106
+ ##
107
+ # Create a new ServingConfigService client object.
108
+ #
109
+ # @example
110
+ #
111
+ # # Create a client using the default configuration
112
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::ServingConfigService::Client.new
113
+ #
114
+ # # Create a client using a custom configuration
115
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::ServingConfigService::Client.new do |config|
116
+ # config.timeout = 10.0
117
+ # end
118
+ #
119
+ # @yield [config] Configure the ServingConfigService client.
120
+ # @yieldparam config [Client::Configuration]
121
+ #
122
+ def initialize
123
+ # These require statements are intentionally placed here to initialize
124
+ # the gRPC module only when it's required.
125
+ # See https://github.com/googleapis/toolkit/issues/446
126
+ require "gapic/grpc"
127
+ require "google/cloud/discoveryengine/v1beta/serving_config_service_services_pb"
128
+
129
+ # Create the configuration object
130
+ @config = Configuration.new Client.configure
131
+
132
+ # Yield the configuration if needed
133
+ yield @config if block_given?
134
+
135
+ # Create credentials
136
+ credentials = @config.credentials
137
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
+ # but only if the default endpoint does not have a region prefix.
139
+ enable_self_signed_jwt = @config.endpoint.nil? ||
140
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
+ !@config.endpoint.split(".").first.include?("-"))
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
144
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
+ credentials = Credentials.new credentials, scope: @config.scope
146
+ end
147
+ @quota_project_id = @config.quota_project
148
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
+
150
+ @serving_config_service_stub = ::Gapic::ServiceStub.new(
151
+ ::Google::Cloud::DiscoveryEngine::V1beta::ServingConfigService::Stub,
152
+ credentials: credentials,
153
+ endpoint: @config.endpoint,
154
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
155
+ universe_domain: @config.universe_domain,
156
+ channel_args: @config.channel_args,
157
+ interceptors: @config.interceptors,
158
+ channel_pool_config: @config.channel_pool
159
+ )
160
+
161
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
162
+ config.credentials = credentials
163
+ config.quota_project = @quota_project_id
164
+ config.endpoint = @serving_config_service_stub.endpoint
165
+ config.universe_domain = @serving_config_service_stub.universe_domain
166
+ end
167
+ end
168
+
169
+ ##
170
+ # Get the associated client for mix-in of the Locations.
171
+ #
172
+ # @return [Google::Cloud::Location::Locations::Client]
173
+ #
174
+ attr_reader :location_client
175
+
176
+ # Service calls
177
+
178
+ ##
179
+ # Updates a ServingConfig.
180
+ #
181
+ # Returns a NOT_FOUND error if the ServingConfig does not exist.
182
+ #
183
+ # @overload update_serving_config(request, options = nil)
184
+ # Pass arguments to `update_serving_config` via a request object, either of type
185
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UpdateServingConfigRequest} or an equivalent Hash.
186
+ #
187
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::UpdateServingConfigRequest, ::Hash]
188
+ # A request object representing the call parameters. Required. To specify no
189
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
190
+ # @param options [::Gapic::CallOptions, ::Hash]
191
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
192
+ #
193
+ # @overload update_serving_config(serving_config: nil, update_mask: nil)
194
+ # Pass arguments to `update_serving_config` via keyword arguments. Note that at
195
+ # least one keyword argument is required. To specify no parameters, or to keep all
196
+ # the default parameter values, pass an empty Hash as a request object (see above).
197
+ #
198
+ # @param serving_config [::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig, ::Hash]
199
+ # Required. The ServingConfig to update.
200
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
201
+ # Indicates which fields in the provided
202
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig ServingConfig} to
203
+ # update. The following are NOT supported:
204
+ #
205
+ # * {::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig#name ServingConfig.name}
206
+ #
207
+ # If not set, all supported fields are updated.
208
+ #
209
+ # @yield [response, operation] Access the result along with the RPC operation
210
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig]
211
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
212
+ #
213
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig]
214
+ #
215
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
216
+ #
217
+ # @example Basic example
218
+ # require "google/cloud/discovery_engine/v1beta"
219
+ #
220
+ # # Create a client object. The client can be reused for multiple calls.
221
+ # client = Google::Cloud::DiscoveryEngine::V1beta::ServingConfigService::Client.new
222
+ #
223
+ # # Create a request. To set request fields, pass in keyword arguments.
224
+ # request = Google::Cloud::DiscoveryEngine::V1beta::UpdateServingConfigRequest.new
225
+ #
226
+ # # Call the update_serving_config method.
227
+ # result = client.update_serving_config request
228
+ #
229
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::ServingConfig.
230
+ # p result
231
+ #
232
+ def update_serving_config request, options = nil
233
+ raise ::ArgumentError, "request must be provided" if request.nil?
234
+
235
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::UpdateServingConfigRequest
236
+
237
+ # Converts hash and nil to an options object
238
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
239
+
240
+ # Customize the options with defaults
241
+ metadata = @config.rpcs.update_serving_config.metadata.to_h
242
+
243
+ # Set x-goog-api-client and x-goog-user-project headers
244
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
245
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
246
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
247
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
248
+
249
+ header_params = {}
250
+ if request.serving_config&.name
251
+ header_params["serving_config.name"] = request.serving_config.name
252
+ end
253
+
254
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
255
+ metadata[:"x-goog-request-params"] ||= request_params_header
256
+
257
+ options.apply_defaults timeout: @config.rpcs.update_serving_config.timeout,
258
+ metadata: metadata,
259
+ retry_policy: @config.rpcs.update_serving_config.retry_policy
260
+
261
+ options.apply_defaults timeout: @config.timeout,
262
+ metadata: @config.metadata,
263
+ retry_policy: @config.retry_policy
264
+
265
+ @serving_config_service_stub.call_rpc :update_serving_config, request, options: options do |response, operation|
266
+ yield response, operation if block_given?
267
+ return response
268
+ end
269
+ rescue ::GRPC::BadStatus => e
270
+ raise ::Google::Cloud::Error.from_error(e)
271
+ end
272
+
273
+ ##
274
+ # Gets a ServingConfig.
275
+ #
276
+ # Returns a NotFound error if the ServingConfig does not exist.
277
+ #
278
+ # @overload get_serving_config(request, options = nil)
279
+ # Pass arguments to `get_serving_config` via a request object, either of type
280
+ # {::Google::Cloud::DiscoveryEngine::V1beta::GetServingConfigRequest} or an equivalent Hash.
281
+ #
282
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::GetServingConfigRequest, ::Hash]
283
+ # A request object representing the call parameters. Required. To specify no
284
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
285
+ # @param options [::Gapic::CallOptions, ::Hash]
286
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
287
+ #
288
+ # @overload get_serving_config(name: nil)
289
+ # Pass arguments to `get_serving_config` via keyword arguments. Note that at
290
+ # least one keyword argument is required. To specify no parameters, or to keep all
291
+ # the default parameter values, pass an empty Hash as a request object (see above).
292
+ #
293
+ # @param name [::String]
294
+ # Required. The resource name of the ServingConfig to get. Format:
295
+ # `projects/{project_number}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config_id}`
296
+ #
297
+ # @yield [response, operation] Access the result along with the RPC operation
298
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig]
299
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
300
+ #
301
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig]
302
+ #
303
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
304
+ #
305
+ # @example Basic example
306
+ # require "google/cloud/discovery_engine/v1beta"
307
+ #
308
+ # # Create a client object. The client can be reused for multiple calls.
309
+ # client = Google::Cloud::DiscoveryEngine::V1beta::ServingConfigService::Client.new
310
+ #
311
+ # # Create a request. To set request fields, pass in keyword arguments.
312
+ # request = Google::Cloud::DiscoveryEngine::V1beta::GetServingConfigRequest.new
313
+ #
314
+ # # Call the get_serving_config method.
315
+ # result = client.get_serving_config request
316
+ #
317
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::ServingConfig.
318
+ # p result
319
+ #
320
+ def get_serving_config request, options = nil
321
+ raise ::ArgumentError, "request must be provided" if request.nil?
322
+
323
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::GetServingConfigRequest
324
+
325
+ # Converts hash and nil to an options object
326
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
327
+
328
+ # Customize the options with defaults
329
+ metadata = @config.rpcs.get_serving_config.metadata.to_h
330
+
331
+ # Set x-goog-api-client and x-goog-user-project headers
332
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
333
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
334
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
335
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
336
+
337
+ header_params = {}
338
+ if request.name
339
+ header_params["name"] = request.name
340
+ end
341
+
342
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
343
+ metadata[:"x-goog-request-params"] ||= request_params_header
344
+
345
+ options.apply_defaults timeout: @config.rpcs.get_serving_config.timeout,
346
+ metadata: metadata,
347
+ retry_policy: @config.rpcs.get_serving_config.retry_policy
348
+
349
+ options.apply_defaults timeout: @config.timeout,
350
+ metadata: @config.metadata,
351
+ retry_policy: @config.retry_policy
352
+
353
+ @serving_config_service_stub.call_rpc :get_serving_config, request, options: options do |response, operation|
354
+ yield response, operation if block_given?
355
+ return response
356
+ end
357
+ rescue ::GRPC::BadStatus => e
358
+ raise ::Google::Cloud::Error.from_error(e)
359
+ end
360
+
361
+ ##
362
+ # Lists all ServingConfigs linked to this dataStore.
363
+ #
364
+ # @overload list_serving_configs(request, options = nil)
365
+ # Pass arguments to `list_serving_configs` via a request object, either of type
366
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ListServingConfigsRequest} or an equivalent Hash.
367
+ #
368
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ListServingConfigsRequest, ::Hash]
369
+ # A request object representing the call parameters. Required. To specify no
370
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
371
+ # @param options [::Gapic::CallOptions, ::Hash]
372
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
373
+ #
374
+ # @overload list_serving_configs(parent: nil, page_size: nil, page_token: nil)
375
+ # Pass arguments to `list_serving_configs` via keyword arguments. Note that at
376
+ # least one keyword argument is required. To specify no parameters, or to keep all
377
+ # the default parameter values, pass an empty Hash as a request object (see above).
378
+ #
379
+ # @param parent [::String]
380
+ # Required. The dataStore resource name. Format:
381
+ # `projects/{project_number}/locations/{location}/collections/{collection}/dataStores/{data_store}`
382
+ # @param page_size [::Integer]
383
+ # Optional. Maximum number of results to return. If unspecified, defaults
384
+ # to 100. If a value greater than 100 is provided, at most 100 results are
385
+ # returned.
386
+ # @param page_token [::String]
387
+ # Optional. A page token, received from a previous `ListServingConfigs` call.
388
+ # Provide this to retrieve the subsequent page.
389
+ #
390
+ # @yield [response, operation] Access the result along with the RPC operation
391
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig>]
392
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
393
+ #
394
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig>]
395
+ #
396
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
397
+ #
398
+ # @example Basic example
399
+ # require "google/cloud/discovery_engine/v1beta"
400
+ #
401
+ # # Create a client object. The client can be reused for multiple calls.
402
+ # client = Google::Cloud::DiscoveryEngine::V1beta::ServingConfigService::Client.new
403
+ #
404
+ # # Create a request. To set request fields, pass in keyword arguments.
405
+ # request = Google::Cloud::DiscoveryEngine::V1beta::ListServingConfigsRequest.new
406
+ #
407
+ # # Call the list_serving_configs method.
408
+ # result = client.list_serving_configs request
409
+ #
410
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
411
+ # # over elements, and API calls will be issued to fetch pages as needed.
412
+ # result.each do |item|
413
+ # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig.
414
+ # p item
415
+ # end
416
+ #
417
+ def list_serving_configs request, options = nil
418
+ raise ::ArgumentError, "request must be provided" if request.nil?
419
+
420
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ListServingConfigsRequest
421
+
422
+ # Converts hash and nil to an options object
423
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
424
+
425
+ # Customize the options with defaults
426
+ metadata = @config.rpcs.list_serving_configs.metadata.to_h
427
+
428
+ # Set x-goog-api-client and x-goog-user-project headers
429
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
430
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
431
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
432
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
433
+
434
+ header_params = {}
435
+ if request.parent
436
+ header_params["parent"] = request.parent
437
+ end
438
+
439
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
440
+ metadata[:"x-goog-request-params"] ||= request_params_header
441
+
442
+ options.apply_defaults timeout: @config.rpcs.list_serving_configs.timeout,
443
+ metadata: metadata,
444
+ retry_policy: @config.rpcs.list_serving_configs.retry_policy
445
+
446
+ options.apply_defaults timeout: @config.timeout,
447
+ metadata: @config.metadata,
448
+ retry_policy: @config.retry_policy
449
+
450
+ @serving_config_service_stub.call_rpc :list_serving_configs, request, options: options do |response, operation|
451
+ response = ::Gapic::PagedEnumerable.new @serving_config_service_stub, :list_serving_configs, request, response, operation, options
452
+ yield response, operation if block_given?
453
+ return response
454
+ end
455
+ rescue ::GRPC::BadStatus => e
456
+ raise ::Google::Cloud::Error.from_error(e)
457
+ end
458
+
459
+ ##
460
+ # Configuration class for the ServingConfigService API.
461
+ #
462
+ # This class represents the configuration for ServingConfigService,
463
+ # providing control over timeouts, retry behavior, logging, transport
464
+ # parameters, and other low-level controls. Certain parameters can also be
465
+ # applied individually to specific RPCs. See
466
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ServingConfigService::Client::Configuration::Rpcs}
467
+ # for a list of RPCs that can be configured independently.
468
+ #
469
+ # Configuration can be applied globally to all clients, or to a single client
470
+ # on construction.
471
+ #
472
+ # @example
473
+ #
474
+ # # Modify the global config, setting the timeout for
475
+ # # update_serving_config to 20 seconds,
476
+ # # and all remaining timeouts to 10 seconds.
477
+ # ::Google::Cloud::DiscoveryEngine::V1beta::ServingConfigService::Client.configure do |config|
478
+ # config.timeout = 10.0
479
+ # config.rpcs.update_serving_config.timeout = 20.0
480
+ # end
481
+ #
482
+ # # Apply the above configuration only to a new client.
483
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::ServingConfigService::Client.new do |config|
484
+ # config.timeout = 10.0
485
+ # config.rpcs.update_serving_config.timeout = 20.0
486
+ # end
487
+ #
488
+ # @!attribute [rw] endpoint
489
+ # A custom service endpoint, as a hostname or hostname:port. The default is
490
+ # nil, indicating to use the default endpoint in the current universe domain.
491
+ # @return [::String,nil]
492
+ # @!attribute [rw] credentials
493
+ # Credentials to send with calls. You may provide any of the following types:
494
+ # * (`String`) The path to a service account key file in JSON format
495
+ # * (`Hash`) A service account key as a Hash
496
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
497
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
498
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
499
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
500
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
501
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
502
+ # * (`nil`) indicating no credentials
503
+ # @return [::Object]
504
+ # @!attribute [rw] scope
505
+ # The OAuth scopes
506
+ # @return [::Array<::String>]
507
+ # @!attribute [rw] lib_name
508
+ # The library name as recorded in instrumentation and logging
509
+ # @return [::String]
510
+ # @!attribute [rw] lib_version
511
+ # The library version as recorded in instrumentation and logging
512
+ # @return [::String]
513
+ # @!attribute [rw] channel_args
514
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
515
+ # `GRPC::Core::Channel` object is provided as the credential.
516
+ # @return [::Hash]
517
+ # @!attribute [rw] interceptors
518
+ # An array of interceptors that are run before calls are executed.
519
+ # @return [::Array<::GRPC::ClientInterceptor>]
520
+ # @!attribute [rw] timeout
521
+ # The call timeout in seconds.
522
+ # @return [::Numeric]
523
+ # @!attribute [rw] metadata
524
+ # Additional gRPC headers to be sent with the call.
525
+ # @return [::Hash{::Symbol=>::String}]
526
+ # @!attribute [rw] retry_policy
527
+ # The retry policy. The value is a hash with the following keys:
528
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
529
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
530
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
531
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
532
+ # trigger a retry.
533
+ # @return [::Hash]
534
+ # @!attribute [rw] quota_project
535
+ # A separate project against which to charge quota.
536
+ # @return [::String]
537
+ # @!attribute [rw] universe_domain
538
+ # The universe domain within which to make requests. This determines the
539
+ # default endpoint URL. The default value of nil uses the environment
540
+ # universe (usually the default "googleapis.com" universe).
541
+ # @return [::String,nil]
542
+ #
543
+ class Configuration
544
+ extend ::Gapic::Config
545
+
546
+ # @private
547
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
548
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
549
+
550
+ config_attr :endpoint, nil, ::String, nil
551
+ config_attr :credentials, nil do |value|
552
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
553
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
554
+ allowed.any? { |klass| klass === value }
555
+ end
556
+ config_attr :scope, nil, ::String, ::Array, nil
557
+ config_attr :lib_name, nil, ::String, nil
558
+ config_attr :lib_version, nil, ::String, nil
559
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
560
+ config_attr :interceptors, nil, ::Array, nil
561
+ config_attr :timeout, nil, ::Numeric, nil
562
+ config_attr :metadata, nil, ::Hash, nil
563
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
564
+ config_attr :quota_project, nil, ::String, nil
565
+ config_attr :universe_domain, nil, ::String, nil
566
+
567
+ # @private
568
+ def initialize parent_config = nil
569
+ @parent_config = parent_config unless parent_config.nil?
570
+
571
+ yield self if block_given?
572
+ end
573
+
574
+ ##
575
+ # Configurations for individual RPCs
576
+ # @return [Rpcs]
577
+ #
578
+ def rpcs
579
+ @rpcs ||= begin
580
+ parent_rpcs = nil
581
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
582
+ Rpcs.new parent_rpcs
583
+ end
584
+ end
585
+
586
+ ##
587
+ # Configuration for the channel pool
588
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
589
+ #
590
+ def channel_pool
591
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
592
+ end
593
+
594
+ ##
595
+ # Configuration RPC class for the ServingConfigService API.
596
+ #
597
+ # Includes fields providing the configuration for each RPC in this service.
598
+ # Each configuration object is of type `Gapic::Config::Method` and includes
599
+ # the following configuration fields:
600
+ #
601
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
602
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
603
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
604
+ # include the following keys:
605
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
606
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
607
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
608
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
609
+ # trigger a retry.
610
+ #
611
+ class Rpcs
612
+ ##
613
+ # RPC-specific configuration for `update_serving_config`
614
+ # @return [::Gapic::Config::Method]
615
+ #
616
+ attr_reader :update_serving_config
617
+ ##
618
+ # RPC-specific configuration for `get_serving_config`
619
+ # @return [::Gapic::Config::Method]
620
+ #
621
+ attr_reader :get_serving_config
622
+ ##
623
+ # RPC-specific configuration for `list_serving_configs`
624
+ # @return [::Gapic::Config::Method]
625
+ #
626
+ attr_reader :list_serving_configs
627
+
628
+ # @private
629
+ def initialize parent_rpcs = nil
630
+ update_serving_config_config = parent_rpcs.update_serving_config if parent_rpcs.respond_to? :update_serving_config
631
+ @update_serving_config = ::Gapic::Config::Method.new update_serving_config_config
632
+ get_serving_config_config = parent_rpcs.get_serving_config if parent_rpcs.respond_to? :get_serving_config
633
+ @get_serving_config = ::Gapic::Config::Method.new get_serving_config_config
634
+ list_serving_configs_config = parent_rpcs.list_serving_configs if parent_rpcs.respond_to? :list_serving_configs
635
+ @list_serving_configs = ::Gapic::Config::Method.new list_serving_configs_config
636
+
637
+ yield self if block_given?
638
+ end
639
+ end
640
+ end
641
+ end
642
+ end
643
+ end
644
+ end
645
+ end
646
+ end