google-cloud-document_ai-v1beta3 0.19.0 → 0.20.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.
@@ -0,0 +1,1996 @@
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/documentai/v1beta3/document_processor_service_pb"
21
+ require "google/cloud/document_ai/v1beta3/document_processor_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module DocumentAI
27
+ module V1beta3
28
+ module DocumentProcessorService
29
+ module Rest
30
+ ##
31
+ # REST client for the DocumentProcessorService service.
32
+ #
33
+ # Service to call Cloud DocumentAI to process documents according to the
34
+ # processor's definition. Processors are built using state-of-the-art Google
35
+ # AI such as natural language, computer vision, and translation to extract
36
+ # structured information from unstructured or semi-structured documents.
37
+ #
38
+ class Client
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :document_processor_service_stub
43
+
44
+ ##
45
+ # Configure the DocumentProcessorService Client class.
46
+ #
47
+ # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all DocumentProcessorService clients
53
+ # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Cloud", "DocumentAI", "V1beta3"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config.rpcs.process_document.timeout = 120.0
74
+ default_config.rpcs.process_document.retry_policy = {
75
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
76
+ }
77
+
78
+ default_config.rpcs.batch_process_documents.timeout = 120.0
79
+ default_config.rpcs.batch_process_documents.retry_policy = {
80
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
81
+ }
82
+
83
+ default_config.rpcs.review_document.timeout = 120.0
84
+ default_config.rpcs.review_document.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
86
+ }
87
+
88
+ default_config
89
+ end
90
+ yield @configure if block_given?
91
+ @configure
92
+ end
93
+
94
+ ##
95
+ # Configure the DocumentProcessorService Client instance.
96
+ #
97
+ # The configuration is set to the derived mode, meaning that values can be changed,
98
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
99
+ # should be made on {Client.configure}.
100
+ #
101
+ # See {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client::Configuration}
102
+ # for a description of the configuration fields.
103
+ #
104
+ # @yield [config] Configure the Client client.
105
+ # @yieldparam config [Client::Configuration]
106
+ #
107
+ # @return [Client::Configuration]
108
+ #
109
+ def configure
110
+ yield @config if block_given?
111
+ @config
112
+ end
113
+
114
+ ##
115
+ # Create a new DocumentProcessorService REST client object.
116
+ #
117
+ # @example
118
+ #
119
+ # # Create a client using the default configuration
120
+ # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config|
124
+ # config.timeout = 10.0
125
+ # end
126
+ #
127
+ # @yield [config] Configure the DocumentProcessorService client.
128
+ # @yieldparam config [Client::Configuration]
129
+ #
130
+ def initialize
131
+ # Create the configuration object
132
+ @config = Configuration.new Client.configure
133
+
134
+ # Yield the configuration if needed
135
+ yield @config if block_given?
136
+
137
+ # Create credentials
138
+ credentials = @config.credentials
139
+ # Use self-signed JWT if the endpoint is unchanged from default,
140
+ # but only if the default endpoint does not have a region prefix.
141
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
142
+ !@config.endpoint.split(".").first.include?("-")
143
+ credentials ||= Credentials.default scope: @config.scope,
144
+ enable_self_signed_jwt: enable_self_signed_jwt
145
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
146
+ credentials = Credentials.new credentials, scope: @config.scope
147
+ end
148
+
149
+ @quota_project_id = @config.quota_project
150
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
151
+
152
+ @operations_client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Operations.new do |config|
153
+ config.credentials = credentials
154
+ config.quota_project = @quota_project_id
155
+ config.endpoint = @config.endpoint
156
+ end
157
+
158
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
159
+ config.credentials = credentials
160
+ config.quota_project = @quota_project_id
161
+ config.endpoint = @config.endpoint
162
+ config.bindings_override = @config.bindings_override
163
+ end
164
+
165
+ @document_processor_service_stub = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
166
+ end
167
+
168
+ ##
169
+ # Get the associated client for long-running operations.
170
+ #
171
+ # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Operations]
172
+ #
173
+ attr_reader :operations_client
174
+
175
+ ##
176
+ # Get the associated client for mix-in of the Locations.
177
+ #
178
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
179
+ #
180
+ attr_reader :location_client
181
+
182
+ # Service calls
183
+
184
+ ##
185
+ # Processes a single document.
186
+ #
187
+ # @overload process_document(request, options = nil)
188
+ # Pass arguments to `process_document` via a request object, either of type
189
+ # {::Google::Cloud::DocumentAI::V1beta3::ProcessRequest} or an equivalent Hash.
190
+ #
191
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::ProcessRequest, ::Hash]
192
+ # A request object representing the call parameters. Required. To specify no
193
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
194
+ # @param options [::Gapic::CallOptions, ::Hash]
195
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
196
+ #
197
+ # @overload process_document(inline_document: nil, raw_document: nil, name: nil, document: nil, skip_human_review: nil, field_mask: nil, process_options: nil)
198
+ # Pass arguments to `process_document` via keyword arguments. Note that at
199
+ # least one keyword argument is required. To specify no parameters, or to keep all
200
+ # the default parameter values, pass an empty Hash as a request object (see above).
201
+ #
202
+ # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash]
203
+ # An inline document proto.
204
+ # @param raw_document [::Google::Cloud::DocumentAI::V1beta3::RawDocument, ::Hash]
205
+ # A raw document content (bytes).
206
+ # @param name [::String]
207
+ # Required. The resource name of the
208
+ # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or
209
+ # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}
210
+ # to use for processing. If a
211
+ # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} is specified, the
212
+ # server will use its [default
213
+ # version][google.cloud.documentai.v1beta3.Processor.default_processor_version].
214
+ # Format: `projects/{project}/locations/{location}/processors/{processor}`,
215
+ # or
216
+ # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
217
+ # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash]
218
+ # The document payload, the [content] and [mime_type] fields must be set.
219
+ # @param skip_human_review [::Boolean]
220
+ # Whether Human Review feature should be skipped for this request. Default to
221
+ # false.
222
+ # @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
223
+ # Specifies which fields to include in ProcessResponse's document.
224
+ # Only supports top level document and pages field so it must be in the form
225
+ # of `{document_field_name}` or `pages.{page_field_name}`.
226
+ # @param process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash]
227
+ # Inference-time options for the process API
228
+ # @yield [result, operation] Access the result along with the TransportOperation object
229
+ # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse]
230
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
231
+ #
232
+ # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse]
233
+ #
234
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
235
+ def process_document request, options = nil
236
+ raise ::ArgumentError, "request must be provided" if request.nil?
237
+
238
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessRequest
239
+
240
+ # Converts hash and nil to an options object
241
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
242
+
243
+ # Customize the options with defaults
244
+ call_metadata = @config.rpcs.process_document.metadata.to_h
245
+
246
+ # Set x-goog-api-client and x-goog-user-project headers
247
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
248
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
249
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
250
+ transports_version_send: [:rest]
251
+
252
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
253
+
254
+ options.apply_defaults timeout: @config.rpcs.process_document.timeout,
255
+ metadata: call_metadata,
256
+ retry_policy: @config.rpcs.process_document.retry_policy
257
+
258
+ options.apply_defaults timeout: @config.timeout,
259
+ metadata: @config.metadata,
260
+ retry_policy: @config.retry_policy
261
+
262
+ @document_processor_service_stub.process_document request, options do |result, operation|
263
+ yield result, operation if block_given?
264
+ return result
265
+ end
266
+ rescue ::Gapic::Rest::Error => e
267
+ raise ::Google::Cloud::Error.from_error(e)
268
+ end
269
+
270
+ ##
271
+ # LRO endpoint to batch process many documents. The output is written
272
+ # to Cloud Storage as JSON in the [Document] format.
273
+ #
274
+ # @overload batch_process_documents(request, options = nil)
275
+ # Pass arguments to `batch_process_documents` via a request object, either of type
276
+ # {::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest} or an equivalent Hash.
277
+ #
278
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest, ::Hash]
279
+ # A request object representing the call parameters. Required. To specify no
280
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
281
+ # @param options [::Gapic::CallOptions, ::Hash]
282
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
283
+ #
284
+ # @overload batch_process_documents(name: nil, input_configs: nil, output_config: nil, input_documents: nil, document_output_config: nil, skip_human_review: nil, process_options: nil)
285
+ # Pass arguments to `batch_process_documents` via keyword arguments. Note that at
286
+ # least one keyword argument is required. To specify no parameters, or to keep all
287
+ # the default parameter values, pass an empty Hash as a request object (see above).
288
+ #
289
+ # @param name [::String]
290
+ # Required. The resource name of
291
+ # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} or
292
+ # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion}.
293
+ # Format: `projects/{project}/locations/{location}/processors/{processor}`,
294
+ # or
295
+ # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
296
+ # @param input_configs [::Array<::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchInputConfig, ::Hash>]
297
+ # The input config for each single document in the batch process.
298
+ # @param output_config [::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest::BatchOutputConfig, ::Hash]
299
+ # The overall output config for batch process.
300
+ # @param input_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash]
301
+ # The input documents for batch process.
302
+ # @param document_output_config [::Google::Cloud::DocumentAI::V1beta3::DocumentOutputConfig, ::Hash]
303
+ # The overall output config for batch process.
304
+ # @param skip_human_review [::Boolean]
305
+ # Whether Human Review feature should be skipped for this request. Default to
306
+ # false.
307
+ # @param process_options [::Google::Cloud::DocumentAI::V1beta3::ProcessOptions, ::Hash]
308
+ # Inference-time options for the process API
309
+ # @yield [result, operation] Access the result along with the TransportOperation object
310
+ # @yieldparam result [::Gapic::Operation]
311
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
312
+ #
313
+ # @return [::Gapic::Operation]
314
+ #
315
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
316
+ def batch_process_documents request, options = nil
317
+ raise ::ArgumentError, "request must be provided" if request.nil?
318
+
319
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest
320
+
321
+ # Converts hash and nil to an options object
322
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
323
+
324
+ # Customize the options with defaults
325
+ call_metadata = @config.rpcs.batch_process_documents.metadata.to_h
326
+
327
+ # Set x-goog-api-client and x-goog-user-project headers
328
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
329
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
330
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
331
+ transports_version_send: [:rest]
332
+
333
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
334
+
335
+ options.apply_defaults timeout: @config.rpcs.batch_process_documents.timeout,
336
+ metadata: call_metadata,
337
+ retry_policy: @config.rpcs.batch_process_documents.retry_policy
338
+
339
+ options.apply_defaults timeout: @config.timeout,
340
+ metadata: @config.metadata,
341
+ retry_policy: @config.retry_policy
342
+
343
+ @document_processor_service_stub.batch_process_documents request, options do |result, operation|
344
+ result = ::Gapic::Operation.new result, @operations_client, options: options
345
+ yield result, operation if block_given?
346
+ return result
347
+ end
348
+ rescue ::Gapic::Rest::Error => e
349
+ raise ::Google::Cloud::Error.from_error(e)
350
+ end
351
+
352
+ ##
353
+ # Fetches processor types. Note that we do not use ListProcessorTypes here
354
+ # because it is not paginated.
355
+ #
356
+ # @overload fetch_processor_types(request, options = nil)
357
+ # Pass arguments to `fetch_processor_types` via a request object, either of type
358
+ # {::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest} or an equivalent Hash.
359
+ #
360
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest, ::Hash]
361
+ # A request object representing the call parameters. Required. To specify no
362
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
363
+ # @param options [::Gapic::CallOptions, ::Hash]
364
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
365
+ #
366
+ # @overload fetch_processor_types(parent: nil)
367
+ # Pass arguments to `fetch_processor_types` via keyword arguments. Note that at
368
+ # least one keyword argument is required. To specify no parameters, or to keep all
369
+ # the default parameter values, pass an empty Hash as a request object (see above).
370
+ #
371
+ # @param parent [::String]
372
+ # Required. The project of processor type to list.
373
+ # The available processor types may depend on the allow-listing on projects.
374
+ # Format: `projects/{project}/locations/{location}`
375
+ # @yield [result, operation] Access the result along with the TransportOperation object
376
+ # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse]
377
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
378
+ #
379
+ # @return [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse]
380
+ #
381
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
382
+ def fetch_processor_types request, options = nil
383
+ raise ::ArgumentError, "request must be provided" if request.nil?
384
+
385
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest
386
+
387
+ # Converts hash and nil to an options object
388
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
389
+
390
+ # Customize the options with defaults
391
+ call_metadata = @config.rpcs.fetch_processor_types.metadata.to_h
392
+
393
+ # Set x-goog-api-client and x-goog-user-project headers
394
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
395
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
396
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
397
+ transports_version_send: [:rest]
398
+
399
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
400
+
401
+ options.apply_defaults timeout: @config.rpcs.fetch_processor_types.timeout,
402
+ metadata: call_metadata,
403
+ retry_policy: @config.rpcs.fetch_processor_types.retry_policy
404
+
405
+ options.apply_defaults timeout: @config.timeout,
406
+ metadata: @config.metadata,
407
+ retry_policy: @config.retry_policy
408
+
409
+ @document_processor_service_stub.fetch_processor_types request, options do |result, operation|
410
+ yield result, operation if block_given?
411
+ return result
412
+ end
413
+ rescue ::Gapic::Rest::Error => e
414
+ raise ::Google::Cloud::Error.from_error(e)
415
+ end
416
+
417
+ ##
418
+ # Lists the processor types that exist.
419
+ #
420
+ # @overload list_processor_types(request, options = nil)
421
+ # Pass arguments to `list_processor_types` via a request object, either of type
422
+ # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest} or an equivalent Hash.
423
+ #
424
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest, ::Hash]
425
+ # A request object representing the call parameters. Required. To specify no
426
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
427
+ # @param options [::Gapic::CallOptions, ::Hash]
428
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
429
+ #
430
+ # @overload list_processor_types(parent: nil, page_size: nil, page_token: nil)
431
+ # Pass arguments to `list_processor_types` via keyword arguments. Note that at
432
+ # least one keyword argument is required. To specify no parameters, or to keep all
433
+ # the default parameter values, pass an empty Hash as a request object (see above).
434
+ #
435
+ # @param parent [::String]
436
+ # Required. The location of processor type to list.
437
+ # The available processor types may depend on the allow-listing on projects.
438
+ # Format: `projects/{project}/locations/{location}`
439
+ # @param page_size [::Integer]
440
+ # The maximum number of processor types to return.
441
+ # If unspecified, at most 100 processor types will be returned.
442
+ # The maximum value is 500; values above 500 will be coerced to 500.
443
+ # @param page_token [::String]
444
+ # Used to retrieve the next page of results, empty if at the end of the list.
445
+ # @yield [result, operation] Access the result along with the TransportOperation object
446
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>]
447
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
448
+ #
449
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>]
450
+ #
451
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
452
+ def list_processor_types request, options = nil
453
+ raise ::ArgumentError, "request must be provided" if request.nil?
454
+
455
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest
456
+
457
+ # Converts hash and nil to an options object
458
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
459
+
460
+ # Customize the options with defaults
461
+ call_metadata = @config.rpcs.list_processor_types.metadata.to_h
462
+
463
+ # Set x-goog-api-client and x-goog-user-project headers
464
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
465
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
466
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
467
+ transports_version_send: [:rest]
468
+
469
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
470
+
471
+ options.apply_defaults timeout: @config.rpcs.list_processor_types.timeout,
472
+ metadata: call_metadata,
473
+ retry_policy: @config.rpcs.list_processor_types.retry_policy
474
+
475
+ options.apply_defaults timeout: @config.timeout,
476
+ metadata: @config.metadata,
477
+ retry_policy: @config.retry_policy
478
+
479
+ @document_processor_service_stub.list_processor_types request, options do |result, operation|
480
+ result = ::Gapic::Rest::PagedEnumerable.new @document_processor_service_stub, :list_processor_types, "processor_types", request, result, options
481
+ yield result, operation if block_given?
482
+ return result
483
+ end
484
+ rescue ::Gapic::Rest::Error => e
485
+ raise ::Google::Cloud::Error.from_error(e)
486
+ end
487
+
488
+ ##
489
+ # Gets a processor type detail.
490
+ #
491
+ # @overload get_processor_type(request, options = nil)
492
+ # Pass arguments to `get_processor_type` via a request object, either of type
493
+ # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest} or an equivalent Hash.
494
+ #
495
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest, ::Hash]
496
+ # A request object representing the call parameters. Required. To specify no
497
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
498
+ # @param options [::Gapic::CallOptions, ::Hash]
499
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
500
+ #
501
+ # @overload get_processor_type(name: nil)
502
+ # Pass arguments to `get_processor_type` via keyword arguments. Note that at
503
+ # least one keyword argument is required. To specify no parameters, or to keep all
504
+ # the default parameter values, pass an empty Hash as a request object (see above).
505
+ #
506
+ # @param name [::String]
507
+ # Required. The processor type resource name.
508
+ # @yield [result, operation] Access the result along with the TransportOperation object
509
+ # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessorType]
510
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
511
+ #
512
+ # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorType]
513
+ #
514
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
515
+ def get_processor_type request, options = nil
516
+ raise ::ArgumentError, "request must be provided" if request.nil?
517
+
518
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest
519
+
520
+ # Converts hash and nil to an options object
521
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
522
+
523
+ # Customize the options with defaults
524
+ call_metadata = @config.rpcs.get_processor_type.metadata.to_h
525
+
526
+ # Set x-goog-api-client and x-goog-user-project headers
527
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
528
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
529
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
530
+ transports_version_send: [:rest]
531
+
532
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
533
+
534
+ options.apply_defaults timeout: @config.rpcs.get_processor_type.timeout,
535
+ metadata: call_metadata,
536
+ retry_policy: @config.rpcs.get_processor_type.retry_policy
537
+
538
+ options.apply_defaults timeout: @config.timeout,
539
+ metadata: @config.metadata,
540
+ retry_policy: @config.retry_policy
541
+
542
+ @document_processor_service_stub.get_processor_type request, options do |result, operation|
543
+ yield result, operation if block_given?
544
+ return result
545
+ end
546
+ rescue ::Gapic::Rest::Error => e
547
+ raise ::Google::Cloud::Error.from_error(e)
548
+ end
549
+
550
+ ##
551
+ # Lists all processors which belong to this project.
552
+ #
553
+ # @overload list_processors(request, options = nil)
554
+ # Pass arguments to `list_processors` via a request object, either of type
555
+ # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest} or an equivalent Hash.
556
+ #
557
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, ::Hash]
558
+ # A request object representing the call parameters. Required. To specify no
559
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
560
+ # @param options [::Gapic::CallOptions, ::Hash]
561
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
562
+ #
563
+ # @overload list_processors(parent: nil, page_size: nil, page_token: nil)
564
+ # Pass arguments to `list_processors` via keyword arguments. Note that at
565
+ # least one keyword argument is required. To specify no parameters, or to keep all
566
+ # the default parameter values, pass an empty Hash as a request object (see above).
567
+ #
568
+ # @param parent [::String]
569
+ # Required. The parent (project and location) which owns this collection of
570
+ # Processors. Format: `projects/{project}/locations/{location}`
571
+ # @param page_size [::Integer]
572
+ # The maximum number of processors to return.
573
+ # If unspecified, at most 50 processors will be returned.
574
+ # The maximum value is 100; values above 100 will be coerced to 100.
575
+ # @param page_token [::String]
576
+ # We will return the processors sorted by creation time. The page token
577
+ # will point to the next processor.
578
+ # @yield [result, operation] Access the result along with the TransportOperation object
579
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>]
580
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
581
+ #
582
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>]
583
+ #
584
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
585
+ def list_processors request, options = nil
586
+ raise ::ArgumentError, "request must be provided" if request.nil?
587
+
588
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest
589
+
590
+ # Converts hash and nil to an options object
591
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
592
+
593
+ # Customize the options with defaults
594
+ call_metadata = @config.rpcs.list_processors.metadata.to_h
595
+
596
+ # Set x-goog-api-client and x-goog-user-project headers
597
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
598
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
599
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
600
+ transports_version_send: [:rest]
601
+
602
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
603
+
604
+ options.apply_defaults timeout: @config.rpcs.list_processors.timeout,
605
+ metadata: call_metadata,
606
+ retry_policy: @config.rpcs.list_processors.retry_policy
607
+
608
+ options.apply_defaults timeout: @config.timeout,
609
+ metadata: @config.metadata,
610
+ retry_policy: @config.retry_policy
611
+
612
+ @document_processor_service_stub.list_processors request, options do |result, operation|
613
+ result = ::Gapic::Rest::PagedEnumerable.new @document_processor_service_stub, :list_processors, "processors", request, result, options
614
+ yield result, operation if block_given?
615
+ return result
616
+ end
617
+ rescue ::Gapic::Rest::Error => e
618
+ raise ::Google::Cloud::Error.from_error(e)
619
+ end
620
+
621
+ ##
622
+ # Gets a processor detail.
623
+ #
624
+ # @overload get_processor(request, options = nil)
625
+ # Pass arguments to `get_processor` via a request object, either of type
626
+ # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest} or an equivalent Hash.
627
+ #
628
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, ::Hash]
629
+ # A request object representing the call parameters. Required. To specify no
630
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
631
+ # @param options [::Gapic::CallOptions, ::Hash]
632
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
633
+ #
634
+ # @overload get_processor(name: nil)
635
+ # Pass arguments to `get_processor` via keyword arguments. Note that at
636
+ # least one keyword argument is required. To specify no parameters, or to keep all
637
+ # the default parameter values, pass an empty Hash as a request object (see above).
638
+ #
639
+ # @param name [::String]
640
+ # Required. The processor resource name.
641
+ # @yield [result, operation] Access the result along with the TransportOperation object
642
+ # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Processor]
643
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
644
+ #
645
+ # @return [::Google::Cloud::DocumentAI::V1beta3::Processor]
646
+ #
647
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
648
+ def get_processor request, options = nil
649
+ raise ::ArgumentError, "request must be provided" if request.nil?
650
+
651
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest
652
+
653
+ # Converts hash and nil to an options object
654
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
655
+
656
+ # Customize the options with defaults
657
+ call_metadata = @config.rpcs.get_processor.metadata.to_h
658
+
659
+ # Set x-goog-api-client and x-goog-user-project headers
660
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
661
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
662
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
663
+ transports_version_send: [:rest]
664
+
665
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
666
+
667
+ options.apply_defaults timeout: @config.rpcs.get_processor.timeout,
668
+ metadata: call_metadata,
669
+ retry_policy: @config.rpcs.get_processor.retry_policy
670
+
671
+ options.apply_defaults timeout: @config.timeout,
672
+ metadata: @config.metadata,
673
+ retry_policy: @config.retry_policy
674
+
675
+ @document_processor_service_stub.get_processor request, options do |result, operation|
676
+ yield result, operation if block_given?
677
+ return result
678
+ end
679
+ rescue ::Gapic::Rest::Error => e
680
+ raise ::Google::Cloud::Error.from_error(e)
681
+ end
682
+
683
+ ##
684
+ # Trains a new processor version.
685
+ # Operation metadata is returned as
686
+ # cloud_documentai_core.TrainProcessorVersionMetadata.
687
+ #
688
+ # @overload train_processor_version(request, options = nil)
689
+ # Pass arguments to `train_processor_version` via a request object, either of type
690
+ # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest} or an equivalent Hash.
691
+ #
692
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Hash]
693
+ # A request object representing the call parameters. Required. To specify no
694
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
695
+ # @param options [::Gapic::CallOptions, ::Hash]
696
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
697
+ #
698
+ # @overload train_processor_version(parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil)
699
+ # Pass arguments to `train_processor_version` via keyword arguments. Note that at
700
+ # least one keyword argument is required. To specify no parameters, or to keep all
701
+ # the default parameter values, pass an empty Hash as a request object (see above).
702
+ #
703
+ # @param parent [::String]
704
+ # Required. The parent (project, location and processor) to create the new
705
+ # version for. Format:
706
+ # `projects/{project}/locations/{location}/processors/{processor}`.
707
+ # @param processor_version [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion, ::Hash]
708
+ # Required. The processor version to be created.
709
+ # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash]
710
+ # Optional. The schema the processor version will be trained with.
711
+ # @param input_data [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData, ::Hash]
712
+ # Optional. The input data used to train the `ProcessorVersion`.
713
+ # @param base_processor_version [::String]
714
+ # Optional. The processor version to use as a base for training. This
715
+ # processor version must be a child of `parent`. Format:
716
+ # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
717
+ # @yield [result, operation] Access the result along with the TransportOperation object
718
+ # @yieldparam result [::Gapic::Operation]
719
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
720
+ #
721
+ # @return [::Gapic::Operation]
722
+ #
723
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
724
+ def train_processor_version request, options = nil
725
+ raise ::ArgumentError, "request must be provided" if request.nil?
726
+
727
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest
728
+
729
+ # Converts hash and nil to an options object
730
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
731
+
732
+ # Customize the options with defaults
733
+ call_metadata = @config.rpcs.train_processor_version.metadata.to_h
734
+
735
+ # Set x-goog-api-client and x-goog-user-project headers
736
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
737
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
738
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
739
+ transports_version_send: [:rest]
740
+
741
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
742
+
743
+ options.apply_defaults timeout: @config.rpcs.train_processor_version.timeout,
744
+ metadata: call_metadata,
745
+ retry_policy: @config.rpcs.train_processor_version.retry_policy
746
+
747
+ options.apply_defaults timeout: @config.timeout,
748
+ metadata: @config.metadata,
749
+ retry_policy: @config.retry_policy
750
+
751
+ @document_processor_service_stub.train_processor_version request, options do |result, operation|
752
+ result = ::Gapic::Operation.new result, @operations_client, options: options
753
+ yield result, operation if block_given?
754
+ return result
755
+ end
756
+ rescue ::Gapic::Rest::Error => e
757
+ raise ::Google::Cloud::Error.from_error(e)
758
+ end
759
+
760
+ ##
761
+ # Gets a processor version detail.
762
+ #
763
+ # @overload get_processor_version(request, options = nil)
764
+ # Pass arguments to `get_processor_version` via a request object, either of type
765
+ # {::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest} or an equivalent Hash.
766
+ #
767
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, ::Hash]
768
+ # A request object representing the call parameters. Required. To specify no
769
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
770
+ # @param options [::Gapic::CallOptions, ::Hash]
771
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
772
+ #
773
+ # @overload get_processor_version(name: nil)
774
+ # Pass arguments to `get_processor_version` via keyword arguments. Note that at
775
+ # least one keyword argument is required. To specify no parameters, or to keep all
776
+ # the default parameter values, pass an empty Hash as a request object (see above).
777
+ #
778
+ # @param name [::String]
779
+ # Required. The processor resource name.
780
+ # @yield [result, operation] Access the result along with the TransportOperation object
781
+ # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion]
782
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
783
+ #
784
+ # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion]
785
+ #
786
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
787
+ def get_processor_version request, options = nil
788
+ raise ::ArgumentError, "request must be provided" if request.nil?
789
+
790
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest
791
+
792
+ # Converts hash and nil to an options object
793
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
794
+
795
+ # Customize the options with defaults
796
+ call_metadata = @config.rpcs.get_processor_version.metadata.to_h
797
+
798
+ # Set x-goog-api-client and x-goog-user-project headers
799
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
800
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
801
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
802
+ transports_version_send: [:rest]
803
+
804
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
805
+
806
+ options.apply_defaults timeout: @config.rpcs.get_processor_version.timeout,
807
+ metadata: call_metadata,
808
+ retry_policy: @config.rpcs.get_processor_version.retry_policy
809
+
810
+ options.apply_defaults timeout: @config.timeout,
811
+ metadata: @config.metadata,
812
+ retry_policy: @config.retry_policy
813
+
814
+ @document_processor_service_stub.get_processor_version request, options do |result, operation|
815
+ yield result, operation if block_given?
816
+ return result
817
+ end
818
+ rescue ::Gapic::Rest::Error => e
819
+ raise ::Google::Cloud::Error.from_error(e)
820
+ end
821
+
822
+ ##
823
+ # Lists all versions of a processor.
824
+ #
825
+ # @overload list_processor_versions(request, options = nil)
826
+ # Pass arguments to `list_processor_versions` via a request object, either of type
827
+ # {::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest} or an equivalent Hash.
828
+ #
829
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest, ::Hash]
830
+ # A request object representing the call parameters. Required. To specify no
831
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
832
+ # @param options [::Gapic::CallOptions, ::Hash]
833
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
834
+ #
835
+ # @overload list_processor_versions(parent: nil, page_size: nil, page_token: nil)
836
+ # Pass arguments to `list_processor_versions` via keyword arguments. Note that at
837
+ # least one keyword argument is required. To specify no parameters, or to keep all
838
+ # the default parameter values, pass an empty Hash as a request object (see above).
839
+ #
840
+ # @param parent [::String]
841
+ # Required. The parent (project, location and processor) to list all
842
+ # versions. Format:
843
+ # `projects/{project}/locations/{location}/processors/{processor}`
844
+ # @param page_size [::Integer]
845
+ # The maximum number of processor versions to return.
846
+ # If unspecified, at most 10 processor versions will be returned.
847
+ # The maximum value is 20; values above 20 will be coerced to 20.
848
+ # @param page_token [::String]
849
+ # We will return the processor versions sorted by creation time. The page
850
+ # token will point to the next processor version.
851
+ # @yield [result, operation] Access the result along with the TransportOperation object
852
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>]
853
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
854
+ #
855
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>]
856
+ #
857
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
858
+ def list_processor_versions request, options = nil
859
+ raise ::ArgumentError, "request must be provided" if request.nil?
860
+
861
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest
862
+
863
+ # Converts hash and nil to an options object
864
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
865
+
866
+ # Customize the options with defaults
867
+ call_metadata = @config.rpcs.list_processor_versions.metadata.to_h
868
+
869
+ # Set x-goog-api-client and x-goog-user-project headers
870
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
871
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
872
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
873
+ transports_version_send: [:rest]
874
+
875
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
876
+
877
+ options.apply_defaults timeout: @config.rpcs.list_processor_versions.timeout,
878
+ metadata: call_metadata,
879
+ retry_policy: @config.rpcs.list_processor_versions.retry_policy
880
+
881
+ options.apply_defaults timeout: @config.timeout,
882
+ metadata: @config.metadata,
883
+ retry_policy: @config.retry_policy
884
+
885
+ @document_processor_service_stub.list_processor_versions request, options do |result, operation|
886
+ result = ::Gapic::Rest::PagedEnumerable.new @document_processor_service_stub, :list_processor_versions, "processor_versions", request, result, options
887
+ yield result, operation if block_given?
888
+ return result
889
+ end
890
+ rescue ::Gapic::Rest::Error => e
891
+ raise ::Google::Cloud::Error.from_error(e)
892
+ end
893
+
894
+ ##
895
+ # Deletes the processor version, all artifacts under the processor version
896
+ # will be deleted.
897
+ #
898
+ # @overload delete_processor_version(request, options = nil)
899
+ # Pass arguments to `delete_processor_version` via a request object, either of type
900
+ # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest} or an equivalent Hash.
901
+ #
902
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest, ::Hash]
903
+ # A request object representing the call parameters. Required. To specify no
904
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
905
+ # @param options [::Gapic::CallOptions, ::Hash]
906
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
907
+ #
908
+ # @overload delete_processor_version(name: nil)
909
+ # Pass arguments to `delete_processor_version` via keyword arguments. Note that at
910
+ # least one keyword argument is required. To specify no parameters, or to keep all
911
+ # the default parameter values, pass an empty Hash as a request object (see above).
912
+ #
913
+ # @param name [::String]
914
+ # Required. The processor version resource name to be deleted.
915
+ # @yield [result, operation] Access the result along with the TransportOperation object
916
+ # @yieldparam result [::Gapic::Operation]
917
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
918
+ #
919
+ # @return [::Gapic::Operation]
920
+ #
921
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
922
+ def delete_processor_version request, options = nil
923
+ raise ::ArgumentError, "request must be provided" if request.nil?
924
+
925
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest
926
+
927
+ # Converts hash and nil to an options object
928
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
929
+
930
+ # Customize the options with defaults
931
+ call_metadata = @config.rpcs.delete_processor_version.metadata.to_h
932
+
933
+ # Set x-goog-api-client and x-goog-user-project headers
934
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
935
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
936
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
937
+ transports_version_send: [:rest]
938
+
939
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
940
+
941
+ options.apply_defaults timeout: @config.rpcs.delete_processor_version.timeout,
942
+ metadata: call_metadata,
943
+ retry_policy: @config.rpcs.delete_processor_version.retry_policy
944
+
945
+ options.apply_defaults timeout: @config.timeout,
946
+ metadata: @config.metadata,
947
+ retry_policy: @config.retry_policy
948
+
949
+ @document_processor_service_stub.delete_processor_version request, options do |result, operation|
950
+ result = ::Gapic::Operation.new result, @operations_client, options: options
951
+ yield result, operation if block_given?
952
+ return result
953
+ end
954
+ rescue ::Gapic::Rest::Error => e
955
+ raise ::Google::Cloud::Error.from_error(e)
956
+ end
957
+
958
+ ##
959
+ # Deploys the processor version.
960
+ #
961
+ # @overload deploy_processor_version(request, options = nil)
962
+ # Pass arguments to `deploy_processor_version` via a request object, either of type
963
+ # {::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest} or an equivalent Hash.
964
+ #
965
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest, ::Hash]
966
+ # A request object representing the call parameters. Required. To specify no
967
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
968
+ # @param options [::Gapic::CallOptions, ::Hash]
969
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
970
+ #
971
+ # @overload deploy_processor_version(name: nil)
972
+ # Pass arguments to `deploy_processor_version` via keyword arguments. Note that at
973
+ # least one keyword argument is required. To specify no parameters, or to keep all
974
+ # the default parameter values, pass an empty Hash as a request object (see above).
975
+ #
976
+ # @param name [::String]
977
+ # Required. The processor version resource name to be deployed.
978
+ # @yield [result, operation] Access the result along with the TransportOperation object
979
+ # @yieldparam result [::Gapic::Operation]
980
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
981
+ #
982
+ # @return [::Gapic::Operation]
983
+ #
984
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
985
+ def deploy_processor_version request, options = nil
986
+ raise ::ArgumentError, "request must be provided" if request.nil?
987
+
988
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest
989
+
990
+ # Converts hash and nil to an options object
991
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
992
+
993
+ # Customize the options with defaults
994
+ call_metadata = @config.rpcs.deploy_processor_version.metadata.to_h
995
+
996
+ # Set x-goog-api-client and x-goog-user-project headers
997
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
998
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
999
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
1000
+ transports_version_send: [:rest]
1001
+
1002
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1003
+
1004
+ options.apply_defaults timeout: @config.rpcs.deploy_processor_version.timeout,
1005
+ metadata: call_metadata,
1006
+ retry_policy: @config.rpcs.deploy_processor_version.retry_policy
1007
+
1008
+ options.apply_defaults timeout: @config.timeout,
1009
+ metadata: @config.metadata,
1010
+ retry_policy: @config.retry_policy
1011
+
1012
+ @document_processor_service_stub.deploy_processor_version request, options do |result, operation|
1013
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1014
+ yield result, operation if block_given?
1015
+ return result
1016
+ end
1017
+ rescue ::Gapic::Rest::Error => e
1018
+ raise ::Google::Cloud::Error.from_error(e)
1019
+ end
1020
+
1021
+ ##
1022
+ # Undeploys the processor version.
1023
+ #
1024
+ # @overload undeploy_processor_version(request, options = nil)
1025
+ # Pass arguments to `undeploy_processor_version` via a request object, either of type
1026
+ # {::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest} or an equivalent Hash.
1027
+ #
1028
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest, ::Hash]
1029
+ # A request object representing the call parameters. Required. To specify no
1030
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1031
+ # @param options [::Gapic::CallOptions, ::Hash]
1032
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1033
+ #
1034
+ # @overload undeploy_processor_version(name: nil)
1035
+ # Pass arguments to `undeploy_processor_version` via keyword arguments. Note that at
1036
+ # least one keyword argument is required. To specify no parameters, or to keep all
1037
+ # the default parameter values, pass an empty Hash as a request object (see above).
1038
+ #
1039
+ # @param name [::String]
1040
+ # Required. The processor version resource name to be undeployed.
1041
+ # @yield [result, operation] Access the result along with the TransportOperation object
1042
+ # @yieldparam result [::Gapic::Operation]
1043
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1044
+ #
1045
+ # @return [::Gapic::Operation]
1046
+ #
1047
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1048
+ def undeploy_processor_version request, options = nil
1049
+ raise ::ArgumentError, "request must be provided" if request.nil?
1050
+
1051
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest
1052
+
1053
+ # Converts hash and nil to an options object
1054
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1055
+
1056
+ # Customize the options with defaults
1057
+ call_metadata = @config.rpcs.undeploy_processor_version.metadata.to_h
1058
+
1059
+ # Set x-goog-api-client and x-goog-user-project headers
1060
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1061
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1062
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
1063
+ transports_version_send: [:rest]
1064
+
1065
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1066
+
1067
+ options.apply_defaults timeout: @config.rpcs.undeploy_processor_version.timeout,
1068
+ metadata: call_metadata,
1069
+ retry_policy: @config.rpcs.undeploy_processor_version.retry_policy
1070
+
1071
+ options.apply_defaults timeout: @config.timeout,
1072
+ metadata: @config.metadata,
1073
+ retry_policy: @config.retry_policy
1074
+
1075
+ @document_processor_service_stub.undeploy_processor_version request, options do |result, operation|
1076
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1077
+ yield result, operation if block_given?
1078
+ return result
1079
+ end
1080
+ rescue ::Gapic::Rest::Error => e
1081
+ raise ::Google::Cloud::Error.from_error(e)
1082
+ end
1083
+
1084
+ ##
1085
+ # Creates a processor from the type processor that the user chose.
1086
+ # The processor will be at "ENABLED" state by default after its creation.
1087
+ #
1088
+ # @overload create_processor(request, options = nil)
1089
+ # Pass arguments to `create_processor` via a request object, either of type
1090
+ # {::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest} or an equivalent Hash.
1091
+ #
1092
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest, ::Hash]
1093
+ # A request object representing the call parameters. Required. To specify no
1094
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1095
+ # @param options [::Gapic::CallOptions, ::Hash]
1096
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1097
+ #
1098
+ # @overload create_processor(parent: nil, processor: nil)
1099
+ # Pass arguments to `create_processor` via keyword arguments. Note that at
1100
+ # least one keyword argument is required. To specify no parameters, or to keep all
1101
+ # the default parameter values, pass an empty Hash as a request object (see above).
1102
+ #
1103
+ # @param parent [::String]
1104
+ # Required. The parent (project and location) under which to create the
1105
+ # processor. Format: `projects/{project}/locations/{location}`
1106
+ # @param processor [::Google::Cloud::DocumentAI::V1beta3::Processor, ::Hash]
1107
+ # Required. The processor to be created, requires [processor_type] and
1108
+ # [display_name] to be set. Also, the processor is under CMEK if CMEK fields
1109
+ # are set.
1110
+ # @yield [result, operation] Access the result along with the TransportOperation object
1111
+ # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Processor]
1112
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1113
+ #
1114
+ # @return [::Google::Cloud::DocumentAI::V1beta3::Processor]
1115
+ #
1116
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1117
+ def create_processor request, options = nil
1118
+ raise ::ArgumentError, "request must be provided" if request.nil?
1119
+
1120
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest
1121
+
1122
+ # Converts hash and nil to an options object
1123
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1124
+
1125
+ # Customize the options with defaults
1126
+ call_metadata = @config.rpcs.create_processor.metadata.to_h
1127
+
1128
+ # Set x-goog-api-client and x-goog-user-project headers
1129
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1130
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1131
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
1132
+ transports_version_send: [:rest]
1133
+
1134
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1135
+
1136
+ options.apply_defaults timeout: @config.rpcs.create_processor.timeout,
1137
+ metadata: call_metadata,
1138
+ retry_policy: @config.rpcs.create_processor.retry_policy
1139
+
1140
+ options.apply_defaults timeout: @config.timeout,
1141
+ metadata: @config.metadata,
1142
+ retry_policy: @config.retry_policy
1143
+
1144
+ @document_processor_service_stub.create_processor request, options do |result, operation|
1145
+ yield result, operation if block_given?
1146
+ return result
1147
+ end
1148
+ rescue ::Gapic::Rest::Error => e
1149
+ raise ::Google::Cloud::Error.from_error(e)
1150
+ end
1151
+
1152
+ ##
1153
+ # Deletes the processor, unloads all deployed model artifacts if it was
1154
+ # enabled and then deletes all artifacts associated with this processor.
1155
+ #
1156
+ # @overload delete_processor(request, options = nil)
1157
+ # Pass arguments to `delete_processor` via a request object, either of type
1158
+ # {::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest} or an equivalent Hash.
1159
+ #
1160
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest, ::Hash]
1161
+ # A request object representing the call parameters. Required. To specify no
1162
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1163
+ # @param options [::Gapic::CallOptions, ::Hash]
1164
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1165
+ #
1166
+ # @overload delete_processor(name: nil)
1167
+ # Pass arguments to `delete_processor` via keyword arguments. Note that at
1168
+ # least one keyword argument is required. To specify no parameters, or to keep all
1169
+ # the default parameter values, pass an empty Hash as a request object (see above).
1170
+ #
1171
+ # @param name [::String]
1172
+ # Required. The processor resource name to be deleted.
1173
+ # @yield [result, operation] Access the result along with the TransportOperation object
1174
+ # @yieldparam result [::Gapic::Operation]
1175
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1176
+ #
1177
+ # @return [::Gapic::Operation]
1178
+ #
1179
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1180
+ def delete_processor request, options = nil
1181
+ raise ::ArgumentError, "request must be provided" if request.nil?
1182
+
1183
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest
1184
+
1185
+ # Converts hash and nil to an options object
1186
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1187
+
1188
+ # Customize the options with defaults
1189
+ call_metadata = @config.rpcs.delete_processor.metadata.to_h
1190
+
1191
+ # Set x-goog-api-client and x-goog-user-project headers
1192
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1193
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1194
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
1195
+ transports_version_send: [:rest]
1196
+
1197
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1198
+
1199
+ options.apply_defaults timeout: @config.rpcs.delete_processor.timeout,
1200
+ metadata: call_metadata,
1201
+ retry_policy: @config.rpcs.delete_processor.retry_policy
1202
+
1203
+ options.apply_defaults timeout: @config.timeout,
1204
+ metadata: @config.metadata,
1205
+ retry_policy: @config.retry_policy
1206
+
1207
+ @document_processor_service_stub.delete_processor request, options do |result, operation|
1208
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1209
+ yield result, operation if block_given?
1210
+ return result
1211
+ end
1212
+ rescue ::Gapic::Rest::Error => e
1213
+ raise ::Google::Cloud::Error.from_error(e)
1214
+ end
1215
+
1216
+ ##
1217
+ # Enables a processor
1218
+ #
1219
+ # @overload enable_processor(request, options = nil)
1220
+ # Pass arguments to `enable_processor` via a request object, either of type
1221
+ # {::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest} or an equivalent Hash.
1222
+ #
1223
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest, ::Hash]
1224
+ # A request object representing the call parameters. Required. To specify no
1225
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1226
+ # @param options [::Gapic::CallOptions, ::Hash]
1227
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1228
+ #
1229
+ # @overload enable_processor(name: nil)
1230
+ # Pass arguments to `enable_processor` via keyword arguments. Note that at
1231
+ # least one keyword argument is required. To specify no parameters, or to keep all
1232
+ # the default parameter values, pass an empty Hash as a request object (see above).
1233
+ #
1234
+ # @param name [::String]
1235
+ # Required. The processor resource name to be enabled.
1236
+ # @yield [result, operation] Access the result along with the TransportOperation object
1237
+ # @yieldparam result [::Gapic::Operation]
1238
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1239
+ #
1240
+ # @return [::Gapic::Operation]
1241
+ #
1242
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1243
+ def enable_processor request, options = nil
1244
+ raise ::ArgumentError, "request must be provided" if request.nil?
1245
+
1246
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest
1247
+
1248
+ # Converts hash and nil to an options object
1249
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1250
+
1251
+ # Customize the options with defaults
1252
+ call_metadata = @config.rpcs.enable_processor.metadata.to_h
1253
+
1254
+ # Set x-goog-api-client and x-goog-user-project headers
1255
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1256
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1257
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
1258
+ transports_version_send: [:rest]
1259
+
1260
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1261
+
1262
+ options.apply_defaults timeout: @config.rpcs.enable_processor.timeout,
1263
+ metadata: call_metadata,
1264
+ retry_policy: @config.rpcs.enable_processor.retry_policy
1265
+
1266
+ options.apply_defaults timeout: @config.timeout,
1267
+ metadata: @config.metadata,
1268
+ retry_policy: @config.retry_policy
1269
+
1270
+ @document_processor_service_stub.enable_processor request, options do |result, operation|
1271
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1272
+ yield result, operation if block_given?
1273
+ return result
1274
+ end
1275
+ rescue ::Gapic::Rest::Error => e
1276
+ raise ::Google::Cloud::Error.from_error(e)
1277
+ end
1278
+
1279
+ ##
1280
+ # Disables a processor
1281
+ #
1282
+ # @overload disable_processor(request, options = nil)
1283
+ # Pass arguments to `disable_processor` via a request object, either of type
1284
+ # {::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest} or an equivalent Hash.
1285
+ #
1286
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest, ::Hash]
1287
+ # A request object representing the call parameters. Required. To specify no
1288
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1289
+ # @param options [::Gapic::CallOptions, ::Hash]
1290
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1291
+ #
1292
+ # @overload disable_processor(name: nil)
1293
+ # Pass arguments to `disable_processor` via keyword arguments. Note that at
1294
+ # least one keyword argument is required. To specify no parameters, or to keep all
1295
+ # the default parameter values, pass an empty Hash as a request object (see above).
1296
+ #
1297
+ # @param name [::String]
1298
+ # Required. The processor resource name to be disabled.
1299
+ # @yield [result, operation] Access the result along with the TransportOperation object
1300
+ # @yieldparam result [::Gapic::Operation]
1301
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1302
+ #
1303
+ # @return [::Gapic::Operation]
1304
+ #
1305
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1306
+ def disable_processor request, options = nil
1307
+ raise ::ArgumentError, "request must be provided" if request.nil?
1308
+
1309
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest
1310
+
1311
+ # Converts hash and nil to an options object
1312
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1313
+
1314
+ # Customize the options with defaults
1315
+ call_metadata = @config.rpcs.disable_processor.metadata.to_h
1316
+
1317
+ # Set x-goog-api-client and x-goog-user-project headers
1318
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1319
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1320
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
1321
+ transports_version_send: [:rest]
1322
+
1323
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1324
+
1325
+ options.apply_defaults timeout: @config.rpcs.disable_processor.timeout,
1326
+ metadata: call_metadata,
1327
+ retry_policy: @config.rpcs.disable_processor.retry_policy
1328
+
1329
+ options.apply_defaults timeout: @config.timeout,
1330
+ metadata: @config.metadata,
1331
+ retry_policy: @config.retry_policy
1332
+
1333
+ @document_processor_service_stub.disable_processor request, options do |result, operation|
1334
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1335
+ yield result, operation if block_given?
1336
+ return result
1337
+ end
1338
+ rescue ::Gapic::Rest::Error => e
1339
+ raise ::Google::Cloud::Error.from_error(e)
1340
+ end
1341
+
1342
+ ##
1343
+ # Set the default (active) version of a
1344
+ # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} that will be used in
1345
+ # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client#process_document ProcessDocument}
1346
+ # and
1347
+ # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client#batch_process_documents BatchProcessDocuments}.
1348
+ #
1349
+ # @overload set_default_processor_version(request, options = nil)
1350
+ # Pass arguments to `set_default_processor_version` via a request object, either of type
1351
+ # {::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest} or an equivalent Hash.
1352
+ #
1353
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest, ::Hash]
1354
+ # A request object representing the call parameters. Required. To specify no
1355
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1356
+ # @param options [::Gapic::CallOptions, ::Hash]
1357
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1358
+ #
1359
+ # @overload set_default_processor_version(processor: nil, default_processor_version: nil)
1360
+ # Pass arguments to `set_default_processor_version` via keyword arguments. Note that at
1361
+ # least one keyword argument is required. To specify no parameters, or to keep all
1362
+ # the default parameter values, pass an empty Hash as a request object (see above).
1363
+ #
1364
+ # @param processor [::String]
1365
+ # Required. The resource name of the
1366
+ # {::Google::Cloud::DocumentAI::V1beta3::Processor Processor} to change default
1367
+ # version.
1368
+ # @param default_processor_version [::String]
1369
+ # Required. The resource name of child
1370
+ # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to use
1371
+ # as default. Format:
1372
+ # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
1373
+ # @yield [result, operation] Access the result along with the TransportOperation object
1374
+ # @yieldparam result [::Gapic::Operation]
1375
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1376
+ #
1377
+ # @return [::Gapic::Operation]
1378
+ #
1379
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1380
+ def set_default_processor_version request, options = nil
1381
+ raise ::ArgumentError, "request must be provided" if request.nil?
1382
+
1383
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest
1384
+
1385
+ # Converts hash and nil to an options object
1386
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1387
+
1388
+ # Customize the options with defaults
1389
+ call_metadata = @config.rpcs.set_default_processor_version.metadata.to_h
1390
+
1391
+ # Set x-goog-api-client and x-goog-user-project headers
1392
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1393
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1394
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
1395
+ transports_version_send: [:rest]
1396
+
1397
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1398
+
1399
+ options.apply_defaults timeout: @config.rpcs.set_default_processor_version.timeout,
1400
+ metadata: call_metadata,
1401
+ retry_policy: @config.rpcs.set_default_processor_version.retry_policy
1402
+
1403
+ options.apply_defaults timeout: @config.timeout,
1404
+ metadata: @config.metadata,
1405
+ retry_policy: @config.retry_policy
1406
+
1407
+ @document_processor_service_stub.set_default_processor_version request, options do |result, operation|
1408
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1409
+ yield result, operation if block_given?
1410
+ return result
1411
+ end
1412
+ rescue ::Gapic::Rest::Error => e
1413
+ raise ::Google::Cloud::Error.from_error(e)
1414
+ end
1415
+
1416
+ ##
1417
+ # Send a document for Human Review. The input document should be processed by
1418
+ # the specified processor.
1419
+ #
1420
+ # @overload review_document(request, options = nil)
1421
+ # Pass arguments to `review_document` via a request object, either of type
1422
+ # {::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest} or an equivalent Hash.
1423
+ #
1424
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, ::Hash]
1425
+ # A request object representing the call parameters. Required. To specify no
1426
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1427
+ # @param options [::Gapic::CallOptions, ::Hash]
1428
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1429
+ #
1430
+ # @overload review_document(inline_document: nil, human_review_config: nil, document: nil, enable_schema_validation: nil, priority: nil, document_schema: nil)
1431
+ # Pass arguments to `review_document` via keyword arguments. Note that at
1432
+ # least one keyword argument is required. To specify no parameters, or to keep all
1433
+ # the default parameter values, pass an empty Hash as a request object (see above).
1434
+ #
1435
+ # @param inline_document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash]
1436
+ # An inline document proto.
1437
+ # @param human_review_config [::String]
1438
+ # Required. The resource name of the HumanReviewConfig that the document will
1439
+ # be reviewed with.
1440
+ # @param document [::Google::Cloud::DocumentAI::V1beta3::Document, ::Hash]
1441
+ # The document that needs human review.
1442
+ # @param enable_schema_validation [::Boolean]
1443
+ # Whether the validation should be performed on the ad-hoc review request.
1444
+ # @param priority [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority]
1445
+ # The priority of the human review task.
1446
+ # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash]
1447
+ # The document schema of the human review task.
1448
+ # @yield [result, operation] Access the result along with the TransportOperation object
1449
+ # @yieldparam result [::Gapic::Operation]
1450
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1451
+ #
1452
+ # @return [::Gapic::Operation]
1453
+ #
1454
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1455
+ def review_document request, options = nil
1456
+ raise ::ArgumentError, "request must be provided" if request.nil?
1457
+
1458
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest
1459
+
1460
+ # Converts hash and nil to an options object
1461
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1462
+
1463
+ # Customize the options with defaults
1464
+ call_metadata = @config.rpcs.review_document.metadata.to_h
1465
+
1466
+ # Set x-goog-api-client and x-goog-user-project headers
1467
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1468
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1469
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
1470
+ transports_version_send: [:rest]
1471
+
1472
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1473
+
1474
+ options.apply_defaults timeout: @config.rpcs.review_document.timeout,
1475
+ metadata: call_metadata,
1476
+ retry_policy: @config.rpcs.review_document.retry_policy
1477
+
1478
+ options.apply_defaults timeout: @config.timeout,
1479
+ metadata: @config.metadata,
1480
+ retry_policy: @config.retry_policy
1481
+
1482
+ @document_processor_service_stub.review_document request, options do |result, operation|
1483
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1484
+ yield result, operation if block_given?
1485
+ return result
1486
+ end
1487
+ rescue ::Gapic::Rest::Error => e
1488
+ raise ::Google::Cloud::Error.from_error(e)
1489
+ end
1490
+
1491
+ ##
1492
+ # Evaluates a ProcessorVersion against annotated documents, producing an
1493
+ # Evaluation.
1494
+ #
1495
+ # @overload evaluate_processor_version(request, options = nil)
1496
+ # Pass arguments to `evaluate_processor_version` via a request object, either of type
1497
+ # {::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest} or an equivalent Hash.
1498
+ #
1499
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Hash]
1500
+ # A request object representing the call parameters. Required. To specify no
1501
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1502
+ # @param options [::Gapic::CallOptions, ::Hash]
1503
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1504
+ #
1505
+ # @overload evaluate_processor_version(processor_version: nil, evaluation_documents: nil)
1506
+ # Pass arguments to `evaluate_processor_version` via keyword arguments. Note that at
1507
+ # least one keyword argument is required. To specify no parameters, or to keep all
1508
+ # the default parameter values, pass an empty Hash as a request object (see above).
1509
+ #
1510
+ # @param processor_version [::String]
1511
+ # Required. The resource name of the
1512
+ # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to
1513
+ # evaluate.
1514
+ # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
1515
+ # @param evaluation_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash]
1516
+ # Optional. The documents used in the evaluation. If unspecified, use the
1517
+ # processor's dataset as evaluation input.
1518
+ # @yield [result, operation] Access the result along with the TransportOperation object
1519
+ # @yieldparam result [::Gapic::Operation]
1520
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1521
+ #
1522
+ # @return [::Gapic::Operation]
1523
+ #
1524
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1525
+ def evaluate_processor_version request, options = nil
1526
+ raise ::ArgumentError, "request must be provided" if request.nil?
1527
+
1528
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest
1529
+
1530
+ # Converts hash and nil to an options object
1531
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1532
+
1533
+ # Customize the options with defaults
1534
+ call_metadata = @config.rpcs.evaluate_processor_version.metadata.to_h
1535
+
1536
+ # Set x-goog-api-client and x-goog-user-project headers
1537
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1538
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1539
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
1540
+ transports_version_send: [:rest]
1541
+
1542
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1543
+
1544
+ options.apply_defaults timeout: @config.rpcs.evaluate_processor_version.timeout,
1545
+ metadata: call_metadata,
1546
+ retry_policy: @config.rpcs.evaluate_processor_version.retry_policy
1547
+
1548
+ options.apply_defaults timeout: @config.timeout,
1549
+ metadata: @config.metadata,
1550
+ retry_policy: @config.retry_policy
1551
+
1552
+ @document_processor_service_stub.evaluate_processor_version request, options do |result, operation|
1553
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1554
+ yield result, operation if block_given?
1555
+ return result
1556
+ end
1557
+ rescue ::Gapic::Rest::Error => e
1558
+ raise ::Google::Cloud::Error.from_error(e)
1559
+ end
1560
+
1561
+ ##
1562
+ # Retrieves a specific evaluation.
1563
+ #
1564
+ # @overload get_evaluation(request, options = nil)
1565
+ # Pass arguments to `get_evaluation` via a request object, either of type
1566
+ # {::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest} or an equivalent Hash.
1567
+ #
1568
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Hash]
1569
+ # A request object representing the call parameters. Required. To specify no
1570
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1571
+ # @param options [::Gapic::CallOptions, ::Hash]
1572
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1573
+ #
1574
+ # @overload get_evaluation(name: nil)
1575
+ # Pass arguments to `get_evaluation` via keyword arguments. Note that at
1576
+ # least one keyword argument is required. To specify no parameters, or to keep all
1577
+ # the default parameter values, pass an empty Hash as a request object (see above).
1578
+ #
1579
+ # @param name [::String]
1580
+ # Required. The resource name of the
1581
+ # {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get.
1582
+ # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
1583
+ # @yield [result, operation] Access the result along with the TransportOperation object
1584
+ # @yieldparam result [::Google::Cloud::DocumentAI::V1beta3::Evaluation]
1585
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1586
+ #
1587
+ # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation]
1588
+ #
1589
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1590
+ def get_evaluation request, options = nil
1591
+ raise ::ArgumentError, "request must be provided" if request.nil?
1592
+
1593
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest
1594
+
1595
+ # Converts hash and nil to an options object
1596
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1597
+
1598
+ # Customize the options with defaults
1599
+ call_metadata = @config.rpcs.get_evaluation.metadata.to_h
1600
+
1601
+ # Set x-goog-api-client and x-goog-user-project headers
1602
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1603
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1604
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
1605
+ transports_version_send: [:rest]
1606
+
1607
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1608
+
1609
+ options.apply_defaults timeout: @config.rpcs.get_evaluation.timeout,
1610
+ metadata: call_metadata,
1611
+ retry_policy: @config.rpcs.get_evaluation.retry_policy
1612
+
1613
+ options.apply_defaults timeout: @config.timeout,
1614
+ metadata: @config.metadata,
1615
+ retry_policy: @config.retry_policy
1616
+
1617
+ @document_processor_service_stub.get_evaluation request, options do |result, operation|
1618
+ yield result, operation if block_given?
1619
+ return result
1620
+ end
1621
+ rescue ::Gapic::Rest::Error => e
1622
+ raise ::Google::Cloud::Error.from_error(e)
1623
+ end
1624
+
1625
+ ##
1626
+ # Retrieves a set of evaluations for a given processor version.
1627
+ #
1628
+ # @overload list_evaluations(request, options = nil)
1629
+ # Pass arguments to `list_evaluations` via a request object, either of type
1630
+ # {::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest} or an equivalent Hash.
1631
+ #
1632
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Hash]
1633
+ # A request object representing the call parameters. Required. To specify no
1634
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1635
+ # @param options [::Gapic::CallOptions, ::Hash]
1636
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1637
+ #
1638
+ # @overload list_evaluations(parent: nil, page_size: nil, page_token: nil)
1639
+ # Pass arguments to `list_evaluations` via keyword arguments. Note that at
1640
+ # least one keyword argument is required. To specify no parameters, or to keep all
1641
+ # the default parameter values, pass an empty Hash as a request object (see above).
1642
+ #
1643
+ # @param parent [::String]
1644
+ # Required. The resource name of the
1645
+ # {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to
1646
+ # list evaluations for.
1647
+ # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
1648
+ # @param page_size [::Integer]
1649
+ # The standard list page size.
1650
+ # If unspecified, at most 5 evaluations will be returned.
1651
+ # The maximum value is 100; values above 100 will be coerced to 100.
1652
+ # @param page_token [::String]
1653
+ # A page token, received from a previous `ListEvaluations` call.
1654
+ # Provide this to retrieve the subsequent page.
1655
+ # @yield [result, operation] Access the result along with the TransportOperation object
1656
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>]
1657
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1658
+ #
1659
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>]
1660
+ #
1661
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1662
+ def list_evaluations request, options = nil
1663
+ raise ::ArgumentError, "request must be provided" if request.nil?
1664
+
1665
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest
1666
+
1667
+ # Converts hash and nil to an options object
1668
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1669
+
1670
+ # Customize the options with defaults
1671
+ call_metadata = @config.rpcs.list_evaluations.metadata.to_h
1672
+
1673
+ # Set x-goog-api-client and x-goog-user-project headers
1674
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1675
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1676
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION,
1677
+ transports_version_send: [:rest]
1678
+
1679
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1680
+
1681
+ options.apply_defaults timeout: @config.rpcs.list_evaluations.timeout,
1682
+ metadata: call_metadata,
1683
+ retry_policy: @config.rpcs.list_evaluations.retry_policy
1684
+
1685
+ options.apply_defaults timeout: @config.timeout,
1686
+ metadata: @config.metadata,
1687
+ retry_policy: @config.retry_policy
1688
+
1689
+ @document_processor_service_stub.list_evaluations request, options do |result, operation|
1690
+ result = ::Gapic::Rest::PagedEnumerable.new @document_processor_service_stub, :list_evaluations, "evaluations", request, result, options
1691
+ yield result, operation if block_given?
1692
+ return result
1693
+ end
1694
+ rescue ::Gapic::Rest::Error => e
1695
+ raise ::Google::Cloud::Error.from_error(e)
1696
+ end
1697
+
1698
+ ##
1699
+ # Configuration class for the DocumentProcessorService REST API.
1700
+ #
1701
+ # This class represents the configuration for DocumentProcessorService REST,
1702
+ # providing control over timeouts, retry behavior, logging, transport
1703
+ # parameters, and other low-level controls. Certain parameters can also be
1704
+ # applied individually to specific RPCs. See
1705
+ # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client::Configuration::Rpcs}
1706
+ # for a list of RPCs that can be configured independently.
1707
+ #
1708
+ # Configuration can be applied globally to all clients, or to a single client
1709
+ # on construction.
1710
+ #
1711
+ # @example
1712
+ #
1713
+ # # Modify the global config, setting the timeout for
1714
+ # # process_document to 20 seconds,
1715
+ # # and all remaining timeouts to 10 seconds.
1716
+ # ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.configure do |config|
1717
+ # config.timeout = 10.0
1718
+ # config.rpcs.process_document.timeout = 20.0
1719
+ # end
1720
+ #
1721
+ # # Apply the above configuration only to a new client.
1722
+ # client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new do |config|
1723
+ # config.timeout = 10.0
1724
+ # config.rpcs.process_document.timeout = 20.0
1725
+ # end
1726
+ #
1727
+ # @!attribute [rw] endpoint
1728
+ # The hostname or hostname:port of the service endpoint.
1729
+ # Defaults to `"documentai.googleapis.com"`.
1730
+ # @return [::String]
1731
+ # @!attribute [rw] credentials
1732
+ # Credentials to send with calls. You may provide any of the following types:
1733
+ # * (`String`) The path to a service account key file in JSON format
1734
+ # * (`Hash`) A service account key as a Hash
1735
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1736
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1737
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1738
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1739
+ # * (`nil`) indicating no credentials
1740
+ # @return [::Object]
1741
+ # @!attribute [rw] scope
1742
+ # The OAuth scopes
1743
+ # @return [::Array<::String>]
1744
+ # @!attribute [rw] lib_name
1745
+ # The library name as recorded in instrumentation and logging
1746
+ # @return [::String]
1747
+ # @!attribute [rw] lib_version
1748
+ # The library version as recorded in instrumentation and logging
1749
+ # @return [::String]
1750
+ # @!attribute [rw] timeout
1751
+ # The call timeout in seconds.
1752
+ # @return [::Numeric]
1753
+ # @!attribute [rw] metadata
1754
+ # Additional headers to be sent with the call.
1755
+ # @return [::Hash{::Symbol=>::String}]
1756
+ # @!attribute [rw] retry_policy
1757
+ # The retry policy. The value is a hash with the following keys:
1758
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1759
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1760
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1761
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1762
+ # trigger a retry.
1763
+ # @return [::Hash]
1764
+ # @!attribute [rw] quota_project
1765
+ # A separate project against which to charge quota.
1766
+ # @return [::String]
1767
+ #
1768
+ class Configuration
1769
+ extend ::Gapic::Config
1770
+
1771
+ config_attr :endpoint, "documentai.googleapis.com", ::String
1772
+ config_attr :credentials, nil do |value|
1773
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1774
+ allowed.any? { |klass| klass === value }
1775
+ end
1776
+ config_attr :scope, nil, ::String, ::Array, nil
1777
+ config_attr :lib_name, nil, ::String, nil
1778
+ config_attr :lib_version, nil, ::String, nil
1779
+ config_attr :timeout, nil, ::Numeric, nil
1780
+ config_attr :metadata, nil, ::Hash, nil
1781
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1782
+ config_attr :quota_project, nil, ::String, nil
1783
+
1784
+ # @private
1785
+ # Overrides for http bindings for the RPCs of this service
1786
+ # are only used when this service is used as mixin, and only
1787
+ # by the host service.
1788
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1789
+ config_attr :bindings_override, {}, ::Hash, nil
1790
+
1791
+ # @private
1792
+ def initialize parent_config = nil
1793
+ @parent_config = parent_config unless parent_config.nil?
1794
+
1795
+ yield self if block_given?
1796
+ end
1797
+
1798
+ ##
1799
+ # Configurations for individual RPCs
1800
+ # @return [Rpcs]
1801
+ #
1802
+ def rpcs
1803
+ @rpcs ||= begin
1804
+ parent_rpcs = nil
1805
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1806
+ Rpcs.new parent_rpcs
1807
+ end
1808
+ end
1809
+
1810
+ ##
1811
+ # Configuration RPC class for the DocumentProcessorService API.
1812
+ #
1813
+ # Includes fields providing the configuration for each RPC in this service.
1814
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1815
+ # the following configuration fields:
1816
+ #
1817
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1818
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1819
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1820
+ # include the following keys:
1821
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1822
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1823
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1824
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1825
+ # trigger a retry.
1826
+ #
1827
+ class Rpcs
1828
+ ##
1829
+ # RPC-specific configuration for `process_document`
1830
+ # @return [::Gapic::Config::Method]
1831
+ #
1832
+ attr_reader :process_document
1833
+ ##
1834
+ # RPC-specific configuration for `batch_process_documents`
1835
+ # @return [::Gapic::Config::Method]
1836
+ #
1837
+ attr_reader :batch_process_documents
1838
+ ##
1839
+ # RPC-specific configuration for `fetch_processor_types`
1840
+ # @return [::Gapic::Config::Method]
1841
+ #
1842
+ attr_reader :fetch_processor_types
1843
+ ##
1844
+ # RPC-specific configuration for `list_processor_types`
1845
+ # @return [::Gapic::Config::Method]
1846
+ #
1847
+ attr_reader :list_processor_types
1848
+ ##
1849
+ # RPC-specific configuration for `get_processor_type`
1850
+ # @return [::Gapic::Config::Method]
1851
+ #
1852
+ attr_reader :get_processor_type
1853
+ ##
1854
+ # RPC-specific configuration for `list_processors`
1855
+ # @return [::Gapic::Config::Method]
1856
+ #
1857
+ attr_reader :list_processors
1858
+ ##
1859
+ # RPC-specific configuration for `get_processor`
1860
+ # @return [::Gapic::Config::Method]
1861
+ #
1862
+ attr_reader :get_processor
1863
+ ##
1864
+ # RPC-specific configuration for `train_processor_version`
1865
+ # @return [::Gapic::Config::Method]
1866
+ #
1867
+ attr_reader :train_processor_version
1868
+ ##
1869
+ # RPC-specific configuration for `get_processor_version`
1870
+ # @return [::Gapic::Config::Method]
1871
+ #
1872
+ attr_reader :get_processor_version
1873
+ ##
1874
+ # RPC-specific configuration for `list_processor_versions`
1875
+ # @return [::Gapic::Config::Method]
1876
+ #
1877
+ attr_reader :list_processor_versions
1878
+ ##
1879
+ # RPC-specific configuration for `delete_processor_version`
1880
+ # @return [::Gapic::Config::Method]
1881
+ #
1882
+ attr_reader :delete_processor_version
1883
+ ##
1884
+ # RPC-specific configuration for `deploy_processor_version`
1885
+ # @return [::Gapic::Config::Method]
1886
+ #
1887
+ attr_reader :deploy_processor_version
1888
+ ##
1889
+ # RPC-specific configuration for `undeploy_processor_version`
1890
+ # @return [::Gapic::Config::Method]
1891
+ #
1892
+ attr_reader :undeploy_processor_version
1893
+ ##
1894
+ # RPC-specific configuration for `create_processor`
1895
+ # @return [::Gapic::Config::Method]
1896
+ #
1897
+ attr_reader :create_processor
1898
+ ##
1899
+ # RPC-specific configuration for `delete_processor`
1900
+ # @return [::Gapic::Config::Method]
1901
+ #
1902
+ attr_reader :delete_processor
1903
+ ##
1904
+ # RPC-specific configuration for `enable_processor`
1905
+ # @return [::Gapic::Config::Method]
1906
+ #
1907
+ attr_reader :enable_processor
1908
+ ##
1909
+ # RPC-specific configuration for `disable_processor`
1910
+ # @return [::Gapic::Config::Method]
1911
+ #
1912
+ attr_reader :disable_processor
1913
+ ##
1914
+ # RPC-specific configuration for `set_default_processor_version`
1915
+ # @return [::Gapic::Config::Method]
1916
+ #
1917
+ attr_reader :set_default_processor_version
1918
+ ##
1919
+ # RPC-specific configuration for `review_document`
1920
+ # @return [::Gapic::Config::Method]
1921
+ #
1922
+ attr_reader :review_document
1923
+ ##
1924
+ # RPC-specific configuration for `evaluate_processor_version`
1925
+ # @return [::Gapic::Config::Method]
1926
+ #
1927
+ attr_reader :evaluate_processor_version
1928
+ ##
1929
+ # RPC-specific configuration for `get_evaluation`
1930
+ # @return [::Gapic::Config::Method]
1931
+ #
1932
+ attr_reader :get_evaluation
1933
+ ##
1934
+ # RPC-specific configuration for `list_evaluations`
1935
+ # @return [::Gapic::Config::Method]
1936
+ #
1937
+ attr_reader :list_evaluations
1938
+
1939
+ # @private
1940
+ def initialize parent_rpcs = nil
1941
+ process_document_config = parent_rpcs.process_document if parent_rpcs.respond_to? :process_document
1942
+ @process_document = ::Gapic::Config::Method.new process_document_config
1943
+ batch_process_documents_config = parent_rpcs.batch_process_documents if parent_rpcs.respond_to? :batch_process_documents
1944
+ @batch_process_documents = ::Gapic::Config::Method.new batch_process_documents_config
1945
+ fetch_processor_types_config = parent_rpcs.fetch_processor_types if parent_rpcs.respond_to? :fetch_processor_types
1946
+ @fetch_processor_types = ::Gapic::Config::Method.new fetch_processor_types_config
1947
+ list_processor_types_config = parent_rpcs.list_processor_types if parent_rpcs.respond_to? :list_processor_types
1948
+ @list_processor_types = ::Gapic::Config::Method.new list_processor_types_config
1949
+ get_processor_type_config = parent_rpcs.get_processor_type if parent_rpcs.respond_to? :get_processor_type
1950
+ @get_processor_type = ::Gapic::Config::Method.new get_processor_type_config
1951
+ list_processors_config = parent_rpcs.list_processors if parent_rpcs.respond_to? :list_processors
1952
+ @list_processors = ::Gapic::Config::Method.new list_processors_config
1953
+ get_processor_config = parent_rpcs.get_processor if parent_rpcs.respond_to? :get_processor
1954
+ @get_processor = ::Gapic::Config::Method.new get_processor_config
1955
+ train_processor_version_config = parent_rpcs.train_processor_version if parent_rpcs.respond_to? :train_processor_version
1956
+ @train_processor_version = ::Gapic::Config::Method.new train_processor_version_config
1957
+ get_processor_version_config = parent_rpcs.get_processor_version if parent_rpcs.respond_to? :get_processor_version
1958
+ @get_processor_version = ::Gapic::Config::Method.new get_processor_version_config
1959
+ list_processor_versions_config = parent_rpcs.list_processor_versions if parent_rpcs.respond_to? :list_processor_versions
1960
+ @list_processor_versions = ::Gapic::Config::Method.new list_processor_versions_config
1961
+ delete_processor_version_config = parent_rpcs.delete_processor_version if parent_rpcs.respond_to? :delete_processor_version
1962
+ @delete_processor_version = ::Gapic::Config::Method.new delete_processor_version_config
1963
+ deploy_processor_version_config = parent_rpcs.deploy_processor_version if parent_rpcs.respond_to? :deploy_processor_version
1964
+ @deploy_processor_version = ::Gapic::Config::Method.new deploy_processor_version_config
1965
+ undeploy_processor_version_config = parent_rpcs.undeploy_processor_version if parent_rpcs.respond_to? :undeploy_processor_version
1966
+ @undeploy_processor_version = ::Gapic::Config::Method.new undeploy_processor_version_config
1967
+ create_processor_config = parent_rpcs.create_processor if parent_rpcs.respond_to? :create_processor
1968
+ @create_processor = ::Gapic::Config::Method.new create_processor_config
1969
+ delete_processor_config = parent_rpcs.delete_processor if parent_rpcs.respond_to? :delete_processor
1970
+ @delete_processor = ::Gapic::Config::Method.new delete_processor_config
1971
+ enable_processor_config = parent_rpcs.enable_processor if parent_rpcs.respond_to? :enable_processor
1972
+ @enable_processor = ::Gapic::Config::Method.new enable_processor_config
1973
+ disable_processor_config = parent_rpcs.disable_processor if parent_rpcs.respond_to? :disable_processor
1974
+ @disable_processor = ::Gapic::Config::Method.new disable_processor_config
1975
+ set_default_processor_version_config = parent_rpcs.set_default_processor_version if parent_rpcs.respond_to? :set_default_processor_version
1976
+ @set_default_processor_version = ::Gapic::Config::Method.new set_default_processor_version_config
1977
+ review_document_config = parent_rpcs.review_document if parent_rpcs.respond_to? :review_document
1978
+ @review_document = ::Gapic::Config::Method.new review_document_config
1979
+ evaluate_processor_version_config = parent_rpcs.evaluate_processor_version if parent_rpcs.respond_to? :evaluate_processor_version
1980
+ @evaluate_processor_version = ::Gapic::Config::Method.new evaluate_processor_version_config
1981
+ get_evaluation_config = parent_rpcs.get_evaluation if parent_rpcs.respond_to? :get_evaluation
1982
+ @get_evaluation = ::Gapic::Config::Method.new get_evaluation_config
1983
+ list_evaluations_config = parent_rpcs.list_evaluations if parent_rpcs.respond_to? :list_evaluations
1984
+ @list_evaluations = ::Gapic::Config::Method.new list_evaluations_config
1985
+
1986
+ yield self if block_given?
1987
+ end
1988
+ end
1989
+ end
1990
+ end
1991
+ end
1992
+ end
1993
+ end
1994
+ end
1995
+ end
1996
+ end