google-cloud-web_risk-v1 0.4.0 → 0.4.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: 6c2c0fd67b41b0e76dfc94bc78f6e3b9c9cb9e3977d65151338c8dc697352810
4
- data.tar.gz: b27c5ea76851d46fb94613eee31b45b22fbbd58b7ea7d4b9dc5630f2f20cd545
3
+ metadata.gz: 2c97449359e074ec74488e11f75c4c4011b3b81cc13134c42fd601c4cac5ec1a
4
+ data.tar.gz: 898043f5c3eef97de24bf031f53323e9ca19c86f89832eb33e0ce2327b54addc
5
5
  SHA512:
6
- metadata.gz: 1927a837efbe78d81f9898e9b99f2a9cdf77dce2f61887c17993c34e98a07b806c923f5cf1cb69bfaf97df69aa1360a9c16c4796ca90446e11acff60be93217f
7
- data.tar.gz: 446510d3c96f76a6b473b654021b94b643a0fd5a97360b7c6f9be8f62625f1fa278d7c48788c42b82bf033910b5136e1d180861f19f51fab63f344cbd8cc178b
6
+ metadata.gz: 6177428c0ccef84cf161fd43ee5be97a350f4aa043b0356f8fbe6b67b25ebf914b8422e55cd6ec0ec76e0396102fb155481f606056c6f43fe3590c47503d5057
7
+ data.tar.gz: 12f6b5113b359101e6d17b8e523c0c6830845be92d5f7b3af055b2733d79e1cf785aa629ac17823432354e486ba74f4260a3f82556042554a2510fc72b4234a7
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-web_risk-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::WebRisk::V1::WebRiskService::Credentials}):
68
68
 
69
- 1. `WEBRISK_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `WEBRISK_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `WEBRISK_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `WEBRISK_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/web_risk/v1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
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/web_risk/v1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config|
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/web_risk/v1"
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/web_risk/v1"
34
34
 
35
35
  client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new # (request fields as keyword arguments...)
37
37
  response = client.compute_threat_list_diff request
38
38
  ```
39
39
 
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module WebRisk
23
23
  module V1
24
- VERSION = "0.4.0"
24
+ VERSION = "0.4.4"
25
25
  end
26
26
  end
27
27
  end
@@ -42,13 +42,12 @@ module Google
42
42
  # See {::Google::Cloud::WebRisk::V1::WebRiskService::Client::Configuration}
43
43
  # for a description of the configuration fields.
44
44
  #
45
- # ## Example
45
+ # @example
46
46
  #
47
- # To modify the configuration for all WebRiskService clients:
48
- #
49
- # ::Google::Cloud::WebRisk::V1::WebRiskService::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
47
+ # # Modify the configuration for all WebRiskService clients
48
+ # ::Google::Cloud::WebRisk::V1::WebRiskService::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
52
51
  #
53
52
  # @yield [config] Configure the Client client.
54
53
  # @yieldparam config [Client::Configuration]
@@ -68,26 +67,17 @@ module Google
68
67
 
69
68
  default_config.rpcs.compute_threat_list_diff.timeout = 600.0
70
69
  default_config.rpcs.compute_threat_list_diff.retry_policy = {
71
- initial_delay: 0.1,
72
- max_delay: 60.0,
73
- multiplier: 1.3,
74
- retry_codes: [4, 14]
70
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
75
71
  }
76
72
 
77
73
  default_config.rpcs.search_uris.timeout = 600.0
78
74
  default_config.rpcs.search_uris.retry_policy = {
79
- initial_delay: 0.1,
80
- max_delay: 60.0,
81
- multiplier: 1.3,
82
- retry_codes: [4, 14]
75
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
83
76
  }
84
77
 
85
78
  default_config.rpcs.search_hashes.timeout = 600.0
86
79
  default_config.rpcs.search_hashes.retry_policy = {
87
- initial_delay: 0.1,
88
- max_delay: 60.0,
89
- multiplier: 1.3,
90
- retry_codes: [4, 14]
80
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
91
81
  }
92
82
 
93
83
  default_config.rpcs.create_submission.timeout = 60.0
@@ -121,19 +111,15 @@ module Google
121
111
  ##
122
112
  # Create a new WebRiskService client object.
123
113
  #
124
- # ## Examples
125
- #
126
- # To create a new WebRiskService client with the default
127
- # configuration:
128
- #
129
- # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new
114
+ # @example
130
115
  #
131
- # To create a new WebRiskService client with a custom
132
- # configuration:
116
+ # # Create a client using the default configuration
117
+ # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new
133
118
  #
134
- # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config|
135
- # config.timeout = 10.0
136
- # end
119
+ # # Create a client using a custom configuration
120
+ # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config|
121
+ # config.timeout = 10.0
122
+ # end
137
123
  #
138
124
  # @yield [config] Configure the WebRiskService client.
139
125
  # @yieldparam config [Client::Configuration]
@@ -153,14 +139,13 @@ module Google
153
139
 
154
140
  # Create credentials
155
141
  credentials = @config.credentials
156
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
142
+ # Use self-signed JWT if the endpoint is unchanged from default,
157
143
  # but only if the default endpoint does not have a region prefix.
158
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
159
- @config.endpoint == Client.configure.endpoint &&
144
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
160
145
  !@config.endpoint.split(".").first.include?("-")
161
146
  credentials ||= Credentials.default scope: @config.scope,
162
147
  enable_self_signed_jwt: enable_self_signed_jwt
163
- if credentials.is_a?(String) || credentials.is_a?(Hash)
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
164
149
  credentials = Credentials.new credentials, scope: @config.scope
165
150
  end
166
151
  @quota_project_id = @config.quota_project
@@ -219,6 +204,21 @@ module Google
219
204
  #
220
205
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
221
206
  #
207
+ # @example Basic example
208
+ # require "google/cloud/web_risk/v1"
209
+ #
210
+ # # Create a client object. The client can be reused for multiple calls.
211
+ # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new
212
+ #
213
+ # # Create a request. To set request fields, pass in keyword arguments.
214
+ # request = Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new
215
+ #
216
+ # # Call the compute_threat_list_diff method.
217
+ # result = client.compute_threat_list_diff request
218
+ #
219
+ # # The returned object is of type Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse.
220
+ # p result
221
+ #
222
222
  def compute_threat_list_diff request, options = nil
223
223
  raise ::ArgumentError, "request must be provided" if request.nil?
224
224
 
@@ -239,7 +239,9 @@ module Google
239
239
  options.apply_defaults timeout: @config.rpcs.compute_threat_list_diff.timeout,
240
240
  metadata: metadata,
241
241
  retry_policy: @config.rpcs.compute_threat_list_diff.retry_policy
242
- options.apply_defaults metadata: @config.metadata,
242
+
243
+ options.apply_defaults timeout: @config.timeout,
244
+ metadata: @config.metadata,
243
245
  retry_policy: @config.retry_policy
244
246
 
245
247
  @web_risk_service_stub.call_rpc :compute_threat_list_diff, request, options: options do |response, operation|
@@ -285,6 +287,21 @@ module Google
285
287
  #
286
288
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
287
289
  #
290
+ # @example Basic example
291
+ # require "google/cloud/web_risk/v1"
292
+ #
293
+ # # Create a client object. The client can be reused for multiple calls.
294
+ # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new
295
+ #
296
+ # # Create a request. To set request fields, pass in keyword arguments.
297
+ # request = Google::Cloud::WebRisk::V1::SearchUrisRequest.new
298
+ #
299
+ # # Call the search_uris method.
300
+ # result = client.search_uris request
301
+ #
302
+ # # The returned object is of type Google::Cloud::WebRisk::V1::SearchUrisResponse.
303
+ # p result
304
+ #
288
305
  def search_uris request, options = nil
289
306
  raise ::ArgumentError, "request must be provided" if request.nil?
290
307
 
@@ -305,7 +322,9 @@ module Google
305
322
  options.apply_defaults timeout: @config.rpcs.search_uris.timeout,
306
323
  metadata: metadata,
307
324
  retry_policy: @config.rpcs.search_uris.retry_policy
308
- options.apply_defaults metadata: @config.metadata,
325
+
326
+ options.apply_defaults timeout: @config.timeout,
327
+ metadata: @config.metadata,
309
328
  retry_policy: @config.retry_policy
310
329
 
311
330
  @web_risk_service_stub.call_rpc :search_uris, request, options: options do |response, operation|
@@ -352,6 +371,21 @@ module Google
352
371
  #
353
372
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
354
373
  #
374
+ # @example Basic example
375
+ # require "google/cloud/web_risk/v1"
376
+ #
377
+ # # Create a client object. The client can be reused for multiple calls.
378
+ # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new
379
+ #
380
+ # # Create a request. To set request fields, pass in keyword arguments.
381
+ # request = Google::Cloud::WebRisk::V1::SearchHashesRequest.new
382
+ #
383
+ # # Call the search_hashes method.
384
+ # result = client.search_hashes request
385
+ #
386
+ # # The returned object is of type Google::Cloud::WebRisk::V1::SearchHashesResponse.
387
+ # p result
388
+ #
355
389
  def search_hashes request, options = nil
356
390
  raise ::ArgumentError, "request must be provided" if request.nil?
357
391
 
@@ -372,7 +406,9 @@ module Google
372
406
  options.apply_defaults timeout: @config.rpcs.search_hashes.timeout,
373
407
  metadata: metadata,
374
408
  retry_policy: @config.rpcs.search_hashes.retry_policy
375
- options.apply_defaults metadata: @config.metadata,
409
+
410
+ options.apply_defaults timeout: @config.timeout,
411
+ metadata: @config.metadata,
376
412
  retry_policy: @config.retry_policy
377
413
 
378
414
  @web_risk_service_stub.call_rpc :search_hashes, request, options: options do |response, operation|
@@ -420,6 +456,21 @@ module Google
420
456
  #
421
457
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
422
458
  #
459
+ # @example Basic example
460
+ # require "google/cloud/web_risk/v1"
461
+ #
462
+ # # Create a client object. The client can be reused for multiple calls.
463
+ # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new
464
+ #
465
+ # # Create a request. To set request fields, pass in keyword arguments.
466
+ # request = Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new
467
+ #
468
+ # # Call the create_submission method.
469
+ # result = client.create_submission request
470
+ #
471
+ # # The returned object is of type Google::Cloud::WebRisk::V1::Submission.
472
+ # p result
473
+ #
423
474
  def create_submission request, options = nil
424
475
  raise ::ArgumentError, "request must be provided" if request.nil?
425
476
 
@@ -437,16 +488,20 @@ module Google
437
488
  gapic_version: ::Google::Cloud::WebRisk::V1::VERSION
438
489
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
439
490
 
440
- header_params = {
441
- "parent" => request.parent
442
- }
491
+ header_params = {}
492
+ if request.parent
493
+ header_params["parent"] = request.parent
494
+ end
495
+
443
496
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
444
497
  metadata[:"x-goog-request-params"] ||= request_params_header
445
498
 
446
499
  options.apply_defaults timeout: @config.rpcs.create_submission.timeout,
447
500
  metadata: metadata,
448
501
  retry_policy: @config.rpcs.create_submission.retry_policy
449
- options.apply_defaults metadata: @config.metadata,
502
+
503
+ options.apply_defaults timeout: @config.timeout,
504
+ metadata: @config.metadata,
450
505
  retry_policy: @config.retry_policy
451
506
 
452
507
  @web_risk_service_stub.call_rpc :create_submission, request, options: options do |response, operation|
@@ -470,22 +525,21 @@ module Google
470
525
  # Configuration can be applied globally to all clients, or to a single client
471
526
  # on construction.
472
527
  #
473
- # # Examples
474
- #
475
- # To modify the global config, setting the timeout for compute_threat_list_diff
476
- # to 20 seconds, and all remaining timeouts to 10 seconds:
477
- #
478
- # ::Google::Cloud::WebRisk::V1::WebRiskService::Client.configure do |config|
479
- # config.timeout = 10.0
480
- # config.rpcs.compute_threat_list_diff.timeout = 20.0
481
- # end
482
- #
483
- # To apply the above configuration only to a new client:
484
- #
485
- # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config|
486
- # config.timeout = 10.0
487
- # config.rpcs.compute_threat_list_diff.timeout = 20.0
488
- # end
528
+ # @example
529
+ #
530
+ # # Modify the global config, setting the timeout for
531
+ # # compute_threat_list_diff to 20 seconds,
532
+ # # and all remaining timeouts to 10 seconds.
533
+ # ::Google::Cloud::WebRisk::V1::WebRiskService::Client.configure do |config|
534
+ # config.timeout = 10.0
535
+ # config.rpcs.compute_threat_list_diff.timeout = 20.0
536
+ # end
537
+ #
538
+ # # Apply the above configuration only to a new client.
539
+ # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config|
540
+ # config.timeout = 10.0
541
+ # config.rpcs.compute_threat_list_diff.timeout = 20.0
542
+ # end
489
543
  #
490
544
  # @!attribute [rw] endpoint
491
545
  # The hostname or hostname:port of the service endpoint.
@@ -1,13 +1,13 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/webrisk/v1/webrisk.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'
10
8
  require 'google/protobuf/timestamp_pb'
9
+ require 'google/protobuf'
10
+
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_file("google/cloud/webrisk/v1/webrisk.proto", :syntax => :proto3) do
13
13
  add_message "google.cloud.webrisk.v1.ComputeThreatListDiffRequest" do
@@ -28,7 +28,7 @@ module Google
28
28
  # website and in client applications.
29
29
  class Service
30
30
 
31
- include GRPC::GenericService
31
+ include ::GRPC::GenericService
32
32
 
33
33
  self.marshal_class_method = :encode
34
34
  self.unmarshal_class_method = :decode
@@ -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 order, rather than the order the user originally
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-web_risk-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.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-03-09 00:00:00.000000000 Z
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: '0.3'
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: '0.3'
32
+ version: 2.a
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: google-cloud-errors
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -197,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
203
  - !ruby/object:Gem::Version
198
204
  version: '0'
199
205
  requirements: []
200
- rubygems_version: 3.2.13
206
+ rubygems_version: 3.2.17
201
207
  signing_key:
202
208
  specification_version: 4
203
209
  summary: API Client library for the Web Risk V1 API