google-cloud-document_ai-v1 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +8 -8
- data/README.md +1 -1
- data/lib/google/cloud/document_ai/v1/document_processor_service/client.rb +4 -13
- data/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb +1 -1
- data/lib/google/cloud/document_ai/v1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c76bae9ab43098fb0c7888768b9d8e174fe3d8ca18b2b04fc54185ee9219063
|
4
|
+
data.tar.gz: 23cd0824cb97cce35b1f1601c91826e72df1b354496ddd36329bac4578129030
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af9d089a4d4ec7e4b006742271c403ba91db1ec498e7fdccdae37654dda3ec108e4ee5c32dba6ebf29493258cdaccdacc6911d25d08452ec517f7671b56b395c
|
7
|
+
data.tar.gz: 51b72ac7f9bbd83dacef74292630d12d92c6474cd733cb7f11b29eefa72034a620b0c20187de5e035cb418a60252f299d1b9eeabc444c1d71f800172b73738da
|
data/AUTHENTICATION.md
CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-document_ai-v1
|
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
67
|
{::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Credentials}):
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
* `DOCUMENT_AI_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
|
+
* `DOCUMENT_AI_KEYFILE` - Path to JSON file, or JSON contents
|
71
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
72
|
+
* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
73
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
74
74
|
|
75
75
|
```ruby
|
76
76
|
require "google/cloud/document_ai/v1"
|
@@ -82,8 +82,8 @@ client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new
|
|
82
82
|
|
83
83
|
### Configuration
|
84
84
|
|
85
|
-
The **Credentials JSON** can be configured instead of
|
86
|
-
environment
|
85
|
+
The path to the **Credentials JSON** file can be configured instead of storing
|
86
|
+
it in an environment variable. Either on an individual client initialization:
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/document_ai/v1"
|
@@ -93,7 +93,7 @@ client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new d
|
|
93
93
|
end
|
94
94
|
```
|
95
95
|
|
96
|
-
Or
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/document_ai/v1"
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
|
|
33
33
|
require "google/cloud/document_ai/v1"
|
34
34
|
|
35
35
|
client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new
|
36
|
-
request =
|
36
|
+
request = ::Google::Cloud::DocumentAI::V1::ProcessRequest.new # (request fields as keyword arguments...)
|
37
37
|
response = client.process_document request
|
38
38
|
```
|
39
39
|
|
@@ -70,26 +70,17 @@ module Google
|
|
70
70
|
|
71
71
|
default_config.rpcs.process_document.timeout = 120.0
|
72
72
|
default_config.rpcs.process_document.retry_policy = {
|
73
|
-
initial_delay: 0.1,
|
74
|
-
max_delay: 60.0,
|
75
|
-
multiplier: 1.3,
|
76
|
-
retry_codes: [4, 14]
|
73
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
77
74
|
}
|
78
75
|
|
79
76
|
default_config.rpcs.batch_process_documents.timeout = 120.0
|
80
77
|
default_config.rpcs.batch_process_documents.retry_policy = {
|
81
|
-
initial_delay: 0.1,
|
82
|
-
max_delay: 60.0,
|
83
|
-
multiplier: 1.3,
|
84
|
-
retry_codes: [4, 14]
|
78
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
85
79
|
}
|
86
80
|
|
87
81
|
default_config.rpcs.review_document.timeout = 120.0
|
88
82
|
default_config.rpcs.review_document.retry_policy = {
|
89
|
-
initial_delay: 0.1,
|
90
|
-
max_delay: 60.0,
|
91
|
-
multiplier: 1.3,
|
92
|
-
retry_codes: [4, 14]
|
83
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
93
84
|
}
|
94
85
|
|
95
86
|
default_config
|
@@ -160,7 +151,7 @@ module Google
|
|
160
151
|
!@config.endpoint.split(".").first.include?("-")
|
161
152
|
credentials ||= Credentials.default scope: @config.scope,
|
162
153
|
enable_self_signed_jwt: enable_self_signed_jwt
|
163
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
154
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
164
155
|
credentials = Credentials.new credentials, scope: @config.scope
|
165
156
|
end
|
166
157
|
@quota_project_id = @config.quota_project
|
@@ -82,7 +82,7 @@ module Google
|
|
82
82
|
# Create credentials
|
83
83
|
credentials = @config.credentials
|
84
84
|
credentials ||= Credentials.default scope: @config.scope
|
85
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
85
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
86
86
|
credentials = Credentials.new credentials, scope: @config.scope
|
87
87
|
end
|
88
88
|
@quota_project_id = @config.quota_project
|
@@ -60,6 +60,12 @@ module Google
|
|
60
60
|
# in any arbitrary order, rather than the order the user originally
|
61
61
|
# provided. Additionally, the list's order may or may not be stable.
|
62
62
|
UNORDERED_LIST = 6
|
63
|
+
|
64
|
+
# Denotes that this field returns a non-empty default value if not set.
|
65
|
+
# This indicates that if the user provides the empty value in a request,
|
66
|
+
# a non-empty value will be returned. The user will not be aware of what
|
67
|
+
# non-empty value to expect.
|
68
|
+
NON_EMPTY_DEFAULT = 7
|
63
69
|
end
|
64
70
|
end
|
65
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-document_ai-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|