google-cloud-discovery_engine-v1beta 0.a → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +429 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/completion_service/credentials.rb +47 -0
  7. data/lib/google/cloud/discovery_engine/v1beta/completion_service/paths.rb +78 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +386 -0
  9. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +114 -0
  10. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest.rb +52 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/completion_service.rb +55 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +1107 -0
  13. data/lib/google/cloud/discovery_engine/v1beta/document_service/credentials.rb +47 -0
  14. data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +768 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +135 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +908 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +905 -0
  18. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb +518 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest.rb +55 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/document_service.rb +58 -0
  21. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +486 -0
  22. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/credentials.rb +47 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/paths.rb +135 -0
  24. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +443 -0
  25. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb +116 -0
  26. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest.rb +52 -0
  27. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service.rb +55 -0
  28. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +42 -0
  29. data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +840 -0
  30. data/lib/google/cloud/discovery_engine/v1beta/schema_service/credentials.rb +47 -0
  31. data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +768 -0
  32. data/lib/google/cloud/discovery_engine/v1beta/schema_service/paths.rb +127 -0
  33. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +680 -0
  34. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +905 -0
  35. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb +382 -0
  36. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest.rb +53 -0
  37. data/lib/google/cloud/discovery_engine/v1beta/schema_service.rb +56 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +513 -0
  39. data/lib/google/cloud/discovery_engine/v1beta/search_service/credentials.rb +47 -0
  40. data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +131 -0
  41. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +465 -0
  42. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +116 -0
  43. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest.rb +52 -0
  44. data/lib/google/cloud/discovery_engine/v1beta/search_service.rb +55 -0
  45. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +638 -0
  46. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/credentials.rb +47 -0
  47. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +768 -0
  48. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/paths.rb +131 -0
  49. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +542 -0
  50. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +905 -0
  51. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +250 -0
  52. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest.rb +53 -0
  53. data/lib/google/cloud/discovery_engine/v1beta/user_event_service.rb +56 -0
  54. data/lib/google/cloud/discovery_engine/v1beta/version.rb +7 -2
  55. data/lib/google/cloud/discovery_engine/v1beta.rb +50 -0
  56. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +41 -0
  57. data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +38 -0
  58. data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +45 -0
  59. data/lib/google/cloud/discoveryengine/v1beta/document_pb.rb +43 -0
  60. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +58 -0
  61. data/lib/google/cloud/discoveryengine/v1beta/document_service_services_pb.rb +81 -0
  62. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +109 -0
  63. data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +40 -0
  64. data/lib/google/cloud/discoveryengine/v1beta/recommendation_service_pb.rb +49 -0
  65. data/lib/google/cloud/discoveryengine/v1beta/recommendation_service_services_pb.rb +45 -0
  66. data/lib/google/cloud/discoveryengine/v1beta/schema_pb.rb +30 -0
  67. data/lib/google/cloud/discoveryengine/v1beta/schema_service_pb.rb +72 -0
  68. data/lib/google/cloud/discoveryengine/v1beta/schema_service_services_pb.rb +53 -0
  69. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +151 -0
  70. data/lib/google/cloud/discoveryengine/v1beta/search_service_services_pb.rb +45 -0
  71. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +93 -0
  72. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +39 -0
  73. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +59 -0
  74. data/lib/google-cloud-discovery_engine-v1beta.rb +21 -0
  75. data/proto_docs/README.md +4 -0
  76. data/proto_docs/google/api/client.rb +381 -0
  77. data/proto_docs/google/api/field_behavior.rb +71 -0
  78. data/proto_docs/google/api/httpbody.rb +80 -0
  79. data/proto_docs/google/api/launch_stage.rb +71 -0
  80. data/proto_docs/google/api/resource.rb +222 -0
  81. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +107 -0
  82. data/proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb +98 -0
  83. data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +107 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +181 -0
  85. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +286 -0
  86. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +84 -0
  87. data/proto_docs/google/cloud/discoveryengine/v1beta/recommendation_service.rb +210 -0
  88. data/proto_docs/google/cloud/discoveryengine/v1beta/schema.rb +45 -0
  89. data/proto_docs/google/cloud/discoveryengine/v1beta/schema_service.rb +180 -0
  90. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +605 -0
  91. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +473 -0
  92. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event_service.rb +64 -0
  93. data/proto_docs/google/longrunning/operations.rb +164 -0
  94. data/proto_docs/google/protobuf/any.rb +141 -0
  95. data/proto_docs/google/protobuf/duration.rb +98 -0
  96. data/proto_docs/google/protobuf/empty.rb +34 -0
  97. data/proto_docs/google/protobuf/struct.rb +96 -0
  98. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  99. data/proto_docs/google/rpc/status.rb +48 -0
  100. data/proto_docs/google/type/date.rb +53 -0
  101. metadata +254 -12
@@ -0,0 +1,908 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/document_service_pb"
21
+ require "google/cloud/discovery_engine/v1beta/document_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DiscoveryEngine
26
+ module V1beta
27
+ module DocumentService
28
+ module Rest
29
+ ##
30
+ # REST client for the DocumentService service.
31
+ #
32
+ # Service for ingesting
33
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} information of the
34
+ # customer's website.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :document_service_stub
41
+
42
+ ##
43
+ # Configure the DocumentService Client class.
44
+ #
45
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all DocumentService clients
51
+ # ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "DiscoveryEngine", "V1beta"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.timeout = 30.0
72
+ default_config.retry_policy = {
73
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
74
+ }
75
+
76
+ default_config.rpcs.import_documents.timeout = 300.0
77
+ default_config.rpcs.import_documents.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config
82
+ end
83
+ yield @configure if block_given?
84
+ @configure
85
+ end
86
+
87
+ ##
88
+ # Configure the DocumentService Client instance.
89
+ #
90
+ # The configuration is set to the derived mode, meaning that values can be changed,
91
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
92
+ # should be made on {Client.configure}.
93
+ #
94
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client::Configuration}
95
+ # for a description of the configuration fields.
96
+ #
97
+ # @yield [config] Configure the Client client.
98
+ # @yieldparam config [Client::Configuration]
99
+ #
100
+ # @return [Client::Configuration]
101
+ #
102
+ def configure
103
+ yield @config if block_given?
104
+ @config
105
+ end
106
+
107
+ ##
108
+ # Create a new DocumentService REST client object.
109
+ #
110
+ # @example
111
+ #
112
+ # # Create a client using the default configuration
113
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.new
114
+ #
115
+ # # Create a client using a custom configuration
116
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.new do |config|
117
+ # config.timeout = 10.0
118
+ # end
119
+ #
120
+ # @yield [config] Configure the DocumentService client.
121
+ # @yieldparam config [Client::Configuration]
122
+ #
123
+ def initialize
124
+ # Create the configuration object
125
+ @config = Configuration.new Client.configure
126
+
127
+ # Yield the configuration if needed
128
+ yield @config if block_given?
129
+
130
+ # Create credentials
131
+ credentials = @config.credentials
132
+ # Use self-signed JWT if the endpoint is unchanged from default,
133
+ # but only if the default endpoint does not have a region prefix.
134
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
135
+ !@config.endpoint.split(".").first.include?("-")
136
+ credentials ||= Credentials.default scope: @config.scope,
137
+ enable_self_signed_jwt: enable_self_signed_jwt
138
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
139
+ credentials = Credentials.new credentials, scope: @config.scope
140
+ end
141
+
142
+ @quota_project_id = @config.quota_project
143
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
144
+
145
+ @operations_client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Operations.new do |config|
146
+ config.credentials = credentials
147
+ config.quota_project = @quota_project_id
148
+ config.endpoint = @config.endpoint
149
+ end
150
+
151
+ @document_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
152
+ end
153
+
154
+ ##
155
+ # Get the associated client for long-running operations.
156
+ #
157
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Operations]
158
+ #
159
+ attr_reader :operations_client
160
+
161
+ # Service calls
162
+
163
+ ##
164
+ # Gets a {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}.
165
+ #
166
+ # @overload get_document(request, options = nil)
167
+ # Pass arguments to `get_document` via a request object, either of type
168
+ # {::Google::Cloud::DiscoveryEngine::V1beta::GetDocumentRequest} or an equivalent Hash.
169
+ #
170
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::GetDocumentRequest, ::Hash]
171
+ # A request object representing the call parameters. Required. To specify no
172
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
173
+ # @param options [::Gapic::CallOptions, ::Hash]
174
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
175
+ #
176
+ # @overload get_document(name: nil)
177
+ # Pass arguments to `get_document` via keyword arguments. Note that at
178
+ # least one keyword argument is required. To specify no parameters, or to keep all
179
+ # the default parameter values, pass an empty Hash as a request object (see above).
180
+ #
181
+ # @param name [::String]
182
+ # Required. Full resource name of
183
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}, such as
184
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
185
+ #
186
+ # If the caller does not have permission to access the
187
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}, regardless of
188
+ # whether or not it exists, a `PERMISSION_DENIED` error is returned.
189
+ #
190
+ # If the requested {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}
191
+ # does not exist, a `NOT_FOUND` error is returned.
192
+ # @yield [result, operation] Access the result along with the TransportOperation object
193
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Document]
194
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
195
+ #
196
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Document]
197
+ #
198
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
199
+ def get_document request, options = nil
200
+ raise ::ArgumentError, "request must be provided" if request.nil?
201
+
202
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::GetDocumentRequest
203
+
204
+ # Converts hash and nil to an options object
205
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
206
+
207
+ # Customize the options with defaults
208
+ call_metadata = @config.rpcs.get_document.metadata.to_h
209
+
210
+ # Set x-goog-api-client and x-goog-user-project headers
211
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
212
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
213
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
214
+ transports_version_send: [:rest]
215
+
216
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
217
+
218
+ options.apply_defaults timeout: @config.rpcs.get_document.timeout,
219
+ metadata: call_metadata,
220
+ retry_policy: @config.rpcs.get_document.retry_policy
221
+
222
+ options.apply_defaults timeout: @config.timeout,
223
+ metadata: @config.metadata,
224
+ retry_policy: @config.retry_policy
225
+
226
+ @document_service_stub.get_document request, options do |result, operation|
227
+ yield result, operation if block_given?
228
+ return result
229
+ end
230
+ rescue ::Gapic::Rest::Error => e
231
+ raise ::Google::Cloud::Error.from_error(e)
232
+ end
233
+
234
+ ##
235
+ # Gets a list of {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s.
236
+ #
237
+ # @overload list_documents(request, options = nil)
238
+ # Pass arguments to `list_documents` via a request object, either of type
239
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ListDocumentsRequest} or an equivalent Hash.
240
+ #
241
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ListDocumentsRequest, ::Hash]
242
+ # A request object representing the call parameters. Required. To specify no
243
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
244
+ # @param options [::Gapic::CallOptions, ::Hash]
245
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
246
+ #
247
+ # @overload list_documents(parent: nil, page_size: nil, page_token: nil)
248
+ # Pass arguments to `list_documents` via keyword arguments. Note that at
249
+ # least one keyword argument is required. To specify no parameters, or to keep all
250
+ # the default parameter values, pass an empty Hash as a request object (see above).
251
+ #
252
+ # @param parent [::String]
253
+ # Required. The parent branch resource name, such as
254
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
255
+ # Use `default_branch` as the branch ID, to list documents under the default
256
+ # branch.
257
+ #
258
+ # If the caller does not have permission to list [Documents][]s under this
259
+ # branch, regardless of whether or not this branch exists, a
260
+ # `PERMISSION_DENIED` error is returned.
261
+ # @param page_size [::Integer]
262
+ # Maximum number of {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s
263
+ # to return. If unspecified, defaults to 100. The maximum allowed value is
264
+ # 1000. Values above 1000 will be coerced to 1000.
265
+ #
266
+ # If this field is negative, an `INVALID_ARGUMENT` error is returned.
267
+ # @param page_token [::String]
268
+ # A page token
269
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ListDocumentsResponse#next_page_token ListDocumentsResponse.next_page_token},
270
+ # received from a previous
271
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client#list_documents DocumentService.ListDocuments}
272
+ # call. Provide this to retrieve the subsequent page.
273
+ #
274
+ # When paginating, all other parameters provided to
275
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client#list_documents DocumentService.ListDocuments}
276
+ # must match the call that provided the page token. Otherwise, an
277
+ # `INVALID_ARGUMENT` error is returned.
278
+ # @yield [result, operation] Access the result along with the TransportOperation object
279
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Document>]
280
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
281
+ #
282
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Document>]
283
+ #
284
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
285
+ def list_documents request, options = nil
286
+ raise ::ArgumentError, "request must be provided" if request.nil?
287
+
288
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ListDocumentsRequest
289
+
290
+ # Converts hash and nil to an options object
291
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
292
+
293
+ # Customize the options with defaults
294
+ call_metadata = @config.rpcs.list_documents.metadata.to_h
295
+
296
+ # Set x-goog-api-client and x-goog-user-project headers
297
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
298
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
299
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
300
+ transports_version_send: [:rest]
301
+
302
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
303
+
304
+ options.apply_defaults timeout: @config.rpcs.list_documents.timeout,
305
+ metadata: call_metadata,
306
+ retry_policy: @config.rpcs.list_documents.retry_policy
307
+
308
+ options.apply_defaults timeout: @config.timeout,
309
+ metadata: @config.metadata,
310
+ retry_policy: @config.retry_policy
311
+
312
+ @document_service_stub.list_documents request, options do |result, operation|
313
+ result = ::Gapic::Rest::PagedEnumerable.new @document_service_stub, :list_documents, "documents", request, result, options
314
+ yield result, operation if block_given?
315
+ return result
316
+ end
317
+ rescue ::Gapic::Rest::Error => e
318
+ raise ::Google::Cloud::Error.from_error(e)
319
+ end
320
+
321
+ ##
322
+ # Creates a {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}.
323
+ #
324
+ # @overload create_document(request, options = nil)
325
+ # Pass arguments to `create_document` via a request object, either of type
326
+ # {::Google::Cloud::DiscoveryEngine::V1beta::CreateDocumentRequest} or an equivalent Hash.
327
+ #
328
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::CreateDocumentRequest, ::Hash]
329
+ # A request object representing the call parameters. Required. To specify no
330
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
331
+ # @param options [::Gapic::CallOptions, ::Hash]
332
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
333
+ #
334
+ # @overload create_document(parent: nil, document: nil, document_id: nil)
335
+ # Pass arguments to `create_document` via keyword arguments. Note that at
336
+ # least one keyword argument is required. To specify no parameters, or to keep all
337
+ # the default parameter values, pass an empty Hash as a request object (see above).
338
+ #
339
+ # @param parent [::String]
340
+ # Required. The parent resource name, such as
341
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
342
+ # @param document [::Google::Cloud::DiscoveryEngine::V1beta::Document, ::Hash]
343
+ # Required. The {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} to
344
+ # create.
345
+ # @param document_id [::String]
346
+ # Required. The ID to use for the
347
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}, which will become
348
+ # the final component of the
349
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document#name Document.name}.
350
+ #
351
+ # If the caller does not have permission to create the
352
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}, regardless of
353
+ # whether or not it exists, a `PERMISSION_DENIED` error is returned.
354
+ #
355
+ # This field must be unique among all
356
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s with the same
357
+ # {::Google::Cloud::DiscoveryEngine::V1beta::CreateDocumentRequest#parent parent}.
358
+ # Otherwise, an `ALREADY_EXISTS` error is returned.
359
+ #
360
+ # This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
361
+ # standard with a length limit of 63 characters. Otherwise, an
362
+ # `INVALID_ARGUMENT` error is returned.
363
+ # @yield [result, operation] Access the result along with the TransportOperation object
364
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Document]
365
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
366
+ #
367
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Document]
368
+ #
369
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
370
+ def create_document request, options = nil
371
+ raise ::ArgumentError, "request must be provided" if request.nil?
372
+
373
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::CreateDocumentRequest
374
+
375
+ # Converts hash and nil to an options object
376
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
377
+
378
+ # Customize the options with defaults
379
+ call_metadata = @config.rpcs.create_document.metadata.to_h
380
+
381
+ # Set x-goog-api-client and x-goog-user-project headers
382
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
383
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
384
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
385
+ transports_version_send: [:rest]
386
+
387
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
388
+
389
+ options.apply_defaults timeout: @config.rpcs.create_document.timeout,
390
+ metadata: call_metadata,
391
+ retry_policy: @config.rpcs.create_document.retry_policy
392
+
393
+ options.apply_defaults timeout: @config.timeout,
394
+ metadata: @config.metadata,
395
+ retry_policy: @config.retry_policy
396
+
397
+ @document_service_stub.create_document request, options do |result, operation|
398
+ yield result, operation if block_given?
399
+ return result
400
+ end
401
+ rescue ::Gapic::Rest::Error => e
402
+ raise ::Google::Cloud::Error.from_error(e)
403
+ end
404
+
405
+ ##
406
+ # Updates a {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}.
407
+ #
408
+ # @overload update_document(request, options = nil)
409
+ # Pass arguments to `update_document` via a request object, either of type
410
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UpdateDocumentRequest} or an equivalent Hash.
411
+ #
412
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::UpdateDocumentRequest, ::Hash]
413
+ # A request object representing the call parameters. Required. To specify no
414
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
415
+ # @param options [::Gapic::CallOptions, ::Hash]
416
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
417
+ #
418
+ # @overload update_document(document: nil, allow_missing: nil)
419
+ # Pass arguments to `update_document` via keyword arguments. Note that at
420
+ # least one keyword argument is required. To specify no parameters, or to keep all
421
+ # the default parameter values, pass an empty Hash as a request object (see above).
422
+ #
423
+ # @param document [::Google::Cloud::DiscoveryEngine::V1beta::Document, ::Hash]
424
+ # Required. The document to update/create.
425
+ #
426
+ # If the caller does not have permission to update the
427
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}, regardless of
428
+ # whether or not it exists, a `PERMISSION_DENIED` error is returned.
429
+ #
430
+ # If the {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} to update
431
+ # does not exist and
432
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UpdateDocumentRequest#allow_missing allow_missing}
433
+ # is not set, a `NOT_FOUND` error is returned.
434
+ # @param allow_missing [::Boolean]
435
+ # If set to true, and the
436
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} is not found, a
437
+ # new {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} will be
438
+ # created.
439
+ # @yield [result, operation] Access the result along with the TransportOperation object
440
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Document]
441
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
442
+ #
443
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Document]
444
+ #
445
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
446
+ def update_document request, options = nil
447
+ raise ::ArgumentError, "request must be provided" if request.nil?
448
+
449
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::UpdateDocumentRequest
450
+
451
+ # Converts hash and nil to an options object
452
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
453
+
454
+ # Customize the options with defaults
455
+ call_metadata = @config.rpcs.update_document.metadata.to_h
456
+
457
+ # Set x-goog-api-client and x-goog-user-project headers
458
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
459
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
460
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
461
+ transports_version_send: [:rest]
462
+
463
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
464
+
465
+ options.apply_defaults timeout: @config.rpcs.update_document.timeout,
466
+ metadata: call_metadata,
467
+ retry_policy: @config.rpcs.update_document.retry_policy
468
+
469
+ options.apply_defaults timeout: @config.timeout,
470
+ metadata: @config.metadata,
471
+ retry_policy: @config.retry_policy
472
+
473
+ @document_service_stub.update_document request, options do |result, operation|
474
+ yield result, operation if block_given?
475
+ return result
476
+ end
477
+ rescue ::Gapic::Rest::Error => e
478
+ raise ::Google::Cloud::Error.from_error(e)
479
+ end
480
+
481
+ ##
482
+ # Deletes a {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}.
483
+ #
484
+ # @overload delete_document(request, options = nil)
485
+ # Pass arguments to `delete_document` via a request object, either of type
486
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DeleteDocumentRequest} or an equivalent Hash.
487
+ #
488
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::DeleteDocumentRequest, ::Hash]
489
+ # A request object representing the call parameters. Required. To specify no
490
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
491
+ # @param options [::Gapic::CallOptions, ::Hash]
492
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
493
+ #
494
+ # @overload delete_document(name: nil)
495
+ # Pass arguments to `delete_document` via keyword arguments. Note that at
496
+ # least one keyword argument is required. To specify no parameters, or to keep all
497
+ # the default parameter values, pass an empty Hash as a request object (see above).
498
+ #
499
+ # @param name [::String]
500
+ # Required. Full resource name of
501
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}, such as
502
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
503
+ #
504
+ # If the caller does not have permission to delete the
505
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}, regardless of
506
+ # whether or not it exists, a `PERMISSION_DENIED` error is returned.
507
+ #
508
+ # If the {::Google::Cloud::DiscoveryEngine::V1beta::Document Document} to delete
509
+ # does not exist, a `NOT_FOUND` error is returned.
510
+ # @yield [result, operation] Access the result along with the TransportOperation object
511
+ # @yieldparam result [::Google::Protobuf::Empty]
512
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
513
+ #
514
+ # @return [::Google::Protobuf::Empty]
515
+ #
516
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
517
+ def delete_document request, options = nil
518
+ raise ::ArgumentError, "request must be provided" if request.nil?
519
+
520
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::DeleteDocumentRequest
521
+
522
+ # Converts hash and nil to an options object
523
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
524
+
525
+ # Customize the options with defaults
526
+ call_metadata = @config.rpcs.delete_document.metadata.to_h
527
+
528
+ # Set x-goog-api-client and x-goog-user-project headers
529
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
530
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
531
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
532
+ transports_version_send: [:rest]
533
+
534
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
535
+
536
+ options.apply_defaults timeout: @config.rpcs.delete_document.timeout,
537
+ metadata: call_metadata,
538
+ retry_policy: @config.rpcs.delete_document.retry_policy
539
+
540
+ options.apply_defaults timeout: @config.timeout,
541
+ metadata: @config.metadata,
542
+ retry_policy: @config.retry_policy
543
+
544
+ @document_service_stub.delete_document request, options do |result, operation|
545
+ yield result, operation if block_given?
546
+ return result
547
+ end
548
+ rescue ::Gapic::Rest::Error => e
549
+ raise ::Google::Cloud::Error.from_error(e)
550
+ end
551
+
552
+ ##
553
+ # Bulk import of multiple
554
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s. Request
555
+ # processing may be synchronous. Non-existing items will be created.
556
+ #
557
+ # Note: It is possible for a subset of the
558
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s to be
559
+ # successfully updated.
560
+ #
561
+ # @overload import_documents(request, options = nil)
562
+ # Pass arguments to `import_documents` via a request object, either of type
563
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ImportDocumentsRequest} or an equivalent Hash.
564
+ #
565
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ImportDocumentsRequest, ::Hash]
566
+ # A request object representing the call parameters. Required. To specify no
567
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
568
+ # @param options [::Gapic::CallOptions, ::Hash]
569
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
570
+ #
571
+ # @overload import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil)
572
+ # Pass arguments to `import_documents` via keyword arguments. Note that at
573
+ # least one keyword argument is required. To specify no parameters, or to keep all
574
+ # the default parameter values, pass an empty Hash as a request object (see above).
575
+ #
576
+ # @param inline_source [::Google::Cloud::DiscoveryEngine::V1beta::ImportDocumentsRequest::InlineSource, ::Hash]
577
+ # The Inline source for the input content for documents.
578
+ # @param gcs_source [::Google::Cloud::DiscoveryEngine::V1beta::GcsSource, ::Hash]
579
+ # Cloud Storage location for the input content.
580
+ # @param bigquery_source [::Google::Cloud::DiscoveryEngine::V1beta::BigQuerySource, ::Hash]
581
+ # BigQuery input source.
582
+ # @param parent [::String]
583
+ # Required. The parent branch resource name, such as
584
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
585
+ # Requires create/update permission.
586
+ # @param error_config [::Google::Cloud::DiscoveryEngine::V1beta::ImportErrorConfig, ::Hash]
587
+ # The desired location of errors incurred during the Import.
588
+ # @param reconciliation_mode [::Google::Cloud::DiscoveryEngine::V1beta::ImportDocumentsRequest::ReconciliationMode]
589
+ # The mode of reconciliation between existing documents and the documents to
590
+ # be imported. Defaults to
591
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ImportDocumentsRequest::ReconciliationMode::INCREMENTAL ReconciliationMode.INCREMENTAL}.
592
+ # @yield [result, operation] Access the result along with the TransportOperation object
593
+ # @yieldparam result [::Gapic::Operation]
594
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
595
+ #
596
+ # @return [::Gapic::Operation]
597
+ #
598
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
599
+ def import_documents request, options = nil
600
+ raise ::ArgumentError, "request must be provided" if request.nil?
601
+
602
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ImportDocumentsRequest
603
+
604
+ # Converts hash and nil to an options object
605
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
606
+
607
+ # Customize the options with defaults
608
+ call_metadata = @config.rpcs.import_documents.metadata.to_h
609
+
610
+ # Set x-goog-api-client and x-goog-user-project headers
611
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
612
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
613
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
614
+ transports_version_send: [:rest]
615
+
616
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
617
+
618
+ options.apply_defaults timeout: @config.rpcs.import_documents.timeout,
619
+ metadata: call_metadata,
620
+ retry_policy: @config.rpcs.import_documents.retry_policy
621
+
622
+ options.apply_defaults timeout: @config.timeout,
623
+ metadata: @config.metadata,
624
+ retry_policy: @config.retry_policy
625
+
626
+ @document_service_stub.import_documents request, options do |result, operation|
627
+ result = ::Gapic::Operation.new result, @operations_client, options: options
628
+ yield result, operation if block_given?
629
+ return result
630
+ end
631
+ rescue ::Gapic::Rest::Error => e
632
+ raise ::Google::Cloud::Error.from_error(e)
633
+ end
634
+
635
+ ##
636
+ # Permanently deletes all selected
637
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s in a branch.
638
+ #
639
+ # This process is asynchronous. Depending on the number of
640
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s to be deleted,
641
+ # this operation can take hours to complete. Before the delete operation
642
+ # completes, some {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s
643
+ # might still be returned by
644
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client#get_document DocumentService.GetDocument}
645
+ # or
646
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client#list_documents DocumentService.ListDocuments}.
647
+ #
648
+ # To get a list of the
649
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s to be deleted,
650
+ # set
651
+ # {::Google::Cloud::DiscoveryEngine::V1beta::PurgeDocumentsRequest#force PurgeDocumentsRequest.force}
652
+ # to false.
653
+ #
654
+ # @overload purge_documents(request, options = nil)
655
+ # Pass arguments to `purge_documents` via a request object, either of type
656
+ # {::Google::Cloud::DiscoveryEngine::V1beta::PurgeDocumentsRequest} or an equivalent Hash.
657
+ #
658
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::PurgeDocumentsRequest, ::Hash]
659
+ # A request object representing the call parameters. Required. To specify no
660
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
661
+ # @param options [::Gapic::CallOptions, ::Hash]
662
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
663
+ #
664
+ # @overload purge_documents(parent: nil, filter: nil, force: nil)
665
+ # Pass arguments to `purge_documents` via keyword arguments. Note that at
666
+ # least one keyword argument is required. To specify no parameters, or to keep all
667
+ # the default parameter values, pass an empty Hash as a request object (see above).
668
+ #
669
+ # @param parent [::String]
670
+ # Required. The parent resource name, such as
671
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
672
+ # @param filter [::String]
673
+ # Required. Filter matching documents to purge. Only currently supported
674
+ # value is
675
+ # `*` (all items).
676
+ # @param force [::Boolean]
677
+ # Actually performs the purge. If `force` is set to false, return the
678
+ # expected purge count without deleting any documents.
679
+ # @yield [result, operation] Access the result along with the TransportOperation object
680
+ # @yieldparam result [::Gapic::Operation]
681
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
682
+ #
683
+ # @return [::Gapic::Operation]
684
+ #
685
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
686
+ def purge_documents request, options = nil
687
+ raise ::ArgumentError, "request must be provided" if request.nil?
688
+
689
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::PurgeDocumentsRequest
690
+
691
+ # Converts hash and nil to an options object
692
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
693
+
694
+ # Customize the options with defaults
695
+ call_metadata = @config.rpcs.purge_documents.metadata.to_h
696
+
697
+ # Set x-goog-api-client and x-goog-user-project headers
698
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
699
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
700
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
701
+ transports_version_send: [:rest]
702
+
703
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
704
+
705
+ options.apply_defaults timeout: @config.rpcs.purge_documents.timeout,
706
+ metadata: call_metadata,
707
+ retry_policy: @config.rpcs.purge_documents.retry_policy
708
+
709
+ options.apply_defaults timeout: @config.timeout,
710
+ metadata: @config.metadata,
711
+ retry_policy: @config.retry_policy
712
+
713
+ @document_service_stub.purge_documents request, options do |result, operation|
714
+ result = ::Gapic::Operation.new result, @operations_client, options: options
715
+ yield result, operation if block_given?
716
+ return result
717
+ end
718
+ rescue ::Gapic::Rest::Error => e
719
+ raise ::Google::Cloud::Error.from_error(e)
720
+ end
721
+
722
+ ##
723
+ # Configuration class for the DocumentService REST API.
724
+ #
725
+ # This class represents the configuration for DocumentService REST,
726
+ # providing control over timeouts, retry behavior, logging, transport
727
+ # parameters, and other low-level controls. Certain parameters can also be
728
+ # applied individually to specific RPCs. See
729
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client::Configuration::Rpcs}
730
+ # for a list of RPCs that can be configured independently.
731
+ #
732
+ # Configuration can be applied globally to all clients, or to a single client
733
+ # on construction.
734
+ #
735
+ # @example
736
+ #
737
+ # # Modify the global config, setting the timeout for
738
+ # # get_document to 20 seconds,
739
+ # # and all remaining timeouts to 10 seconds.
740
+ # ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.configure do |config|
741
+ # config.timeout = 10.0
742
+ # config.rpcs.get_document.timeout = 20.0
743
+ # end
744
+ #
745
+ # # Apply the above configuration only to a new client.
746
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.new do |config|
747
+ # config.timeout = 10.0
748
+ # config.rpcs.get_document.timeout = 20.0
749
+ # end
750
+ #
751
+ # @!attribute [rw] endpoint
752
+ # The hostname or hostname:port of the service endpoint.
753
+ # Defaults to `"discoveryengine.googleapis.com"`.
754
+ # @return [::String]
755
+ # @!attribute [rw] credentials
756
+ # Credentials to send with calls. You may provide any of the following types:
757
+ # * (`String`) The path to a service account key file in JSON format
758
+ # * (`Hash`) A service account key as a Hash
759
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
760
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
761
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
762
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
763
+ # * (`nil`) indicating no credentials
764
+ # @return [::Object]
765
+ # @!attribute [rw] scope
766
+ # The OAuth scopes
767
+ # @return [::Array<::String>]
768
+ # @!attribute [rw] lib_name
769
+ # The library name as recorded in instrumentation and logging
770
+ # @return [::String]
771
+ # @!attribute [rw] lib_version
772
+ # The library version as recorded in instrumentation and logging
773
+ # @return [::String]
774
+ # @!attribute [rw] timeout
775
+ # The call timeout in seconds.
776
+ # @return [::Numeric]
777
+ # @!attribute [rw] metadata
778
+ # Additional headers to be sent with the call.
779
+ # @return [::Hash{::Symbol=>::String}]
780
+ # @!attribute [rw] retry_policy
781
+ # The retry policy. The value is a hash with the following keys:
782
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
783
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
784
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
785
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
786
+ # trigger a retry.
787
+ # @return [::Hash]
788
+ # @!attribute [rw] quota_project
789
+ # A separate project against which to charge quota.
790
+ # @return [::String]
791
+ #
792
+ class Configuration
793
+ extend ::Gapic::Config
794
+
795
+ config_attr :endpoint, "discoveryengine.googleapis.com", ::String
796
+ config_attr :credentials, nil do |value|
797
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
798
+ allowed.any? { |klass| klass === value }
799
+ end
800
+ config_attr :scope, nil, ::String, ::Array, nil
801
+ config_attr :lib_name, nil, ::String, nil
802
+ config_attr :lib_version, nil, ::String, nil
803
+ config_attr :timeout, nil, ::Numeric, nil
804
+ config_attr :metadata, nil, ::Hash, nil
805
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
806
+ config_attr :quota_project, nil, ::String, nil
807
+
808
+ # @private
809
+ def initialize parent_config = nil
810
+ @parent_config = parent_config unless parent_config.nil?
811
+
812
+ yield self if block_given?
813
+ end
814
+
815
+ ##
816
+ # Configurations for individual RPCs
817
+ # @return [Rpcs]
818
+ #
819
+ def rpcs
820
+ @rpcs ||= begin
821
+ parent_rpcs = nil
822
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
823
+ Rpcs.new parent_rpcs
824
+ end
825
+ end
826
+
827
+ ##
828
+ # Configuration RPC class for the DocumentService API.
829
+ #
830
+ # Includes fields providing the configuration for each RPC in this service.
831
+ # Each configuration object is of type `Gapic::Config::Method` and includes
832
+ # the following configuration fields:
833
+ #
834
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
835
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
836
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
837
+ # include the following keys:
838
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
839
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
840
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
841
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
842
+ # trigger a retry.
843
+ #
844
+ class Rpcs
845
+ ##
846
+ # RPC-specific configuration for `get_document`
847
+ # @return [::Gapic::Config::Method]
848
+ #
849
+ attr_reader :get_document
850
+ ##
851
+ # RPC-specific configuration for `list_documents`
852
+ # @return [::Gapic::Config::Method]
853
+ #
854
+ attr_reader :list_documents
855
+ ##
856
+ # RPC-specific configuration for `create_document`
857
+ # @return [::Gapic::Config::Method]
858
+ #
859
+ attr_reader :create_document
860
+ ##
861
+ # RPC-specific configuration for `update_document`
862
+ # @return [::Gapic::Config::Method]
863
+ #
864
+ attr_reader :update_document
865
+ ##
866
+ # RPC-specific configuration for `delete_document`
867
+ # @return [::Gapic::Config::Method]
868
+ #
869
+ attr_reader :delete_document
870
+ ##
871
+ # RPC-specific configuration for `import_documents`
872
+ # @return [::Gapic::Config::Method]
873
+ #
874
+ attr_reader :import_documents
875
+ ##
876
+ # RPC-specific configuration for `purge_documents`
877
+ # @return [::Gapic::Config::Method]
878
+ #
879
+ attr_reader :purge_documents
880
+
881
+ # @private
882
+ def initialize parent_rpcs = nil
883
+ get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document
884
+ @get_document = ::Gapic::Config::Method.new get_document_config
885
+ list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents
886
+ @list_documents = ::Gapic::Config::Method.new list_documents_config
887
+ create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document
888
+ @create_document = ::Gapic::Config::Method.new create_document_config
889
+ update_document_config = parent_rpcs.update_document if parent_rpcs.respond_to? :update_document
890
+ @update_document = ::Gapic::Config::Method.new update_document_config
891
+ delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document
892
+ @delete_document = ::Gapic::Config::Method.new delete_document_config
893
+ import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents
894
+ @import_documents = ::Gapic::Config::Method.new import_documents_config
895
+ purge_documents_config = parent_rpcs.purge_documents if parent_rpcs.respond_to? :purge_documents
896
+ @purge_documents = ::Gapic::Config::Method.new purge_documents_config
897
+
898
+ yield self if block_given?
899
+ end
900
+ end
901
+ end
902
+ end
903
+ end
904
+ end
905
+ end
906
+ end
907
+ end
908
+ end