google-cloud-document_ai-v1beta3 0.13.0 → 0.14.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f73c064f8aeb55219eabce72ddea4e6878bb6cb9e509322f06bddda3d0372bc
4
- data.tar.gz: 8ff59c1e1afcacbad59be672ecf1008085d184fac33c4ec4f4139f86acd18cac
3
+ metadata.gz: 650cea67e4769baacc82734ac1c7513dfb44dd66f5b1a0f5dcacb1004afceefb
4
+ data.tar.gz: 64eff21575a82eb59761a3106e331fac1f695a19481706f23bdf5090453cfc43
5
5
  SHA512:
6
- metadata.gz: ea14acb6b93210b7e0e755dcdc3e10763f6b24208fd21d852d2ddd41fe6ec028f44d40ba5ac4e00473f50b1d6d8dcb854c963cd8f9e8526a0168aec5dd687b01
7
- data.tar.gz: 295a33772ea212a8abdbcfc4eddbb1a984b3cf0782e64f7ab35a214daf15249982e2b532d58f127fc20a47af3efa71cee6c98e4f7e8a51fe7c54631251438497
6
+ metadata.gz: b6d068b41fde80dc672fbcac3ffe1f93cd9c58607f3f93e74245c24abacac36c867a2ea1750e4a4002be7494a22654f8e0a504b81f7f06876da4ac589780d760
7
+ data.tar.gz: 15468d06286b4e322096d32a703c2f5233c83e1fff08df6fcc697057bd9776739e1e0dbf343672e45fc81bee6269428e69049881a28143a1e823ac7a68fe3aef
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
@@ -225,6 +225,8 @@ module Google
225
225
  # false.
226
226
  # @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
227
227
  # Specifies which fields to include in ProcessResponse's document.
228
+ # Only supports top level document and pages field so it must be in the form
229
+ # of `{document_field_name}` or `pages.{page_field_name}`.
228
230
  #
229
231
  # @yield [response, operation] Access the result along with the RPC operation
230
232
  # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse]
@@ -772,6 +774,112 @@ module Google
772
774
  raise ::Google::Cloud::Error.from_error(e)
773
775
  end
774
776
 
777
+ ##
778
+ # Trains a new processor version.
779
+ # Operation metadata is returned as
780
+ # cloud_documentai_core.TrainProcessorVersionMetadata.
781
+ #
782
+ # @overload train_processor_version(request, options = nil)
783
+ # Pass arguments to `train_processor_version` via a request object, either of type
784
+ # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest} or an equivalent Hash.
785
+ #
786
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Hash]
787
+ # A request object representing the call parameters. Required. To specify no
788
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
789
+ # @param options [::Gapic::CallOptions, ::Hash]
790
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
791
+ #
792
+ # @overload train_processor_version(parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil)
793
+ # Pass arguments to `train_processor_version` via keyword arguments. Note that at
794
+ # least one keyword argument is required. To specify no parameters, or to keep all
795
+ # the default parameter values, pass an empty Hash as a request object (see above).
796
+ #
797
+ # @param parent [::String]
798
+ # Required. The parent (project, location and processor) to create the new version for.
799
+ # Format: `projects/{project}/locations/{location}/processors/{processor}`.
800
+ # @param processor_version [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion, ::Hash]
801
+ # Required. The processor version to be created.
802
+ # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash]
803
+ # Optional. The schema the processor version will be trained with.
804
+ # @param input_data [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData, ::Hash]
805
+ # Optional. The input data used to train the `ProcessorVersion`.
806
+ # @param base_processor_version [::String]
807
+ # Optional. The processor version to use as a base for training. This processor version
808
+ # must be a child of `parent`. Format:
809
+ # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
810
+ #
811
+ # @yield [response, operation] Access the result along with the RPC operation
812
+ # @yieldparam response [::Gapic::Operation]
813
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
814
+ #
815
+ # @return [::Gapic::Operation]
816
+ #
817
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
818
+ #
819
+ # @example Basic example
820
+ # require "google/cloud/document_ai/v1beta3"
821
+ #
822
+ # # Create a client object. The client can be reused for multiple calls.
823
+ # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
824
+ #
825
+ # # Create a request. To set request fields, pass in keyword arguments.
826
+ # request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new
827
+ #
828
+ # # Call the train_processor_version method.
829
+ # result = client.train_processor_version request
830
+ #
831
+ # # The returned object is of type Gapic::Operation. You can use this
832
+ # # object to check the status of an operation, cancel it, or wait
833
+ # # for results. Here is how to block until completion:
834
+ # result.wait_until_done! timeout: 60
835
+ # if result.response?
836
+ # p result.response
837
+ # else
838
+ # puts "Error!"
839
+ # end
840
+ #
841
+ def train_processor_version request, options = nil
842
+ raise ::ArgumentError, "request must be provided" if request.nil?
843
+
844
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest
845
+
846
+ # Converts hash and nil to an options object
847
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
848
+
849
+ # Customize the options with defaults
850
+ metadata = @config.rpcs.train_processor_version.metadata.to_h
851
+
852
+ # Set x-goog-api-client and x-goog-user-project headers
853
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
854
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
855
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
856
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
857
+
858
+ header_params = {}
859
+ if request.parent
860
+ header_params["parent"] = request.parent
861
+ end
862
+
863
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
864
+ metadata[:"x-goog-request-params"] ||= request_params_header
865
+
866
+ options.apply_defaults timeout: @config.rpcs.train_processor_version.timeout,
867
+ metadata: metadata,
868
+ retry_policy: @config.rpcs.train_processor_version.retry_policy
869
+
870
+ options.apply_defaults timeout: @config.timeout,
871
+ metadata: @config.metadata,
872
+ retry_policy: @config.retry_policy
873
+
874
+ @document_processor_service_stub.call_rpc :train_processor_version, request, options: options do |response, operation|
875
+ response = ::Gapic::Operation.new response, @operations_client, options: options
876
+ yield response, operation if block_given?
877
+ return response
878
+ end
879
+ rescue ::GRPC::BadStatus => e
880
+ raise ::Google::Cloud::Error.from_error(e)
881
+ end
882
+
775
883
  ##
776
884
  # Gets a processor version detail.
777
885
  #
@@ -1811,6 +1919,290 @@ module Google
1811
1919
  raise ::Google::Cloud::Error.from_error(e)
1812
1920
  end
1813
1921
 
1922
+ ##
1923
+ # Evaluates a ProcessorVersion against annotated documents, producing an
1924
+ # Evaluation.
1925
+ #
1926
+ # @overload evaluate_processor_version(request, options = nil)
1927
+ # Pass arguments to `evaluate_processor_version` via a request object, either of type
1928
+ # {::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest} or an equivalent Hash.
1929
+ #
1930
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Hash]
1931
+ # A request object representing the call parameters. Required. To specify no
1932
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1933
+ # @param options [::Gapic::CallOptions, ::Hash]
1934
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1935
+ #
1936
+ # @overload evaluate_processor_version(processor_version: nil, evaluation_documents: nil)
1937
+ # Pass arguments to `evaluate_processor_version` via keyword arguments. Note that at
1938
+ # least one keyword argument is required. To specify no parameters, or to keep all
1939
+ # the default parameter values, pass an empty Hash as a request object (see above).
1940
+ #
1941
+ # @param processor_version [::String]
1942
+ # Required. The resource name of the {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to evaluate.
1943
+ # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
1944
+ # @param evaluation_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash]
1945
+ # Optional. The documents used in the evaluation. If unspecified, use the processor's
1946
+ # dataset as evaluation input.
1947
+ #
1948
+ # @yield [response, operation] Access the result along with the RPC operation
1949
+ # @yieldparam response [::Gapic::Operation]
1950
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1951
+ #
1952
+ # @return [::Gapic::Operation]
1953
+ #
1954
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1955
+ #
1956
+ # @example Basic example
1957
+ # require "google/cloud/document_ai/v1beta3"
1958
+ #
1959
+ # # Create a client object. The client can be reused for multiple calls.
1960
+ # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
1961
+ #
1962
+ # # Create a request. To set request fields, pass in keyword arguments.
1963
+ # request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new
1964
+ #
1965
+ # # Call the evaluate_processor_version method.
1966
+ # result = client.evaluate_processor_version request
1967
+ #
1968
+ # # The returned object is of type Gapic::Operation. You can use this
1969
+ # # object to check the status of an operation, cancel it, or wait
1970
+ # # for results. Here is how to block until completion:
1971
+ # result.wait_until_done! timeout: 60
1972
+ # if result.response?
1973
+ # p result.response
1974
+ # else
1975
+ # puts "Error!"
1976
+ # end
1977
+ #
1978
+ def evaluate_processor_version request, options = nil
1979
+ raise ::ArgumentError, "request must be provided" if request.nil?
1980
+
1981
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest
1982
+
1983
+ # Converts hash and nil to an options object
1984
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1985
+
1986
+ # Customize the options with defaults
1987
+ metadata = @config.rpcs.evaluate_processor_version.metadata.to_h
1988
+
1989
+ # Set x-goog-api-client and x-goog-user-project headers
1990
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1991
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1992
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
1993
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1994
+
1995
+ header_params = {}
1996
+ if request.processor_version
1997
+ header_params["processor_version"] = request.processor_version
1998
+ end
1999
+
2000
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2001
+ metadata[:"x-goog-request-params"] ||= request_params_header
2002
+
2003
+ options.apply_defaults timeout: @config.rpcs.evaluate_processor_version.timeout,
2004
+ metadata: metadata,
2005
+ retry_policy: @config.rpcs.evaluate_processor_version.retry_policy
2006
+
2007
+ options.apply_defaults timeout: @config.timeout,
2008
+ metadata: @config.metadata,
2009
+ retry_policy: @config.retry_policy
2010
+
2011
+ @document_processor_service_stub.call_rpc :evaluate_processor_version, request, options: options do |response, operation|
2012
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2013
+ yield response, operation if block_given?
2014
+ return response
2015
+ end
2016
+ rescue ::GRPC::BadStatus => e
2017
+ raise ::Google::Cloud::Error.from_error(e)
2018
+ end
2019
+
2020
+ ##
2021
+ # Retrieves a specific evaluation.
2022
+ #
2023
+ # @overload get_evaluation(request, options = nil)
2024
+ # Pass arguments to `get_evaluation` via a request object, either of type
2025
+ # {::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest} or an equivalent Hash.
2026
+ #
2027
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Hash]
2028
+ # A request object representing the call parameters. Required. To specify no
2029
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2030
+ # @param options [::Gapic::CallOptions, ::Hash]
2031
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2032
+ #
2033
+ # @overload get_evaluation(name: nil)
2034
+ # Pass arguments to `get_evaluation` via keyword arguments. Note that at
2035
+ # least one keyword argument is required. To specify no parameters, or to keep all
2036
+ # the default parameter values, pass an empty Hash as a request object (see above).
2037
+ #
2038
+ # @param name [::String]
2039
+ # Required. The resource name of the {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get.
2040
+ # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
2041
+ #
2042
+ # @yield [response, operation] Access the result along with the RPC operation
2043
+ # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Evaluation]
2044
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2045
+ #
2046
+ # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation]
2047
+ #
2048
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2049
+ #
2050
+ # @example Basic example
2051
+ # require "google/cloud/document_ai/v1beta3"
2052
+ #
2053
+ # # Create a client object. The client can be reused for multiple calls.
2054
+ # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
2055
+ #
2056
+ # # Create a request. To set request fields, pass in keyword arguments.
2057
+ # request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new
2058
+ #
2059
+ # # Call the get_evaluation method.
2060
+ # result = client.get_evaluation request
2061
+ #
2062
+ # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation.
2063
+ # p result
2064
+ #
2065
+ def get_evaluation request, options = nil
2066
+ raise ::ArgumentError, "request must be provided" if request.nil?
2067
+
2068
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest
2069
+
2070
+ # Converts hash and nil to an options object
2071
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2072
+
2073
+ # Customize the options with defaults
2074
+ metadata = @config.rpcs.get_evaluation.metadata.to_h
2075
+
2076
+ # Set x-goog-api-client and x-goog-user-project headers
2077
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2078
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2079
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
2080
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2081
+
2082
+ header_params = {}
2083
+ if request.name
2084
+ header_params["name"] = request.name
2085
+ end
2086
+
2087
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2088
+ metadata[:"x-goog-request-params"] ||= request_params_header
2089
+
2090
+ options.apply_defaults timeout: @config.rpcs.get_evaluation.timeout,
2091
+ metadata: metadata,
2092
+ retry_policy: @config.rpcs.get_evaluation.retry_policy
2093
+
2094
+ options.apply_defaults timeout: @config.timeout,
2095
+ metadata: @config.metadata,
2096
+ retry_policy: @config.retry_policy
2097
+
2098
+ @document_processor_service_stub.call_rpc :get_evaluation, request, options: options do |response, operation|
2099
+ yield response, operation if block_given?
2100
+ return response
2101
+ end
2102
+ rescue ::GRPC::BadStatus => e
2103
+ raise ::Google::Cloud::Error.from_error(e)
2104
+ end
2105
+
2106
+ ##
2107
+ # Retrieves a set of evaluations for a given processor version.
2108
+ #
2109
+ # @overload list_evaluations(request, options = nil)
2110
+ # Pass arguments to `list_evaluations` via a request object, either of type
2111
+ # {::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest} or an equivalent Hash.
2112
+ #
2113
+ # @param request [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Hash]
2114
+ # A request object representing the call parameters. Required. To specify no
2115
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2116
+ # @param options [::Gapic::CallOptions, ::Hash]
2117
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2118
+ #
2119
+ # @overload list_evaluations(parent: nil, page_size: nil, page_token: nil)
2120
+ # Pass arguments to `list_evaluations` via keyword arguments. Note that at
2121
+ # least one keyword argument is required. To specify no parameters, or to keep all
2122
+ # the default parameter values, pass an empty Hash as a request object (see above).
2123
+ #
2124
+ # @param parent [::String]
2125
+ # Required. The resource name of the {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to list evaluations for.
2126
+ # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
2127
+ # @param page_size [::Integer]
2128
+ # The standard list page size.
2129
+ # If unspecified, at most 5 evaluations will be returned.
2130
+ # The maximum value is 100; values above 100 will be coerced to 100.
2131
+ # @param page_token [::String]
2132
+ # A page token, received from a previous `ListEvaluations` call.
2133
+ # Provide this to retrieve the subsequent page.
2134
+ #
2135
+ # @yield [response, operation] Access the result along with the RPC operation
2136
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>]
2137
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2138
+ #
2139
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>]
2140
+ #
2141
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2142
+ #
2143
+ # @example Basic example
2144
+ # require "google/cloud/document_ai/v1beta3"
2145
+ #
2146
+ # # Create a client object. The client can be reused for multiple calls.
2147
+ # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new
2148
+ #
2149
+ # # Create a request. To set request fields, pass in keyword arguments.
2150
+ # request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new
2151
+ #
2152
+ # # Call the list_evaluations method.
2153
+ # result = client.list_evaluations request
2154
+ #
2155
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2156
+ # # iterate over all elements by calling #each, and the enumerable
2157
+ # # will lazily make API calls to fetch subsequent pages. Other
2158
+ # # methods are also available for managing paging directly.
2159
+ # result.each do |response|
2160
+ # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation.
2161
+ # p response
2162
+ # end
2163
+ #
2164
+ def list_evaluations request, options = nil
2165
+ raise ::ArgumentError, "request must be provided" if request.nil?
2166
+
2167
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest
2168
+
2169
+ # Converts hash and nil to an options object
2170
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2171
+
2172
+ # Customize the options with defaults
2173
+ metadata = @config.rpcs.list_evaluations.metadata.to_h
2174
+
2175
+ # Set x-goog-api-client and x-goog-user-project headers
2176
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2177
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2178
+ gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION
2179
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2180
+
2181
+ header_params = {}
2182
+ if request.parent
2183
+ header_params["parent"] = request.parent
2184
+ end
2185
+
2186
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2187
+ metadata[:"x-goog-request-params"] ||= request_params_header
2188
+
2189
+ options.apply_defaults timeout: @config.rpcs.list_evaluations.timeout,
2190
+ metadata: metadata,
2191
+ retry_policy: @config.rpcs.list_evaluations.retry_policy
2192
+
2193
+ options.apply_defaults timeout: @config.timeout,
2194
+ metadata: @config.metadata,
2195
+ retry_policy: @config.retry_policy
2196
+
2197
+ @document_processor_service_stub.call_rpc :list_evaluations, request, options: options do |response, operation|
2198
+ response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_evaluations, request, response, operation, options
2199
+ yield response, operation if block_given?
2200
+ return response
2201
+ end
2202
+ rescue ::GRPC::BadStatus => e
2203
+ raise ::Google::Cloud::Error.from_error(e)
2204
+ end
2205
+
1814
2206
  ##
1815
2207
  # Configuration class for the DocumentProcessorService API.
1816
2208
  #
@@ -1977,6 +2369,11 @@ module Google
1977
2369
  #
1978
2370
  attr_reader :get_processor
1979
2371
  ##
2372
+ # RPC-specific configuration for `train_processor_version`
2373
+ # @return [::Gapic::Config::Method]
2374
+ #
2375
+ attr_reader :train_processor_version
2376
+ ##
1980
2377
  # RPC-specific configuration for `get_processor_version`
1981
2378
  # @return [::Gapic::Config::Method]
1982
2379
  #
@@ -2031,6 +2428,21 @@ module Google
2031
2428
  # @return [::Gapic::Config::Method]
2032
2429
  #
2033
2430
  attr_reader :review_document
2431
+ ##
2432
+ # RPC-specific configuration for `evaluate_processor_version`
2433
+ # @return [::Gapic::Config::Method]
2434
+ #
2435
+ attr_reader :evaluate_processor_version
2436
+ ##
2437
+ # RPC-specific configuration for `get_evaluation`
2438
+ # @return [::Gapic::Config::Method]
2439
+ #
2440
+ attr_reader :get_evaluation
2441
+ ##
2442
+ # RPC-specific configuration for `list_evaluations`
2443
+ # @return [::Gapic::Config::Method]
2444
+ #
2445
+ attr_reader :list_evaluations
2034
2446
 
2035
2447
  # @private
2036
2448
  def initialize parent_rpcs = nil
@@ -2046,6 +2458,8 @@ module Google
2046
2458
  @list_processors = ::Gapic::Config::Method.new list_processors_config
2047
2459
  get_processor_config = parent_rpcs.get_processor if parent_rpcs.respond_to? :get_processor
2048
2460
  @get_processor = ::Gapic::Config::Method.new get_processor_config
2461
+ train_processor_version_config = parent_rpcs.train_processor_version if parent_rpcs.respond_to? :train_processor_version
2462
+ @train_processor_version = ::Gapic::Config::Method.new train_processor_version_config
2049
2463
  get_processor_version_config = parent_rpcs.get_processor_version if parent_rpcs.respond_to? :get_processor_version
2050
2464
  @get_processor_version = ::Gapic::Config::Method.new get_processor_version_config
2051
2465
  list_processor_versions_config = parent_rpcs.list_processor_versions if parent_rpcs.respond_to? :list_processor_versions
@@ -2068,6 +2482,12 @@ module Google
2068
2482
  @set_default_processor_version = ::Gapic::Config::Method.new set_default_processor_version_config
2069
2483
  review_document_config = parent_rpcs.review_document if parent_rpcs.respond_to? :review_document
2070
2484
  @review_document = ::Gapic::Config::Method.new review_document_config
2485
+ evaluate_processor_version_config = parent_rpcs.evaluate_processor_version if parent_rpcs.respond_to? :evaluate_processor_version
2486
+ @evaluate_processor_version = ::Gapic::Config::Method.new evaluate_processor_version_config
2487
+ get_evaluation_config = parent_rpcs.get_evaluation if parent_rpcs.respond_to? :get_evaluation
2488
+ @get_evaluation = ::Gapic::Config::Method.new get_evaluation_config
2489
+ list_evaluations_config = parent_rpcs.list_evaluations if parent_rpcs.respond_to? :list_evaluations
2490
+ @list_evaluations = ::Gapic::Config::Method.new list_evaluations_config
2071
2491
 
2072
2492
  yield self if block_given?
2073
2493
  end
@@ -24,6 +24,29 @@ module Google
24
24
  module DocumentProcessorService
25
25
  # Path helper methods for the DocumentProcessorService API.
26
26
  module Paths
27
+ ##
28
+ # Create a fully-qualified Evaluation resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param processor [String]
37
+ # @param processor_version [String]
38
+ # @param evaluation [String]
39
+ #
40
+ # @return [::String]
41
+ def evaluation_path project:, location:, processor:, processor_version:, evaluation:
42
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
43
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
44
+ raise ::ArgumentError, "processor cannot contain /" if processor.to_s.include? "/"
45
+ raise ::ArgumentError, "processor_version cannot contain /" if processor_version.to_s.include? "/"
46
+
47
+ "projects/#{project}/locations/#{location}/processors/#{processor}/processorVersions/#{processor_version}/evaluations/#{evaluation}"
48
+ end
49
+
27
50
  ##
28
51
  # Create a fully-qualified HumanReviewConfig resource string.
29
52
  #
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module DocumentAI
23
23
  module V1beta3
24
- VERSION = "0.13.0"
24
+ VERSION = "0.14.0"
25
25
  end
26
26
  end
27
27
  end
@@ -3,6 +3,8 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
+ require 'google/protobuf/field_mask_pb'
7
+
6
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
9
  add_file("google/cloud/documentai/v1beta3/document_io.proto", :syntax => :proto3) do
8
10
  add_message "google.cloud.documentai.v1beta3.RawDocument" do
@@ -32,6 +34,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
32
34
  end
33
35
  add_message "google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig" do
34
36
  optional :gcs_uri, :string, 1
37
+ optional :field_mask, :message, 2, "google.protobuf.FieldMask"
35
38
  end
36
39
  end
37
40
  end
@@ -45,6 +45,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
45
45
  optional :text_style, :string, 5
46
46
  optional :text_decoration, :string, 6
47
47
  optional :font_size, :message, 7, "google.cloud.documentai.v1beta3.Document.Style.FontSize"
48
+ optional :font_family, :string, 8
48
49
  end
49
50
  add_message "google.cloud.documentai.v1beta3.Document.Style.FontSize" do
50
51
  optional :size, :float, 1
@@ -66,6 +67,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
66
67
  repeated :form_fields, :message, 11, "google.cloud.documentai.v1beta3.Document.Page.FormField"
67
68
  repeated :symbols, :message, 12, "google.cloud.documentai.v1beta3.Document.Page.Symbol"
68
69
  repeated :detected_barcodes, :message, 15, "google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode"
70
+ optional :image_quality_scores, :message, 17, "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores"
69
71
  optional :provenance, :message, 16, "google.cloud.documentai.v1beta3.Document.Provenance"
70
72
  end
71
73
  add_message "google.cloud.documentai.v1beta3.Document.Page.Dimension" do
@@ -142,6 +144,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
142
144
  repeated :header_rows, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.Table.TableRow"
143
145
  repeated :body_rows, :message, 3, "google.cloud.documentai.v1beta3.Document.Page.Table.TableRow"
144
146
  repeated :detected_languages, :message, 4, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage"
147
+ optional :provenance, :message, 5, "google.cloud.documentai.v1beta3.Document.Provenance"
145
148
  end
146
149
  add_message "google.cloud.documentai.v1beta3.Document.Page.Table.TableRow" do
147
150
  repeated :cells, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Table.TableCell"
@@ -170,6 +173,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
170
173
  optional :language_code, :string, 1
171
174
  optional :confidence, :float, 2
172
175
  end
176
+ add_message "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores" do
177
+ optional :quality_score, :float, 1
178
+ repeated :detected_defects, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect"
179
+ end
180
+ add_message "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect" do
181
+ optional :type, :string, 1
182
+ optional :confidence, :float, 2
183
+ end
173
184
  add_message "google.cloud.documentai.v1beta3.Document.Entity" do
174
185
  optional :text_anchor, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor"
175
186
  optional :type, :string, 2
@@ -299,6 +310,8 @@ module Google
299
310
  Document::Page::FormField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.FormField").msgclass
300
311
  Document::Page::DetectedBarcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode").msgclass
301
312
  Document::Page::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage").msgclass
313
+ Document::Page::ImageQualityScores = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores").msgclass
314
+ Document::Page::ImageQualityScores::DetectedDefect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect").msgclass
302
315
  Document::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity").msgclass
303
316
  Document::Entity::NormalizedValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue").msgclass
304
317
  Document::EntityRelation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.EntityRelation").msgclass