google-cloud-phishing_protection-v1beta1 0.3.0 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +8 -8
- data/README.md +1 -1
- data/lib/google/cloud/phishing_protection/v1beta1/phishing_protection_service/client.rb +53 -41
- data/lib/google/cloud/phishing_protection/v1beta1/version.rb +1 -1
- data/lib/google/cloud/phishingprotection/v1beta1/phishingprotection_pb.rb +2 -2
- data/lib/google/cloud/phishingprotection/v1beta1/phishingprotection_services_pb.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc63c5285fe041314f4e5730ac02c02d2d22a86be1310411671e9fa3aea42c19
|
4
|
+
data.tar.gz: 64048130b75a5525d10b5e886202435035a621a58bb7a0f05caf9c5fd88a8d2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2701234976a314873c0eb5034b7466cdb405bba90565325a68d4c24a625f684f948b35dc8e1f602ae96504921d279345dbfb6467927506aa25e7233a9fdc4136
|
7
|
+
data.tar.gz: 04fdd9d2510bbdcded82fe8bfccdd62ea1e4d3a028cc4ea95e9e77d7bce126ed944ffac042e477208b884eb3df916f394b3f1fc5ddd86d7cf368305ee2f09442
|
data/AUTHENTICATION.md
CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-phishing_protection-v1beta1
|
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
67
|
{::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Credentials}):
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
* `PHISHING_PROTECTION_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
|
+
* `PHISHING_PROTECTION_KEYFILE` - Path to JSON file, or JSON contents
|
71
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
72
|
+
* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
73
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
74
74
|
|
75
75
|
```ruby
|
76
76
|
require "google/cloud/phishing_protection/v1beta1"
|
@@ -82,8 +82,8 @@ client = ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService
|
|
82
82
|
|
83
83
|
### Configuration
|
84
84
|
|
85
|
-
The **Credentials JSON** can be configured instead of
|
86
|
-
environment
|
85
|
+
The path to the **Credentials JSON** file can be configured instead of storing
|
86
|
+
it in an environment variable. Either on an individual client initialization:
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/phishing_protection/v1beta1"
|
@@ -93,7 +93,7 @@ client = ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService
|
|
93
93
|
end
|
94
94
|
```
|
95
95
|
|
96
|
-
Or
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/phishing_protection/v1beta1"
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
|
|
33
33
|
require "google/cloud/phishing_protection/v1beta1"
|
34
34
|
|
35
35
|
client = ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.new
|
36
|
-
request =
|
36
|
+
request = ::Google::Cloud::PhishingProtection::V1beta1::ReportPhishingRequest.new # (request fields as keyword arguments...)
|
37
37
|
response = client.report_phishing request
|
38
38
|
```
|
39
39
|
|
@@ -41,13 +41,12 @@ module Google
|
|
41
41
|
# See {::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client::Configuration}
|
42
42
|
# for a description of the configuration fields.
|
43
43
|
#
|
44
|
-
#
|
44
|
+
# @example
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# end
|
46
|
+
# # Modify the configuration for all PhishingProtectionService clients
|
47
|
+
# ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
51
50
|
#
|
52
51
|
# @yield [config] Configure the Client client.
|
53
52
|
# @yieldparam config [Client::Configuration]
|
@@ -96,19 +95,15 @@ module Google
|
|
96
95
|
##
|
97
96
|
# Create a new PhishingProtectionService client object.
|
98
97
|
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
# To create a new PhishingProtectionService client with the default
|
102
|
-
# configuration:
|
98
|
+
# @example
|
103
99
|
#
|
104
|
-
#
|
100
|
+
# # Create a client using the default configuration
|
101
|
+
# client = ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.new
|
105
102
|
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
110
|
-
# config.timeout = 10.0
|
111
|
-
# end
|
103
|
+
# # Create a client using a custom configuration
|
104
|
+
# client = ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.new do |config|
|
105
|
+
# config.timeout = 10.0
|
106
|
+
# end
|
112
107
|
#
|
113
108
|
# @yield [config] Configure the PhishingProtectionService client.
|
114
109
|
# @yieldparam config [Client::Configuration]
|
@@ -128,14 +123,13 @@ module Google
|
|
128
123
|
|
129
124
|
# Create credentials
|
130
125
|
credentials = @config.credentials
|
131
|
-
# Use self-signed JWT if the
|
126
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
132
127
|
# but only if the default endpoint does not have a region prefix.
|
133
|
-
enable_self_signed_jwt = @config.
|
134
|
-
@config.endpoint == Client.configure.endpoint &&
|
128
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
135
129
|
!@config.endpoint.split(".").first.include?("-")
|
136
130
|
credentials ||= Credentials.default scope: @config.scope,
|
137
131
|
enable_self_signed_jwt: enable_self_signed_jwt
|
138
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
132
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
139
133
|
credentials = Credentials.new credentials, scope: @config.scope
|
140
134
|
end
|
141
135
|
@quota_project_id = @config.quota_project
|
@@ -190,6 +184,21 @@ module Google
|
|
190
184
|
#
|
191
185
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
192
186
|
#
|
187
|
+
# @example Basic example
|
188
|
+
# require "google/cloud/phishing_protection/v1beta1"
|
189
|
+
#
|
190
|
+
# # Create a client object. The client can be reused for multiple calls.
|
191
|
+
# client = Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.new
|
192
|
+
#
|
193
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
194
|
+
# request = Google::Cloud::PhishingProtection::V1beta1::ReportPhishingRequest.new
|
195
|
+
#
|
196
|
+
# # Call the report_phishing method.
|
197
|
+
# result = client.report_phishing request
|
198
|
+
#
|
199
|
+
# # The returned object is of type Google::Cloud::PhishingProtection::V1beta1::ReportPhishingResponse.
|
200
|
+
# p result
|
201
|
+
#
|
193
202
|
def report_phishing request, options = nil
|
194
203
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
195
204
|
|
@@ -207,16 +216,20 @@ module Google
|
|
207
216
|
gapic_version: ::Google::Cloud::PhishingProtection::V1beta1::VERSION
|
208
217
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
209
218
|
|
210
|
-
header_params = {
|
211
|
-
|
212
|
-
|
219
|
+
header_params = {}
|
220
|
+
if request.parent
|
221
|
+
header_params["parent"] = request.parent
|
222
|
+
end
|
223
|
+
|
213
224
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
214
225
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
215
226
|
|
216
227
|
options.apply_defaults timeout: @config.rpcs.report_phishing.timeout,
|
217
228
|
metadata: metadata,
|
218
229
|
retry_policy: @config.rpcs.report_phishing.retry_policy
|
219
|
-
|
230
|
+
|
231
|
+
options.apply_defaults timeout: @config.timeout,
|
232
|
+
metadata: @config.metadata,
|
220
233
|
retry_policy: @config.retry_policy
|
221
234
|
|
222
235
|
@phishing_protection_service_stub.call_rpc :report_phishing, request, options: options do |response, operation|
|
@@ -240,22 +253,21 @@ module Google
|
|
240
253
|
# Configuration can be applied globally to all clients, or to a single client
|
241
254
|
# on construction.
|
242
255
|
#
|
243
|
-
#
|
244
|
-
#
|
245
|
-
#
|
246
|
-
# to 20 seconds,
|
247
|
-
#
|
248
|
-
#
|
249
|
-
#
|
250
|
-
#
|
251
|
-
#
|
252
|
-
#
|
253
|
-
#
|
254
|
-
#
|
255
|
-
#
|
256
|
-
#
|
257
|
-
#
|
258
|
-
# end
|
256
|
+
# @example
|
257
|
+
#
|
258
|
+
# # Modify the global config, setting the timeout for
|
259
|
+
# # report_phishing to 20 seconds,
|
260
|
+
# # and all remaining timeouts to 10 seconds.
|
261
|
+
# ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.configure do |config|
|
262
|
+
# config.timeout = 10.0
|
263
|
+
# config.rpcs.report_phishing.timeout = 20.0
|
264
|
+
# end
|
265
|
+
#
|
266
|
+
# # Apply the above configuration only to a new client.
|
267
|
+
# client = ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.new do |config|
|
268
|
+
# config.timeout = 10.0
|
269
|
+
# config.rpcs.report_phishing.timeout = 20.0
|
270
|
+
# end
|
259
271
|
#
|
260
272
|
# @!attribute [rw] endpoint
|
261
273
|
# The hostname or hostname:port of the service endpoint.
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/cloud/phishingprotection/v1beta1/phishingprotection.proto
|
3
3
|
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
4
|
require 'google/api/annotations_pb'
|
7
5
|
require 'google/api/client_pb'
|
8
6
|
require 'google/api/field_behavior_pb'
|
9
7
|
require 'google/api/resource_pb'
|
8
|
+
require 'google/protobuf'
|
9
|
+
|
10
10
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
11
11
|
add_file("google/cloud/phishingprotection/v1beta1/phishingprotection.proto", :syntax => :proto3) do
|
12
12
|
add_message "google.cloud.phishingprotection.v1beta1.ReportPhishingRequest" do
|
@@ -57,9 +57,15 @@ module Google
|
|
57
57
|
|
58
58
|
# Denotes that a (repeated) field is an unordered list.
|
59
59
|
# This indicates that the service may provide the elements of the list
|
60
|
-
# in any arbitrary
|
60
|
+
# in any arbitrary order, rather than the order the user originally
|
61
61
|
# provided. Additionally, the list's order may or may not be stable.
|
62
62
|
UNORDERED_LIST = 6
|
63
|
+
|
64
|
+
# Denotes that this field returns a non-empty default value if not set.
|
65
|
+
# This indicates that if the user provides the empty value in a request,
|
66
|
+
# a non-empty value will be returned. The user will not be aware of what
|
67
|
+
# non-empty value to expect.
|
68
|
+
NON_EMPTY_DEFAULT = 7
|
63
69
|
end
|
64
70
|
end
|
65
71
|
end
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-phishing_protection-v1beta1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.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: 2021-
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.7'
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 2.a
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.7'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 2.a
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: google-cloud-errors
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
204
|
- !ruby/object:Gem::Version
|
199
205
|
version: '0'
|
200
206
|
requirements: []
|
201
|
-
rubygems_version: 3.2.
|
207
|
+
rubygems_version: 3.2.17
|
202
208
|
signing_key:
|
203
209
|
specification_version: 4
|
204
210
|
summary: API Client library for the Phishing Protection V1beta1 API
|