google-cloud-ai_platform-v1 0.58.0 → 0.59.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb +3 -10
  3. data/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb +73 -10
  4. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb +3 -10
  5. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb +73 -10
  6. data/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb +103 -0
  7. data/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb +3 -10
  8. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/client.rb +96 -0
  9. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb +73 -10
  10. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/service_stub.rb +60 -0
  11. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb +3 -10
  12. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb +73 -10
  13. data/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb +3 -10
  14. data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb +73 -10
  15. data/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb +3 -10
  16. data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb +73 -10
  17. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/operations.rb +3 -10
  18. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb +73 -10
  19. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb +3 -10
  20. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb +73 -10
  21. data/lib/google/cloud/ai_platform/v1/index_service/operations.rb +3 -10
  22. data/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb +73 -10
  23. data/lib/google/cloud/ai_platform/v1/job_service/operations.rb +3 -10
  24. data/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb +73 -10
  25. data/lib/google/cloud/ai_platform/v1/llm_utility_service/paths.rb +19 -0
  26. data/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb +3 -10
  27. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb +73 -10
  28. data/lib/google/cloud/ai_platform/v1/migration_service/operations.rb +3 -10
  29. data/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb +73 -10
  30. data/lib/google/cloud/ai_platform/v1/model_service/operations.rb +3 -10
  31. data/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb +73 -10
  32. data/lib/google/cloud/ai_platform/v1/notebook_service/operations.rb +3 -10
  33. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb +73 -10
  34. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/operations.rb +3 -10
  35. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb +73 -10
  36. data/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb +3 -10
  37. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb +73 -10
  38. data/lib/google/cloud/ai_platform/v1/prediction_service/paths.rb +19 -0
  39. data/lib/google/cloud/ai_platform/v1/rest.rb +2 -0
  40. data/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb +3 -10
  41. data/lib/google/cloud/ai_platform/v1/schedule_service/paths.rb +38 -0
  42. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb +73 -10
  43. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +3 -10
  44. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb +73 -10
  45. data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +3 -10
  46. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb +73 -10
  47. data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
  48. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/client.rb +1405 -0
  49. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/credentials.rb +47 -0
  50. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/operations.rb +810 -0
  51. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb +173 -0
  52. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/client.rb +1318 -0
  53. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb +4244 -0
  54. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub.rb +663 -0
  55. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest.rb +54 -0
  56. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service.rb +56 -0
  57. data/lib/google/cloud/ai_platform/v1/vertex_rag_service/client.rb +672 -0
  58. data/lib/google/cloud/ai_platform/v1/vertex_rag_service/credentials.rb +47 -0
  59. data/lib/google/cloud/ai_platform/v1/vertex_rag_service/paths.rb +69 -0
  60. data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/client.rb +634 -0
  61. data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/service_stub.rb +249 -0
  62. data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest.rb +53 -0
  63. data/lib/google/cloud/ai_platform/v1/vertex_rag_service.rb +55 -0
  64. data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +3 -10
  65. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb +73 -10
  66. data/lib/google/cloud/ai_platform/v1.rb +2 -0
  67. data/lib/google/cloud/aiplatform/v1/api_auth_pb.rb +46 -0
  68. data/lib/google/cloud/aiplatform/v1/endpoint_pb.rb +5 -1
  69. data/lib/google/cloud/aiplatform/v1/endpoint_service_pb.rb +3 -1
  70. data/lib/google/cloud/aiplatform/v1/endpoint_service_services_pb.rb +2 -0
  71. data/lib/google/cloud/aiplatform/v1/io_pb.rb +16 -1
  72. data/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb +1 -1
  73. data/lib/google/cloud/aiplatform/v1/notebook_execution_job_pb.rb +6 -1
  74. data/lib/google/cloud/aiplatform/v1/tool_pb.rb +5 -1
  75. data/lib/google/cloud/aiplatform/v1/vertex_rag_data_pb.rb +67 -0
  76. data/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_pb.rb +71 -0
  77. data/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_services_pb.rb +63 -0
  78. data/lib/google/cloud/aiplatform/v1/vertex_rag_service_pb.rb +65 -0
  79. data/lib/google/cloud/aiplatform/v1/vertex_rag_service_services_pb.rb +52 -0
  80. data/proto_docs/google/cloud/aiplatform/v1/api_auth.rb +45 -0
  81. data/proto_docs/google/cloud/aiplatform/v1/endpoint.rb +30 -0
  82. data/proto_docs/google/cloud/aiplatform/v1/endpoint_service.rb +22 -0
  83. data/proto_docs/google/cloud/aiplatform/v1/io.rb +158 -0
  84. data/proto_docs/google/cloud/aiplatform/v1/machine_resources.rb +8 -0
  85. data/proto_docs/google/cloud/aiplatform/v1/notebook_execution_job.rb +18 -0
  86. data/proto_docs/google/cloud/aiplatform/v1/tool.rb +72 -0
  87. data/proto_docs/google/cloud/aiplatform/v1/vertex_rag_data.rb +334 -0
  88. data/proto_docs/google/cloud/aiplatform/v1/vertex_rag_data_service.rb +293 -0
  89. data/proto_docs/google/cloud/aiplatform/v1/vertex_rag_service.rb +279 -0
  90. data/proto_docs/google/longrunning/operations.rb +19 -14
  91. metadata +28 -2
@@ -0,0 +1,1405 @@
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/aiplatform/v1/vertex_rag_data_service_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
23
+
24
+ module Google
25
+ module Cloud
26
+ module AIPlatform
27
+ module V1
28
+ module VertexRagDataService
29
+ ##
30
+ # Client for the VertexRagDataService service.
31
+ #
32
+ # A service for managing user data for RAG.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :vertex_rag_data_service_stub
45
+
46
+ ##
47
+ # Configure the VertexRagDataService Client class.
48
+ #
49
+ # See {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all VertexRagDataService clients
55
+ # ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "AIPlatform", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the VertexRagDataService Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @vertex_rag_data_service_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new VertexRagDataService client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the VertexRagDataService client.
124
+ # @yieldparam config [Client::Configuration]
125
+ #
126
+ def initialize
127
+ # These require statements are intentionally placed here to initialize
128
+ # the gRPC module only when it's required.
129
+ # See https://github.com/googleapis/toolkit/issues/446
130
+ require "gapic/grpc"
131
+ require "google/cloud/aiplatform/v1/vertex_rag_data_service_services_pb"
132
+
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+ @quota_project_id = @config.quota_project
152
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
153
+
154
+ @operations_client = Operations.new do |config|
155
+ config.credentials = credentials
156
+ config.quota_project = @quota_project_id
157
+ config.endpoint = @config.endpoint
158
+ config.universe_domain = @config.universe_domain
159
+ end
160
+
161
+ @vertex_rag_data_service_stub = ::Gapic::ServiceStub.new(
162
+ ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Stub,
163
+ credentials: credentials,
164
+ endpoint: @config.endpoint,
165
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
166
+ universe_domain: @config.universe_domain,
167
+ channel_args: @config.channel_args,
168
+ interceptors: @config.interceptors,
169
+ channel_pool_config: @config.channel_pool
170
+ )
171
+
172
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
173
+ config.credentials = credentials
174
+ config.quota_project = @quota_project_id
175
+ config.endpoint = @vertex_rag_data_service_stub.endpoint
176
+ config.universe_domain = @vertex_rag_data_service_stub.universe_domain
177
+ end
178
+
179
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
180
+ config.credentials = credentials
181
+ config.quota_project = @quota_project_id
182
+ config.endpoint = @vertex_rag_data_service_stub.endpoint
183
+ config.universe_domain = @vertex_rag_data_service_stub.universe_domain
184
+ end
185
+ end
186
+
187
+ ##
188
+ # Get the associated client for long-running operations.
189
+ #
190
+ # @return [::Google::Cloud::AIPlatform::V1::VertexRagDataService::Operations]
191
+ #
192
+ attr_reader :operations_client
193
+
194
+ ##
195
+ # Get the associated client for mix-in of the Locations.
196
+ #
197
+ # @return [Google::Cloud::Location::Locations::Client]
198
+ #
199
+ attr_reader :location_client
200
+
201
+ ##
202
+ # Get the associated client for mix-in of the IAMPolicy.
203
+ #
204
+ # @return [Google::Iam::V1::IAMPolicy::Client]
205
+ #
206
+ attr_reader :iam_policy_client
207
+
208
+ # Service calls
209
+
210
+ ##
211
+ # Creates a RagCorpus.
212
+ #
213
+ # @overload create_rag_corpus(request, options = nil)
214
+ # Pass arguments to `create_rag_corpus` via a request object, either of type
215
+ # {::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest} or an equivalent Hash.
216
+ #
217
+ # @param request [::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest, ::Hash]
218
+ # A request object representing the call parameters. Required. To specify no
219
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
220
+ # @param options [::Gapic::CallOptions, ::Hash]
221
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
222
+ #
223
+ # @overload create_rag_corpus(parent: nil, rag_corpus: nil)
224
+ # Pass arguments to `create_rag_corpus` via keyword arguments. Note that at
225
+ # least one keyword argument is required. To specify no parameters, or to keep all
226
+ # the default parameter values, pass an empty Hash as a request object (see above).
227
+ #
228
+ # @param parent [::String]
229
+ # Required. The resource name of the Location to create the RagCorpus in.
230
+ # Format: `projects/{project}/locations/{location}`
231
+ # @param rag_corpus [::Google::Cloud::AIPlatform::V1::RagCorpus, ::Hash]
232
+ # Required. The RagCorpus to create.
233
+ #
234
+ # @yield [response, operation] Access the result along with the RPC operation
235
+ # @yieldparam response [::Gapic::Operation]
236
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
237
+ #
238
+ # @return [::Gapic::Operation]
239
+ #
240
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
241
+ #
242
+ # @example Basic example
243
+ # require "google/cloud/ai_platform/v1"
244
+ #
245
+ # # Create a client object. The client can be reused for multiple calls.
246
+ # client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new
247
+ #
248
+ # # Create a request. To set request fields, pass in keyword arguments.
249
+ # request = Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest.new
250
+ #
251
+ # # Call the create_rag_corpus method.
252
+ # result = client.create_rag_corpus request
253
+ #
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
257
+ # result.wait_until_done! timeout: 60
258
+ # if result.response?
259
+ # p result.response
260
+ # else
261
+ # puts "No response received."
262
+ # end
263
+ #
264
+ def create_rag_corpus request, options = nil
265
+ raise ::ArgumentError, "request must be provided" if request.nil?
266
+
267
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest
268
+
269
+ # Converts hash and nil to an options object
270
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
271
+
272
+ # Customize the options with defaults
273
+ metadata = @config.rpcs.create_rag_corpus.metadata.to_h
274
+
275
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
276
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
277
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
278
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
279
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
280
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
281
+
282
+ header_params = {}
283
+ if request.parent
284
+ header_params["parent"] = request.parent
285
+ end
286
+
287
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
288
+ metadata[:"x-goog-request-params"] ||= request_params_header
289
+
290
+ options.apply_defaults timeout: @config.rpcs.create_rag_corpus.timeout,
291
+ metadata: metadata,
292
+ retry_policy: @config.rpcs.create_rag_corpus.retry_policy
293
+
294
+ options.apply_defaults timeout: @config.timeout,
295
+ metadata: @config.metadata,
296
+ retry_policy: @config.retry_policy
297
+
298
+ @vertex_rag_data_service_stub.call_rpc :create_rag_corpus, request, options: options do |response, operation|
299
+ response = ::Gapic::Operation.new response, @operations_client, options: options
300
+ yield response, operation if block_given?
301
+ return response
302
+ end
303
+ rescue ::GRPC::BadStatus => e
304
+ raise ::Google::Cloud::Error.from_error(e)
305
+ end
306
+
307
+ ##
308
+ # Updates a RagCorpus.
309
+ #
310
+ # @overload update_rag_corpus(request, options = nil)
311
+ # Pass arguments to `update_rag_corpus` via a request object, either of type
312
+ # {::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest} or an equivalent Hash.
313
+ #
314
+ # @param request [::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest, ::Hash]
315
+ # A request object representing the call parameters. Required. To specify no
316
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
317
+ # @param options [::Gapic::CallOptions, ::Hash]
318
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
319
+ #
320
+ # @overload update_rag_corpus(rag_corpus: nil)
321
+ # Pass arguments to `update_rag_corpus` via keyword arguments. Note that at
322
+ # least one keyword argument is required. To specify no parameters, or to keep all
323
+ # the default parameter values, pass an empty Hash as a request object (see above).
324
+ #
325
+ # @param rag_corpus [::Google::Cloud::AIPlatform::V1::RagCorpus, ::Hash]
326
+ # Required. The RagCorpus which replaces the resource on the server.
327
+ #
328
+ # @yield [response, operation] Access the result along with the RPC operation
329
+ # @yieldparam response [::Gapic::Operation]
330
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
331
+ #
332
+ # @return [::Gapic::Operation]
333
+ #
334
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
335
+ #
336
+ # @example Basic example
337
+ # require "google/cloud/ai_platform/v1"
338
+ #
339
+ # # Create a client object. The client can be reused for multiple calls.
340
+ # client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new
341
+ #
342
+ # # Create a request. To set request fields, pass in keyword arguments.
343
+ # request = Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest.new
344
+ #
345
+ # # Call the update_rag_corpus method.
346
+ # result = client.update_rag_corpus request
347
+ #
348
+ # # The returned object is of type Gapic::Operation. You can use it to
349
+ # # check the status of an operation, cancel it, or wait for results.
350
+ # # Here is how to wait for a response.
351
+ # result.wait_until_done! timeout: 60
352
+ # if result.response?
353
+ # p result.response
354
+ # else
355
+ # puts "No response received."
356
+ # end
357
+ #
358
+ def update_rag_corpus request, options = nil
359
+ raise ::ArgumentError, "request must be provided" if request.nil?
360
+
361
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest
362
+
363
+ # Converts hash and nil to an options object
364
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
365
+
366
+ # Customize the options with defaults
367
+ metadata = @config.rpcs.update_rag_corpus.metadata.to_h
368
+
369
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
370
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
371
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
372
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
373
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
374
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
375
+
376
+ header_params = {}
377
+ if request.rag_corpus&.name
378
+ header_params["rag_corpus.name"] = request.rag_corpus.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.update_rag_corpus.timeout,
385
+ metadata: metadata,
386
+ retry_policy: @config.rpcs.update_rag_corpus.retry_policy
387
+
388
+ options.apply_defaults timeout: @config.timeout,
389
+ metadata: @config.metadata,
390
+ retry_policy: @config.retry_policy
391
+
392
+ @vertex_rag_data_service_stub.call_rpc :update_rag_corpus, 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
+ # Gets a RagCorpus.
403
+ #
404
+ # @overload get_rag_corpus(request, options = nil)
405
+ # Pass arguments to `get_rag_corpus` via a request object, either of type
406
+ # {::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest} or an equivalent Hash.
407
+ #
408
+ # @param request [::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest, ::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 get_rag_corpus(name: nil)
415
+ # Pass arguments to `get_rag_corpus` 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 name [::String]
420
+ # Required. The name of the RagCorpus resource.
421
+ # Format:
422
+ # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
423
+ #
424
+ # @yield [response, operation] Access the result along with the RPC operation
425
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::RagCorpus]
426
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
427
+ #
428
+ # @return [::Google::Cloud::AIPlatform::V1::RagCorpus]
429
+ #
430
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
431
+ #
432
+ # @example Basic example
433
+ # require "google/cloud/ai_platform/v1"
434
+ #
435
+ # # Create a client object. The client can be reused for multiple calls.
436
+ # client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new
437
+ #
438
+ # # Create a request. To set request fields, pass in keyword arguments.
439
+ # request = Google::Cloud::AIPlatform::V1::GetRagCorpusRequest.new
440
+ #
441
+ # # Call the get_rag_corpus method.
442
+ # result = client.get_rag_corpus request
443
+ #
444
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::RagCorpus.
445
+ # p result
446
+ #
447
+ def get_rag_corpus request, options = nil
448
+ raise ::ArgumentError, "request must be provided" if request.nil?
449
+
450
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest
451
+
452
+ # Converts hash and nil to an options object
453
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
454
+
455
+ # Customize the options with defaults
456
+ metadata = @config.rpcs.get_rag_corpus.metadata.to_h
457
+
458
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
459
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
460
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
461
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
462
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
463
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
464
+
465
+ header_params = {}
466
+ if request.name
467
+ header_params["name"] = request.name
468
+ end
469
+
470
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
471
+ metadata[:"x-goog-request-params"] ||= request_params_header
472
+
473
+ options.apply_defaults timeout: @config.rpcs.get_rag_corpus.timeout,
474
+ metadata: metadata,
475
+ retry_policy: @config.rpcs.get_rag_corpus.retry_policy
476
+
477
+ options.apply_defaults timeout: @config.timeout,
478
+ metadata: @config.metadata,
479
+ retry_policy: @config.retry_policy
480
+
481
+ @vertex_rag_data_service_stub.call_rpc :get_rag_corpus, request, options: options do |response, operation|
482
+ yield response, operation if block_given?
483
+ return response
484
+ end
485
+ rescue ::GRPC::BadStatus => e
486
+ raise ::Google::Cloud::Error.from_error(e)
487
+ end
488
+
489
+ ##
490
+ # Lists RagCorpora in a Location.
491
+ #
492
+ # @overload list_rag_corpora(request, options = nil)
493
+ # Pass arguments to `list_rag_corpora` via a request object, either of type
494
+ # {::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest} or an equivalent Hash.
495
+ #
496
+ # @param request [::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest, ::Hash]
497
+ # A request object representing the call parameters. Required. To specify no
498
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
499
+ # @param options [::Gapic::CallOptions, ::Hash]
500
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
501
+ #
502
+ # @overload list_rag_corpora(parent: nil, page_size: nil, page_token: nil)
503
+ # Pass arguments to `list_rag_corpora` via keyword arguments. Note that at
504
+ # least one keyword argument is required. To specify no parameters, or to keep all
505
+ # the default parameter values, pass an empty Hash as a request object (see above).
506
+ #
507
+ # @param parent [::String]
508
+ # Required. The resource name of the Location from which to list the
509
+ # RagCorpora. Format: `projects/{project}/locations/{location}`
510
+ # @param page_size [::Integer]
511
+ # Optional. The standard list page size.
512
+ # @param page_token [::String]
513
+ # Optional. The standard list page token.
514
+ # Typically obtained via
515
+ # {::Google::Cloud::AIPlatform::V1::ListRagCorporaResponse#next_page_token ListRagCorporaResponse.next_page_token}
516
+ # of the previous
517
+ # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client#list_rag_corpora VertexRagDataService.ListRagCorpora}
518
+ # call.
519
+ #
520
+ # @yield [response, operation] Access the result along with the RPC operation
521
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagCorpus>]
522
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
523
+ #
524
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagCorpus>]
525
+ #
526
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
527
+ #
528
+ # @example Basic example
529
+ # require "google/cloud/ai_platform/v1"
530
+ #
531
+ # # Create a client object. The client can be reused for multiple calls.
532
+ # client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new
533
+ #
534
+ # # Create a request. To set request fields, pass in keyword arguments.
535
+ # request = Google::Cloud::AIPlatform::V1::ListRagCorporaRequest.new
536
+ #
537
+ # # Call the list_rag_corpora method.
538
+ # result = client.list_rag_corpora request
539
+ #
540
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
541
+ # # over elements, and API calls will be issued to fetch pages as needed.
542
+ # result.each do |item|
543
+ # # Each element is of type ::Google::Cloud::AIPlatform::V1::RagCorpus.
544
+ # p item
545
+ # end
546
+ #
547
+ def list_rag_corpora request, options = nil
548
+ raise ::ArgumentError, "request must be provided" if request.nil?
549
+
550
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest
551
+
552
+ # Converts hash and nil to an options object
553
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
554
+
555
+ # Customize the options with defaults
556
+ metadata = @config.rpcs.list_rag_corpora.metadata.to_h
557
+
558
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
559
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
560
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
561
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
562
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
563
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
564
+
565
+ header_params = {}
566
+ if request.parent
567
+ header_params["parent"] = request.parent
568
+ end
569
+
570
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
571
+ metadata[:"x-goog-request-params"] ||= request_params_header
572
+
573
+ options.apply_defaults timeout: @config.rpcs.list_rag_corpora.timeout,
574
+ metadata: metadata,
575
+ retry_policy: @config.rpcs.list_rag_corpora.retry_policy
576
+
577
+ options.apply_defaults timeout: @config.timeout,
578
+ metadata: @config.metadata,
579
+ retry_policy: @config.retry_policy
580
+
581
+ @vertex_rag_data_service_stub.call_rpc :list_rag_corpora, request, options: options do |response, operation|
582
+ response = ::Gapic::PagedEnumerable.new @vertex_rag_data_service_stub, :list_rag_corpora, request, response, operation, options
583
+ yield response, operation if block_given?
584
+ return response
585
+ end
586
+ rescue ::GRPC::BadStatus => e
587
+ raise ::Google::Cloud::Error.from_error(e)
588
+ end
589
+
590
+ ##
591
+ # Deletes a RagCorpus.
592
+ #
593
+ # @overload delete_rag_corpus(request, options = nil)
594
+ # Pass arguments to `delete_rag_corpus` via a request object, either of type
595
+ # {::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest} or an equivalent Hash.
596
+ #
597
+ # @param request [::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest, ::Hash]
598
+ # A request object representing the call parameters. Required. To specify no
599
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
600
+ # @param options [::Gapic::CallOptions, ::Hash]
601
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
602
+ #
603
+ # @overload delete_rag_corpus(name: nil, force: nil)
604
+ # Pass arguments to `delete_rag_corpus` via keyword arguments. Note that at
605
+ # least one keyword argument is required. To specify no parameters, or to keep all
606
+ # the default parameter values, pass an empty Hash as a request object (see above).
607
+ #
608
+ # @param name [::String]
609
+ # Required. The name of the RagCorpus resource to be deleted.
610
+ # Format:
611
+ # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
612
+ # @param force [::Boolean]
613
+ # Optional. If set to true, any RagFiles in this RagCorpus will also be
614
+ # deleted. Otherwise, the request will only work if the RagCorpus has no
615
+ # RagFiles.
616
+ #
617
+ # @yield [response, operation] Access the result along with the RPC operation
618
+ # @yieldparam response [::Gapic::Operation]
619
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
620
+ #
621
+ # @return [::Gapic::Operation]
622
+ #
623
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
624
+ #
625
+ # @example Basic example
626
+ # require "google/cloud/ai_platform/v1"
627
+ #
628
+ # # Create a client object. The client can be reused for multiple calls.
629
+ # client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new
630
+ #
631
+ # # Create a request. To set request fields, pass in keyword arguments.
632
+ # request = Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest.new
633
+ #
634
+ # # Call the delete_rag_corpus method.
635
+ # result = client.delete_rag_corpus request
636
+ #
637
+ # # The returned object is of type Gapic::Operation. You can use it to
638
+ # # check the status of an operation, cancel it, or wait for results.
639
+ # # Here is how to wait for a response.
640
+ # result.wait_until_done! timeout: 60
641
+ # if result.response?
642
+ # p result.response
643
+ # else
644
+ # puts "No response received."
645
+ # end
646
+ #
647
+ def delete_rag_corpus request, options = nil
648
+ raise ::ArgumentError, "request must be provided" if request.nil?
649
+
650
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest
651
+
652
+ # Converts hash and nil to an options object
653
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
654
+
655
+ # Customize the options with defaults
656
+ metadata = @config.rpcs.delete_rag_corpus.metadata.to_h
657
+
658
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
659
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
660
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
661
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
662
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
663
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
664
+
665
+ header_params = {}
666
+ if request.name
667
+ header_params["name"] = request.name
668
+ end
669
+
670
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
671
+ metadata[:"x-goog-request-params"] ||= request_params_header
672
+
673
+ options.apply_defaults timeout: @config.rpcs.delete_rag_corpus.timeout,
674
+ metadata: metadata,
675
+ retry_policy: @config.rpcs.delete_rag_corpus.retry_policy
676
+
677
+ options.apply_defaults timeout: @config.timeout,
678
+ metadata: @config.metadata,
679
+ retry_policy: @config.retry_policy
680
+
681
+ @vertex_rag_data_service_stub.call_rpc :delete_rag_corpus, request, options: options do |response, operation|
682
+ response = ::Gapic::Operation.new response, @operations_client, options: options
683
+ yield response, operation if block_given?
684
+ return response
685
+ end
686
+ rescue ::GRPC::BadStatus => e
687
+ raise ::Google::Cloud::Error.from_error(e)
688
+ end
689
+
690
+ ##
691
+ # Upload a file into a RagCorpus.
692
+ #
693
+ # @overload upload_rag_file(request, options = nil)
694
+ # Pass arguments to `upload_rag_file` via a request object, either of type
695
+ # {::Google::Cloud::AIPlatform::V1::UploadRagFileRequest} or an equivalent Hash.
696
+ #
697
+ # @param request [::Google::Cloud::AIPlatform::V1::UploadRagFileRequest, ::Hash]
698
+ # A request object representing the call parameters. Required. To specify no
699
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
700
+ # @param options [::Gapic::CallOptions, ::Hash]
701
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
702
+ #
703
+ # @overload upload_rag_file(parent: nil, rag_file: nil, upload_rag_file_config: nil)
704
+ # Pass arguments to `upload_rag_file` via keyword arguments. Note that at
705
+ # least one keyword argument is required. To specify no parameters, or to keep all
706
+ # the default parameter values, pass an empty Hash as a request object (see above).
707
+ #
708
+ # @param parent [::String]
709
+ # Required. The name of the RagCorpus resource into which to upload the file.
710
+ # Format:
711
+ # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
712
+ # @param rag_file [::Google::Cloud::AIPlatform::V1::RagFile, ::Hash]
713
+ # Required. The RagFile to upload.
714
+ # @param upload_rag_file_config [::Google::Cloud::AIPlatform::V1::UploadRagFileConfig, ::Hash]
715
+ # Required. The config for the RagFiles to be uploaded into the RagCorpus.
716
+ # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client#upload_rag_file VertexRagDataService.UploadRagFile}.
717
+ #
718
+ # @yield [response, operation] Access the result along with the RPC operation
719
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::UploadRagFileResponse]
720
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
721
+ #
722
+ # @return [::Google::Cloud::AIPlatform::V1::UploadRagFileResponse]
723
+ #
724
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
725
+ #
726
+ # @example Basic example
727
+ # require "google/cloud/ai_platform/v1"
728
+ #
729
+ # # Create a client object. The client can be reused for multiple calls.
730
+ # client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new
731
+ #
732
+ # # Create a request. To set request fields, pass in keyword arguments.
733
+ # request = Google::Cloud::AIPlatform::V1::UploadRagFileRequest.new
734
+ #
735
+ # # Call the upload_rag_file method.
736
+ # result = client.upload_rag_file request
737
+ #
738
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::UploadRagFileResponse.
739
+ # p result
740
+ #
741
+ def upload_rag_file request, options = nil
742
+ raise ::ArgumentError, "request must be provided" if request.nil?
743
+
744
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UploadRagFileRequest
745
+
746
+ # Converts hash and nil to an options object
747
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
748
+
749
+ # Customize the options with defaults
750
+ metadata = @config.rpcs.upload_rag_file.metadata.to_h
751
+
752
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
753
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
754
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
755
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
756
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
757
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
758
+
759
+ header_params = {}
760
+ if request.parent
761
+ header_params["parent"] = request.parent
762
+ end
763
+
764
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
765
+ metadata[:"x-goog-request-params"] ||= request_params_header
766
+
767
+ options.apply_defaults timeout: @config.rpcs.upload_rag_file.timeout,
768
+ metadata: metadata,
769
+ retry_policy: @config.rpcs.upload_rag_file.retry_policy
770
+
771
+ options.apply_defaults timeout: @config.timeout,
772
+ metadata: @config.metadata,
773
+ retry_policy: @config.retry_policy
774
+
775
+ @vertex_rag_data_service_stub.call_rpc :upload_rag_file, request, options: options do |response, operation|
776
+ yield response, operation if block_given?
777
+ return response
778
+ end
779
+ rescue ::GRPC::BadStatus => e
780
+ raise ::Google::Cloud::Error.from_error(e)
781
+ end
782
+
783
+ ##
784
+ # Import files from Google Cloud Storage or Google Drive into a RagCorpus.
785
+ #
786
+ # @overload import_rag_files(request, options = nil)
787
+ # Pass arguments to `import_rag_files` via a request object, either of type
788
+ # {::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest} or an equivalent Hash.
789
+ #
790
+ # @param request [::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest, ::Hash]
791
+ # A request object representing the call parameters. Required. To specify no
792
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
793
+ # @param options [::Gapic::CallOptions, ::Hash]
794
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
795
+ #
796
+ # @overload import_rag_files(parent: nil, import_rag_files_config: nil)
797
+ # Pass arguments to `import_rag_files` via keyword arguments. Note that at
798
+ # least one keyword argument is required. To specify no parameters, or to keep all
799
+ # the default parameter values, pass an empty Hash as a request object (see above).
800
+ #
801
+ # @param parent [::String]
802
+ # Required. The name of the RagCorpus resource into which to import files.
803
+ # Format:
804
+ # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
805
+ # @param import_rag_files_config [::Google::Cloud::AIPlatform::V1::ImportRagFilesConfig, ::Hash]
806
+ # Required. The config for the RagFiles to be synced and imported into the
807
+ # RagCorpus.
808
+ # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client#import_rag_files VertexRagDataService.ImportRagFiles}.
809
+ #
810
+ # @yield [response, operation] Access the result along with the RPC operation
811
+ # @yieldparam response [::Gapic::Operation]
812
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
813
+ #
814
+ # @return [::Gapic::Operation]
815
+ #
816
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
817
+ #
818
+ # @example Basic example
819
+ # require "google/cloud/ai_platform/v1"
820
+ #
821
+ # # Create a client object. The client can be reused for multiple calls.
822
+ # client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new
823
+ #
824
+ # # Create a request. To set request fields, pass in keyword arguments.
825
+ # request = Google::Cloud::AIPlatform::V1::ImportRagFilesRequest.new
826
+ #
827
+ # # Call the import_rag_files method.
828
+ # result = client.import_rag_files request
829
+ #
830
+ # # The returned object is of type Gapic::Operation. You can use it to
831
+ # # check the status of an operation, cancel it, or wait for results.
832
+ # # Here is how to wait for a response.
833
+ # result.wait_until_done! timeout: 60
834
+ # if result.response?
835
+ # p result.response
836
+ # else
837
+ # puts "No response received."
838
+ # end
839
+ #
840
+ def import_rag_files request, options = nil
841
+ raise ::ArgumentError, "request must be provided" if request.nil?
842
+
843
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest
844
+
845
+ # Converts hash and nil to an options object
846
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
847
+
848
+ # Customize the options with defaults
849
+ metadata = @config.rpcs.import_rag_files.metadata.to_h
850
+
851
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
852
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
853
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
854
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
855
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
856
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
857
+
858
+ header_params = {}
859
+ if request.parent
860
+ header_params["parent"] = request.parent
861
+ end
862
+
863
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
864
+ metadata[:"x-goog-request-params"] ||= request_params_header
865
+
866
+ options.apply_defaults timeout: @config.rpcs.import_rag_files.timeout,
867
+ metadata: metadata,
868
+ retry_policy: @config.rpcs.import_rag_files.retry_policy
869
+
870
+ options.apply_defaults timeout: @config.timeout,
871
+ metadata: @config.metadata,
872
+ retry_policy: @config.retry_policy
873
+
874
+ @vertex_rag_data_service_stub.call_rpc :import_rag_files, request, options: options do |response, operation|
875
+ response = ::Gapic::Operation.new response, @operations_client, options: options
876
+ yield response, operation if block_given?
877
+ return response
878
+ end
879
+ rescue ::GRPC::BadStatus => e
880
+ raise ::Google::Cloud::Error.from_error(e)
881
+ end
882
+
883
+ ##
884
+ # Gets a RagFile.
885
+ #
886
+ # @overload get_rag_file(request, options = nil)
887
+ # Pass arguments to `get_rag_file` via a request object, either of type
888
+ # {::Google::Cloud::AIPlatform::V1::GetRagFileRequest} or an equivalent Hash.
889
+ #
890
+ # @param request [::Google::Cloud::AIPlatform::V1::GetRagFileRequest, ::Hash]
891
+ # A request object representing the call parameters. Required. To specify no
892
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
893
+ # @param options [::Gapic::CallOptions, ::Hash]
894
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
895
+ #
896
+ # @overload get_rag_file(name: nil)
897
+ # Pass arguments to `get_rag_file` via keyword arguments. Note that at
898
+ # least one keyword argument is required. To specify no parameters, or to keep all
899
+ # the default parameter values, pass an empty Hash as a request object (see above).
900
+ #
901
+ # @param name [::String]
902
+ # Required. The name of the RagFile resource.
903
+ # Format:
904
+ # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`
905
+ #
906
+ # @yield [response, operation] Access the result along with the RPC operation
907
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::RagFile]
908
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
909
+ #
910
+ # @return [::Google::Cloud::AIPlatform::V1::RagFile]
911
+ #
912
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
913
+ #
914
+ # @example Basic example
915
+ # require "google/cloud/ai_platform/v1"
916
+ #
917
+ # # Create a client object. The client can be reused for multiple calls.
918
+ # client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new
919
+ #
920
+ # # Create a request. To set request fields, pass in keyword arguments.
921
+ # request = Google::Cloud::AIPlatform::V1::GetRagFileRequest.new
922
+ #
923
+ # # Call the get_rag_file method.
924
+ # result = client.get_rag_file request
925
+ #
926
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::RagFile.
927
+ # p result
928
+ #
929
+ def get_rag_file request, options = nil
930
+ raise ::ArgumentError, "request must be provided" if request.nil?
931
+
932
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetRagFileRequest
933
+
934
+ # Converts hash and nil to an options object
935
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
936
+
937
+ # Customize the options with defaults
938
+ metadata = @config.rpcs.get_rag_file.metadata.to_h
939
+
940
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
941
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
942
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
943
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
944
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
945
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
946
+
947
+ header_params = {}
948
+ if request.name
949
+ header_params["name"] = request.name
950
+ end
951
+
952
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
953
+ metadata[:"x-goog-request-params"] ||= request_params_header
954
+
955
+ options.apply_defaults timeout: @config.rpcs.get_rag_file.timeout,
956
+ metadata: metadata,
957
+ retry_policy: @config.rpcs.get_rag_file.retry_policy
958
+
959
+ options.apply_defaults timeout: @config.timeout,
960
+ metadata: @config.metadata,
961
+ retry_policy: @config.retry_policy
962
+
963
+ @vertex_rag_data_service_stub.call_rpc :get_rag_file, request, options: options do |response, operation|
964
+ yield response, operation if block_given?
965
+ return response
966
+ end
967
+ rescue ::GRPC::BadStatus => e
968
+ raise ::Google::Cloud::Error.from_error(e)
969
+ end
970
+
971
+ ##
972
+ # Lists RagFiles in a RagCorpus.
973
+ #
974
+ # @overload list_rag_files(request, options = nil)
975
+ # Pass arguments to `list_rag_files` via a request object, either of type
976
+ # {::Google::Cloud::AIPlatform::V1::ListRagFilesRequest} or an equivalent Hash.
977
+ #
978
+ # @param request [::Google::Cloud::AIPlatform::V1::ListRagFilesRequest, ::Hash]
979
+ # A request object representing the call parameters. Required. To specify no
980
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
981
+ # @param options [::Gapic::CallOptions, ::Hash]
982
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
983
+ #
984
+ # @overload list_rag_files(parent: nil, page_size: nil, page_token: nil)
985
+ # Pass arguments to `list_rag_files` via keyword arguments. Note that at
986
+ # least one keyword argument is required. To specify no parameters, or to keep all
987
+ # the default parameter values, pass an empty Hash as a request object (see above).
988
+ #
989
+ # @param parent [::String]
990
+ # Required. The resource name of the RagCorpus from which to list the
991
+ # RagFiles. Format:
992
+ # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
993
+ # @param page_size [::Integer]
994
+ # Optional. The standard list page size.
995
+ # @param page_token [::String]
996
+ # Optional. The standard list page token.
997
+ # Typically obtained via
998
+ # {::Google::Cloud::AIPlatform::V1::ListRagFilesResponse#next_page_token ListRagFilesResponse.next_page_token}
999
+ # of the previous
1000
+ # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client#list_rag_files VertexRagDataService.ListRagFiles}
1001
+ # call.
1002
+ #
1003
+ # @yield [response, operation] Access the result along with the RPC operation
1004
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagFile>]
1005
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1006
+ #
1007
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagFile>]
1008
+ #
1009
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1010
+ #
1011
+ # @example Basic example
1012
+ # require "google/cloud/ai_platform/v1"
1013
+ #
1014
+ # # Create a client object. The client can be reused for multiple calls.
1015
+ # client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new
1016
+ #
1017
+ # # Create a request. To set request fields, pass in keyword arguments.
1018
+ # request = Google::Cloud::AIPlatform::V1::ListRagFilesRequest.new
1019
+ #
1020
+ # # Call the list_rag_files method.
1021
+ # result = client.list_rag_files request
1022
+ #
1023
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1024
+ # # over elements, and API calls will be issued to fetch pages as needed.
1025
+ # result.each do |item|
1026
+ # # Each element is of type ::Google::Cloud::AIPlatform::V1::RagFile.
1027
+ # p item
1028
+ # end
1029
+ #
1030
+ def list_rag_files request, options = nil
1031
+ raise ::ArgumentError, "request must be provided" if request.nil?
1032
+
1033
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListRagFilesRequest
1034
+
1035
+ # Converts hash and nil to an options object
1036
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1037
+
1038
+ # Customize the options with defaults
1039
+ metadata = @config.rpcs.list_rag_files.metadata.to_h
1040
+
1041
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1042
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1043
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1044
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
1045
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1046
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1047
+
1048
+ header_params = {}
1049
+ if request.parent
1050
+ header_params["parent"] = request.parent
1051
+ end
1052
+
1053
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1054
+ metadata[:"x-goog-request-params"] ||= request_params_header
1055
+
1056
+ options.apply_defaults timeout: @config.rpcs.list_rag_files.timeout,
1057
+ metadata: metadata,
1058
+ retry_policy: @config.rpcs.list_rag_files.retry_policy
1059
+
1060
+ options.apply_defaults timeout: @config.timeout,
1061
+ metadata: @config.metadata,
1062
+ retry_policy: @config.retry_policy
1063
+
1064
+ @vertex_rag_data_service_stub.call_rpc :list_rag_files, request, options: options do |response, operation|
1065
+ response = ::Gapic::PagedEnumerable.new @vertex_rag_data_service_stub, :list_rag_files, request, response, operation, options
1066
+ yield response, operation if block_given?
1067
+ return response
1068
+ end
1069
+ rescue ::GRPC::BadStatus => e
1070
+ raise ::Google::Cloud::Error.from_error(e)
1071
+ end
1072
+
1073
+ ##
1074
+ # Deletes a RagFile.
1075
+ #
1076
+ # @overload delete_rag_file(request, options = nil)
1077
+ # Pass arguments to `delete_rag_file` via a request object, either of type
1078
+ # {::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest} or an equivalent Hash.
1079
+ #
1080
+ # @param request [::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest, ::Hash]
1081
+ # A request object representing the call parameters. Required. To specify no
1082
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1083
+ # @param options [::Gapic::CallOptions, ::Hash]
1084
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1085
+ #
1086
+ # @overload delete_rag_file(name: nil)
1087
+ # Pass arguments to `delete_rag_file` via keyword arguments. Note that at
1088
+ # least one keyword argument is required. To specify no parameters, or to keep all
1089
+ # the default parameter values, pass an empty Hash as a request object (see above).
1090
+ #
1091
+ # @param name [::String]
1092
+ # Required. The name of the RagFile resource to be deleted.
1093
+ # Format:
1094
+ # `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`
1095
+ #
1096
+ # @yield [response, operation] Access the result along with the RPC operation
1097
+ # @yieldparam response [::Gapic::Operation]
1098
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1099
+ #
1100
+ # @return [::Gapic::Operation]
1101
+ #
1102
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1103
+ #
1104
+ # @example Basic example
1105
+ # require "google/cloud/ai_platform/v1"
1106
+ #
1107
+ # # Create a client object. The client can be reused for multiple calls.
1108
+ # client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new
1109
+ #
1110
+ # # Create a request. To set request fields, pass in keyword arguments.
1111
+ # request = Google::Cloud::AIPlatform::V1::DeleteRagFileRequest.new
1112
+ #
1113
+ # # Call the delete_rag_file method.
1114
+ # result = client.delete_rag_file request
1115
+ #
1116
+ # # The returned object is of type Gapic::Operation. You can use it to
1117
+ # # check the status of an operation, cancel it, or wait for results.
1118
+ # # Here is how to wait for a response.
1119
+ # result.wait_until_done! timeout: 60
1120
+ # if result.response?
1121
+ # p result.response
1122
+ # else
1123
+ # puts "No response received."
1124
+ # end
1125
+ #
1126
+ def delete_rag_file request, options = nil
1127
+ raise ::ArgumentError, "request must be provided" if request.nil?
1128
+
1129
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest
1130
+
1131
+ # Converts hash and nil to an options object
1132
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1133
+
1134
+ # Customize the options with defaults
1135
+ metadata = @config.rpcs.delete_rag_file.metadata.to_h
1136
+
1137
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1138
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1139
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1140
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
1141
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1142
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1143
+
1144
+ header_params = {}
1145
+ if request.name
1146
+ header_params["name"] = request.name
1147
+ end
1148
+
1149
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1150
+ metadata[:"x-goog-request-params"] ||= request_params_header
1151
+
1152
+ options.apply_defaults timeout: @config.rpcs.delete_rag_file.timeout,
1153
+ metadata: metadata,
1154
+ retry_policy: @config.rpcs.delete_rag_file.retry_policy
1155
+
1156
+ options.apply_defaults timeout: @config.timeout,
1157
+ metadata: @config.metadata,
1158
+ retry_policy: @config.retry_policy
1159
+
1160
+ @vertex_rag_data_service_stub.call_rpc :delete_rag_file, request, options: options do |response, operation|
1161
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1162
+ yield response, operation if block_given?
1163
+ return response
1164
+ end
1165
+ rescue ::GRPC::BadStatus => e
1166
+ raise ::Google::Cloud::Error.from_error(e)
1167
+ end
1168
+
1169
+ ##
1170
+ # Configuration class for the VertexRagDataService API.
1171
+ #
1172
+ # This class represents the configuration for VertexRagDataService,
1173
+ # providing control over timeouts, retry behavior, logging, transport
1174
+ # parameters, and other low-level controls. Certain parameters can also be
1175
+ # applied individually to specific RPCs. See
1176
+ # {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client::Configuration::Rpcs}
1177
+ # for a list of RPCs that can be configured independently.
1178
+ #
1179
+ # Configuration can be applied globally to all clients, or to a single client
1180
+ # on construction.
1181
+ #
1182
+ # @example
1183
+ #
1184
+ # # Modify the global config, setting the timeout for
1185
+ # # create_rag_corpus to 20 seconds,
1186
+ # # and all remaining timeouts to 10 seconds.
1187
+ # ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.configure do |config|
1188
+ # config.timeout = 10.0
1189
+ # config.rpcs.create_rag_corpus.timeout = 20.0
1190
+ # end
1191
+ #
1192
+ # # Apply the above configuration only to a new client.
1193
+ # client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Client.new do |config|
1194
+ # config.timeout = 10.0
1195
+ # config.rpcs.create_rag_corpus.timeout = 20.0
1196
+ # end
1197
+ #
1198
+ # @!attribute [rw] endpoint
1199
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1200
+ # nil, indicating to use the default endpoint in the current universe domain.
1201
+ # @return [::String,nil]
1202
+ # @!attribute [rw] credentials
1203
+ # Credentials to send with calls. You may provide any of the following types:
1204
+ # * (`String`) The path to a service account key file in JSON format
1205
+ # * (`Hash`) A service account key as a Hash
1206
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1207
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1208
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1209
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1210
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1211
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1212
+ # * (`nil`) indicating no credentials
1213
+ # @return [::Object]
1214
+ # @!attribute [rw] scope
1215
+ # The OAuth scopes
1216
+ # @return [::Array<::String>]
1217
+ # @!attribute [rw] lib_name
1218
+ # The library name as recorded in instrumentation and logging
1219
+ # @return [::String]
1220
+ # @!attribute [rw] lib_version
1221
+ # The library version as recorded in instrumentation and logging
1222
+ # @return [::String]
1223
+ # @!attribute [rw] channel_args
1224
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1225
+ # `GRPC::Core::Channel` object is provided as the credential.
1226
+ # @return [::Hash]
1227
+ # @!attribute [rw] interceptors
1228
+ # An array of interceptors that are run before calls are executed.
1229
+ # @return [::Array<::GRPC::ClientInterceptor>]
1230
+ # @!attribute [rw] timeout
1231
+ # The call timeout in seconds.
1232
+ # @return [::Numeric]
1233
+ # @!attribute [rw] metadata
1234
+ # Additional gRPC headers to be sent with the call.
1235
+ # @return [::Hash{::Symbol=>::String}]
1236
+ # @!attribute [rw] retry_policy
1237
+ # The retry policy. The value is a hash with the following keys:
1238
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1239
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1240
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1241
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1242
+ # trigger a retry.
1243
+ # @return [::Hash]
1244
+ # @!attribute [rw] quota_project
1245
+ # A separate project against which to charge quota.
1246
+ # @return [::String]
1247
+ # @!attribute [rw] universe_domain
1248
+ # The universe domain within which to make requests. This determines the
1249
+ # default endpoint URL. The default value of nil uses the environment
1250
+ # universe (usually the default "googleapis.com" universe).
1251
+ # @return [::String,nil]
1252
+ #
1253
+ class Configuration
1254
+ extend ::Gapic::Config
1255
+
1256
+ # @private
1257
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1258
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
1259
+
1260
+ config_attr :endpoint, nil, ::String, nil
1261
+ config_attr :credentials, nil do |value|
1262
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1263
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1264
+ allowed.any? { |klass| klass === value }
1265
+ end
1266
+ config_attr :scope, nil, ::String, ::Array, nil
1267
+ config_attr :lib_name, nil, ::String, nil
1268
+ config_attr :lib_version, nil, ::String, nil
1269
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1270
+ config_attr :interceptors, nil, ::Array, nil
1271
+ config_attr :timeout, nil, ::Numeric, nil
1272
+ config_attr :metadata, nil, ::Hash, nil
1273
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1274
+ config_attr :quota_project, nil, ::String, nil
1275
+ config_attr :universe_domain, nil, ::String, nil
1276
+
1277
+ # @private
1278
+ def initialize parent_config = nil
1279
+ @parent_config = parent_config unless parent_config.nil?
1280
+
1281
+ yield self if block_given?
1282
+ end
1283
+
1284
+ ##
1285
+ # Configurations for individual RPCs
1286
+ # @return [Rpcs]
1287
+ #
1288
+ def rpcs
1289
+ @rpcs ||= begin
1290
+ parent_rpcs = nil
1291
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1292
+ Rpcs.new parent_rpcs
1293
+ end
1294
+ end
1295
+
1296
+ ##
1297
+ # Configuration for the channel pool
1298
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1299
+ #
1300
+ def channel_pool
1301
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1302
+ end
1303
+
1304
+ ##
1305
+ # Configuration RPC class for the VertexRagDataService API.
1306
+ #
1307
+ # Includes fields providing the configuration for each RPC in this service.
1308
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1309
+ # the following configuration fields:
1310
+ #
1311
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1312
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1313
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1314
+ # include the following keys:
1315
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1316
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1317
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1318
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1319
+ # trigger a retry.
1320
+ #
1321
+ class Rpcs
1322
+ ##
1323
+ # RPC-specific configuration for `create_rag_corpus`
1324
+ # @return [::Gapic::Config::Method]
1325
+ #
1326
+ attr_reader :create_rag_corpus
1327
+ ##
1328
+ # RPC-specific configuration for `update_rag_corpus`
1329
+ # @return [::Gapic::Config::Method]
1330
+ #
1331
+ attr_reader :update_rag_corpus
1332
+ ##
1333
+ # RPC-specific configuration for `get_rag_corpus`
1334
+ # @return [::Gapic::Config::Method]
1335
+ #
1336
+ attr_reader :get_rag_corpus
1337
+ ##
1338
+ # RPC-specific configuration for `list_rag_corpora`
1339
+ # @return [::Gapic::Config::Method]
1340
+ #
1341
+ attr_reader :list_rag_corpora
1342
+ ##
1343
+ # RPC-specific configuration for `delete_rag_corpus`
1344
+ # @return [::Gapic::Config::Method]
1345
+ #
1346
+ attr_reader :delete_rag_corpus
1347
+ ##
1348
+ # RPC-specific configuration for `upload_rag_file`
1349
+ # @return [::Gapic::Config::Method]
1350
+ #
1351
+ attr_reader :upload_rag_file
1352
+ ##
1353
+ # RPC-specific configuration for `import_rag_files`
1354
+ # @return [::Gapic::Config::Method]
1355
+ #
1356
+ attr_reader :import_rag_files
1357
+ ##
1358
+ # RPC-specific configuration for `get_rag_file`
1359
+ # @return [::Gapic::Config::Method]
1360
+ #
1361
+ attr_reader :get_rag_file
1362
+ ##
1363
+ # RPC-specific configuration for `list_rag_files`
1364
+ # @return [::Gapic::Config::Method]
1365
+ #
1366
+ attr_reader :list_rag_files
1367
+ ##
1368
+ # RPC-specific configuration for `delete_rag_file`
1369
+ # @return [::Gapic::Config::Method]
1370
+ #
1371
+ attr_reader :delete_rag_file
1372
+
1373
+ # @private
1374
+ def initialize parent_rpcs = nil
1375
+ create_rag_corpus_config = parent_rpcs.create_rag_corpus if parent_rpcs.respond_to? :create_rag_corpus
1376
+ @create_rag_corpus = ::Gapic::Config::Method.new create_rag_corpus_config
1377
+ update_rag_corpus_config = parent_rpcs.update_rag_corpus if parent_rpcs.respond_to? :update_rag_corpus
1378
+ @update_rag_corpus = ::Gapic::Config::Method.new update_rag_corpus_config
1379
+ get_rag_corpus_config = parent_rpcs.get_rag_corpus if parent_rpcs.respond_to? :get_rag_corpus
1380
+ @get_rag_corpus = ::Gapic::Config::Method.new get_rag_corpus_config
1381
+ list_rag_corpora_config = parent_rpcs.list_rag_corpora if parent_rpcs.respond_to? :list_rag_corpora
1382
+ @list_rag_corpora = ::Gapic::Config::Method.new list_rag_corpora_config
1383
+ delete_rag_corpus_config = parent_rpcs.delete_rag_corpus if parent_rpcs.respond_to? :delete_rag_corpus
1384
+ @delete_rag_corpus = ::Gapic::Config::Method.new delete_rag_corpus_config
1385
+ upload_rag_file_config = parent_rpcs.upload_rag_file if parent_rpcs.respond_to? :upload_rag_file
1386
+ @upload_rag_file = ::Gapic::Config::Method.new upload_rag_file_config
1387
+ import_rag_files_config = parent_rpcs.import_rag_files if parent_rpcs.respond_to? :import_rag_files
1388
+ @import_rag_files = ::Gapic::Config::Method.new import_rag_files_config
1389
+ get_rag_file_config = parent_rpcs.get_rag_file if parent_rpcs.respond_to? :get_rag_file
1390
+ @get_rag_file = ::Gapic::Config::Method.new get_rag_file_config
1391
+ list_rag_files_config = parent_rpcs.list_rag_files if parent_rpcs.respond_to? :list_rag_files
1392
+ @list_rag_files = ::Gapic::Config::Method.new list_rag_files_config
1393
+ delete_rag_file_config = parent_rpcs.delete_rag_file if parent_rpcs.respond_to? :delete_rag_file
1394
+ @delete_rag_file = ::Gapic::Config::Method.new delete_rag_file_config
1395
+
1396
+ yield self if block_given?
1397
+ end
1398
+ end
1399
+ end
1400
+ end
1401
+ end
1402
+ end
1403
+ end
1404
+ end
1405
+ end