google-cloud-web_risk-v1beta1 0.1.1 → 0.2.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc3bf4ab0278ded884f7cf84e9108da9fa5c994865d00600fb5925086a13e40e
|
4
|
+
data.tar.gz: 854b956e332d4391c5b46953609da83a51dafc913eb0efac1b2c9b0a82a1c8b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6bff6defd42e63eb6347b11a26ee11b9f7b276ef32644399043833144dc9061105ee242d9f785886be888bf3da8155a5ef0ae3745e1aae4cf1f7abe71118de0
|
7
|
+
data.tar.gz: 4ed8c9f00e8c0451371c2352f7ae7ada6cb81b1ef154e513949a37c1a2f900008e0d8040c9626b1487f0be17f200e04f9e38b87d5738395e268e8ee83ae064fd
|
data/README.md
CHANGED
@@ -18,6 +18,7 @@ In order to use this library, you first need to go through the following steps:
|
|
18
18
|
|
19
19
|
1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
20
20
|
1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
21
|
+
1. [Enable the API.](https://console.cloud.google.com/apis/library/webrisk.googleapis.com)
|
21
22
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
22
23
|
|
23
24
|
## Quick Start
|
@@ -33,6 +34,9 @@ response = client.compute_threat_list_diff request
|
|
33
34
|
View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-web_risk-v1beta1/latest)
|
34
35
|
for class and method documentation.
|
35
36
|
|
37
|
+
See also the [Product Documentation](https://cloud.google.com/web-risk)
|
38
|
+
for general usage information.
|
39
|
+
|
36
40
|
## Enabling Logging
|
37
41
|
|
38
42
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
@@ -25,24 +25,24 @@ module Google
|
|
25
25
|
module V1beta1
|
26
26
|
module WebRiskService
|
27
27
|
##
|
28
|
-
# Client for the
|
28
|
+
# Client for the WebRiskService service.
|
29
29
|
#
|
30
30
|
# Web Risk v1beta1 API defines an interface to detect malicious URLs on your
|
31
31
|
# website and in client applications.
|
32
32
|
#
|
33
33
|
class Client
|
34
34
|
# @private
|
35
|
-
attr_reader :
|
35
|
+
attr_reader :web_risk_service_stub
|
36
36
|
|
37
37
|
##
|
38
|
-
# Configure the
|
38
|
+
# Configure the WebRiskService Client class.
|
39
39
|
#
|
40
40
|
# See {::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client::Configuration}
|
41
41
|
# for a description of the configuration fields.
|
42
42
|
#
|
43
43
|
# ## Example
|
44
44
|
#
|
45
|
-
# To modify the configuration for all
|
45
|
+
# To modify the configuration for all WebRiskService clients:
|
46
46
|
#
|
47
47
|
# ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.configure do |config|
|
48
48
|
# config.timeout = 10.0
|
@@ -69,7 +69,7 @@ module Google
|
|
69
69
|
initial_delay: 0.1,
|
70
70
|
max_delay: 60.0,
|
71
71
|
multiplier: 1.3,
|
72
|
-
retry_codes: [
|
72
|
+
retry_codes: [4, 14]
|
73
73
|
}
|
74
74
|
|
75
75
|
default_config.rpcs.search_uris.timeout = 600.0
|
@@ -77,7 +77,7 @@ module Google
|
|
77
77
|
initial_delay: 0.1,
|
78
78
|
max_delay: 60.0,
|
79
79
|
multiplier: 1.3,
|
80
|
-
retry_codes: [
|
80
|
+
retry_codes: [4, 14]
|
81
81
|
}
|
82
82
|
|
83
83
|
default_config.rpcs.search_hashes.timeout = 600.0
|
@@ -85,7 +85,7 @@ module Google
|
|
85
85
|
initial_delay: 0.1,
|
86
86
|
max_delay: 60.0,
|
87
87
|
multiplier: 1.3,
|
88
|
-
retry_codes: [
|
88
|
+
retry_codes: [4, 14]
|
89
89
|
}
|
90
90
|
|
91
91
|
default_config
|
@@ -95,7 +95,7 @@ module Google
|
|
95
95
|
end
|
96
96
|
|
97
97
|
##
|
98
|
-
# Configure the
|
98
|
+
# Configure the WebRiskService Client instance.
|
99
99
|
#
|
100
100
|
# The configuration is set to the derived mode, meaning that values can be changed,
|
101
101
|
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
@@ -115,23 +115,23 @@ module Google
|
|
115
115
|
end
|
116
116
|
|
117
117
|
##
|
118
|
-
# Create a new
|
118
|
+
# Create a new WebRiskService client object.
|
119
119
|
#
|
120
120
|
# ## Examples
|
121
121
|
#
|
122
|
-
# To create a new
|
122
|
+
# To create a new WebRiskService client with the default
|
123
123
|
# configuration:
|
124
124
|
#
|
125
125
|
# client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new
|
126
126
|
#
|
127
|
-
# To create a new
|
127
|
+
# To create a new WebRiskService client with a custom
|
128
128
|
# configuration:
|
129
129
|
#
|
130
130
|
# client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config|
|
131
131
|
# config.timeout = 10.0
|
132
132
|
# end
|
133
133
|
#
|
134
|
-
# @yield [config] Configure the
|
134
|
+
# @yield [config] Configure the WebRiskService client.
|
135
135
|
# @yieldparam config [Client::Configuration]
|
136
136
|
#
|
137
137
|
def initialize
|
@@ -153,9 +153,10 @@ module Google
|
|
153
153
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
154
154
|
credentials = Credentials.new credentials, scope: @config.scope
|
155
155
|
end
|
156
|
-
@quota_project_id =
|
156
|
+
@quota_project_id = @config.quota_project
|
157
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
157
158
|
|
158
|
-
@
|
159
|
+
@web_risk_service_stub = ::Gapic::ServiceStub.new(
|
159
160
|
::Google::Cloud::WebRisk::V1beta1::WebRiskServiceV1Beta1::Stub,
|
160
161
|
credentials: credentials,
|
161
162
|
endpoint: @config.endpoint,
|
@@ -223,7 +224,7 @@ module Google
|
|
223
224
|
options.apply_defaults metadata: @config.metadata,
|
224
225
|
retry_policy: @config.retry_policy
|
225
226
|
|
226
|
-
@
|
227
|
+
@web_risk_service_stub.call_rpc :compute_threat_list_diff, request, options: options do |response, operation|
|
227
228
|
yield response, operation if block_given?
|
228
229
|
return response
|
229
230
|
end
|
@@ -285,7 +286,7 @@ module Google
|
|
285
286
|
options.apply_defaults metadata: @config.metadata,
|
286
287
|
retry_policy: @config.retry_policy
|
287
288
|
|
288
|
-
@
|
289
|
+
@web_risk_service_stub.call_rpc :search_uris, request, options: options do |response, operation|
|
289
290
|
yield response, operation if block_given?
|
290
291
|
return response
|
291
292
|
end
|
@@ -352,7 +353,7 @@ module Google
|
|
352
353
|
options.apply_defaults metadata: @config.metadata,
|
353
354
|
retry_policy: @config.retry_policy
|
354
355
|
|
355
|
-
@
|
356
|
+
@web_risk_service_stub.call_rpc :search_hashes, request, options: options do |response, operation|
|
356
357
|
yield response, operation if block_given?
|
357
358
|
return response
|
358
359
|
end
|
@@ -361,9 +362,9 @@ module Google
|
|
361
362
|
end
|
362
363
|
|
363
364
|
##
|
364
|
-
# Configuration class for the
|
365
|
+
# Configuration class for the WebRiskService API.
|
365
366
|
#
|
366
|
-
# This class represents the configuration for
|
367
|
+
# This class represents the configuration for WebRiskService,
|
367
368
|
# providing control over timeouts, retry behavior, logging, transport
|
368
369
|
# parameters, and other low-level controls. Certain parameters can also be
|
369
370
|
# applied individually to specific RPCs. See
|
@@ -436,24 +437,28 @@ module Google
|
|
436
437
|
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
437
438
|
# trigger a retry.
|
438
439
|
# @return [::Hash]
|
440
|
+
# @!attribute [rw] quota_project
|
441
|
+
# A separate project against which to charge quota.
|
442
|
+
# @return [::String]
|
439
443
|
#
|
440
444
|
class Configuration
|
441
445
|
extend ::Gapic::Config
|
442
446
|
|
443
|
-
config_attr :endpoint,
|
444
|
-
config_attr :credentials,
|
447
|
+
config_attr :endpoint, "webrisk.googleapis.com", ::String
|
448
|
+
config_attr :credentials, nil do |value|
|
445
449
|
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
446
450
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
447
451
|
allowed.any? { |klass| klass === value }
|
448
452
|
end
|
449
|
-
config_attr :scope,
|
450
|
-
config_attr :lib_name,
|
451
|
-
config_attr :lib_version,
|
452
|
-
config_attr(:channel_args,
|
453
|
-
config_attr :interceptors,
|
454
|
-
config_attr :timeout,
|
455
|
-
config_attr :metadata,
|
456
|
-
config_attr :retry_policy,
|
453
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
454
|
+
config_attr :lib_name, nil, ::String, nil
|
455
|
+
config_attr :lib_version, nil, ::String, nil
|
456
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
457
|
+
config_attr :interceptors, nil, ::Array, nil
|
458
|
+
config_attr :timeout, nil, ::Numeric, nil
|
459
|
+
config_attr :metadata, nil, ::Hash, nil
|
460
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
461
|
+
config_attr :quota_project, nil, ::String, nil
|
457
462
|
|
458
463
|
# @private
|
459
464
|
def initialize parent_config = nil
|
@@ -469,13 +474,13 @@ module Google
|
|
469
474
|
def rpcs
|
470
475
|
@rpcs ||= begin
|
471
476
|
parent_rpcs = nil
|
472
|
-
parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to?
|
477
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
|
473
478
|
Rpcs.new parent_rpcs
|
474
479
|
end
|
475
480
|
end
|
476
481
|
|
477
482
|
##
|
478
|
-
# Configuration RPC class for the
|
483
|
+
# Configuration RPC class for the WebRiskService API.
|
479
484
|
#
|
480
485
|
# Includes fields providing the configuration for each RPC in this service.
|
481
486
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
@@ -23,7 +23,7 @@ module Google
|
|
23
23
|
module WebRisk
|
24
24
|
module V1beta1
|
25
25
|
module WebRiskService
|
26
|
-
# Credentials for the
|
26
|
+
# Credentials for the WebRiskService API.
|
27
27
|
class Credentials < ::Google::Auth::Credentials
|
28
28
|
self.scope = [
|
29
29
|
"https://www.googleapis.com/auth/cloud-platform"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-web_risk-v1beta1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.4
|
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-
|
11
|
+
date: 2020-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: google-cloud-errors
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,42 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '5.
|
61
|
+
version: '5.14'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '5.
|
68
|
+
version: '5.14'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest-focus
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.1'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: minitest-rg
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '5.2'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '5.2'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: rake
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
193
|
- !ruby/object:Gem::Version
|
166
194
|
version: '0'
|
167
195
|
requirements: []
|
168
|
-
rubygems_version: 3.
|
196
|
+
rubygems_version: 3.1.3
|
169
197
|
signing_key:
|
170
198
|
specification_version: 4
|
171
199
|
summary: API Client library for the Web Risk V1beta1 API
|