google-cloud-discovery_engine-v1beta 0.7.2 → 0.9.0

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