google-cloud-phishing_protection 0.15.2 → 0.16.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: 9fc4e1b89bdf23fa38e8c73134d3b1d8395efa20c07f33118ff490334d4efe7a
4
- data.tar.gz: 6ba076f5ef3293bb0e8462ab437d784684490527e9563f23e739a67c37dd68b7
3
+ metadata.gz: fc48681843db4a801e7ff349e7cfb1359bd01882ff96d1f768f4c5c8287dc63f
4
+ data.tar.gz: e60352ab2270a7164ff0d25ba41168d57dded1c297b1bc26a08254e3dae54292
5
5
  SHA512:
6
- metadata.gz: 4f52da76b5d1f7499ec4134d200e0ab968a483ac94c4586bfad9fc7c7ba931f895d2227adb3870bb0fb4e2d8dd1638236cd9a042113c3fc63a54719e66f43409
7
- data.tar.gz: 41019a307e7fb1842bf31b56d82fb2fe99930266c70e9bf4f48ce59a6cdcc621e77d6f108006e692b8866554cba792fae9e5d676f037c82e5df87488b7b7b63e
6
+ metadata.gz: 02c313ed30a940c5a936f3c138351c83aec8ad8121397b908c7e07f2fa1a6ca3fa0c989a6f95db3847d94db0a779ed69a57f8e693c6c58609707ef57a8439e44
7
+ data.tar.gz: bdae98751fe08299bd6524f4a20091431833a2722994107f823eda3537fcb2f996d38e5dd56718f486c1e40942df530102dcdf0ce49c923d9f81d58d4ea36723
data/README.md CHANGED
@@ -42,9 +42,39 @@ and includes substantial interface changes. Existing code written for earlier
42
42
  versions of this library will likely require updates to use this version.
43
43
  See the {file:MIGRATING.md MIGRATING.md} document for more information.
44
44
 
45
+ ## Debug Logging
46
+
47
+ This library comes with opt-in Debug Logging that can help you troubleshoot
48
+ your application's integration with the API. When logging is activated, key
49
+ events such as requests and responses, along with data payloads and metadata
50
+ such as headers and client configuration, are logged to the standard error
51
+ stream.
52
+
53
+ **WARNING:** Client Library Debug Logging includes your data payloads in
54
+ plaintext, which could include sensitive data such as PII for yourself or your
55
+ customers, private keys, or other security data that could be compromising if
56
+ leaked. Always practice good data hygiene with your application logs, and follow
57
+ the principle of least access. Google also recommends that Client Library Debug
58
+ Logging be enabled only temporarily during active debugging, and not used
59
+ permanently in production.
60
+
61
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
62
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
63
+ list of client library gem names. This will select the default logging behavior,
64
+ which writes logs to the standard error stream. On a local workstation, this may
65
+ result in logs appearing on the console. When running on a Google Cloud hosting
66
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
67
+ results in logs appearing alongside your application logs in the
68
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
69
+
70
+ Debug logging also requires that the versioned clients for this service be
71
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
72
+ working, try updating the versioned clients in your bundle or installed gems:
73
+ [google-cloud-phishing_protection-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-phishing_protection-v1beta1/latest).
74
+
45
75
  ## Supported Ruby Versions
46
76
 
47
- This library is supported on Ruby 2.7+.
77
+ This library is supported on Ruby 3.0+.
48
78
 
49
79
  Google provides official support for Ruby versions that are actively supported
50
80
  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 PhishingProtection
23
- VERSION = "0.15.2"
23
+ VERSION = "0.16.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 PhishingProtectionService service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::PhishingProtection.phishing_protection_service_available?}.
65
+ #
61
66
  # ## About PhishingProtectionService
62
67
  #
63
68
  # Service to report phishing URIs.
@@ -79,6 +84,37 @@ module Google
79
84
  service_module.const_get(:Client).new(&block)
80
85
  end
81
86
 
87
+ ##
88
+ # Determines whether the PhishingProtectionService service is supported by the current client.
89
+ # If true, you can retrieve a client object by calling {Google::Cloud::PhishingProtection.phishing_protection_service}.
90
+ # If false, that method will raise an exception. This could happen if the given
91
+ # API version does not exist or does not support the PhishingProtectionService service,
92
+ # or if the versioned client gem needs an update to support the PhishingProtectionService service.
93
+ #
94
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
95
+ # Defaults to `:v1beta1`.
96
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
97
+ # @return [boolean] Whether the service is available.
98
+ #
99
+ def self.phishing_protection_service_available? version: :v1beta1, transport: :grpc
100
+ require "google/cloud/phishing_protection/#{version.to_s.downcase}"
101
+ package_name = Google::Cloud::PhishingProtection
102
+ .constants
103
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
104
+ .first
105
+ return false unless package_name
106
+ service_module = Google::Cloud::PhishingProtection.const_get package_name
107
+ return false unless service_module.const_defined? :PhishingProtectionService
108
+ service_module = service_module.const_get :PhishingProtectionService
109
+ if transport == :rest
110
+ return false unless service_module.const_defined? :Rest
111
+ service_module = service_module.const_get :Rest
112
+ end
113
+ service_module.const_defined? :Client
114
+ rescue ::LoadError
115
+ false
116
+ end
117
+
82
118
  ##
83
119
  # Configure the google-cloud-phishing_protection library.
84
120
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-phishing_protection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.2
4
+ version: 0.16.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
@@ -65,7 +64,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
65
64
  licenses:
66
65
  - Apache-2.0
67
66
  metadata: {}
68
- post_install_message:
69
67
  rdoc_options: []
70
68
  require_paths:
71
69
  - lib
@@ -73,15 +71,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
73
71
  requirements:
74
72
  - - ">="
75
73
  - !ruby/object:Gem::Version
76
- version: '2.7'
74
+ version: '3.0'
77
75
  required_rubygems_version: !ruby/object:Gem::Requirement
78
76
  requirements:
79
77
  - - ">="
80
78
  - !ruby/object:Gem::Version
81
79
  version: '0'
82
80
  requirements: []
83
- rubygems_version: 3.5.6
84
- signing_key:
81
+ rubygems_version: 3.6.2
85
82
  specification_version: 4
86
83
  summary: API Client library for the Phishing Protection API
87
84
  test_files: []