google-cloud-web_risk 1.1.0 → 1.1.1
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 +4 -4
- data/MIGRATING.md +48 -0
- data/lib/google/cloud/web_risk/version.rb +1 -1
- 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: 2741793e5ba601d0e4462f549c6eb09ba3d4af736e1e75decf292c53a3928241
|
4
|
+
data.tar.gz: 71a312ca78ec23068213f3f60aadc475a4526f2cef59e2f659f9002ddbf070c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3135cfb4b1f33518f89e472d7b8422539e5d13332d67203083aa75f50a1646d23c28fbc4b9448aa83ede4e824260a944540ffe751330f5f4a43f6f1f6725c61
|
7
|
+
data.tar.gz: f87adb333824db667f56d10aeecd82fe157f422f22f8fe6164c54157a448ddbfce5aa54af235c76d1e9426cc878ec05f6a961695f5aaf57f732ccc2f96d1b299
|
data/MIGRATING.md
CHANGED
@@ -30,6 +30,10 @@ To summarize:
|
|
30
30
|
specifies whether they are required or optional. Additionally, you can pass
|
31
31
|
a proto request object instead of separate arguments. See
|
32
32
|
[Passing Arguments](#passing-arguments) for more info.
|
33
|
+
* Previously, clients reported RPC errors by raising instances of
|
34
|
+
`Google::Gax::GaxError` and its subclasses. Now, RPC exceptions are of type
|
35
|
+
`Google::Cloud::Error` and its subclasses. See
|
36
|
+
[Handling Errors](#handling-errors) for more info.
|
33
37
|
|
34
38
|
### Library Structure
|
35
39
|
|
@@ -227,3 +231,47 @@ response = client.search_uris(
|
|
227
231
|
timeout: 10.0
|
228
232
|
)
|
229
233
|
```
|
234
|
+
|
235
|
+
### Handling Errors
|
236
|
+
|
237
|
+
The client reports standard
|
238
|
+
[gRPC error codes](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md)
|
239
|
+
by raising exceptions. In the older gem, these exceptions were located in the
|
240
|
+
`Google::Gax` namespace and were subclasses of the `Google::Gax::GaxError` base
|
241
|
+
exception class, defined in the `google-gax` gem. However, these classes were
|
242
|
+
different from the standard exceptions (subclasses of `Google::Cloud::Error`)
|
243
|
+
thrown by other client libraries such as `google-cloud-storage`.
|
244
|
+
|
245
|
+
The new client library now uses the `Google::Cloud::Error` exception hierarchy,
|
246
|
+
for consistency across all the Google Cloud client libraries. In general, these
|
247
|
+
exceptions have the same name as their counterparts from older releases, but
|
248
|
+
are located in the `Google::Cloud` namespace rather than the `Google::Gax`
|
249
|
+
namespace.
|
250
|
+
|
251
|
+
Old:
|
252
|
+
```
|
253
|
+
client = Google::Cloud::Webrisk.new
|
254
|
+
|
255
|
+
uri = "http://example.com"
|
256
|
+
threat_types = [Google::Cloud::Webrisk::V1beta1::ThreatType::MALWARE]
|
257
|
+
|
258
|
+
begin
|
259
|
+
response = client.search_uris uri, threat_types
|
260
|
+
rescue Google::Gax::Error => e
|
261
|
+
# Handle exceptions that subclass Google::Gax::Error
|
262
|
+
end
|
263
|
+
```
|
264
|
+
|
265
|
+
New:
|
266
|
+
```
|
267
|
+
client = Google::Cloud::WebRisk.web_risk_service
|
268
|
+
|
269
|
+
uri = "http://example.com"
|
270
|
+
threat_types = [Google::Cloud::WebRisk::V1::ThreatType::MALWARE]
|
271
|
+
|
272
|
+
begin
|
273
|
+
response = client.search_uris uri: uri, threat_types: threat_types
|
274
|
+
rescue Google::Cloud::Error => e
|
275
|
+
# Handle exceptions that subclass Google::Cloud::Error
|
276
|
+
end
|
277
|
+
```
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-web_risk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.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: 2020-05-
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|