google-cloud-document_ai 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6493b60788527b7218abc5054aa7c701b8555eb9564c3a0419d3eb5148a6561
4
- data.tar.gz: e4d25262e1cfd5255108a0a7226dd78950c1633f6d8e3600ba597d6c8d78e8c3
3
+ metadata.gz: 0ee39d470f05e36357d4412614cfda148189cf6a17107a1efbadce9b64ac5007
4
+ data.tar.gz: b7f73db076d361b2c564733a5bc17990ed7d568bbadf6cd15251b40e06b5cc4e
5
5
  SHA512:
6
- metadata.gz: ce7c860e6a431fbb7c99159d95b6466bcfec721b8e3c765e123ece2812aec9df6c69fe1afbeb82e7a1137a487868445d83c0cf9c516def8f7caed8ac3efea0ee
7
- data.tar.gz: 8d9141f3aa694a0c72c3866010d5c3e8b5b2c7abf95021ad23f3ec2136ef0cc67618e0c8789d3449101d970aec494c044a5abce5775eb4dac31a7e201d275e89
6
+ metadata.gz: b6e828283f7a6746fcc93576542bea21c19761b01b2a377d992ba0effb6422acd48a4f939c7214797632518640b313c43cb69f502b247389df9e809cb9b616ca
7
+ data.tar.gz: f65116627cc33c429d80d0902f8cbb1cbea0fe729b9b7e28015f1f19a1b2737e5cf03e826f1cf00134de500f71aa60390145c9c64d6a4c027365172cfe54c8b0
data/README.md CHANGED
@@ -19,7 +19,7 @@ client gems:
19
19
  [google-cloud-document_ai-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest),
20
20
  [google-cloud-document_ai-v1beta3](https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1beta3/latest).
21
21
 
22
- See also the [Product Documentation](https://cloud.google.com/document-ai/)
22
+ See also the [Product Documentation](https://cloud.google.com/document-ai/docs)
23
23
  for more usage information.
24
24
 
25
25
  ## Quick Start
@@ -32,12 +32,43 @@ In order to use this library, you first need to go through the following steps:
32
32
 
33
33
  1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
34
34
  1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
35
- 1. [Enable the API.](https://console.cloud.google.com/apis/library/us-documentai.googleapis.com)
35
+ 1. [Enable the API.](https://console.cloud.google.com/apis/library/documentai.googleapis.com)
36
36
  1. {file:AUTHENTICATION.md Set up authentication.}
37
37
 
38
+ ## Debug Logging
39
+
40
+ This library comes with opt-in Debug Logging that can help you troubleshoot
41
+ your application's integration with the API. When logging is activated, key
42
+ events such as requests and responses, along with data payloads and metadata
43
+ such as headers and client configuration, are logged to the standard error
44
+ stream.
45
+
46
+ **WARNING:** Client Library Debug Logging includes your data payloads in
47
+ plaintext, which could include sensitive data such as PII for yourself or your
48
+ customers, private keys, or other security data that could be compromising if
49
+ leaked. Always practice good data hygiene with your application logs, and follow
50
+ the principle of least access. Google also recommends that Client Library Debug
51
+ Logging be enabled only temporarily during active debugging, and not used
52
+ permanently in production.
53
+
54
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
55
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
56
+ list of client library gem names. This will select the default logging behavior,
57
+ which writes logs to the standard error stream. On a local workstation, this may
58
+ result in logs appearing on the console. When running on a Google Cloud hosting
59
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
60
+ results in logs appearing alongside your application logs in the
61
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
62
+
63
+ Debug logging also requires that the versioned clients for this service be
64
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
65
+ working, try updating the versioned clients in your bundle or installed gems:
66
+ [google-cloud-document_ai-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1/latest),
67
+ [google-cloud-document_ai-v1beta3](https://cloud.google.com/ruby/docs/reference/google-cloud-document_ai-v1beta3/latest).
68
+
38
69
  ## Supported Ruby Versions
39
70
 
40
- This library is supported on Ruby 2.7+.
71
+ This library is supported on Ruby 3.0+.
41
72
 
42
73
  Google provides official support for Ruby versions that are actively supported
43
74
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module DocumentAI
23
- VERSION = "1.4.0"
23
+ VERSION = "1.5.0"
24
24
  end
25
25
  end
26
26
  end
@@ -58,6 +58,11 @@ module Google
58
58
  # You can also specify a different transport by passing `:rest` or `:grpc` in
59
59
  # the `transport` parameter.
60
60
  #
61
+ # Raises an exception if the currently installed versioned client gem for the
62
+ # given API version does not support the given transport of the DocumentProcessorService service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::DocumentAI.document_processor_service_available?}.
65
+ #
61
66
  # ## About DocumentProcessorService
62
67
  #
63
68
  # Service to call Document AI to process documents according to the
@@ -82,6 +87,37 @@ module Google
82
87
  service_module.const_get(:Client).new(&block)
83
88
  end
84
89
 
90
+ ##
91
+ # Determines whether the DocumentProcessorService service is supported by the current client.
92
+ # If true, you can retrieve a client object by calling {Google::Cloud::DocumentAI.document_processor_service}.
93
+ # If false, that method will raise an exception. This could happen if the given
94
+ # API version does not exist or does not support the DocumentProcessorService service,
95
+ # or if the versioned client gem needs an update to support the DocumentProcessorService service.
96
+ #
97
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
98
+ # Defaults to `:v1`.
99
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
100
+ # @return [boolean] Whether the service is available.
101
+ #
102
+ def self.document_processor_service_available? version: :v1, transport: :grpc
103
+ require "google/cloud/document_ai/#{version.to_s.downcase}"
104
+ package_name = Google::Cloud::DocumentAI
105
+ .constants
106
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
107
+ .first
108
+ return false unless package_name
109
+ service_module = Google::Cloud::DocumentAI.const_get package_name
110
+ return false unless service_module.const_defined? :DocumentProcessorService
111
+ service_module = service_module.const_get :DocumentProcessorService
112
+ if transport == :rest
113
+ return false unless service_module.const_defined? :Rest
114
+ service_module = service_module.const_get :Rest
115
+ end
116
+ service_module.const_defined? :Client
117
+ rescue ::LoadError
118
+ false
119
+ end
120
+
85
121
  ##
86
122
  # Configure the google-cloud-document_ai library.
87
123
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-document_ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-26 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-core
@@ -83,7 +82,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
83
82
  licenses:
84
83
  - Apache-2.0
85
84
  metadata: {}
86
- post_install_message:
87
85
  rdoc_options: []
88
86
  require_paths:
89
87
  - lib
@@ -91,15 +89,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
89
  requirements:
92
90
  - - ">="
93
91
  - !ruby/object:Gem::Version
94
- version: '2.7'
92
+ version: '3.0'
95
93
  required_rubygems_version: !ruby/object:Gem::Requirement
96
94
  requirements:
97
95
  - - ">="
98
96
  - !ruby/object:Gem::Version
99
97
  version: '0'
100
98
  requirements: []
101
- rubygems_version: 3.5.6
102
- signing_key:
99
+ rubygems_version: 3.6.2
103
100
  specification_version: 4
104
101
  summary: API Client library for the Document AI API
105
102
  test_files: []