google-cloud-language 1.7.1 → 1.8.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: 35e563b1d74da72839e25d264364e8afc13dd0feb4f1bd24b88fc8abedfeb73e
4
- data.tar.gz: 90a22981a7883581249b5bc81b0f5a9024e407b77e8469de47910808f7a56351
3
+ metadata.gz: 3af09f2a6f18c5cade2c3e26485b1daf2a75f6b266a67c0ae153708811c4ed2c
4
+ data.tar.gz: 1282138fc154557ec9fb0f34517321785f0fffdd4768932482df74c0f1077b84
5
5
  SHA512:
6
- metadata.gz: f053673b78d3feb07d1c74c7cca1f43f8ade9149071f1d87bf844e257daef3890c8884507e2719f80b29ee67f4e796dde211a25a6c434415461e9484b9467acb
7
- data.tar.gz: cb8e5daf412358d9514737eedfafb186f10bf1395ed8cb120f2612b860a0a50a43ddd43ade6dae9ea04c2253a3078c00422dc23a02f336c9a8a737cb608ecaee
6
+ metadata.gz: 669af530f4096ba38249681a3f38e9f731578b3573fb095f6a474d2ac35b479a2f9b31dd6261fc3d7f69b9a853435efd575007545a2821fdb143f09301629e8f
7
+ data.tar.gz: ff8486c1fcc9bda8e80daad17d61112f481e34f7300eaea582567bcca3f5950e1737f8f28fff5805fc839e60870d41aab853c8fcee643146b03591c96a30d990
data/README.md CHANGED
@@ -43,9 +43,40 @@ and includes substantial interface changes. Existing code written for earlier
43
43
  versions of this library will likely require updates to use this version.
44
44
  See the {file:MIGRATING.md MIGRATING.md} document for more information.
45
45
 
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ Debug logging also requires that the versioned clients for this service be
72
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
73
+ working, try updating the versioned clients in your bundle or installed gems:
74
+ [google-cloud-language-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-language-v1/latest),
75
+ [google-cloud-language-v1beta2](https://cloud.google.com/ruby/docs/reference/google-cloud-language-v1beta2/latest).
76
+
46
77
  ## Supported Ruby Versions
47
78
 
48
- This library is supported on Ruby 2.7+.
79
+ This library is supported on Ruby 3.0+.
49
80
 
50
81
  Google provides official support for Ruby versions that are actively supported
51
82
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Language
19
- VERSION = "1.7.1".freeze
19
+ VERSION = "1.8.0".freeze
20
20
  end
21
21
  end
22
22
  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 LanguageService service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::Language.language_service_available?}.
65
+ #
61
66
  # ## About LanguageService
62
67
  #
63
68
  # Provides text analysis operations such as sentiment analysis and entity
@@ -80,6 +85,37 @@ module Google
80
85
  service_module.const_get(:Client).new(&block)
81
86
  end
82
87
 
88
+ ##
89
+ # Determines whether the LanguageService service is supported by the current client.
90
+ # If true, you can retrieve a client object by calling {Google::Cloud::Language.language_service}.
91
+ # If false, that method will raise an exception. This could happen if the given
92
+ # API version does not exist or does not support the LanguageService service,
93
+ # or if the versioned client gem needs an update to support the LanguageService service.
94
+ #
95
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
96
+ # Defaults to `:v1`.
97
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
98
+ # @return [boolean] Whether the service is available.
99
+ #
100
+ def self.language_service_available? version: :v1, transport: :grpc
101
+ require "google/cloud/language/#{version.to_s.downcase}"
102
+ package_name = Google::Cloud::Language
103
+ .constants
104
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
105
+ .first
106
+ return false unless package_name
107
+ service_module = Google::Cloud::Language.const_get package_name
108
+ return false unless service_module.const_defined? :LanguageService
109
+ service_module = service_module.const_get :LanguageService
110
+ if transport == :rest
111
+ return false unless service_module.const_defined? :Rest
112
+ service_module = service_module.const_get :Rest
113
+ end
114
+ service_module.const_defined? :Client
115
+ rescue ::LoadError
116
+ false
117
+ end
118
+
83
119
  ##
84
120
  # Configure the google-cloud-language library.
85
121
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-language
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.8.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-08-09 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 Cloud Natural Language API
105
102
  test_files: []